Fix user photo popup layout for RTL

When RTL language is set, the edit-photo popup window
on user profile info is not shown fully.
The popup window should be aligned with the anchor.

Bug: 27955356

Change-Id: Ic9b9eb935e1a88800b008bcf0157b40a49502206
This commit is contained in:
Ryoji Miyazaki
2016-03-01 15:13:36 +09:00
committed by Yoshinori Hirano
parent 71dcb876e8
commit 996e8b723a

View File

@@ -36,6 +36,7 @@ import android.provider.MediaStore;
import android.provider.ContactsContract.DisplayPhoto; import android.provider.ContactsContract.DisplayPhoto;
import android.support.v4.content.FileProvider; import android.support.v4.content.FileProvider;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.AdapterView; import android.widget.AdapterView;
@@ -161,6 +162,7 @@ public class EditUserPhotoController {
final int width = Math.max(mImageView.getWidth(), context.getResources() final int width = Math.max(mImageView.getWidth(), context.getResources()
.getDimensionPixelSize(R.dimen.update_user_photo_popup_min_width)); .getDimensionPixelSize(R.dimen.update_user_photo_popup_min_width));
listPopupWindow.setWidth(width); listPopupWindow.setWidth(width);
listPopupWindow.setDropDownGravity(Gravity.START);
listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override