Browse Source

Regular top up carrier selection removed

master
Preyea Regmi 4 years ago
parent
commit
f71b6b822e
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 25
      app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java
  3. 69
      app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/services/regular/RegularLocalTopupFragment.java
  4. 58
      app/src/main/res/layout/fragment_regular_local_topup.xml

BIN
.idea/caches/build_file_checksums.ser

25
app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/presenter/topup/LocalTopUpPresenter.java

@ -9,7 +9,7 @@ import com.gmeremit.online.gmeremittance_native.accountmanage.presenter.payments
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.domesticremit.send.model.KFTCBalanceCheckDTO;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericThrowable;
import com.gmeremit.online.gmeremittance_native.security.utils.SecurityUtils;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.ButtonsGrid;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.CardInfoDTO;
import com.gmeremit.online.gmeremittance_native.topup.local.model.topup.LocalTopUpDetailDTO;
@ -24,9 +24,9 @@ import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.Utils;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponseV2;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericResponseDataModel;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericThrowable;
import com.gmeremit.online.gmeremittance_native.utils.https.HTTPConstants;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;
import com.gmeremit.online.gmeremittance_native.security.utils.SecurityUtils;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
@ -356,8 +356,10 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
LocalTopUpTxnRequestBodyDTO localTopUpTxnRequestBodyDTO = new LocalTopUpTxnRequestBodyDTO();
localTopUpTxnRequestBodyDTO.setBuyType(REGULAR_CARD_TYPE);
localTopUpTxnRequestBodyDTO.setCustomerId(this.gateway.getUserIDNumber());
localTopUpTxnRequestBodyDTO.setChargeType(regularTopUpValidator.selectedCarrierType.getCardCode());
localTopUpTxnRequestBodyDTO.setCardName(regularTopUpValidator.selectedCarrierType.getCardName());
// localTopUpTxnRequestBodyDTO.setChargeType(regularTopUpValidator.selectedCarrierType.getCardCode());
// localTopUpTxnRequestBodyDTO.setCardName(regularTopUpValidator.selectedCarrierType.getCardName());
localTopUpTxnRequestBodyDTO.setChargeType("");
localTopUpTxnRequestBodyDTO.setCardName("");
localTopUpTxnRequestBodyDTO.setPhoneNo(userMsisdn);
localTopUpTxnRequestBodyDTO.setPrice(regularTopUpValidator.selectedDeno.getPrice());
localTopUpTxnRequestBodyDTO.setUseWalletMoney(regularTopUpValidator.selectedDeno.getPrice());
@ -481,7 +483,7 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
@Override
public void onRegularTopUpCarrierTypeSelected(CardInfoDTO carrierType) {
regularTopUpValidator.isSelectedCarrierTypeValid(carrierType);
}
@ -509,11 +511,10 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
public class RegularTopUpValidator {
private ButtonsGrid selectedDeno;
private CardInfoDTO selectedCarrierType;
void isDenoValid(ButtonsGrid selectedDeno) {
this.selectedDeno = selectedDeno;
if (selectedDeno != null && selectedDeno.getPrice() != null && this.selectedCarrierType != null) {
if (selectedDeno != null && selectedDeno.getPrice() != null) {
//Since we are showing account balance only when user explicitly request. So by-pass amount comparision
//if user hasn't viewed corresponding account balance otherwise perform comparision.
compareReuglarTopPrices();
@ -544,18 +545,10 @@ public class LocalTopUpPresenter extends BasePresenter implements LocalTopUpPres
public void validateAll() {
isDenoValid(selectedDeno);
isSelectedCarrierTypeValid(selectedCarrierType);
// isSelectedCarrierTypeValid(selectedCarrierType);
}
public void isSelectedCarrierTypeValid(CardInfoDTO carrierType) {
this.selectedCarrierType = carrierType;
if (selectedCarrierType != null && this.selectedDeno != null) {
compareReuglarTopPrices();
} else
view.enableRegularTopUpButton(false, getStringfromStringId(R.string.continue_text));
}
}
public class FixedTopUpValidator {

69
app/src/main/java/com/gmeremit/online/gmeremittance_native/topup/local/view/topup/services/regular/RegularLocalTopupFragment.java

@ -32,12 +32,6 @@ import static android.view.View.GONE;
public class RegularLocalTopupFragment extends BaseFragment implements DenoListRvAdapter.DenoSelectionListener {
@BindView(R.id.carrierTypeInputField)
GMEFormInputField carrierTypeInputField;
@BindView(R.id.imageView8)
ImageView carrierTypeInputFieldCaratIcon;
@BindView(R.id.topupDenoListRv)
RecyclerView topupDenoListRv;
@ -51,7 +45,6 @@ public class RegularLocalTopupFragment extends BaseFragment implements DenoListR
ViewGroup buttonContainer;
private GenericTextListingDialog<CardInfoDTO> carrierTypeListingDialog;
private CarrierTypeClickListener carrierTypeClickListener;
private LocalTopUpResponseDTO regularTopUpData;
@Override
@ -68,7 +61,6 @@ public class RegularLocalTopupFragment extends BaseFragment implements DenoListR
}
private void init() {
carrierTypeClickListener = new CarrierTypeClickListener();
setupRecyclerView();
}
@ -99,18 +91,7 @@ public class RegularLocalTopupFragment extends BaseFragment implements DenoListR
}
@Override
public void onStart() {
super.onStart();
carrierTypeInputField.getEditTextView().setOnClickListener(carrierTypeClickListener);
}
@Override
public void onStop() {
super.onStop();
carrierTypeInputField.getEditTextView().setOnClickListener(null);
}
@Override
public void onDenoSelected(ButtonsGrid selectedDeno) {
@ -123,31 +104,31 @@ public class RegularLocalTopupFragment extends BaseFragment implements DenoListR
continueBtn.setText(buttonHintText);
}
private void promptCarrierTypeSelection() {
carrierTypeListingDialog = new GenericTextListingDialog<>();
carrierTypeListingDialog.setData(regularTopUpData.getCardInfo());
carrierTypeListingDialog.setListener(carrierType ->
{
((LocalTopUpActivityActionListener) getActivity()).getPresenter().onRegularTopUpCarrierTypeSelected(carrierType);
carrierTypeInputField.getEditTextView().setText(carrierType.getCardName());
carrierTypeListingDialog.dismiss();
});
carrierTypeListingDialog.setHintAndTitle(getString(R.string.search_text), getString(R.string.selected_carrier_type_text), getString(R.string.no_result_found_text));
carrierTypeListingDialog.disableSearch(false);
if (!carrierTypeListingDialog.isAdded())
carrierTypeListingDialog.show(getActivity().getSupportFragmentManager(), "AccountSelector");
}
public class CarrierTypeClickListener implements View.OnClickListener {
@Override
public void onClick(View v) {
promptCarrierTypeSelection();
}
}
//
// private void promptCarrierTypeSelection() {
//
// carrierTypeListingDialog = new GenericTextListingDialog<>();
// carrierTypeListingDialog.setData(regularTopUpData.getCardInfo());
// carrierTypeListingDialog.setListener(carrierType ->
// {
// ((LocalTopUpActivityActionListener) getActivity()).getPresenter().onRegularTopUpCarrierTypeSelected(carrierType);
// carrierTypeInputField.getEditTextView().setText(carrierType.getCardName());
// carrierTypeListingDialog.dismiss();
// });
// carrierTypeListingDialog.setHintAndTitle(getString(R.string.search_text), getString(R.string.selected_carrier_type_text), getString(R.string.no_result_found_text));
// carrierTypeListingDialog.disableSearch(false);
// if (!carrierTypeListingDialog.isAdded())
// carrierTypeListingDialog.show(getActivity().getSupportFragmentManager(), "AccountSelector");
// }
// public class CarrierTypeClickListener implements View.OnClickListener {
//
// @Override
// public void onClick(View v) {
// promptCarrierTypeSelection();
// }
// }
}

58
app/src/main/res/layout/fragment_regular_local_topup.xml

@ -12,35 +12,35 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.gmeremit.online.gmeremittance_native.customwidgets.GMEFormInputField
android:layout_marginTop="@dimen/_15sdp"
android:id="@+id/carrierTypeInputField"
style="@style/gme_form_text_input_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/selected_carrier_type_text"
android:visibility="visible"
app:edFormCursorVisible="false"
app:edFormFocusable="false"
android:layout_marginStart="@dimen/_8sdp"
app:layout_constraintEnd_toStartOf="@+id/imageView8"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- <com.gmeremit.online.gmeremittance_native.customwidgets.GMEFormInputField-->
<!-- android:layout_marginTop="@dimen/_15sdp"-->
<!-- android:id="@+id/carrierTypeInputField"-->
<!-- style="@style/gme_form_text_input_layout"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:hint="@string/selected_carrier_type_text"-->
<!-- android:visibility="visible"-->
<!-- app:edFormCursorVisible="false"-->
<!-- app:edFormFocusable="false"-->
<!-- android:layout_marginStart="@dimen/_8sdp"-->
<!-- app:layout_constraintEnd_toStartOf="@+id/imageView8"-->
<!-- app:layout_constraintHorizontal_bias="0.5"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<ImageView
android:id="@+id/imageView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginEnd="@dimen/_8sdp"
android:background="@drawable/ic_arrow_down"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/carrierTypeInputField"
app:layout_constraintTop_toTopOf="@+id/carrierTypeInputField"
app:layout_constraintBottom_toBottomOf="@+id/carrierTypeInputField"/>
<!-- <ImageView-->
<!-- android:id="@+id/imageView8"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="13dp"-->
<!-- android:layout_marginStart="@dimen/_8sdp"-->
<!-- android:layout_marginEnd="@dimen/_8sdp"-->
<!-- android:background="@drawable/ic_arrow_down"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHorizontal_bias="0.5"-->
<!-- app:layout_constraintStart_toEndOf="@+id/carrierTypeInputField"-->
<!-- app:layout_constraintTop_toTopOf="@+id/carrierTypeInputField"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/carrierTypeInputField"/>-->
<androidx.recyclerview.widget.RecyclerView
android:layout_marginTop="@dimen/_15sdp"
@ -52,7 +52,7 @@
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/carrierTypeInputField"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<View

Loading…
Cancel
Save