Merge "RequestManageCredentials support RTL languages" into sc-dev am: 099a144869
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14018678 Change-Id: Id19b8324a3d5154697d90599a0d56def215b9448
This commit is contained in:
@@ -25,6 +25,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -61,6 +62,7 @@ public class CredentialManagementAppAdapter extends RecyclerView.Adapter<Recycle
|
||||
|
||||
private final boolean mIncludeHeader;
|
||||
private final boolean mIncludeExpander;
|
||||
private final boolean mIsLayoutRtl;
|
||||
|
||||
/**
|
||||
* View holder for the header in the request manage credentials screen.
|
||||
@@ -113,6 +115,15 @@ public class CredentialManagementAppAdapter extends RecyclerView.Adapter<Recycle
|
||||
mChildRecyclerView = view.findViewById(R.id.uris);
|
||||
mExpandedApps = new ArrayList<>();
|
||||
|
||||
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<Recycle
|
||||
mViewPool = new RecyclerView.RecycledViewPool();
|
||||
mIncludeHeader = includeHeader;
|
||||
mIncludeExpander = includeExpander;
|
||||
mIsLayoutRtl = context.getResources().getConfiguration().getLayoutDirection()
|
||||
== View.LAYOUT_DIRECTION_RTL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user