|
@ -105,8 +105,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
@BindView(R.id.appVersionTxtView) |
|
|
@BindView(R.id.appVersionTxtView) |
|
|
TextView appVersionTxtView; |
|
|
TextView appVersionTxtView; |
|
|
|
|
|
|
|
|
@BindView(R.id.fab_chat) |
|
|
|
|
|
View fab_chat; |
|
|
|
|
|
|
|
|
|
|
|
//EXrate Related View |
|
|
//EXrate Related View |
|
|
@BindView(R.id.paymentModeRV) |
|
|
@BindView(R.id.paymentModeRV) |
|
@ -131,8 +129,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
@BindView(R.id.exchangeRateTxtView) |
|
|
@BindView(R.id.exchangeRateTxtView) |
|
|
TextView exchangeRateTxtView; |
|
|
TextView exchangeRateTxtView; |
|
|
|
|
|
|
|
|
@BindView(R.id.notificationCounterTxtView) |
|
|
|
|
|
TextView notificationCounterTxtView; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.gmeExratePC) |
|
|
@BindView(R.id.gmeExratePC) |
|
|
TextView gmeExratePC; |
|
|
TextView gmeExratePC; |
|
@ -168,7 +165,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
private ReceiveAmountTextWatcher receiveMoneyTextWatcher; |
|
|
private ReceiveAmountTextWatcher receiveMoneyTextWatcher; |
|
|
private GestureDetectorCompat gestureDetector; |
|
|
private GestureDetectorCompat gestureDetector; |
|
|
private AmountChangeAndFocusOutDetector myViewGestureDetector; |
|
|
private AmountChangeAndFocusOutDetector myViewGestureDetector; |
|
|
private ChannelIOEventListener channelIOEventListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -201,8 +197,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
receiveMoneyTextWatcher = new ReceiveAmountTextWatcher(receiveAmountEdTxt); |
|
|
receiveMoneyTextWatcher = new ReceiveAmountTextWatcher(receiveAmountEdTxt); |
|
|
myViewGestureDetector = new AmountChangeAndFocusOutDetector(); |
|
|
myViewGestureDetector = new AmountChangeAndFocusOutDetector(); |
|
|
gestureDetector = new GestureDetectorCompat(this, myViewGestureDetector); |
|
|
gestureDetector = new GestureDetectorCompat(this, myViewGestureDetector); |
|
|
channelIOEventListener = new ChannelIOEventListener(this); |
|
|
|
|
|
ChannelIO.setChannelPluginListener(channelIOEventListener); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -237,9 +231,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
if (languageViewTransitionManager.isUserOnLanguageSelectionView()) |
|
|
if (languageViewTransitionManager.isUserOnLanguageSelectionView()) |
|
|
onBackPressed(); |
|
|
onBackPressed(); |
|
|
break; |
|
|
break; |
|
|
case R.id.fab_chat: |
|
|
|
|
|
promptToChat(); |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case R.id.selectedLanguageText: |
|
|
case R.id.selectedLanguageText: |
|
|
case R.id.selectedLanguageIcon: |
|
|
case R.id.selectedLanguageIcon: |
|
|
if (!languageViewTransitionManager.isUserOnLanguageSelectionView()) |
|
|
if (!languageViewTransitionManager.isUserOnLanguageSelectionView()) |
|
@ -255,7 +247,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
btn_login.setOnClickListener(this); |
|
|
btn_login.setOnClickListener(this); |
|
|
btn_new_user.setOnClickListener(this); |
|
|
btn_new_user.setOnClickListener(this); |
|
|
iv_back.setOnClickListener(this); |
|
|
iv_back.setOnClickListener(this); |
|
|
fab_chat.setOnClickListener(this); |
|
|
|
|
|
selectedLanguageText.setOnClickListener(this); |
|
|
selectedLanguageText.setOnClickListener(this); |
|
|
selectedLanguageIcon.setOnClickListener(this); |
|
|
selectedLanguageIcon.setOnClickListener(this); |
|
|
countrySelectionSpinner.setOnClickListener(this); |
|
|
countrySelectionSpinner.setOnClickListener(this); |
|
@ -270,7 +261,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
btn_login.setOnClickListener(null); |
|
|
btn_login.setOnClickListener(null); |
|
|
btn_new_user.setOnClickListener(null); |
|
|
btn_new_user.setOnClickListener(null); |
|
|
iv_back.setOnClickListener(null); |
|
|
iv_back.setOnClickListener(null); |
|
|
fab_chat.setOnClickListener(null); |
|
|
|
|
|
selectedLanguageText.setOnClickListener(null); |
|
|
selectedLanguageText.setOnClickListener(null); |
|
|
selectedLanguageIcon.setOnClickListener(null); |
|
|
selectedLanguageIcon.setOnClickListener(null); |
|
|
countrySelectionSpinner.setOnClickListener(null); |
|
|
countrySelectionSpinner.setOnClickListener(null); |
|
@ -347,42 +337,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
selectedLanguageIcon.setImageResource(flagFromCountryCode); |
|
|
selectedLanguageIcon.setImageResource(flagFromCountryCode); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void promptToChat() { |
|
|
|
|
|
|
|
|
|
|
|
if (channelIOEventListener != null && channelIOEventListener.isSessionAlive()) { |
|
|
|
|
|
ChatUtils.ChatInitData initializer = ChatUtils.startChannelIoCredential(true); |
|
|
|
|
|
showProgressBar(true, getString(R.string.loading_text)); |
|
|
|
|
|
ChannelIO.boot(initializer.getChannelPluginSettings(), channelIOEventListener); |
|
|
|
|
|
} else { |
|
|
|
|
|
try { |
|
|
|
|
|
FragmentManager fragmentManager = getSupportFragmentManager(); |
|
|
|
|
|
if (fragmentManager == null) |
|
|
|
|
|
return; |
|
|
|
|
|
CustomAlertDialog customAlertDialog; |
|
|
|
|
|
|
|
|
|
|
|
customAlertDialog = new CustomAlertDialog(); |
|
|
|
|
|
customAlertDialog.setMessage(getString(R.string.check_start_chat_text)); |
|
|
|
|
|
customAlertDialog.setAlertType(CustomAlertDialog.AlertType.ALERT); |
|
|
|
|
|
customAlertDialog.setPositiveBtnString(getString(R.string.yes_text)); |
|
|
|
|
|
customAlertDialog.setNegativeBtnString(getString(R.string.no_text)); |
|
|
|
|
|
customAlertDialog.setActionListener(new CustomAlertDialog.CustomDialogActionListener() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onCutomDialogActionPressed(CustomAlertDialog.AlertType alertType) { |
|
|
|
|
|
|
|
|
|
|
|
ChatUtils.ChatInitData initializer = ChatUtils.startChannelIoCredential(true); |
|
|
|
|
|
showProgressBar(true, getString(R.string.loading_text)); |
|
|
|
|
|
ChannelIO.boot(initializer.getChannelPluginSettings(), channelIOEventListener); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customAlertDialog.show(fragmentManager, "CustomerMes"); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -787,7 +741,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
selectedLanguageText.getLocationOnScreen(languageTextLeftAndTopCoordinates); |
|
|
selectedLanguageText.getLocationOnScreen(languageTextLeftAndTopCoordinates); |
|
|
btn_login.getLocationOnScreen(btnLoginLeftAndTopCoordinates); |
|
|
btn_login.getLocationOnScreen(btnLoginLeftAndTopCoordinates); |
|
|
btn_new_user.getLocationOnScreen(btnRegisterLeftAndTopCoordinates); |
|
|
btn_new_user.getLocationOnScreen(btnRegisterLeftAndTopCoordinates); |
|
|
fab_chat.getLocationOnScreen(btnFABLeftAndTopCoordinates); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rect sendMoneyBoundRect = new Rect(sendMoneyLeftAndTopCoordinates[0], sendMoneyLeftAndTopCoordinates[1], |
|
|
Rect sendMoneyBoundRect = new Rect(sendMoneyLeftAndTopCoordinates[0], sendMoneyLeftAndTopCoordinates[1], |
|
@ -818,9 +771,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
btnRegisterLeftAndTopCoordinates[0] + btn_new_user.getMeasuredWidth(), |
|
|
btnRegisterLeftAndTopCoordinates[0] + btn_new_user.getMeasuredWidth(), |
|
|
btnRegisterLeftAndTopCoordinates[1] + btn_new_user.getMeasuredHeight()); |
|
|
btnRegisterLeftAndTopCoordinates[1] + btn_new_user.getMeasuredHeight()); |
|
|
|
|
|
|
|
|
Rect btn_fabRect = new Rect(btnFABLeftAndTopCoordinates[0], btnFABLeftAndTopCoordinates[1], |
|
|
|
|
|
btnFABLeftAndTopCoordinates[0] + fab_chat.getMeasuredWidth(), |
|
|
|
|
|
btnFABLeftAndTopCoordinates[1] + fab_chat.getMeasuredHeight()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (receiveAmountEdTxt.hasFocus() || sendAmountEdTxt.hasFocus()) |
|
|
return (receiveAmountEdTxt.hasFocus() || sendAmountEdTxt.hasFocus()) |
|
@ -830,8 +781,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
&& !selectedLanguageTextRect.contains(posX, posY) |
|
|
&& !selectedLanguageTextRect.contains(posX, posY) |
|
|
&& !selectedLanguageIconRect.contains(posX, posY) |
|
|
&& !selectedLanguageIconRect.contains(posX, posY) |
|
|
&& !btn_loginRect.contains(posX, posY) |
|
|
&& !btn_loginRect.contains(posX, posY) |
|
|
&& !btn_new_userRect.contains(posX, posY) |
|
|
|
|
|
&& !btn_fabRect.contains(posX, posY); |
|
|
|
|
|
|
|
|
&& !btn_new_userRect.contains(posX, posY); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -839,45 +789,6 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ChannelIOEventListener extends ChatUtils.ChannelIOListenerAdapter { |
|
|
|
|
|
|
|
|
|
|
|
public ChannelIOEventListener(Context context) { |
|
|
|
|
|
super(context); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void onChangeBadge(int count) { |
|
|
|
|
|
String countString; |
|
|
|
|
|
if (count == 0) |
|
|
|
|
|
countString = ""; |
|
|
|
|
|
else if (count > 99) |
|
|
|
|
|
countString = "99+"; |
|
|
|
|
|
else |
|
|
|
|
|
countString = count + ""; |
|
|
|
|
|
|
|
|
|
|
|
if (countString.length() > 0) { |
|
|
|
|
|
notificationCounterTxtView.setText(countString); |
|
|
|
|
|
notificationCounterTxtView.setVisibility(View.VISIBLE); |
|
|
|
|
|
} else { |
|
|
|
|
|
notificationCounterTxtView.setText(countString); |
|
|
|
|
|
notificationCounterTxtView.setVisibility(View.INVISIBLE); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void onCompletion(ChannelPluginCompletionStatus status, @Nullable Guest guest) { |
|
|
|
|
|
super.onCompletion(status, guest); |
|
|
|
|
|
showProgressBar(false, getString(R.string.loading_text)); |
|
|
|
|
|
|
|
|
|
|
|
String errorMessage = ChatUtils.errorMessage(status, SplashScreen.this); |
|
|
|
|
|
if (errorMessage == null) |
|
|
|
|
|
ChannelIO.open(SplashScreen.this); |
|
|
|
|
|
else |
|
|
|
|
|
showPopUpMessage(errorMessage, CustomAlertDialog.AlertType.FAILED, null); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |