Skip to content

Commit

Permalink
Convert to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
a1573595 committed Jan 31, 2022
1 parent 4514525 commit 070590c
Show file tree
Hide file tree
Showing 479 changed files with 3,431 additions and 17,848 deletions.
2 changes: 2 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/build
/build
79 changes: 51 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}

android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
compileSdk 31

defaultConfig {
applicationId 'com.a1573595.parkingdemo'
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0.0"
applicationId "com.a1573595.parkingdemo"
minSdk 21
targetSdk 31
versionCode 4
versionName "1.1.0"
ndkVersion "23.1.7779620"

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-gson.pro', 'proguard-rules.pro', 'proguard-sqlite.pro',
'proguard-okhttp.pro', 'proguard-retrofit2.pro'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

ndk {
debugSymbolLevel 'FULL'
}
}

buildTypes {
debug {
debuggable true
}
release {
debuggable false
minifyEnabled true
Expand All @@ -32,45 +41,59 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
testOptions.unitTests {
includeAndroidResources = true
}
}

dependencies {
def lifecycle_version = "2.4.0"
def retrofit_version = "2.9.0"
def okHttp_version = "4.9.2"
def room_version = "2.4.0"
def room_version = "2.4.1"

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.activity:activity-ktx:1.4.0'

implementation 'com.google.android.gms:play-services-maps:18.0.1'
implementation 'com.google.android.gms:play-services-location:19.0.0'
implementation 'com.google.android.gms:play-services-maps:18.0.2'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.maps.android:android-maps-utils:2.3.0'

// implementation 'io.reactivex.rxjava3:rxjava:3.0.5'
// implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'

implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"
implementation "com.squareup.retrofit2:adapter-rxjava3:$retrofit_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okHttp_version"

implementation 'com.google.code.gson:gson:2.8.9'

implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava2:$room_version"
implementation 'androidx.datastore:datastore-preferences-rxjava3:1.0.0'

implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava3:$room_version"
implementation 'net.zetetic:android-database-sqlcipher:4.5.0'
implementation "androidx.sqlite:sqlite:2.2.0"
implementation "androidx.sqlite:sqlite-ktx:2.2.0"

implementation 'com.jakewharton.timber:timber:5.0.1'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'

testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'androidx.test.ext:junit-ktx:1.1.3'
testImplementation 'androidx.test:core-ktx:1.4.0'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'io.mockk:mockk:1.12.2'

androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
10 changes: 3 additions & 7 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\user\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# You can control the set of applied configuration files using the
# proguardFiles setting 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:
Expand All @@ -22,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
Binary file modified app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.a1573595.parkinglotdemo

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.a1573595.parkinglotdemo", appContext.packageName)
}
}
39 changes: 16 additions & 23 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,52 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.a1573595.parkingdemo">
package="com.a1573595.parkinglotdemo">

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

<application
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:name=".MainApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/Theme.ParkingLotDemo">

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/map_key" />
android:value="ADD_YOUR_API_KEY" />

<activity
android:name=".main.MainActivity"
android:name=".page.main.MainActivity"
android:exported="true"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:theme="@style/NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".update.UpdateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".parkingMap.ParkingMapActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name=".parkingList.ParkingListActivity"
android:name=".page.map.MapActivity"
android:screenOrientation="portrait"
android:theme="@style/NoActionBar" />
<activity
android:name=".parkingInfo.ParkingInfoActivity"
android:name=".page.fuzzySearch.FuzzySearchActivity"
android:screenOrientation="portrait" />
<activity
android:name=".parkingFuzzySearch.ParkingFuzzySearchActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden" />
android:name=".page.history.HistoryActivity"
android:screenOrientation="portrait" />
<activity
android:name=".page.detail.DetailActivity"
android:screenOrientation="portrait" />
</application>

</manifest>
Binary file removed app/src/main/ic_launcher-playstore.png
Binary file not shown.
27 changes: 0 additions & 27 deletions app/src/main/java/com/a1573595/parkingdemo/BaseActivity.java

This file was deleted.

30 changes: 0 additions & 30 deletions app/src/main/java/com/a1573595/parkingdemo/BasePresenter.java

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/main/java/com/a1573595/parkingdemo/BaseView.java

This file was deleted.

Loading

0 comments on commit 070590c

Please sign in to comment.