Crop image view to center

This commit is contained in:
Dominik Schürmann 2015-03-04 15:26:09 +01:00
parent 2389ce9aeb
commit 502a0b5376
2 changed files with 6 additions and 7 deletions

View File

@ -76,7 +76,6 @@ import org.sufficientlysecure.keychain.ui.util.FormattingUtils;
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
import org.sufficientlysecure.keychain.ui.util.Notify; import org.sufficientlysecure.keychain.ui.util.Notify;
import org.sufficientlysecure.keychain.ui.util.QrCodeUtils; import org.sufficientlysecure.keychain.ui.util.QrCodeUtils;
import org.sufficientlysecure.keychain.ui.widget.AspectRatioImageView;
import org.sufficientlysecure.keychain.util.ContactHelper; import org.sufficientlysecure.keychain.util.ContactHelper;
import org.sufficientlysecure.keychain.util.ExportHelper; import org.sufficientlysecure.keychain.util.ExportHelper;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
@ -104,7 +103,7 @@ public class ViewKeyActivity extends BaseActivity implements
private ImageButton mActionEncryptText; private ImageButton mActionEncryptText;
private ImageButton mActionNfc; private ImageButton mActionNfc;
private FloatingActionButton mFab; private FloatingActionButton mFab;
private AspectRatioImageView mPhoto; private ImageView mPhoto;
private ImageView mQrCode; private ImageView mQrCode;
private CardView mQrCodeLayout; private CardView mQrCodeLayout;
@ -146,7 +145,7 @@ public class ViewKeyActivity extends BaseActivity implements
mActionEncryptText = (ImageButton) findViewById(R.id.view_key_action_encrypt_text); mActionEncryptText = (ImageButton) findViewById(R.id.view_key_action_encrypt_text);
mActionNfc = (ImageButton) findViewById(R.id.view_key_action_nfc); mActionNfc = (ImageButton) findViewById(R.id.view_key_action_nfc);
mFab = (FloatingActionButton) findViewById(R.id.fab); mFab = (FloatingActionButton) findViewById(R.id.fab);
mPhoto = (AspectRatioImageView) findViewById(R.id.view_key_photo); mPhoto = (ImageView) findViewById(R.id.view_key_photo);
mQrCode = (ImageView) findViewById(R.id.view_key_qr_code); mQrCode = (ImageView) findViewById(R.id.view_key_qr_code);
mQrCodeLayout = (CardView) findViewById(R.id.view_key_qr_code_layout); mQrCodeLayout = (CardView) findViewById(R.id.view_key_qr_code_layout);

View File

@ -15,12 +15,11 @@
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:orientation="horizontal"> android:orientation="horizontal">
<org.sufficientlysecure.keychain.ui.widget.AspectRatioImageView <ImageView
android:id="@+id/view_key_photo" android:id="@+id/view_key_photo"
app:aspectRatioEnabled="true"
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_below="@+id/status_bar" android:layout_below="@+id/status_bar"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
@ -29,7 +28,8 @@
android:cropToPadding="false" android:cropToPadding="false"
android:focusable="false" android:focusable="false"
android:adjustViewBounds="false" android:adjustViewBounds="false"
android:layout_alignParentTop="false" /> android:layout_alignParentTop="false"
android:scaleType="centerCrop" />
<ImageView <ImageView
android:id="@+id/status_bar" android:id="@+id/status_bar"