|
|
@ -19,18 +19,20 @@ import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; |
|
|
|
import android.support.v7.widget.RecyclerView; |
|
|
|
import android.support.v7.widget.StaggeredGridLayoutManager; |
|
|
|
import android.text.Editable; |
|
|
|
import android.text.TextWatcher; |
|
|
|
import android.view.KeyEvent; |
|
|
|
import android.view.View; |
|
|
|
import android.view.animation.AccelerateDecelerateInterpolator; |
|
|
|
import android.view.animation.AnticipateOvershootInterpolator; |
|
|
|
import android.view.animation.Interpolator; |
|
|
|
import android.view.animation.OvershootInterpolator; |
|
|
|
import android.view.inputmethod.EditorInfo; |
|
|
|
import android.widget.EditText; |
|
|
|
import android.widget.ImageView; |
|
|
|
import android.widget.TextView; |
|
|
|
|
|
|
|
import com.gmeremit.online.gmeremittance_native.R; |
|
|
|
import com.gmeremit.online.gmeremittance_native.base.BaseActivity; |
|
|
|
import com.gmeremit.online.gmeremittance_native.customwidgets.CurrencyFormatterTextWatcher; |
|
|
|
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper; |
|
|
|
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.ExchangeRateCurrencyListingDialog; |
|
|
|
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService; |
|
|
@ -52,7 +54,7 @@ import butterknife.BindView; |
|
|
|
import butterknife.ButterKnife; |
|
|
|
|
|
|
|
|
|
|
|
public class SplashScreen extends BaseActivity implements View.OnClickListener, LanguageSelectionRVAdapter.LanguageSelectionListener, SplashScreenPresenterInterface.SplashScreenContractInterfacee, PayoutModeSelectionRVAdapter.OnPaymentModeSelectionListener { |
|
|
|
public class SplashScreen extends BaseActivity implements View.OnClickListener, LanguageSelectionRVAdapter.LanguageSelectionListener, SplashScreenPresenterInterface.SplashScreenContractInterfacee, PayoutModeSelectionRVAdapter.OnPaymentModeSelectionListener, TextView.OnEditorActionListener { |
|
|
|
|
|
|
|
@BindView(R.id.view_pager) |
|
|
|
ConstraintLayout view_pager; |
|
|
@ -157,8 +159,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
languageViewTransitionManager = new LanguageViewTransitionManager(this); |
|
|
|
initLanguageRV(); |
|
|
|
initPayoutModeRV(); |
|
|
|
sendMoneyTextWatcher = new SendAmountTextWatcher(); |
|
|
|
receiveMoneyTextWatcher = new ReceiveAmountTextWatcher(); |
|
|
|
sendMoneyTextWatcher = new SendAmountTextWatcher(sendAmountEdTxt); |
|
|
|
receiveMoneyTextWatcher = new ReceiveAmountTextWatcher(receiveAmountEdTxt); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -210,6 +212,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
selectedLanguageText.setOnClickListener(this); |
|
|
|
selectedLanguageIcon.setOnClickListener(this); |
|
|
|
countrySelectionSpinner.setOnClickListener(this); |
|
|
|
receiveAmountEdTxt.setOnEditorActionListener(this); |
|
|
|
sendAmountEdTxt.setOnEditorActionListener(this); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -221,6 +225,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
selectedLanguageText.setOnClickListener(null); |
|
|
|
selectedLanguageIcon.setOnClickListener(null); |
|
|
|
countrySelectionSpinner.setOnClickListener(null); |
|
|
|
receiveAmountEdTxt.setOnEditorActionListener(this); |
|
|
|
sendAmountEdTxt.setOnEditorActionListener(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -320,14 +326,14 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updatePayoutAmount(String pAmount) { |
|
|
|
public void showPayoutAmount(String pAmount) { |
|
|
|
startReceiveAmountListener(false); |
|
|
|
receiveAmountEdTxt.setText(pAmount); |
|
|
|
startReceiveAmountListener(true); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateCollectionAmount(String pAmount) { |
|
|
|
public void showCollectionAmount(String pAmount) { |
|
|
|
startSendAmountListener(false); |
|
|
|
sendAmountEdTxt.setText(pAmount); |
|
|
|
startSendAmountListener(true); |
|
|
@ -347,8 +353,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void showTransferChargeAndExrate(String chargeAmount, String exRate,boolean playAnimation) { |
|
|
|
if(playAnimation) { |
|
|
|
public void showTransferChargeAndExrate(String chargeAmount, String exRate, boolean playAnimation) { |
|
|
|
if (playAnimation) { |
|
|
|
ViewCompat.animate(this.transferFeeTxtView).alpha(0).withLayer().setDuration(200).setInterpolator(languageViewTransitionManager.accelerateDecelerateInterpolator).withEndAction(() -> { |
|
|
|
transferFeeTxtView.setText(chargeAmount); |
|
|
|
ViewCompat.animate(transferFeeTxtView).alpha(1).withLayer().setDuration(200).setInterpolator(languageViewTransitionManager.accelerateDecelerateInterpolator).start(); |
|
|
@ -361,9 +367,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
transferFeeTxtView.setText(chargeAmount); |
|
|
|
exchangeRateTxtView.setText(exRate); |
|
|
|
} |
|
|
@ -382,6 +386,33 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
presenter.setPaymentMode(selectedData); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { |
|
|
|
switch (v.getId()) { |
|
|
|
case R.id.sendAmountEdTxt: |
|
|
|
if (actionId == EditorInfo.IME_ACTION_DONE) { |
|
|
|
presenter.setCalcByPayoutAmount(false); |
|
|
|
presenter.calcExrate(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
case R.id.receiveAmountEdTxt: |
|
|
|
if (actionId == EditorInfo.IME_ACTION_DONE) { |
|
|
|
presenter.setCalcByPayoutAmount(true); |
|
|
|
presenter.calcExrate(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onPointerCaptureChanged(boolean hasCapture) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Helper class to switch between different state of this activity layout. |
|
|
|
*/ |
|
|
@ -550,7 +581,11 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class SendAmountTextWatcher implements TextWatcher { |
|
|
|
class SendAmountTextWatcher extends CurrencyFormatterTextWatcher { |
|
|
|
|
|
|
|
public SendAmountTextWatcher(EditText editText) { |
|
|
|
super(editText); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
|
@ -564,11 +599,16 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
|
|
|
|
@Override |
|
|
|
public void afterTextChanged(Editable s) { |
|
|
|
|
|
|
|
super.afterTextChanged(s); |
|
|
|
presenter.setCAmount(s.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class ReceiveAmountTextWatcher implements TextWatcher { |
|
|
|
class ReceiveAmountTextWatcher extends CurrencyFormatterTextWatcher { |
|
|
|
|
|
|
|
public ReceiveAmountTextWatcher(EditText editText) { |
|
|
|
super(editText); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|
|
@ -582,7 +622,8 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
|
|
|
|
@Override |
|
|
|
public void afterTextChanged(Editable s) { |
|
|
|
|
|
|
|
super.afterTextChanged(s); |
|
|
|
presenter.setPAmount(s.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|