Fix the unclickable learn more link.

The UsageProgressBarPreference is replaced with BatteryHeaderTextPreference, and the movement method of the textview was not added, which leads to the unclickable link.

Hence, add back the movement method of the textview to allow the linkable text.

Fixes: 382395040
Test: manual test
Flag: EXEMPT bugfix
Change-Id: I6dd5b2c2fbec891035fa8b0fefa47de6962324b7
This commit is contained in:
Yiling Chuang
2024-12-06 11:03:51 +00:00
parent aa2379967c
commit 572afa59e6

View File

@@ -18,6 +18,7 @@ package com.android.settings.fuelgauge;
import android.content.Context;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.util.AttributeSet;
import android.widget.TextView;
@@ -44,6 +45,7 @@ public class BatteryHeaderTextPreference extends Preference implements GroupSect
public void onBindViewHolder(PreferenceViewHolder view) {
final TextView textView = (TextView) view.findViewById(R.id.text);
textView.setText(mText);
textView.setMovementMethod(LinkMovementMethod.getInstance());
if (!TextUtils.isEmpty(mContentDescription)) {
textView.setContentDescription(mContentDescription);
}