Skip to content

Commit 36986ef

Browse files
alperozturk96tobiasKaminsky
authored andcommitted
fix: layout padding
Signed-off-by: alperozturk <[email protected]>
1 parent 8cd40bd commit 36986ef

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

app/src/main/java/com/owncloud/android/ui/adapter/OCFileListGridController.kt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ class OCFileListGridController {
2525
private const val TAG = "OCFileListGridController"
2626

2727
// Reserved space for file extension text in DP
28-
private const val EXTENSION_RESERVED_DP: Int = 36
28+
private const val EXTENSION_RESERVED_DP: Int = 32
2929

3030
// Padding between text and more icon in DP
31-
private const val SAFETY_MARGIN_DP: Int = 8
32-
33-
// extra spacing between text and more button
34-
private const val MORE_BUTTON_MARGIN_DP: Int = 8
31+
private const val SAFETY_MARGIN_DP: Int = 16
3532
}
3633

3734
private var lastScreenWidth = -1
@@ -62,18 +59,15 @@ class OCFileListGridController {
6259

6360
val moreButtonPx = context.resources.getDimensionPixelSize(R.dimen.iconized_single_line_item_icon_size)
6461

65-
// 3-4 chars width
66-
6762
val density = context.resources.displayMetrics.density
6863
val extensionMinPx = (density * EXTENSION_RESERVED_DP).toInt()
6964
val paddingPx = (density * SAFETY_MARGIN_DP).toInt()
70-
val moreButtonMarginPx = (density * MORE_BUTTON_MARGIN_DP).toInt()
7165

7266
// name + more button
73-
cachedFolderMaxWidth = cellWidth - moreButtonPx - paddingPx - moreButtonMarginPx
67+
cachedFolderMaxWidth = cellWidth - moreButtonPx - paddingPx
7468

7569
// name + extension + more button
76-
cachedFileMaxWidth = cellWidth - moreButtonPx - extensionMinPx - paddingPx - moreButtonMarginPx
70+
cachedFileMaxWidth = cellWidth - moreButtonPx - extensionMinPx - paddingPx
7771

7872
// fallback
7973
if (cachedFolderMaxWidth < 0) {
@@ -128,10 +122,6 @@ class OCFileListGridController {
128122
ConstraintSet.END
129123
)
130124

131-
val marginEnd =
132-
constraintLayout.context.resources.getDimensionPixelSize(R.dimen.standard_quarter_margin)
133-
setMargin(R.id.more, ConstraintSet.END, marginEnd)
134-
135125
applyTo(constraintLayout)
136126
}
137127
} else {

0 commit comments

Comments
 (0)