public void init(Context context) { final LayoutInflater inflater = LayoutInflater.from(context); View view = inflater.inflate(R.layout.layout_form, this, true); ImageView frontview = (ImageView) view.findViewById(R.id.ImageView_card_front); ImageView backView = (ImageView) view.findViewById(R.id.ImageView_card_back); ImageView brandView = (ImageView) view.findViewById(R.id.ImageView_card_brand); mEntry = (CreditCardEntry) view.findViewById(R.id.View_card_entry); mEntry.setCardFrontImage(frontview); mEntry.setCardBackImage(backView); mEntry.setBrandCardImage(brandView); mKeyPad = (KeyPadView) view.findViewById(R.id.View_key_pad); mDelegate = mEntry.getDelegate(); mKeyPad.setDelegate(mDelegate); mPositiveButton = (TextView) view.findViewById(R.id.TextView_positive_button); mEntry.setCallBack( new Callback() { @Override public void onSuccess() { mPositiveButton.setBackgroundResource(R.drawable.touch_feedback); mPositiveButton.setTextColor(getResources().getColor(R.color.secondary_text)); mPositiveButton.setClickable(true); } @Override public void onError() { mPositiveButton.setBackgroundResource(android.R.color.transparent); mPositiveButton.setTextColor(getResources().getColor(R.color.lightest_gray)); mPositiveButton.setClickable(false); } }); }
public void setCardEntry(Card card) { mEntry.setCardInput(card); }
public void setCardIOListener(CreditCardEntry.CardIOListener cardIOListener) { mEntry.setCardIOListener(cardIOListener); }
public Card getCreditCard() { return mEntry.getCreditCard(); }
public boolean isCreditCardValid() { return mEntry.isCreditCardValid(); }