优化
This commit is contained in:
+3
-3
@@ -18,7 +18,7 @@ def version = "3." + releaseTime()
|
|||||||
def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim())
|
def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim())
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
compileSdkVersion 33
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "32.0.0"
|
||||||
namespace 'io.legado.app'
|
namespace 'io.legado.app'
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
@@ -42,7 +42,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "io.legado.app"
|
applicationId "io.legado.app"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 32
|
targetSdkVersion 33
|
||||||
versionCode 10000 + gitCommits
|
versionCode 10000 + gitCommits
|
||||||
versionName version
|
versionName version
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -156,7 +156,7 @@ dependencies {
|
|||||||
implementation('com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3')
|
implementation('com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3')
|
||||||
|
|
||||||
//androidX
|
//androidX
|
||||||
implementation('androidx.core:core-ktx:1.8.0')
|
implementation('androidx.core:core-ktx:1.9.0')
|
||||||
implementation('androidx.appcompat:appcompat:1.5.1')
|
implementation('androidx.appcompat:appcompat:1.5.1')
|
||||||
implementation('androidx.activity:activity-ktx:1.5.1')
|
implementation('androidx.activity:activity-ktx:1.5.1')
|
||||||
implementation('androidx.fragment:fragment-ktx:1.5.2')
|
implementation('androidx.fragment:fragment-ktx:1.5.2')
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class MoreConfigDialog : DialogFragment() {
|
|||||||
class ReadPreferenceFragment : PreferenceFragment(),
|
class ReadPreferenceFragment : PreferenceFragment(),
|
||||||
SharedPreferences.OnSharedPreferenceChangeListener {
|
SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
private val slopSquare by lazy { ViewConfiguration.get(context).scaledTouchSlop }
|
private val slopSquare by lazy { ViewConfiguration.get(requireContext()).scaledTouchSlop }
|
||||||
|
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
|||||||
@@ -65,10 +65,17 @@ fun Menu.applyOpenTint(context: Context) {
|
|||||||
fun Menu.iconItemOnLongClick(id: Int, function: (view: View) -> Unit) {
|
fun Menu.iconItemOnLongClick(id: Int, function: (view: View) -> Unit) {
|
||||||
findItem(id)?.let { item ->
|
findItem(id)?.let { item ->
|
||||||
item.setActionView(R.layout.view_action_button)
|
item.setActionView(R.layout.view_action_button)
|
||||||
item.actionView.contentDescription = item.title
|
item.actionView?.run {
|
||||||
item.actionView.findViewById<ImageButton>(R.id.item).setImageDrawable(item.icon)
|
contentDescription = item.title
|
||||||
item.actionView.setOnLongClickListener { function.invoke(item.actionView); true }
|
findViewById<ImageButton>(R.id.item).setImageDrawable(item.icon)
|
||||||
item.actionView.setOnClickListener { performIdentifierAction(id, 0) }
|
setOnLongClickListener {
|
||||||
|
function.invoke(this)
|
||||||
|
true
|
||||||
|
}
|
||||||
|
setOnClickListener {
|
||||||
|
performIdentifierAction(id, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user