Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
adonixis committed Feb 1, 2017
0 parents commit 6c015d1
Show file tree
Hide file tree
Showing 31 changed files with 1,329 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*.jks
.gradle
.DS_Store

# generated files
build/
app/build

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
.classpath
.project

# Proguard folder generated by Eclipse
proguard/

# Intellij project files
*.iml
*.ipr
*.iws
.idea/

# Gradle wrapper
/gradle
/gradlew
/gradlew.bat
gradle.properties

app/src/androidTest/
app/src/test/
/app/google-services.json
/captures/
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
45 changes: 45 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

dexOptions {
javaMaxHeapSize "2g"
}

dataBinding {
enabled = true
}

defaultConfig {
applicationId "ru.adonixis.submitcreditcardflow"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}

buildTypes {
release {
minifyEnabled true
shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

debug {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
}

dependencies {
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
}
25 changes: 25 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in H:\Android\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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
27 changes: 27 additions & 0 deletions app/src/main/AndroidManifest.xml
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="ru.adonixis.submitcreditcardflow">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity
android:name=".SubmitCreditCardActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible|adjustResize"
android:theme="@style/AppTheme.NoActionBar"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added app/src/main/assets/fonts/PTM55FT.ttf
Binary file not shown.
60 changes: 60 additions & 0 deletions app/src/main/java/ru/adonixis/submitcreditcardflow/Card.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package ru.adonixis.submitcreditcardflow;

public class Card {

private String cardNumber;
private String expiredDate;
private String cardHolder;
private String cvvCode;

public Card() {
}

public Card(String cardNumber, String expiredDate, String cardHolder, String cvvCode) {
this.cardNumber = cardNumber;
this.expiredDate = expiredDate;
this.cardHolder = cardHolder;
this.cvvCode = cvvCode;
}

public String getCardNumber() {
return cardNumber;
}

public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}

public String getExpiredDate() {
return expiredDate;
}

public void setExpiredDate(String expiredDate) {
this.expiredDate = expiredDate;
}

public String getCardHolder() {
return cardHolder;
}

public void setCardHolder(String cardHolder) {
this.cardHolder = cardHolder;
}

public String getCvvCode() {
return cvvCode;
}

public void setCvvCode(String cvvCode) {
this.cvvCode = cvvCode;
}

@Override
public String toString() {
return "Card info:\r\n" +
"Card number = " + cardNumber + "\r\n" +
"Expired date = " + expiredDate + "\r\n" +
"Card holder = " + cardHolder + "\r\n" +
"CVV code = " + cvvCode;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package ru.adonixis.submitcreditcardflow;

import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;

public class PTMonoTextView extends AppCompatTextView {

public PTMonoTextView(Context context) {
super(context);
applyCustomFont(context);
}

public PTMonoTextView(Context context, AttributeSet attrs) {
super(context, attrs);
applyCustomFont(context);
}

public PTMonoTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
applyCustomFont(context);
}

private void applyCustomFont(Context context) {
Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fonts/PTM55FT.ttf");
setTypeface(typeface);
}
}
Loading

0 comments on commit 6c015d1

Please sign in to comment.