Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/pimob 2191 upgrade kotlin compose and agp #245

Merged
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
with:
submodules: recursive

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: corretto
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/verify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: corretto
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -50,11 +50,11 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: corretto
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
31 changes: 17 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apply plugin: 'com.android.application'
plugins {
id("com.android.application")
}

android {
compileSdkVersion 33
namespace = "checkout.checkout_android"
compileSdk = 34
defaultConfig {
applicationId "checkout.checkout_android"
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -24,8 +27,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

buildTypes {
Expand All @@ -43,17 +46,17 @@ android {
}

dependencies {
implementation'androidx.activity:activity:1.6.1'
implementation 'androidx.activity:activity:1.8.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestUtil 'androidx.test:orchestrator:1.4.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestUtil 'androidx.test:orchestrator:1.4.2'

ext.okHttpVersion = '4.9.0'
ext.okHttpVersion = '4.11.0'
implementation 'com.squareup.okhttp3:okhttp:' + ext.okHttpVersion
implementation 'com.squareup.okhttp3:logging-interceptor:' + ext.okHttpVersion

Expand Down
92 changes: 24 additions & 68 deletions app/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,110 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.2.1" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.1)" variant="all" version="7.2.1">
<issues format="6" by="lint 7.2.1" type="baseline" client="gradle" dependencies="false"
name="AGP (7.2.1)" variant="all" version="7.2.1">

<issue
id="OldTargetApi"
<issue id="OldTargetApi"
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
errorLine1=" targetSdkVersion 31"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="8"
column="9"/>
errorLine1=" targetSdkVersion 31" errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location file="build.gradle" line="8" column="9" />
</issue>

<issue
id="GradleDependency"
<issue id="GradleDependency"
message="A newer version of androidx.appcompat:appcompat than 1.2.0 is available: 1.4.2"
errorLine1=" implementation &apos;androidx.appcompat:appcompat:1.2.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="48"
column="20"/>
<location file="build.gradle" line="48" column="20" />
</issue>

<issue
id="DataExtractionRules"
<issue id="DataExtractionRules"
message="The attribute `android:fullBackupContent` is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute `android:dataExtractionRules` specifying an `@xml` resource which configures cloud backups and device transfers on Android 12 and higher."
errorLine1=" android:fullBackupContent=&quot;true&quot;"
errorLine2=" ~~~~">
<location
file="src/main/AndroidManifest.xml"
line="12"
column="36"/>
<location file="src/main/AndroidManifest.xml" line="12" column="36" />
</issue>

<issue
id="UnusedResources"
message="The resource `R.color.colorAccent` appears to be unused"
<issue id="UnusedResources" message="The resource `R.color.colorAccent` appears to be unused"
errorLine1=" &lt;color name=&quot;colorAccent&quot;>#FF4081&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/colors.xml"
line="5"
column="12"/>
<location file="src/main/res/values/colors.xml" line="5" column="12" />
</issue>

<issue
id="UnusedResources"
message="The resource `R.color.jcolorPrimary` appears to be unused"
<issue id="UnusedResources" message="The resource `R.color.jcolorPrimary` appears to be unused"
errorLine1=" &lt;color name=&quot;jcolorPrimary&quot;>#711711&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/colors.xml"
line="7"
column="12"/>
<location file="src/main/res/values/colors.xml" line="7" column="12" />
</issue>

<issue
id="UnusedResources"
<issue id="UnusedResources"
message="The resource `R.color.jcolorPrimaryDark` appears to be unused"
errorLine1=" &lt;color name=&quot;jcolorPrimaryDark&quot;>#303F9F&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/colors.xml"
line="8"
column="12"/>
<location file="src/main/res/values/colors.xml" line="8" column="12" />
</issue>

<issue
id="UnusedResources"
message="The resource `R.color.jcolorAccent` appears to be unused"
<issue id="UnusedResources" message="The resource `R.color.jcolorAccent` appears to be unused"
errorLine1=" &lt;color name=&quot;jcolorAccent&quot;>#bec52d&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/colors.xml"
line="9"
column="12"/>
<location file="src/main/res/values/colors.xml" line="9" column="12" />
</issue>

<issue
id="UnusedResources"
message="The resource `R.color.jcolorAccent2` appears to be unused"
<issue id="UnusedResources" message="The resource `R.color.jcolorAccent2` appears to be unused"
errorLine1=" &lt;color name=&quot;jcolorAccent2&quot;>#bec52d&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/colors.xml"
line="10"
column="12"/>
<location file="src/main/res/values/colors.xml" line="10" column="12" />
</issue>

<issue
id="IconLocation"
<issue id="IconLocation"
message="Found bitmap drawable `res/drawable/bike.png` in densityless folder">
<location
file="src/main/res/drawable/bike.png"/>
<location file="src/main/res/drawable/bike.png" />
</issue>

<issue
id="ContentDescription"
message="Missing `contentDescription` attribute on image"
errorLine1=" &lt;ImageView"
errorLine2=" ~~~~~~~~~">
<location
file="src/main/res/layout/activity_checkout.xml"
line="29"
column="14"/>
<issue id="ContentDescription" message="Missing `contentDescription` attribute on image"
errorLine1=" &lt;ImageView" errorLine2=" ~~~~~~~~~">
<location file="src/main/res/layout/activity_checkout.xml" line="29" column="14" />
</issue>

</issues>
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="checkout.checkout_android">
xmlns:tools="http://schemas.android.com/tools">

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

Expand All @@ -11,7 +11,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:fullBackupContent="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="MonochromeLauncherIcon">

<activity
android:name=".CheckoutActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import androidx.activity.ComponentActivity;
import androidx.annotation.NonNull;

import com.checkout.frames.api.PaymentFormMediator;
import com.checkout.frames.api.PaymentFlowHandler;
import com.checkout.frames.api.PaymentFormMediator;
import com.checkout.frames.screen.paymentform.model.PaymentFormConfig;
import com.checkout.frames.style.screen.PaymentFormStyle;
import com.checkout.threedsecure.model.ThreeDSRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@
import okhttp3.logging.HttpLoggingInterceptor;

public class PaymentUtil {
private PaymentUtil() { }

private static final boolean LOGGING_ENABLED = true;

public interface Callback {
void onPaymentCreated(boolean success, @Nullable String redirectUrl);
}

public static OkHttpClient newClient() {
OkHttpClient.Builder okHttpBuilder =new OkHttpClient.Builder();
OkHttpClient.Builder okHttpBuilder = new OkHttpClient.Builder();

if (LOGGING_ENABLED) {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(message -> Log.d("okhttp", message));
Expand Down Expand Up @@ -96,8 +94,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) {
}
} catch (Exception e) {
e.printStackTrace();
}
finally {
} finally {
postResponse(result, redirectUrl);
}
}
Expand Down
34 changes: 34 additions & 0 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
4 changes: 3 additions & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MonochromeLauncherIcon">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
5 changes: 3 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">


<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Expand All @@ -10,7 +11,7 @@
</style>

<!-- Customise the theme.-->
<style name="CustomPaymentFormTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="CustomPaymentFormTheme" parent="Theme.AppCompat.Light.DarkActionBar" tools:supress="UnusedResources">

<!-- TOOLBAR COLOR. -->
<item name="colorPrimary">#000000</item>
Expand Down
6 changes: 6 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ workflows:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- cache-pull@2: {}
- set-java-version@1:
inputs:
- set_java_version: '17'
- install-missing-android-tools@3:
inputs:
- ndk_version: 21.0.6113669
- install-missing-android-tools@3:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ repositories {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
implementation("com.android.tools.build:gradle:7.2.1")
implementation("com.android.tools.build:gradle:8.1.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.property("kotlinVersion")}")
implementation("de.mannodermaus.gradle.plugins:android-junit5:${project.property("mannodermausAndroidJunit5Version")}")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${project.property("dokkaVersion")}")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
6 changes: 3 additions & 3 deletions buildSrc/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlinVersion=1.7.0
gradleVersion=7.2.0
kotlinVersion=1.9.10
gradleVersion=8.1.2
mannodermausAndroidJunit5Version=1.8.0.0
dokkaVersion=1.6.21
dokkaVersion=1.9.0
codeQualityToolsPlugin=0.21.0
Loading