Skip to content

Commit

Permalink
feat: add scrollbar style to candidate view
Browse files Browse the repository at this point in the history
Currently candidate view use the default style in Android OS,
which varies in different manufacturer.  Adding a style to it
so that it has the same scrollbar on different Android model.
  • Loading branch information
goofyz committed Dec 18, 2023
1 parent a193d58 commit 1b9eb75
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/candidate_scrollbar_thumb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:height="4dp" android:width="12dp" />
<solid android:color="#66666666" />
<corners android:radius="4dp"/>
</shape>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/candidate_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:id="@+id/candidate_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
style="@style/candidate_scrollBar"
android:fillViewport="true">

<LinearLayout
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="candidate_scrollBar">
<item name="android:scrollbarSize">4dp</item>
<item name="android:scrollbarStyle">outsideOverlay</item>
<item name="android:scrollbars">horizontal</item>
<item name="android:fadeScrollbars">true</item>
<item name="android:scrollbarThumbHorizontal">@drawable/candidate_scrollbar_thumb</item>
</style>
</resources>

0 comments on commit 1b9eb75

Please sign in to comment.