diff options
| author | 2025-02-24 23:20:54 -0800 | |
|---|---|---|
| committer | 2025-02-24 23:20:54 -0800 | |
| commit | b56b1588e7e428ce4f46b0964a1fe136f9536e49 (patch) | |
| tree | 7cbe3d23114f3b3df0ac576602284be97f8ac7a7 | |
| parent | ca5412643e146840e2a010e398857eab316e6461 (diff) | |
| parent | 489178e6c6e59fc265c312401e3556b942873f8c (diff) | |
Merge "Remove api version restriction from IntroPreference" into main
| -rw-r--r-- | packages/SettingsLib/IntroPreference/src/com/android/settingslib/widget/IntroPreference.kt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/SettingsLib/IntroPreference/src/com/android/settingslib/widget/IntroPreference.kt b/packages/SettingsLib/IntroPreference/src/com/android/settingslib/widget/IntroPreference.kt index 9d037e91a86f..806580b10cc8 100644 --- a/packages/SettingsLib/IntroPreference/src/com/android/settingslib/widget/IntroPreference.kt +++ b/packages/SettingsLib/IntroPreference/src/com/android/settingslib/widget/IntroPreference.kt @@ -17,20 +17,20 @@ package com.android.settingslib.widget import android.content.Context -import android.os.Build import android.text.TextUtils import android.util.AttributeSet import android.view.View -import androidx.annotation.RequiresApi import androidx.preference.Preference import androidx.preference.PreferenceViewHolder import com.android.settingslib.widget.preference.intro.R -class IntroPreference @JvmOverloads constructor( +class IntroPreference +@JvmOverloads +constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, - defStyleRes: Int = 0 + defStyleRes: Int = 0, ) : Preference(context, attrs, defStyleAttr, defStyleRes), GroupSectionDividerMixin { private var isCollapsable: Boolean = true @@ -66,9 +66,9 @@ class IntroPreference @JvmOverloads constructor( /** * Sets whether the summary is collapsable. + * * @param collapsable True if the summary should be collapsable, false otherwise. */ - @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) fun setCollapsable(collapsable: Boolean) { isCollapsable = collapsable minLines = if (isCollapsable) DEFAULT_MIN_LINES else DEFAULT_MAX_LINES @@ -77,9 +77,9 @@ class IntroPreference @JvmOverloads constructor( /** * Sets the minimum number of lines to display when collapsed. + * * @param lines The minimum number of lines. */ - @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) fun setMinLines(lines: Int) { minLines = lines.coerceIn(1, DEFAULT_MAX_LINES) notifyChanged() @@ -87,9 +87,9 @@ class IntroPreference @JvmOverloads constructor( /** * Sets the action when clicking on the hyperlink in the text. + * * @param listener The click listener for hyperlink. */ - @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) fun setHyperlinkListener(listener: View.OnClickListener) { if (hyperlinkListener != listener) { hyperlinkListener = listener @@ -99,9 +99,9 @@ class IntroPreference @JvmOverloads constructor( /** * Sets the action when clicking on the learn more view. + * * @param listener The click listener for learn more. */ - @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) fun setLearnMoreAction(listener: View.OnClickListener) { if (learnMoreListener != listener) { learnMoreListener = listener @@ -111,9 +111,9 @@ class IntroPreference @JvmOverloads constructor( /** * Sets the text of learn more view. + * * @param text The text of learn more. */ - @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) fun setLearnMoreText(text: CharSequence) { if (!TextUtils.equals(learnMoreText, text)) { learnMoreText = text |