Skip to content

Commit

Permalink
FileBrowser: Enable fast scroll track (PR #2213 by @guanglinn)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanglinn authored Mar 27, 2024
1 parent c38944f commit 7549fbd
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 15 deletions.
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/scrollbar_thumb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/scrollbar_thumb_background_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/scrollbar_thumb_background" />
</selector>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/scrollbar_thumb_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="12dp">
<shape android:shape="rectangle">
<solid android:color="@color/transparent" />
</shape>
</item>

<item
android:width="6dp"
android:left="12dp">
<shape android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="@color/light_grey" />
</shape>
</item>
</layer-list>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/scrollbar_thumb_background_pressed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="12dp">
<shape android:shape="rectangle">
<solid android:color="@color/transparent" />
</shape>
</item>

<item
android:width="6dp"
android:left="12dp">
<shape android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="@color/grey" />
</shape>
</item>
</layer-list>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/scrollbar_track.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/scrollbar_track_background" android:state_pressed="true" />
<item android:drawable="@drawable/scrollbar_track_background" />
</selector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/scrollbar_track_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/transparent" />
</shape>
6 changes: 5 additions & 1 deletion app/src/main/res/layout/opoc_filesystem_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="100dp"
app:fastScrollEnabled="true"
app:fastScrollHorizontalThumbDrawable="@drawable/scrollbar_thumb"
app:fastScrollHorizontalTrackDrawable="@drawable/scrollbar_track"
app:fastScrollVerticalThumbDrawable="@drawable/scrollbar_thumb"
app:fastScrollVerticalTrackDrawable="@drawable/scrollbar_track"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>


</FrameLayout>
28 changes: 14 additions & 14 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,36 @@
<color name="divider">#B6B6B6</color>

<color name="accent_light">#FF9800</color>
<color name="divider_2">#3d3d3d</color>
<color name="divider_2">#3D3D3D</color>
<color name="default_link_color">#388E3C</color>

<color name="light__background">#eeeeee</color>
<color name="light__background_2">#f9f9f9</color>
<color name="light__background">#EEEEEE</color>
<color name="light__background_2">#F9F9F9</color>
<color name="light__primary_text">#212121</color>
<color name="light__secondary_text">#757575</color>

<color name="dark__background">#222222</color>
<color name="dark__background_2">#424242</color>
<color name="dark__primary_text">@color/white</color>
<color name="dark__secondary_text">#9e9e9e</color>
<color name="dark__secondary_text">#9E9E9E</color>

<color name="ic_launcher_background">#636363</color>
<color name="white">#ffffffff</color>
<color name="white">#FFFFFFFF</color>
<color name="black">#000000</color>
<color name="grey">#ff505050</color>
<color name="dark_grey">#ff212121</color>
<color name="light_grey">#ffC0C0C0</color>
<color name="lighter_grey">#ffE0E0E0</color>
<color name="grey">#FF505050</color>
<color name="dark_grey">#FF212121</color>
<color name="light_grey">#FFC0C0C0</color>
<color name="lighter_grey">#FFE0E0E0</color>

<color name="solarized_bg_dark">#002B36</color>
<color name="solarized_bg_light">#FCF5E4</color>
<color name="solarized_fg">#657b83</color>
<color name="solarized_fg">#657B83</color>
<color name="gruvbox_bg_dark">#282828</color>
<color name="gruvbox_fg_dark">#EBDBB2</color>
<color name="gruvbox_bg_light">#FBF1C7</color>
<color name="gruvbox_fg_light">#3C3836</color>
<color name="green_dark">#00ff00</color>
<color name="green_light">#00bb00</color>
<color name="green_dark">#00FF00</color>
<color name="green_light">#00BB00</color>

<color name="sepia_fg_light__bg_dark">#282828</color>
<color name="sepia_bg_light__fg_dark">#EBDBB2</color>
Expand All @@ -68,6 +68,6 @@
<color name="nord_bg_light">#ECEFF4</color>
<color name="nord_fg_light">#2E3440</color>

<color name="link">#ff1ea3fd</color>;

<color name="link">#FF1EA3FD</color>;
<color name="transparent">#00FFFFFF</color>
</resources>

0 comments on commit 7549fbd

Please sign in to comment.