From 97fa08823359e9e1075d2bdfa508fdcb5b1eeb47 Mon Sep 17 00:00:00 2001
From: Rosemoe <2073412493@qq.com>
Date: Sun, 18 Feb 2024 15:02:00 +0800
Subject: [PATCH] refact: move attrs of scrollbar drawables
---
app/src/main/res/layout/activity_main.xml | 8 ++++----
.../java/io/github/rosemoe/sora/widget/CodeEditor.java | 8 ++++----
editor/src/main/res/values/attrs.xml | 8 ++++----
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 9fcbf5ee3..fe3ad6d21 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -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" />
diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/CodeEditor.java b/editor/src/main/java/io/github/rosemoe/sora/widget/CodeEditor.java
index 2ccbafa65..7f86e7921 100644
--- a/editor/src/main/java/io/github/rosemoe/sora/widget/CodeEditor.java
+++ b/editor/src/main/java/io/github/rosemoe/sora/widget/CodeEditor.java
@@ -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));
diff --git a/editor/src/main/res/values/attrs.xml b/editor/src/main/res/values/attrs.xml
index 984df23b1..ce3f7fb45 100644
--- a/editor/src/main/res/values/attrs.xml
+++ b/editor/src/main/res/values/attrs.xml
@@ -27,10 +27,10 @@
-
-
-
-
+
+
+
+