Loading res/layout/supported_links_dialog_item.xml +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textDirection="locale" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:ellipsize="marquee" android:gravity="center_vertical" Loading src/com/android/settings/applications/intentpicker/AppLaunchSettings.java +7 −1 Original line number Diff line number Diff line Loading @@ -281,12 +281,18 @@ public class AppLaunchSettings extends AppInfoBase implements final List<String> verifiedLinksList = IntentPickerUtils.getLinksList( mDomainVerificationManager, mPackageName, DOMAIN_STATE_VERIFIED); return new AlertDialog.Builder(mContext) AlertDialog dialog = new AlertDialog.Builder(mContext) .setCustomTitle(titleView) .setCancelable(true) .setItems(verifiedLinksList.toArray(new String[0]), /* listener= */ null) .setPositiveButton(R.string.app_launch_dialog_ok, /* listener= */ null) .create(); if (dialog.getListView() != null) { dialog.getListView().setTextDirection(View.TEXT_DIRECTION_LOCALE); } else { Log.w(TAG, "createVerifiedLinksDialog: dialog.getListView() is null, please check it."); } return dialog; } @VisibleForTesting Loading src/com/android/settings/applications/intentpicker/SupportedLinksAdapter.java +11 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.settings.applications.intentpicker; import android.content.Context; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -29,6 +31,7 @@ import java.util.List; /** This adapter is for supported links dialog. */ public class SupportedLinksAdapter extends BaseAdapter { private static final String TAG = "SupportedLinksAdapter"; private final Context mContext; private final List<SupportedLinkWrapper> mWrapperList; Loading Loading @@ -62,6 +65,14 @@ public class SupportedLinksAdapter extends BaseAdapter { R.layout.supported_links_dialog_item, /* root= */ null); } final CheckedTextView textView = convertView.findViewById(android.R.id.text1); Drawable[] drawables = textView.getCompoundDrawables(); if (mContext.getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL && drawables[0] != null) { Log.d(TAG, "getView: RTL direction."); // Set a checkbox position. It is same as the android:drawableRight attribute. textView.setCompoundDrawables(/* left= */ null, /* top= */ null, drawables[0], /* bottom= */ null); } textView.setText(mWrapperList.get(position).getDisplayTitle(mContext)); textView.setEnabled(mWrapperList.get(position).isEnabled()); textView.setChecked(mWrapperList.get(position).isChecked()); Loading Loading
res/layout/supported_links_dialog_item.xml +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textDirection="locale" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:ellipsize="marquee" android:gravity="center_vertical" Loading
src/com/android/settings/applications/intentpicker/AppLaunchSettings.java +7 −1 Original line number Diff line number Diff line Loading @@ -281,12 +281,18 @@ public class AppLaunchSettings extends AppInfoBase implements final List<String> verifiedLinksList = IntentPickerUtils.getLinksList( mDomainVerificationManager, mPackageName, DOMAIN_STATE_VERIFIED); return new AlertDialog.Builder(mContext) AlertDialog dialog = new AlertDialog.Builder(mContext) .setCustomTitle(titleView) .setCancelable(true) .setItems(verifiedLinksList.toArray(new String[0]), /* listener= */ null) .setPositiveButton(R.string.app_launch_dialog_ok, /* listener= */ null) .create(); if (dialog.getListView() != null) { dialog.getListView().setTextDirection(View.TEXT_DIRECTION_LOCALE); } else { Log.w(TAG, "createVerifiedLinksDialog: dialog.getListView() is null, please check it."); } return dialog; } @VisibleForTesting Loading
src/com/android/settings/applications/intentpicker/SupportedLinksAdapter.java +11 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.settings.applications.intentpicker; import android.content.Context; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -29,6 +31,7 @@ import java.util.List; /** This adapter is for supported links dialog. */ public class SupportedLinksAdapter extends BaseAdapter { private static final String TAG = "SupportedLinksAdapter"; private final Context mContext; private final List<SupportedLinkWrapper> mWrapperList; Loading Loading @@ -62,6 +65,14 @@ public class SupportedLinksAdapter extends BaseAdapter { R.layout.supported_links_dialog_item, /* root= */ null); } final CheckedTextView textView = convertView.findViewById(android.R.id.text1); Drawable[] drawables = textView.getCompoundDrawables(); if (mContext.getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL && drawables[0] != null) { Log.d(TAG, "getView: RTL direction."); // Set a checkbox position. It is same as the android:drawableRight attribute. textView.setCompoundDrawables(/* left= */ null, /* top= */ null, drawables[0], /* bottom= */ null); } textView.setText(mWrapperList.get(position).getDisplayTitle(mContext)); textView.setEnabled(mWrapperList.get(position).isEnabled()); textView.setChecked(mWrapperList.get(position).isChecked()); Loading