introduce text protection and fix color change after confirm
This commit is contained in:
parent
bff9aa1401
commit
6fa5f0b129
|
@ -48,6 +48,7 @@ import android.view.animation.AlphaAnimation;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.Animation.AnimationListener;
|
import android.view.animation.Animation.AnimationListener;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
@ -120,6 +121,7 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
||||||
private ImageButton mActionNfc;
|
private ImageButton mActionNfc;
|
||||||
private FloatingActionButton mFab;
|
private FloatingActionButton mFab;
|
||||||
private ImageView mPhoto;
|
private ImageView mPhoto;
|
||||||
|
private FrameLayout mPhotoLayout;
|
||||||
private ImageView mQrCode;
|
private ImageView mQrCode;
|
||||||
private CardView mQrCodeLayout;
|
private CardView mQrCodeLayout;
|
||||||
|
|
||||||
|
@ -169,6 +171,7 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
||||||
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 = (ImageView) findViewById(R.id.view_key_photo);
|
mPhoto = (ImageView) findViewById(R.id.view_key_photo);
|
||||||
|
mPhotoLayout = (FrameLayout) findViewById(R.id.view_key_photo_layout);
|
||||||
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);
|
||||||
|
|
||||||
|
@ -779,8 +782,12 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onPostExecute(Bitmap photo) {
|
protected void onPostExecute(Bitmap photo) {
|
||||||
|
if (photo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mPhoto.setImageBitmap(photo);
|
mPhoto.setImageBitmap(photo);
|
||||||
mPhoto.setVisibility(View.VISIBLE);
|
mPhotoLayout.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -892,6 +899,8 @@ public class ViewKeyActivity extends BaseNfcActivity implements
|
||||||
ObjectAnimator colorFade =
|
ObjectAnimator colorFade =
|
||||||
ObjectAnimator.ofObject(mAppBarLayout, "backgroundColor",
|
ObjectAnimator.ofObject(mAppBarLayout, "backgroundColor",
|
||||||
new ArgbEvaluator(), mPreviousColor, color);
|
new ArgbEvaluator(), mPreviousColor, color);
|
||||||
|
mCollapsingToolbarLayout.setContentScrimColor(color);
|
||||||
|
mCollapsingToolbarLayout.setStatusBarScrimColor(getStatusBarBackgroundColor(color));
|
||||||
|
|
||||||
colorFade.setDuration(1200);
|
colorFade.setDuration(1200);
|
||||||
colorFade.start();
|
colorFade.start();
|
||||||
|
|
|
@ -34,21 +34,36 @@
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
app:layout_collapseMode="parallax">
|
app:layout_collapseMode="parallax">
|
||||||
|
|
||||||
<ImageView
|
<FrameLayout
|
||||||
android:id="@+id/view_key_photo"
|
android:id="@+id/view_key_photo_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="false"
|
android:layout_alignParentTop="false"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/view_key_photo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="false"
|
android:adjustViewBounds="false"
|
||||||
android:baselineAlignBottom="false"
|
android:baselineAlignBottom="false"
|
||||||
android:cropToPadding="false"
|
android:cropToPadding="false"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/ic_launcher"
|
android:src="@drawable/ic_launcher" />
|
||||||
android:visibility="gone" />
|
|
||||||
|
<!-- text protection scrim -->
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:background="@drawable/scrim_bottom" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/view_key_status"
|
android:id="@+id/view_key_status"
|
||||||
|
|
|
@ -29,4 +29,8 @@
|
||||||
<color name="android_green_light">#7bad45</color>
|
<color name="android_green_light">#7bad45</color>
|
||||||
<color name="android_green_dark">#6c983d</color>
|
<color name="android_green_dark">#6c983d</color>
|
||||||
|
|
||||||
|
<!-- text protection scrim colors -->
|
||||||
|
<color name="translucent_scrim_bottom">#2A000000</color>
|
||||||
|
<color name="translucent_scrim_bottom_center">#2A000000</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue