Skip to content

Commit

Permalink
Added margin in image item to see the imagen bigger like was before t…
Browse files Browse the repository at this point in the history
…he re-architecture
  • Loading branch information
Aitorbp committed Jul 3, 2023
1 parent 438f658 commit b7aa482
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import androidx.core.view.isVisible
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.owncloud.android.MainApp.Companion.appContext
import com.owncloud.android.R
import com.owncloud.android.databinding.GridItemBinding
import com.owncloud.android.databinding.ItemFileListBinding
Expand Down Expand Up @@ -232,6 +233,14 @@ class FileListAdapter(
val view = holder as GridViewHolder
view.binding.Filename.text = file.fileName
}
ViewType.GRID_IMAGE.ordinal -> {
val layoutParams = fileIcon.layoutParams as ViewGroup.MarginLayoutParams
val resources = appContext.resources
val marginImage = resources.getDimensionPixelSize(R.dimen.standard_quarter_margin)
layoutParams.setMargins(marginImage, marginImage, marginImage, marginImage)
layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT
}
}

setIconPinAccordingToFilesLocalState(holder.itemView.findViewById(R.id.localFileIndicator), fileWithSyncInfo)
Expand Down

0 comments on commit b7aa482

Please sign in to comment.