Browse Source

AVD added

master
Preyea Regmi 6 years ago
parent
commit
3d75c53afe
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 48
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/view/TransactionPasswordPromptActivity.java
  3. 105
      app/src/main/res/drawable-xxxhdpi/avd_fingerprint_off_to_on.xml
  4. 67
      app/src/main/res/drawable-xxxhdpi/vd_fingerprint_on.xml
  5. 3
      app/src/main/res/interpolator/fingerprint_off_0.xml
  6. 3
      app/src/main/res/interpolator/fingerprint_off_1.xml
  7. 3
      app/src/main/res/interpolator/fingerprint_on_0.xml
  8. 3
      app/src/main/res/interpolator/fingerprint_on_1.xml
  9. 5
      app/src/main/res/layout/activity_transaction_password_prompt.xml

BIN
.idea/caches/build_file_checksums.ser

48
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/view/TransactionPasswordPromptActivity.java

@ -1,15 +1,20 @@
package com.gmeremit.online.gmeremittance_native.transactionpasspromt.view;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.support.graphics.drawable.AnimatedVectorDrawableCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v7.app.AppCompatDelegate;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
@ -20,6 +25,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
@ -61,6 +67,9 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
@BindView(R.id.rootView)
View rootView;
@BindView(R.id.passwordPromptImageView)
ImageView passwordPromptImageView;
@BindView(R.id.passwordErrorTxt)
GmeErrorTextView passwordErrorTxt;
@ -76,6 +85,8 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
private String paymentType;
private TransactionPasswordPromptV2PresenterInterface presenter;
private CountDownTimer countDownTimer;
private AnimatedVectorDrawable fingerPrintAVD;
private AnimatedVectorDrawableCompat fingerPrintAVDCompat;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -113,6 +124,8 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
securityKeypadListener = new SecurityKeypadListener();
myViewGestureDetector = new TransactionPasswordPromptActivityGestureDetector();
gestureDetector = new GestureDetectorCompat(this, myViewGestureDetector);
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
try {
securityKeyboardManager = new SecurityKeyboardManager(this);
SecurityKeypadRequestParamBuilder request = new SecurityKeypadRequestParamBuilder(this);
@ -123,11 +136,13 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
title.setText(getString(R.string.enter_otp_password_text));
request.setMaxLength(4);
ballonView.setVisibility(View.INVISIBLE);
passwordPromptImageView.setBackgroundResource(R.drawable.ic_penny_test_pending);
} else {
request.setHintString(getString(R.string.password_text));
title.setText(getString(R.string.enter_login_password_text));
resendRequest.setVisibility(View.INVISIBLE);
setupFingerPrintIconIfRequired();
}
securityKeyboardManager.bindWithSecurityWidgetView(securityKeyboardView)
@ -142,12 +157,23 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
}
}
private void setupFingerPrintIconIfRequired() {
//TODO if biometric is on
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
fingerPrintAVD = (AnimatedVectorDrawable) ContextCompat.getDrawable(this, R.drawable.avd_fingerprint_off_to_on);
} else {
fingerPrintAVDCompat = (AnimatedVectorDrawableCompat) ContextCompat.getDrawable(this, R.drawable.avd_fingerprint_off_to_on);
}
}
private void performDefaultAction(Bundle savedInstanceState) {
securityKeyboardManager.showKeyboard();
if (checkIfRequiredOTPScreen())
if (checkIfRequiredOTPScreen()) {
new Handler().postDelayed(() -> {
presenter.getOtp();
}, 400);
}
}
@ -196,6 +222,26 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
}
@Override
protected void onResume() {
super.onResume();
new Handler().postDelayed(()->animateFingerPrintAppearAnimationIfRequired(),500);
}
@SuppressLint("NewApi")
private void animateFingerPrintAppearAnimationIfRequired() {
if (!checkIfRequiredOTPScreen()) {
if (fingerPrintAVD != null && !fingerPrintAVD.isRunning()) {
passwordPromptImageView.setImageDrawable(fingerPrintAVD);
fingerPrintAVD.start();
}
else if (fingerPrintAVDCompat != null && !fingerPrintAVDCompat.isRunning()) {
passwordPromptImageView.setImageDrawable(fingerPrintAVDCompat);
fingerPrintAVDCompat.start();
}
}
}
@Override
public void onSecurityViewRecievedFocus() {
if (securityKeyboardManager != null && !securityKeyboardManager.isKeyboardVisible())

105
app/src/main/res/drawable-xxxhdpi/avd_fingerprint_off_to_on.xml

@ -0,0 +1,105 @@
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:drawable="@drawable/vd_fingerprint_on">
<target android:name="ridge_5_path">
<aapt:attr name="android:animation">
<set android:ordering="sequentially">
<objectAnimator
android:duration="33"
android:interpolator="@android:interpolator/linear"
android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="0"
android:valueType="floatType"/>
<objectAnimator
android:duration="383"
android:interpolator="@interpolator/fingerprint_on_0"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"/>
</set>
</aapt:attr>
</target>
<target android:name="ridge_7_path">
<aapt:attr name="android:animation">
<set android:ordering="sequentially">
<objectAnimator
android:duration="83"
android:interpolator="@android:interpolator/linear"
android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="0"
android:valueType="floatType"/>
<objectAnimator
android:duration="483"
android:interpolator="@interpolator/fingerprint_on_1"
android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="1"
android:valueType="floatType"/>
</set>
</aapt:attr>
</target>
<target android:name="ridge_6_path">
<aapt:attr name="android:animation">
<set android:ordering="sequentially">
<objectAnimator
android:duration="50"
android:interpolator="@android:interpolator/linear"
android:propertyName="trimPathStart"
android:valueFrom="1"
android:valueTo="1"
android:valueType="floatType"/>
<objectAnimator
android:duration="549"
android:interpolator="@interpolator/fingerprint_on_1"
android:propertyName="trimPathStart"
android:valueFrom="1"
android:valueTo="0"
android:valueType="floatType"/>
</set>
</aapt:attr>
</target>
<target android:name="ridge_2_path">
<aapt:attr name="android:animation">
<set android:ordering="sequentially">
<objectAnimator
android:duration="216"
android:interpolator="@android:interpolator/linear"
android:propertyName="trimPathStart"
android:valueFrom="1"
android:valueTo="1"
android:valueType="floatType"/>
<objectAnimator
android:duration="400"
android:interpolator="@interpolator/fingerprint_on_1"
android:propertyName="trimPathStart"
android:valueFrom="1"
android:valueTo="0"
android:valueType="floatType"/>
</set>
</aapt:attr>
</target>
<target android:name="ridge_1_path">
<aapt:attr name="android:animation">
<set android:ordering="sequentially">
<objectAnimator
android:duration="316"
android:interpolator="@android:interpolator/linear"
android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="0"
android:valueType="floatType"/>
<objectAnimator
android:duration="383"
android:interpolator="@interpolator/fingerprint_on_1"
android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="1"
android:valueType="floatType"/>
</set>
</aapt:attr>
</target>
</animated-vector>

67
app/src/main/res/drawable-xxxhdpi/vd_fingerprint_on.xml

@ -0,0 +1,67 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="lockscreen_fingerprint_draw_on"
android:width="48dp"
android:height="48dp"
android:viewportHeight="32"
android:viewportWidth="32">
<group
android:name="white_fingerprint_ridges"
android:translateX="16.125"
android:translateY="19.75">
<group
android:name="white_fingerprint_ridges_pivot"
android:translateX="33.2085"
android:translateY="30.91685">
<group android:name="ridge_5">
<path
android:name="ridge_5_path"
android:pathData="M -25.3591003418,-24.4138946533 c -0.569000244141,0.106399536133 -1.12660217285,0.140594482422 -1.45460510254,0.140594482422 c -1.29689025879,0 -2.53239440918,-0.343307495117 -3.62019348145,-1.12400817871 c -1.67700195312,-1.20349121094 -2.76950073242,-3.17008972168 -2.76950073242,-5.39189147949"
android:strokeAlpha="0.5"
android:strokeColor="?attr/colorControlNormal"
android:strokeLineCap="round"
android:strokeWidth="1.45"/>
</group>
<group android:name="ridge_4">
<path
android:name="ridge_7_path"
android:pathData="M -36.1409912109,-21.7843475342 c -1.00540161133,-1.19300842285 -1.57499694824,-1.9181060791 -2.36520385742,-3.50170898438 c -0.827560424805,-1.65869140625 -1.31352233887,-3.49159240723 -1.31352233887,-5.48489379883 c 0,-3.66279602051 2.96932983398,-6.63220214844 6.63221740723,-6.63220214844 c 3.6628112793,0 6.63220214844,2.96940612793 6.63220214844,6.63220214844"
android:strokeAlpha="0.5"
android:strokeColor="?attr/colorControlNormal"
android:strokeLineCap="round"
android:strokeWidth="1.45"/>
</group>
<group android:name="ridge_3">
<path
android:name="ridge_6_path"
android:pathData="M -42.1907958984,-25.6756896973 c -0.758117675781,-2.14370727539 -0.896545410156,-3.86891174316 -0.896545410156,-5.12921142578 c 0,-1.46069335938 0.249176025391,-2.84799194336 0.814682006836,-4.09748840332 c 1.56153869629,-3.45030212402 5.03434753418,-5.85076904297 9.0679473877,-5.85076904297 c 5.49430847168,0 9.94830322266,4.4539642334 9.94830322266,9.94825744629 c 0,1.83151245117 -1.48460388184,3.31610107422 -3.31610107422,3.31610107422 c -1.83149719238,0 -3.31610107422,-1.48469543457 -3.31610107422,-3.31610107422 c 0,-1.83139038086 -1.48458862305,-3.31610107422 -3.31610107422,-3.31610107422 c -1.83149719238,0 -3.31610107422,1.48471069336 -3.31610107422,3.31610107422 c 0,2.57020568848 0.989517211914,4.88710021973 2.60510253906,6.5865020752 c 1.22210693359,1.28550720215 2.43139648438,2.09950256348 4.47590637207,2.69030761719"
android:strokeAlpha="0.5"
android:strokeColor="?attr/colorControlNormal"
android:strokeLineCap="round"
android:strokeWidth="1.45"/>
</group>
<group android:name="ridge_2">
<path
android:name="ridge_2_path"
android:pathData="M -44.0646514893,-38.1672973633 c 1.19026184082,-1.77430725098 2.67503356934,-3.24531555176 4.55902099609,-4.27278137207 c 1.88395690918,-1.0274810791 4.04466247559,-1.61137390137 6.34175109863,-1.61137390137 c 2.28761291504,0 4.43991088867,0.579071044922 6.31831359863,1.59861755371 c 1.8784942627,1.01954650879 3.36059570312,2.4796295166 4.55279541016,4.24153137207"
android:strokeAlpha="0.5"
android:strokeColor="?attr/colorControlNormal"
android:strokeLineCap="round"
android:strokeWidth="1.45"/>
</group>
<group
android:name="ridge_1"
android:translateX="-97.5"
android:translateY="-142.5">
<path
android:name="ridge_1_path"
android:pathData="M 71.7812347412,97.0507202148 c -2.27149963379,-1.31344604492 -4.71360778809,-2.07006835938 -7.56221008301,-2.07006835938 c -2.84869384766,0 -5.23320007324,0.779556274414 -7.34411621094,2.07006835938"
android:strokeAlpha="0.5"
android:strokeColor="?attr/colorControlNormal"
android:strokeLineCap="round"
android:strokeWidth="1.45"/>
</group>
</group>
</group>
</vector>

3
app/src/main/res/interpolator/fingerprint_off_0.xml

@ -0,0 +1,3 @@
<pathInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:pathData="M 0,0 c 0.5,0 1,1 1,1"/>

3
app/src/main/res/interpolator/fingerprint_off_1.xml

@ -0,0 +1,3 @@
<pathInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:pathData="M 0,0 c 0.5,0 0.5,1.0 1,1"/>

3
app/src/main/res/interpolator/fingerprint_on_0.xml

@ -0,0 +1,3 @@
<pathInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:pathData="M 0,0 c 0,0 0.29,1 1,1"/>

3
app/src/main/res/interpolator/fingerprint_on_1.xml

@ -0,0 +1,3 @@
<pathInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:pathData="M 0,0 c 0,0 0.5,1 1,1"/>

5
app/src/main/res/layout/activity_transaction_password_prompt.xml

@ -22,12 +22,14 @@
android:textSize="20sp" />
<ImageView
android:id="@+id/passwordPromptImageView"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:minHeight="48dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_penny_test_pending" />
/>
<com.gmeremit.online.gmeremittance_native.utils.security.securitykeypad.SecurityKeyboardView
@ -57,6 +59,7 @@
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp"
android:padding="10dp"
android:gravity="center"
android:text="@string/resend_request_text"
android:textColor="@color/colorPrimary"
android:textSize="14sp"

Loading…
Cancel
Save