diff --git a/app/build.gradle b/app/build.gradle index d09fb49b..911d7694 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,6 +30,15 @@ android { setProperty("archivesBaseName", "GME_" + dateTime + "_v" + versionCode + "(" + versionName + ")") } + splits { + abi { + enable true + reset() + include 'x86', 'armeabi-v7a', 'x86_64' + universalApk true + } + } + signingConfigs { release { keyAlias 'GmeRemitKey' diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardManager.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardManager.java index 986b6863..3d5be905 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardManager.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardManager.java @@ -41,6 +41,9 @@ public class SecurityKeyboardManager { } + + + public SecurityKeyboardManager bindWithSecurityWidgetView(SecurityKeyboardWidgetBinder binder) { if (binder == null) throw new IllegalArgumentException("Binding view must implement " + SecurityKeyboardWidgetBinder.class.getSimpleName()); diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardView.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardView.java index ae4402ae..d4876a2c 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardView.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardView.java @@ -1,10 +1,12 @@ package com.gmeremit.online.gmeremittance_native.utils.security.securitykeypad; import android.content.Context; +import android.content.res.TypedArray; import android.graphics.Rect; import android.support.v4.view.GestureDetectorCompat; import android.util.AttributeSet; import android.view.GestureDetector; +import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.widget.EditText; @@ -42,18 +44,18 @@ public class SecurityKeyboardView extends RelativeLayout implements SecurityKeyb public SecurityKeyboardView(Context context) { super(context); - init(context); + init(context, null); } public SecurityKeyboardView(Context context, AttributeSet attrs) { super(context, attrs); - init(context); + init(context, attrs); } public SecurityKeyboardView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - init(context); + init(context, attrs); } @@ -65,11 +67,34 @@ public class SecurityKeyboardView extends RelativeLayout implements SecurityKeyb this.keyboardBallonView = keyboardBallonView; } - private void init(Context context) { + + private void init(Context context, AttributeSet attrs) { + boolean shouldCenterGravityInput = false; + int keypadCursorPaddingStart=0; + if (attrs != null) { + TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.SecurityKeyboardView); + shouldCenterGravityInput = a.getBoolean(R.styleable.SecurityKeyboardView_centerGravityInput, false); + keypadCursorPaddingStart=a.getInteger(R.styleable.SecurityKeyboardView_keypadCursorPaddingStart,10); + a.recycle(); + } View v = View.inflate(context, R.layout.security_keyboard_view, this); securityKeyboard = (EditText) v.findViewById(R.id.securityKeyboardEditText); horizontalScrollView = (HorizontalScrollView) v.findViewById(R.id.securityKeyboardScrollView); + + + keyLayout = (LinearLayout) v.findViewById(R.id.keyLayout); + if (shouldCenterGravityInput) { + keyLayout.setGravity(Gravity.CENTER); + securityKeyboard.setTextAlignment(TEXT_ALIGNMENT_CENTER); + } + if(keypadCursorPaddingStart!=0) { + float density = context.getResources().getDisplayMetrics().density; + int paddingPixel = (int) (keypadCursorPaddingStart * density); + keyLayout.setPadding(paddingPixel, 0, 0, 0); + } + + clearImageButton = (ImageButton) v.findViewById(R.id.securityKeyboardClearAllImageView); myViewGestureDetector = new SecurityKeyboardManagerGestureDetector(); gestureDetector = new GestureDetectorCompat(context, myViewGestureDetector); @@ -118,10 +143,10 @@ public class SecurityKeyboardView extends RelativeLayout implements SecurityKeyb getLocationOnScreen(securityKeypadInputFieldLeftAndTopCoordinates); - int imageButtonWidth=clearImageButton.getWidth(); + int imageButtonWidth = clearImageButton.getWidth(); Rect securityKeypadBoundRect = new Rect(securityKeypadInputFieldLeftAndTopCoordinates[0], securityKeypadInputFieldLeftAndTopCoordinates[1], - securityKeypadInputFieldLeftAndTopCoordinates[0] + getMeasuredWidth()-imageButtonWidth, + securityKeypadInputFieldLeftAndTopCoordinates[0] + getMeasuredWidth() - imageButtonWidth, securityKeypadInputFieldLeftAndTopCoordinates[1] + getMeasuredHeight()); return securityKeypadBoundRect.contains(posX, posY); @@ -141,8 +166,8 @@ public class SecurityKeyboardView extends RelativeLayout implements SecurityKeyb keyboardContainerView.getChildAt(0).getLocationOnScreen(keypadContainerLeftAndTopCoordinates); Rect securityKeypadContainerBoundRect = new Rect(keypadContainerLeftAndTopCoordinates[0], keypadContainerLeftAndTopCoordinates[1], - keypadContainerLeftAndTopCoordinates[0] + keyboardContainerView.getChildAt(0).getMeasuredWidth(), - keypadContainerLeftAndTopCoordinates[1] + keyboardContainerView.getChildAt(0).getMeasuredHeight()); + keypadContainerLeftAndTopCoordinates[0] + keyboardContainerView.getChildAt(0).getMeasuredWidth(), + keypadContainerLeftAndTopCoordinates[1] + keyboardContainerView.getChildAt(0).getMeasuredHeight()); return securityKeypadContainerBoundRect.contains(posX, posY); diff --git a/app/src/main/res/drawable/ic_rounded_password_prompt.xml b/app/src/main/res/drawable/ic_rounded_password_prompt.xml index 21d032a0..ebb2e103 100644 --- a/app/src/main/res/drawable/ic_rounded_password_prompt.xml +++ b/app/src/main/res/drawable/ic_rounded_password_prompt.xml @@ -2,6 +2,6 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/activity_transaction_password_prompt.xml b/app/src/main/res/layout/activity_transaction_password_prompt.xml index c376085f..749c59d7 100644 --- a/app/src/main/res/layout/activity_transaction_password_prompt.xml +++ b/app/src/main/res/layout/activity_transaction_password_prompt.xml @@ -1,62 +1,80 @@ - - - + android:fitsSystemWindows="true" + android:orientation="vertical"> + + + + + + + + + + + + + + + android:layout_gravity="center_vertical" + android:layout_marginEnd="5dp" + android:layout_marginStart="5dp" /> + - - + android:paddingBottom="2dp" + android:paddingTop="2dp" /> - + android:layout_height="0dp" + android:layout_weight="1"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/security_keyboard_view.xml b/app/src/main/res/layout/security_keyboard_view.xml index a832f3f3..f6e3311b 100644 --- a/app/src/main/res/layout/security_keyboard_view.xml +++ b/app/src/main/res/layout/security_keyboard_view.xml @@ -39,10 +39,11 @@ + + + + + \ No newline at end of file