Android Open Source - SwipeCardEntry Main Activity






From Project

Back to project page SwipeCardEntry.

License

The source code is released under:

SwipeCardEntry Copyright 2014 ReThought Ltd and contributors This software is licensed under the following terms: Redistribution and use in source and binary forms, with or without modification, ar...

If you think the Android project SwipeCardEntry listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.rethoughtsolutions.swipecardentry.sample;
//from w ww.  j  a v a2 s .co m
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.rethoughtsolutions.swipecardentry.SwipeCardEntry;

public class MainActivity extends Activity {

    private SwipeCardEntry mSwipeCardEntry;

    private Button mPayButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mSwipeCardEntry = (SwipeCardEntry) findViewById(R.id.swipecardentry);
        mPayButton = (Button) findViewById(R.id.paybutton);


        mSwipeCardEntry.setListener(new SwipeCardEntry.Listener() {
            @Override
            public void onCardEntryCompleted(boolean completed) {
                mPayButton.setEnabled(completed);
            }
        });

        mPayButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this,"Pay button clicked!",Toast.LENGTH_SHORT).show();
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        mPayButton.setEnabled(mSwipeCardEntry.isCompleted());
    }
}




Java Source Code List

com.rethoughtsolutions.swipecardentry.SwipeCardEntry.java
com.rethoughtsolutions.swipecardentry.sample.MainActivity.java