Fix to show APN prefs correctly

Test: Settings -> Advanced -> Access Point Names

Change-Id: Ia3ad443ac056a877abd6cd258c2219d8ee6ff181
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
Taesu Lee
2020-05-04 18:15:52 +09:00
parent 1a0f1591de
commit 14853cb490
2 changed files with 4 additions and 12 deletions

View File

@@ -38,7 +38,7 @@
android:background="?android:attr/selectableItemBackground">
<TextView
android:id="@+id/title"
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
@@ -46,7 +46,7 @@
android:textAppearance="?android:attr/textAppearanceListItem" />
<TextView
android:id="@+id/summary"
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"

View File

@@ -26,7 +26,6 @@ import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.android.messaging.R;
import com.android.messaging.datamodel.data.ParticipantData;
@@ -81,7 +80,7 @@ public class ApnPreference extends Preference implements
} else {
rb.setVisibility(View.GONE);
}
setApnRadioButtonContentDescription(rb);
rb.setContentDescription(getTitle());
}
View textLayout = view.findViewById(R.id.text_layout);
@@ -92,13 +91,6 @@ public class ApnPreference extends Preference implements
return view;
}
public void setApnRadioButtonContentDescription(final CompoundButton buttonView) {
final View widget = (View) buttonView.getParent();
final TextView tv = (TextView) widget.findViewById(R.id.title);
final String apnTitle = tv.getText().toString();
buttonView.setContentDescription(apnTitle);
}
public boolean isChecked() {
return getKey().equals(mSelectedKey);
}
@@ -128,7 +120,7 @@ public class ApnPreference extends Preference implements
mCurrentChecked = null;
mSelectedKey = null;
}
setApnRadioButtonContentDescription(buttonView);
buttonView.setContentDescription(getTitle());
}
public void onClick(android.view.View v) {