|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.gmeremit.online.gmeremittance_native.exchange_rate.view; |
|
|
|
|
|
|
|
import android.graphics.Rect; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.support.v4.view.GestureDetectorCompat; |
|
|
|
import android.support.v4.view.ViewCompat; |
|
|
@ -7,6 +8,7 @@ import android.support.v7.widget.DefaultItemAnimator; |
|
|
|
import android.support.v7.widget.RecyclerView; |
|
|
|
import android.text.Editable; |
|
|
|
import android.text.TextWatcher; |
|
|
|
import android.util.Log; |
|
|
|
import android.view.GestureDetector; |
|
|
|
import android.view.KeyEvent; |
|
|
|
import android.view.MotionEvent; |
|
|
@ -79,6 +81,11 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod |
|
|
|
@BindView(R.id.rootView) |
|
|
|
View rootView; |
|
|
|
|
|
|
|
@BindView(R.id.receiveMoneyViewContainer) |
|
|
|
View receiveMoneyViewContainer; |
|
|
|
|
|
|
|
@BindView(R.id.sendMoneyViewContainer) |
|
|
|
View sendMoneyViewContainer; |
|
|
|
|
|
|
|
@BindView(R.id.exRateCalculateButton) |
|
|
|
Button exRateCalculateButton; |
|
|
@ -262,7 +269,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod |
|
|
|
if (sendMoneyEditText.getText().toString().length()>0) |
|
|
|
prepareToGetForex(); |
|
|
|
else |
|
|
|
showToastMessage("Please specify sending amount."); |
|
|
|
showToastMessage("Please specify sending amount"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
|
|
|
@ -273,7 +280,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod |
|
|
|
if (recieveMoneyEditText.getText().toString().length()>0) |
|
|
|
prepareToGetForex(); |
|
|
|
else |
|
|
|
showToastMessage("Please specify recieving amount."); |
|
|
|
showToastMessage("Please specify receiving amount"); |
|
|
|
} |
|
|
|
return true; |
|
|
|
|
|
|
@ -517,7 +524,8 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean onSingleTapUp(MotionEvent e) { |
|
|
|
if(e.getAction()==MotionEvent.ACTION_UP&&( sendMoneyEditText.hasFocus()||recieveMoneyEditText.hasFocus())) |
|
|
|
// if(e.getAction()==MotionEvent.ACTION_UP&&( sendMoneyEditText.hasFocus()||recieveMoneyEditText.hasFocus())) |
|
|
|
if(e.getAction()==MotionEvent.ACTION_UP&&(!hasTouchedOnAmountWidget(e.getX(),e.getY()))) |
|
|
|
{ |
|
|
|
View currentViewWithFocus=getCurrentFocus(); |
|
|
|
if(currentViewWithFocus!=null) |
|
|
@ -529,4 +537,23 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod |
|
|
|
return super.onSingleTapUp(e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private boolean hasTouchedOnAmountWidget(float x, float y) { |
|
|
|
|
|
|
|
int [] sendMoneyTopAndLeftCoordinates=new int[2]; |
|
|
|
int [] receiveMoneyTopAndLeftCoordinates=new int[2]; |
|
|
|
|
|
|
|
sendMoneyViewContainer.getLocationOnScreen(sendMoneyTopAndLeftCoordinates); |
|
|
|
receiveMoneyViewContainer.getLocationOnScreen(receiveMoneyTopAndLeftCoordinates); |
|
|
|
|
|
|
|
Rect sendMoneyBoundRect=new Rect(sendMoneyTopAndLeftCoordinates[0],sendMoneyTopAndLeftCoordinates[1], |
|
|
|
sendMoneyTopAndLeftCoordinates[0]+sendMoneyViewContainer.getMeasuredWidth(), |
|
|
|
sendMoneyTopAndLeftCoordinates[1]+sendMoneyViewContainer.getMeasuredHeight()); |
|
|
|
|
|
|
|
Rect receiveMoneyBoundRect=new Rect(receiveMoneyTopAndLeftCoordinates[0],receiveMoneyTopAndLeftCoordinates[1], |
|
|
|
receiveMoneyTopAndLeftCoordinates[0]+receiveMoneyViewContainer.getMeasuredWidth(), |
|
|
|
receiveMoneyTopAndLeftCoordinates[1]+receiveMoneyViewContainer.getMeasuredHeight()); |
|
|
|
|
|
|
|
return (sendMoneyBoundRect.contains((int) x,(int) y)||receiveMoneyBoundRect.contains((int)x,(int) y)); |
|
|
|
} |
|
|
|
} |