-
-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debug: Show detailed version information when long pressing the chang…
…elog settings entry Implements #939
- Loading branch information
Showing
6 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/src/main/java/eu/darken/sdmse/common/preferences/Preference2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package eu.darken.sdmse.common.preferences | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.View | ||
import androidx.annotation.AttrRes | ||
import androidx.annotation.StyleRes | ||
import androidx.preference.Preference | ||
import androidx.preference.PreferenceViewHolder | ||
import eu.darken.sdmse.common.debug.logging.logTag | ||
|
||
|
||
open class Preference2 @JvmOverloads constructor( | ||
context: Context, | ||
attrs: AttributeSet? = null, | ||
@AttrRes defStyleAttr: Int = androidx.preference.R.attr.preferenceStyle, | ||
@StyleRes defStyleRes: Int = 0, | ||
) : Preference(context, attrs, defStyleAttr, defStyleRes) { | ||
|
||
private var longClickListener: View.OnLongClickListener? = null | ||
|
||
override fun onBindViewHolder(holder: PreferenceViewHolder) { | ||
super.onBindViewHolder(holder) | ||
|
||
holder.itemView.setOnLongClickListener(longClickListener) | ||
} | ||
|
||
fun setOnLongClickListener(action: View.OnLongClickListener?) { | ||
longClickListener = action | ||
} | ||
|
||
companion object { | ||
private val TAG = logTag("Preference2") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/src/main/java/eu/darken/sdmse/main/ui/settings/SettingEvents.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package eu.darken.sdmse.main.ui.settings | ||
|
||
sealed class SettingEvents { | ||
data class ShowVersionInfo(val info: String) : SettingEvents() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters