Search in sources :

Example 1 with CreditCardView

use of movile.com.creditcardguide.view.CreditCardView in project CreditCardView by Movile.

the class CreditCardFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_input_credit_card2, null);
    FontUtils.loadFonts(view);
    if (savedInstanceState != null && savedInstanceState.containsKey(PURCHASE_OPTION_SELECTED)) {
        selectedPurchaseOption = (PurchaseOption) savedInstanceState.getSerializable(PURCHASE_OPTION_SELECTED);
    }
    colorFieldWrong = getActivity().getResources().getColor(R.color.red_wrong);
    colorField = getActivity().getResources().getColor(R.color.edittext_color);
    validator = new CreditCardValidatorProd();
    listFlagCreditCard = (ListView) view.findViewById(R.id.view_list_card_listview);
    creditCardView = (CreditCardView) view.findViewById(R.id.creditcard_view);
    editNumberCard = (EditText) view.findViewById(R.id.ed_number_credit_card);
    editExpireCard = (EditText) view.findViewById(R.id.ed_expire_credit_card);
    editCVVCard = (EditText) view.findViewById(R.id.ed_cvv_credit_card);
    editNameCard = (EditText) view.findViewById(R.id.ed_name_credit_card);
    btEdit = (Button) view.findViewById(R.id.bt_edit);
    layoutPayment = (LinearLayout) view.findViewById(R.id.frg_input_card_layout_payment);
    layoutData = (FrameLayout) view.findViewById(R.id.frg_input_card_layout_data);
    spInstallments = (Spinner) view.findViewById(R.id.frg_payment_sp_portion);
    btNext = (ImageView) view.findViewById(R.id.frg_input_card_bt_next);
    btPay = (Button) view.findViewById(R.id.frg_input_card_bt_pay);
    txtValue = (TextView) view.findViewById(R.id.frg_input_card_txt_value);
    switchSaveCard = (Switch) view.findViewById(R.id.frg_input_card_sw_save_card);
    textLabelNumber = (TextView) view.findViewById(R.id.txt_label_number_card);
    textLabelExpireDate = (TextView) view.findViewById(R.id.txt_label_expire_date);
    textLabelCVV = (TextView) view.findViewById(R.id.txt_label_cvv);
    textLabelOwnerName = (TextView) view.findViewById(R.id.txt_label_owner_name);
    textLabelTotal = (TextView) view.findViewById(R.id.txt_label_total);
    pager = (LockableViewPager) view.findViewById(R.id.pager);
    return view;
}
Also used : ImageView(android.widget.ImageView) CreditCardView(movile.com.creditcardguide.view.CreditCardView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 2 with CreditCardView

use of movile.com.creditcardguide.view.CreditCardView in project CreditCardView by Movile.

the class CrediCardViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_credicard_view);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle("Credit Card View");
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    final CreditCardView creditCardView = (CreditCardView) findViewById(R.id.act_creditcard_view);
    creditCardView.chooseFlag(IssuerCode.VISACREDITO);
    creditCardView.setTextExpDate("12/19");
    creditCardView.setTextNumber("5555 4444 3333 1111");
    creditCardView.setTextOwner("Felipe Silvestre");
    creditCardView.setTextCVV("432");
    ((EditText) findViewById(R.id.ed_owner_name)).addTextChangedListener(new TextWatcher() {

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            creditCardView.setTextOwner(s);
        }

        @Override
        public void afterTextChanged(Editable s) {
        }
    });
    findViewById(R.id.bt_flip).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (creditCardView.isShowingFront()) {
                creditCardView.flipToBack();
            } else {
                creditCardView.flipToFront();
            }
        }
    });
}
Also used : EditText(android.widget.EditText) CreditCardView(movile.com.creditcardguide.view.CreditCardView) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) View(android.view.View) CreditCardView(movile.com.creditcardguide.view.CreditCardView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

View (android.view.View)2 CreditCardView (movile.com.creditcardguide.view.CreditCardView)2 Toolbar (android.support.v7.widget.Toolbar)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 AdapterView (android.widget.AdapterView)1 EditText (android.widget.EditText)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1