예제 #1
0
  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);
          }
        });
  }
예제 #2
0
 public void setCardEntry(Card card) {
   mEntry.setCardInput(card);
 }
예제 #3
0
 public void setCardIOListener(CreditCardEntry.CardIOListener cardIOListener) {
   mEntry.setCardIOListener(cardIOListener);
 }
예제 #4
0
 public Card getCreditCard() {
   return mEntry.getCreditCard();
 }
예제 #5
0
 public boolean isCreditCardValid() {
   return mEntry.isCreditCardValid();
 }