Quellcode durchsuchen

新增 高亮焦点 为 Android TV 模式(首页- 书架/发现/订阅/我的);

Kevin SuTJ vor 4 Jahren
Ursprung
Commit
0ce9096b51

+ 4 - 0
app/src/main/res/drawable/bg_item_focused_on_tv.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@color/btn_bg_press" android:state_focused="true" />
+</selector>

+ 2 - 1
app/src/main/res/drawable/bg_prefs_color.xml

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@color/btn_bg_press" />
+    <item android:drawable="@color/btn_bg_press" android:state_focused="true" />
+    <item android:drawable="@color/btn_bg_press" android:state_pressed="true" />
 </selector>
 </selector>

+ 1 - 0
app/src/main/res/layout/item_bookshelf_grid.xml

@@ -7,6 +7,7 @@
     android:layout_height="wrap_content"
     android:layout_height="wrap_content"
     android:clickable="true"
     android:clickable="true"
     android:focusable="true"
     android:focusable="true"
+    android:background="@drawable/bg_item_focused_on_tv"
     tools:ignore="UnusedAttribute">
     tools:ignore="UnusedAttribute">
 
 
 
 

+ 1 - 0
app/src/main/res/layout/item_bookshelf_list.xml

@@ -7,6 +7,7 @@
     android:layout_height="wrap_content"
     android:layout_height="wrap_content"
     android:clickable="true"
     android:clickable="true"
     android:focusable="true"
     android:focusable="true"
+    android:background="@drawable/bg_item_focused_on_tv"
     tools:ignore="UnusedAttribute">
     tools:ignore="UnusedAttribute">
 
 
     <io.legado.app.ui.widget.image.CoverImageView
     <io.legado.app.ui.widget.image.CoverImageView

+ 3 - 1
app/src/main/res/layout/item_find_book.xml

@@ -5,7 +5,9 @@
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_height="wrap_content"
     android:gravity="center"
     android:gravity="center"
-    android:orientation="vertical">
+    android:orientation="vertical"
+    android:focusable="true"
+    android:background="@drawable/bg_item_focused_on_tv">
 
 
     <LinearLayout
     <LinearLayout
         android:id="@+id/ll_title"
         android:id="@+id/ll_title"

+ 3 - 1
app/src/main/res/layout/item_rss.xml

@@ -4,7 +4,9 @@
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:tools="http://schemas.android.com/tools"
     android:padding="16dp"
     android:padding="16dp"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:focusable="true"
+    android:background="@drawable/bg_item_focused_on_tv">
 
 
     <io.legado.app.ui.widget.image.FilletImageView
     <io.legado.app.ui.widget.image.FilletImageView
         android:id="@+id/iv_icon"
         android:id="@+id/iv_icon"