Skip to content

Commit

Permalink
Merge pull request #1411 from openMF/feature/upgradeToAndroidX
Browse files Browse the repository at this point in the history
fix: upgrade to AndroidX
  • Loading branch information
therajanmaurya authored Oct 27, 2023
2 parents 22d3ae8 + 56e169f commit 98a78c6
Show file tree
Hide file tree
Showing 131 changed files with 1,312 additions and 1,235 deletions.
26 changes: 14 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32"
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "https://www.jitpack.io" }
maven { url "https://plugins.gradle.org/m2/" }
}
}

Expand All @@ -30,18 +32,18 @@ task clean(type: Delete) {

ext {
// Sdk and tools
minSdkVersion = 16
targetSdkVersion = 31
compileSdkVersion = 31
minSdkVersion = 21
targetSdkVersion = 34
compileSdkVersion = 34
buildToolsVersion = '30.0.3'
kotlinVersion = "1.4.32"
kotlinVersion = "1.9.10" // 1.9.10

// App dependencies
supportLibraryVersion = '28.0.0'
daggerVersion = '2.18'
daggerVersion = '2.48.1'
retrofitVersion = '2.2.0'
okHttp3Version = '3.6.0'
butterKnifeVersion = '8.8.1'
butterKnifeVersion = '10.2.3'
dbflowVersion = '3.1.1'
espressoVersion = '2.2.2'
rxandroidVersion = '1.1.0'
Expand Down
6 changes: 3 additions & 3 deletions config/quality/quality.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ task checkstyle(type: Checkstyle, group: 'Verification', description: 'Runs code
include '**/*.java'

reports {
xml.enabled = true
//xml.enabled = true
xml {
destination file("$reportsDir/checkstyle/checkstyle.xml")
}
Expand All @@ -47,8 +47,8 @@ task pmd(type: Pmd, group: 'Verification', description: 'Inspect sourcecode for
exclude '**/gen/**'

reports {
xml.enabled = true
html.enabled = true
//xml.enabled = true
//html.enabled = true
xml {
destination file("$reportsDir/pmd/pmd.xml")
}
Expand Down
36 changes: 21 additions & 15 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.github.dcendents.android-maven'
apply from: '../config/quality/quality.gradle'
apply plugin: 'kotlin-parcelize'

group='com.github.ankurs287'

android {
compileSdkVersion rootProject.ext.compileSdkVersion

compileSdk rootProject.ext.compileSdkVersion
namespace 'org.mifos.mobilewallet.core'
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}
buildTypes {
Expand All @@ -33,20 +30,22 @@ android {
abortOnError false
disable 'InvalidPackage'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildFeatures{
dataBinding true
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation("com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation 'androidx.appcompat:appcompat:1.6.1'

implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"

implementation ("com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion") {
// exclude Retrofit’s OkHttp peer-dependency module and define your own module import
Expand All @@ -63,4 +62,11 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${rootProject.kotlinVersion}"

testImplementation "junit:junit:$rootProject.junitVersion"
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}

kapt {
correctErrorTypes true
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static org.junit.Assert.assertEquals;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="org.mifos.mobilewallet.core"/>
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ public class BaseURL {

public static final String PROTOCOL_HTTPS = "https://";

public static final String API_ENDPOINT = "demo.mifos.io";
public static final String API_ENDPOINT = "venus.mifos.community";
public static final String API_PATH = "/fineract-provider/api/v1/";

//self service url
public static final String API_ENDPOINT_SELF = "demo.mifos.io";
public static final String API_ENDPOINT_SELF = "venus.mifos.community";
public static final String API_PATH_SELF = "/fineract-provider/api/v1/self/";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.mifos.mobilewallet.core.data.fineract.entity.authentication

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
class AuthenticationPayload(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.mifos.mobilewallet.core.data.fineract.entity.payload

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class StandingInstructionPayload(var fromOfficeId : Int, var fromClientId : Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.mifos.mobilewallet.core.data.fineract.entity.standinginstruction

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.SavingAccount
import org.mifos.mobilewallet.core.data.fineract.entity.client.Client
import org.mifos.mobilewallet.core.data.fineract.entity.client.Status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Constants {
public static final String SAVINGS = "savingsAccounts";
public static final String TRANSACTIONS = "transactions";

public static final int WALLET_ACCOUNT_SAVINGS_PRODUCT_ID = 35;
public static final int WALLET_ACCOUNT_SAVINGS_PRODUCT_ID = 1;

public static final int MIFOS_MERCHANT_SAVINGS_PRODUCT_ID = 165; // 372
public static final int MIFOS_CONSUMER_SAVINGS_PRODUCT_ID = 165; // 373
Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ RblClientIdProp=a
RblClientSecretProp=b
org.gradle.daemon=true
org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 11 18:59:41 IST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
50 changes: 28 additions & 22 deletions mifospay/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apply plugin: 'com.android.application'
apply from: '../config/quality/quality.gradle'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'

android {
compileSdkVersion rootProject.ext.compileSdkVersion

compileSdk rootProject.ext.compileSdkVersion
namespace 'org.mifos.mobilewallet.mifospay'
defaultConfig {
applicationId "org.mifos.mobilewallet.mifospay"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -24,7 +24,7 @@ android {
}
}
buildFeatures{
viewBinding true
dataBinding true
}

aaptOptions {
Expand All @@ -36,34 +36,38 @@ android {
disable 'InvalidPackage'
}

compileOptions.incremental = false
compileOptions {
incremental = false
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation("com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion", {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})

implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion"
implementation "com.android.support:animated-vector-drawable:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-media-compat:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
api "com.android.support:design:$rootProject.supportLibraryVersion"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "androidx.core:core-ktx:1.12.0"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
api 'com.google.android.material:material:1.0.0' // update require alot of UI changes

implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion"
kapt "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion"

// Splash API
implementation 'androidx.core:core-splashscreen:1.0.1'

implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"

implementation("com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion") {
// exclude Retrofit’s OkHttp peer-dependency module and define your own module import
Expand Down Expand Up @@ -98,4 +102,6 @@ dependencies {
implementation project(':core')
}

apply plugin: 'com.google.gms.google-services'
kapt {
correctErrorTypes true
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static org.junit.Assert.assertEquals;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
5 changes: 2 additions & 3 deletions mifospay/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mifos.mobilewallet.mifospay">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
Expand Down Expand Up @@ -49,7 +48,7 @@
android:theme="@style/AppTheme" />

<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="org.mifos.mobilewallet.mifospay.provider"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.app.Application;
import android.content.Context;
import android.support.v7.app.AppCompatDelegate;
import androidx.appcompat.app.AppCompatDelegate;

import com.mifos.mobile.passcode.utils.ForegroundChecker;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import org.mifos.mobilewallet.mifospay.auth.ui.LoginActivity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.mifos.mobilewallet.mifospay.auth.ui

import android.content.Intent
import android.os.Bundle
import android.support.design.widget.TextInputEditText
import com.google.android.material.textfield.TextInputEditText
import android.text.Editable
import android.text.TextWatcher
import android.widget.Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.mifos.mobilewallet.mifospay.bank.adapters;

import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Loading

0 comments on commit 98a78c6

Please sign in to comment.