Skip to content

Commit c5f38a9

Browse files
committed
improving the UI of grid view a bit
1 parent 34edd70 commit c5f38a9

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
706706
val fileName = listItem.name
707707
item_name.text = if (textToHighlight.isEmpty()) fileName else fileName.highlightTextPart(textToHighlight, adjustedPrimaryColor)
708708
item_name.setTextColor(textColor)
709-
item_name.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize)
709+
item_name.setTextSize(TypedValue.COMPLEX_UNIT_PX, if (isListViewType) fontSize else smallerFontSize)
710710

711711
item_details?.setTextColor(textColor)
712712
item_details?.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize)

app/src/main/res/layout/item_file_dir_grid.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:id="@+id/item_frame"
5-
android:layout_width="wrap_content"
5+
android:layout_width="match_parent"
66
android:layout_height="wrap_content"
77
android:background="?attr/selectableItemBackground"
88
android:clickable="true"
@@ -15,25 +15,25 @@
1515
android:id="@+id/item_holder"
1616
android:layout_width="match_parent"
1717
android:layout_height="wrap_content"
18-
android:paddingEnd="@dimen/activity_margin">
18+
android:layout_marginBottom="@dimen/normal_margin">
1919

2020
<ImageView
2121
android:id="@+id/item_icon"
22-
android:layout_width="@dimen/file_picker_icon_size"
23-
android:layout_height="@dimen/file_picker_icon_size"
24-
android:layout_centerVertical="true"
25-
android:padding="@dimen/medium_margin"
22+
android:layout_width="@dimen/grid_view_icon_size"
23+
android:layout_height="@dimen/grid_view_icon_size"
24+
android:layout_centerHorizontal="true"
2625
android:src="@drawable/ic_folder_vector" />
2726

2827
<TextView
2928
android:id="@+id/item_name"
30-
android:layout_width="wrap_content"
29+
android:layout_width="match_parent"
3130
android:layout_height="wrap_content"
3231
android:layout_below="@+id/item_icon"
3332
android:ellipsize="end"
34-
android:maxLines="2"
35-
android:paddingStart="@dimen/tiny_margin"
36-
android:paddingTop="@dimen/small_margin"
33+
android:gravity="center_horizontal"
34+
android:maxLines="1"
35+
android:paddingStart="@dimen/medium_margin"
36+
android:paddingEnd="@dimen/medium_margin"
3737
tools:text="Directory" />
3838

3939
</RelativeLayout>

app/src/main/res/values/dimens.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
2+
<dimen name="grid_view_icon_size">60dp</dimen>
33
</resources>

0 commit comments

Comments
 (0)