Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandresoler committed Jun 15, 2022
1 parent d844986 commit 9d4fb99
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 43 deletions.
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
compileSdkVersion 32

defaultConfig {
applicationId "com.lyra.sampleandroidgooglepay"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
targetSdkVersion 32
versionCode 2
versionName "1.1"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -25,14 +25,14 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.0"
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

// Google Pay
implementation 'com.google.android.gms:play-services-wallet:16.0.0'
implementation 'com.google.android.gms:play-services-wallet:19.1.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.lyra.sampleandroidgooglepay.payment

import android.app.Activity
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import com.google.android.gms.wallet.AutoResolveHelper
import com.google.android.gms.wallet.PaymentData

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ object LyraPayment {
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun executeTransaction(googlePayData: String, activity: Activity) {
doAsync {
DoAsync {
try {
// Payload payment part
val lyraPayload = JSONObject()
Expand Down Expand Up @@ -277,7 +277,8 @@ object LyraPayment {
* @property handler Function0<Unit>
* @constructor
*/
class doAsync(val handler: () -> Unit) : AsyncTask<Void, Void, Void>() {
class DoAsync(val handler: () -> Unit) : AsyncTask<Void, Void, Void>() {
@Deprecated("Deprecated in Java")
override fun doInBackground(vararg params: Void?): Void? {
handler()
return null
Expand Down
54 changes: 32 additions & 22 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,60 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
android:id="@+id/relativeLayout"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:indeterminate="true" />
android:indeterminate="true"
android:visibility="gone" />
</RelativeLayout>

<LinearLayout
android:layout_width="match_parent"
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="9dp"
android:layout_marginEnd="9dp"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content">
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/relativeLayout">

<EditText
android:id="@+id/amountText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/amount_hint"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:id="@+id/amountText"/>
android:hint="@string/amount_hint"
android:inputType="numberDecimal" />

<EditText
android:inputType="textEmailAddress"
android:id="@+id/emailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email_hint"
android:id="@+id/emailText"/>
android:inputType="textEmailAddress" />

<EditText
android:inputType="text"
android:id="@+id/orderText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/order_hint"
android:id="@+id/orderText"/>
android:inputType="text" />

<Button
android:id="@+id/payBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/payBtn"
android:text="@string/pay_btn_text"
android:layout_gravity="center"
android:onClick="onPayClick"
android:visibility="gone"
android:layout_gravity="center"/>
android:text="@string/pay_btn_text"
android:visibility="gone" />
</LinearLayout>

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Sep 26 09:10:25 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit 9d4fb99

Please sign in to comment.