Skip to content

Commit

Permalink
refact: move attrs of scrollbar drawables
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosemoe committed Feb 18, 2024
1 parent c62a9b8 commit 97fa088
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
android:id="@+id/editor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarThumbHorizontal="@drawable/scrollbar_thumb"
android:scrollbarThumbVertical="@drawable/scrollbar_thumb"
android:scrollbarTrackHorizontal="@drawable/scrollbar_track"
android:scrollbarTrackVertical="@drawable/scrollbar_track"
app:scrollbarThumbHorizontal="@drawable/scrollbar_thumb"
app:scrollbarThumbVertical="@drawable/scrollbar_thumb"
app:scrollbarTrackHorizontal="@drawable/scrollbar_track"
app:scrollbarTrackVertical="@drawable/scrollbar_track"
app:lnPanelPosition="center"
app:lnPanelPositionMode="follow" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ protected void initialize(AttributeSet attrs, int defStyleAttr, int defStyleRes)
protected void applyAttributeSets(AttributeSet attrs, int defStyleAttr, int defStyleRes) {
var array = getContext().obtainStyledAttributes(attrs, R.styleable.CodeEditor, defStyleAttr, defStyleRes);

setHorizontalScrollbarThumbDrawable(array.getDrawable(R.styleable.CodeEditor_android_scrollbarThumbHorizontal));
setHorizontalScrollbarTrackDrawable(array.getDrawable(R.styleable.CodeEditor_android_scrollbarTrackHorizontal));
setVerticalScrollbarThumbDrawable(array.getDrawable(R.styleable.CodeEditor_android_scrollbarThumbVertical));
setVerticalScrollbarTrackDrawable(array.getDrawable(R.styleable.CodeEditor_android_scrollbarTrackVertical));
setHorizontalScrollbarThumbDrawable(array.getDrawable(R.styleable.CodeEditor_scrollbarThumbHorizontal));
setHorizontalScrollbarTrackDrawable(array.getDrawable(R.styleable.CodeEditor_scrollbarTrackHorizontal));
setVerticalScrollbarThumbDrawable(array.getDrawable(R.styleable.CodeEditor_scrollbarThumbVertical));
setVerticalScrollbarTrackDrawable(array.getDrawable(R.styleable.CodeEditor_scrollbarTrackVertical));

setLnPanelPositionMode(array.getInt(R.styleable.CodeEditor_lnPanelPositionMode, LineInfoPanelPositionMode.FOLLOW));
setLnPanelPosition(array.getInt(R.styleable.CodeEditor_lnPanelPosition, LineInfoPanelPosition.CENTER));
Expand Down
8 changes: 4 additions & 4 deletions editor/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<attr name="codeEditorStyle" format="reference" />

<declare-styleable name="CodeEditor">
<attr name="android:scrollbarTrackHorizontal" />
<attr name="android:scrollbarThumbHorizontal" />
<attr name="android:scrollbarTrackVertical" />
<attr name="android:scrollbarThumbVertical" />
<attr name="scrollbarTrackHorizontal" format="reference" />
<attr name="scrollbarThumbHorizontal" format="reference" />
<attr name="scrollbarTrackVertical" format="reference" />
<attr name="scrollbarThumbVertical" format="reference" />

<attr name="lnPanelPositionMode">
<enum name="fixed" value="0" />
Expand Down

0 comments on commit 97fa088

Please sign in to comment.