From b7867817d0c5574d2124ae85bd0d7680c927bbc7 Mon Sep 17 00:00:00 2001 From: Alex Johnston Date: Mon, 29 Mar 2021 18:28:17 +0000 Subject: [PATCH] RequestManageCredentials support RTL languages * App name and URIs should be displayed to the left of the app icon for right-to-left languages e.g. arabic. Manual testing steps: * Set language as Arabic * Install TestDPC and select 'Request to manage credentials'. * Verify app name and URLs are correctly displayed. * Go to Settings > Security > Encryption & Credentials > Credential management app and verify apps and URIs are displayed corretly. Bug: 170627997 Test: Manual testing Change-Id: Id383e5d92022fc2e40494fadb12c64a46b1f6a65 --- res/layout/app_authentication_item.xml | 7 +++++-- .../security/CredentialManagementAppAdapter.java | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/res/layout/app_authentication_item.xml b/res/layout/app_authentication_item.xml index 423722e5f70..16d6fbd254f 100644 --- a/res/layout/app_authentication_item.xml +++ b/res/layout/app_authentication_item.xml @@ -26,7 +26,8 @@ android:layout_width="24dp" android:layout_height="24dp"/> - - + (); + if (mIsLayoutRtl) { + RelativeLayout appDetails = view.findViewById(R.id.app_details); + RelativeLayout.LayoutParams params = + (RelativeLayout.LayoutParams) appDetails.getLayoutParams(); + params.addRule(RelativeLayout.LEFT_OF, R.id.app_icon); + params.addRule(RelativeLayout.RIGHT_OF, R.id.expand); + view.setLayoutParams(params); + } + mExpanderIconView.setOnClickListener(view1 -> { final String appName = mSortedAppNames.get(getBindingAdapterPosition()); if (mExpandedApps.contains(appName)) { @@ -195,6 +206,8 @@ public class CredentialManagementAppAdapter extends RecyclerView.Adapter