-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
417 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="CheckoutFlow" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="android-gradle" name="Android-Gradle"> | ||
<configuration> | ||
<option name="GRADLE_PROJECT_PATH" value=":app" /> | ||
</configuration> | ||
</facet> | ||
<facet type="android" name="Android"> | ||
<configuration> | ||
<option name="SELECTED_BUILD_VARIANT" value="debug" /> | ||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" /> | ||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> | ||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" /> | ||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" /> | ||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" /> | ||
<afterSyncTasks> | ||
<task>generateDebugAndroidTestSources</task> | ||
<task>generateDebugSources</task> | ||
</afterSyncTasks> | ||
<option name="ALLOW_USER_CONFIGURATION" value="false" /> | ||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> | ||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> | ||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" /> | ||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> | ||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" /> | ||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" /> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> | ||
</content> | ||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" exported="" name="library-2.4.0" level="project" /> | ||
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" /> | ||
<orderEntry type="module" module-name="creditcarddesign" exported="" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "22.0.1" | ||
|
||
defaultConfig { | ||
applicationId "com.cooltechworks.checkoutflow" | ||
minSdkVersion 10 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'], dir: 'libs') | ||
compile project(':creditcarddesign') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/sharish/ADT_BASE/adt-bundle-mac-x86_64-20130729/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.cooltechworks.checkoutflow"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name="com.cooltechworks.creditcarddesign.CardEditActivity" | ||
android:configChanges="keyboard|keyboardHidden" | ||
android:label="@string/app_name"> | ||
</activity> | ||
<activity | ||
android:name="com.cooltechworks.creditcarddesign.sample.MainActivity" | ||
android:label="@string/title_activity_main" | ||
android:theme="@style/AppTheme"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Binary file not shown.
104 changes: 104 additions & 0 deletions
104
app/src/main/java/com/cooltechworks/creditcarddesign/sample/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package com.cooltechworks.creditcarddesign.sample; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.widget.LinearLayout; | ||
|
||
import com.cooltechworks.checkoutflow.R; | ||
import com.cooltechworks.creditcarddesign.CardEditActivity; | ||
import com.cooltechworks.creditcarddesign.CreditCardUtils; | ||
import com.cooltechworks.creditcarddesign.CreditCardView; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
|
||
findViewById(R.id.add_card).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(MainActivity.this, CardEditActivity.class); | ||
startActivityForResult(intent, 0); | ||
} | ||
}); | ||
} | ||
|
||
private void initListener(final int index, CreditCardView creditCardView) { | ||
|
||
|
||
creditCardView.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
|
||
CreditCardView creditCardView = (CreditCardView) v; | ||
String cardNumber = creditCardView.getCardNumber(); | ||
String expiry = creditCardView.getExpiry(); | ||
String cardHolderName = creditCardView.getCardHolderName(); | ||
|
||
Intent intent = new Intent(MainActivity.this, CardEditActivity.class); | ||
intent.putExtra(CreditCardUtils.EXTRA_CARD_HOLDER_NAME, cardHolderName); | ||
intent.putExtra(CreditCardUtils.EXTRA_CARD_NUMBER, cardNumber); | ||
intent.putExtra(CreditCardUtils.EXTRA_CARD_EXPIRY, expiry); | ||
intent.putExtra(CreditCardUtils.EXTRA_CARD_SHOW_CARD_SIDE, CreditCardUtils.CARD_SIDE_FRONT); | ||
|
||
startActivityForResult(intent, index); | ||
|
||
} | ||
}); | ||
|
||
} | ||
|
||
|
||
|
||
public void onActivityResult(int reqCode, int resultCode, Intent data) { | ||
|
||
if(resultCode == RESULT_OK) { | ||
|
||
LinearLayout cardContainer = (LinearLayout) findViewById(R.id.card_container); | ||
|
||
|
||
String name = data.getStringExtra(CreditCardUtils.EXTRA_CARD_HOLDER_NAME); | ||
String cardNumber = data.getStringExtra(CreditCardUtils.EXTRA_CARD_NUMBER); | ||
String expiry = data.getStringExtra(CreditCardUtils.EXTRA_CARD_EXPIRY); | ||
String cvv = data.getStringExtra(CreditCardUtils.EXTRA_CARD_CVV); | ||
|
||
|
||
if(reqCode == 0) { | ||
|
||
|
||
CreditCardView creditCardView = new CreditCardView(this); | ||
|
||
creditCardView.setCVV(cvv); | ||
creditCardView.setCardHolderName(name); | ||
creditCardView.setCardExpiry(expiry); | ||
creditCardView.setCardNumber(cardNumber); | ||
|
||
int index = cardContainer.getChildCount(); | ||
cardContainer.addView(creditCardView); | ||
initListener(index, creditCardView); | ||
|
||
|
||
|
||
} | ||
else { | ||
|
||
CreditCardView creditCardView = (CreditCardView) cardContainer.getChildAt(reqCode); | ||
|
||
creditCardView.setCardExpiry(expiry); | ||
creditCardView.setCardNumber(cardNumber); | ||
creditCardView.setCardHolderName(name); | ||
creditCardView.setCVV(cvv); | ||
|
||
} | ||
} | ||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_height="match_parent" | ||
tools:context="com.cooltechworks.creditcarddesign.sample.MainActivity"> | ||
|
||
<LinearLayout | ||
android:id="@+id/card_container" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
> | ||
|
||
<!--<com.cooltechworks.creditcarddesign.CreditCardView--> | ||
<!--android:id="@+id/card_1"--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--app:card_number="56656789000000000"--> | ||
<!--app:card_holder_name="JOHN MATTEW"--> | ||
<!--app:cvv="522"--> | ||
<!--app:card_expiration="01/12"--> | ||
<!--/>--> | ||
|
||
<!--<com.cooltechworks.creditcarddesign.CreditCardView--> | ||
<!--android:id="@+id/card_2"--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--app:card_number="34656789000000000"--> | ||
<!--app:card_holder_name="JOHN MATTEW"--> | ||
<!--app:cvv="522"--> | ||
<!--app:card_expiration="01/12"--> | ||
<!--/>--> | ||
|
||
<!--<com.cooltechworks.creditcarddesign.CreditCardView--> | ||
<!--android:id="@+id/card_3"--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--app:card_number="44656789000000000"--> | ||
<!--app:card_holder_name="JOHN MATTEW"--> | ||
<!--app:cvv="522"--> | ||
<!--app:card_expiration="01/12"--> | ||
<!--/>--> | ||
|
||
|
||
<!--<com.cooltechworks.creditcarddesign.CreditCardView--> | ||
<!--android:id="@+id/card_4"--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--app:card_number="56456789000000000"--> | ||
<!--app:card_holder_name="JOHN MATTEW"--> | ||
<!--app:cvv="522"--> | ||
<!--app:card_expiration="01/12"--> | ||
<!--/>--> | ||
|
||
<!--<com.cooltechworks.creditcarddesign.CreditCardView--> | ||
<!--android:id="@+id/card_5"--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--app:card_number="38056789000000000"--> | ||
<!--app:card_holder_name="JOHN MATTEW"--> | ||
<!--app:cvv="522"--> | ||
<!--app:card_expiration="01/12"--> | ||
<!--/>--> | ||
|
||
<Button | ||
android:id="@+id/add_card" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="ADD CARD" | ||
/> | ||
|
||
</LinearLayout> | ||
|
||
</ScrollView> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<resources>> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<resources> | ||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml | ||
(such as screen margins) for screens with more than 820dp of available width. This | ||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | ||
<dimen name="activity_horizontal_margin">64dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<!--<color name="green_continue">#1fc055</color>--> | ||
<!--<color name="chip_color">#d4edfa</color>--> | ||
<!--<color name="chip_inner_color">#e0e4e4</color>--> | ||
<!--<color name="chip_yellow_color">#fbe191</color>--> | ||
<!--<color name="chip_yellow_inner_color">#eed280</color>--> | ||
<!--<color name="visa_color">#7323DC</color>--> | ||
<!--<color name="visa_color_gradient">#460E8F</color>--> | ||
<!--<color name="amex_color">#108B4C</color>--> | ||
<!--<color name="amex_color_gradient">#108B4C</color>--> | ||
<!--<!–<color name="mastercard_color">#d04c84</color>–>--> | ||
<!--<!–<color name="mastercard_color_gradient">#d04882</color>–>--> | ||
<!--<color name="default_color">#515050</color>--> | ||
<!--<color name="default_color_gradient">#1D1C1C</color>--> | ||
<!--<color name="mastercard_color">@color/blue_color</color>--> | ||
<!--<color name="mastercard_color_gradient">@color/blue_color_gradient</color>--> | ||
|
||
|
||
|
||
</resources> |
Oops, something went wrong.