pull/78/head
kunfei 5 years ago
parent cbfd41748b
commit 7696e36286
  1. 22
      app/src/main/java/io/legado/app/lib/theme/prefs/ATEListPreference.kt
  2. 4
      app/src/main/res/values/arrays.xml
  3. 8
      app/src/main/res/xml/pref_config_read.xml

@ -0,0 +1,22 @@
package io.legado.app.lib.theme.prefs
import android.content.Context
import android.util.AttributeSet
import android.widget.TextView
import androidx.preference.ListPreference
import androidx.preference.PreferenceViewHolder
import io.legado.app.R
class ATEListPreference(context: Context, attrs: AttributeSet) : ListPreference(context, attrs) {
init {
widgetLayoutResource = R.layout.item_text
}
override fun onBindViewHolder(holder: PreferenceViewHolder?) {
super.onBindViewHolder(holder)
val textView = holder?.itemView?.findViewById<TextView>(R.id.text_view)
textView?.text = entry
}
}

@ -78,13 +78,13 @@
<item>常亮</item> <item>常亮</item>
</string-array> </string-array>
<integer-array name="screen_time_out_value"> <string-array name="screen_time_out_value">
<item>0</item> <item>0</item>
<item>60</item> <item>60</item>
<item>120</item> <item>120</item>
<item>180</item> <item>180</item>
<item>-1</item> <item>-1</item>
</integer-array> </string-array>
<string-array name="screen_direction_list_title"> <string-array name="screen_direction_list_title">
<item>@string/screen_unspecified</item> <item>@string/screen_unspecified</item>

@ -2,6 +2,14 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.lib.theme.prefs.ATEListPreference
android:key="keep_light"
android:defaultValue="0"
android:entryValues="@array/screen_time_out_value"
android:entries="@array/screen_time_out"
android:title="@string/keep_light"
app:iconSpaceReserved="false" />
<io.legado.app.lib.theme.prefs.ATESwitchPreference <io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:title="@string/pt_hide_status_bar" android:title="@string/pt_hide_status_bar"

Loading…
Cancel
Save