Skip to content

Commit

Permalink
Update MerchantConnector example app
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Willson committed Nov 29, 2018
1 parent bfd5c9e commit 73087e5
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 152 deletions.
14 changes: 0 additions & 14 deletions merchantexample/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion merchantexample/MerchantExample/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions merchantexample/MerchantExample/build.gradle

This file was deleted.

17 changes: 0 additions & 17 deletions merchantexample/MerchantExample/proguard-rules.txt

This file was deleted.

This file was deleted.

33 changes: 27 additions & 6 deletions merchantexample/build.gradle
@@ -1,16 +1,37 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

repositories {
jcenter()
google()
}
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

allprojects {
repositories {
mavenCentral()
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '22.0.1'

defaultConfig {
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
}
}
}

dependencies {
compile 'com.clover.sdk:clover-android-sdk:210.1'
}
18 changes: 0 additions & 18 deletions merchantexample/gradle.properties

This file was deleted.

1 change: 0 additions & 1 deletion merchantexample/settings.gradle

This file was deleted.

Expand Up @@ -3,7 +3,7 @@
package="com.clover.example.merchantexample"
xmlns:tools="http://schemas.android.com/tools">

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="27"/>

<uses-permission android:name="android.permission.GET_ACCOUNTS"/>

Expand Down
Expand Up @@ -21,6 +21,7 @@ public class MainActivity extends Activity {
private MerchantConnector merchantConnector;

private TextView merchantName;
private TextView merchantId;
private TextView address1;
private TextView address2;
private TextView address3;
Expand All @@ -40,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {

// Find all the TextView objects
merchantName = (TextView) findViewById(R.id.merchant_name);
merchantId = (TextView) findViewById(R.id.merchant_id);
address1 = (TextView) findViewById(R.id.merchant_address1);
address2 = (TextView) findViewById(R.id.merchant_address2);
address3 = (TextView) findViewById(R.id.merchant_address3);
Expand Down Expand Up @@ -133,6 +135,7 @@ protected void onPostExecute(Merchant merchant) {
// Populate the merchant information
if (merchant != null) {
merchantName.setText(merchant.getName());
merchantId.setText(merchant.getId());
address1.setText(merchant.getAddress().getAddress1());
address2.setText(merchant.getAddress().getAddress2());
address3.setText(merchant.getAddress().getAddress3());
Expand Down
75 changes: 75 additions & 0 deletions merchantexample/src/main/res/layout/activity_main.xml
@@ -0,0 +1,75 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical"
android:background="@android:color/white"
tools:context="com.clover.example.merchantexample.MainActivity">

<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center"/>

<TextView
android:id="@+id/merchant_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_address2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_address3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_zip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>

<TextView
android:id="@+id/merchant_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium.Inverse"/>
</LinearLayout>
Expand Up @@ -2,7 +2,6 @@
<resources>

<string name="app_name">MerchantExample</string>

<string name="no_account">There is no Clover account.</string>

</resources>

0 comments on commit 73087e5

Please sign in to comment.