diff --git a/.gitignore b/.gitignore
index 2cb544944..bd90f6a3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ release.keystore
com_crashlytics_export_strings.xml
crashlytics-build.properties
crashlytics.properties
+.kotlin/
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
index 96a0adfcf..34839bbd6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
[submodule "third_party/nfc-felica-lib"]
path = third_party/nfc-felica-lib
- url = https://github.com/codebutler/nfc-felica-lib.git
+ url = https://github.com/jspaetzel/nfc-felica-lib.git
diff --git a/README.md b/README.md
index f7ce8c658..b8f2fdbb4 100644
--- a/README.md
+++ b/README.md
@@ -93,7 +93,6 @@ FareBot uses the following open-source libraries:
* [Guava](https://github.com/google/guava)
* [Kotlin](https://kotlinlang.org/)
* [Magellan](https://github.com/wealthfront/magellan/)
-* [RxBroadcast](https://github.com/cantrowitz/RxBroadcast)
* [RxJava](https://github.com/ReactiveX/RxJava)
* [RxRelay](https://github.com/JakeWharton/RxRelay)
diff --git a/build.gradle b/build.gradle
index cdd056e0f..41c7e5867 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,29 +1,33 @@
buildscript {
+ ext {
+ kotlin_version = '1.9.25'
+ }
repositories {
mavenLocal()
- jcenter()
+ mavenCentral()
+ maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
- maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.0-alpha13'
- classpath 'io.fabric.tools:gradle:1.28.1'
- classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
+ classpath 'com.android.tools.build:gradle:8.5.2'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath 'app.cash.sqldelight:gradle-plugin:2.0.2'
}
}
plugins {
- id 'com.github.ben-manes.versions' version '0.21.0'
+ id 'com.github.ben-manes.versions' version '0.51.0'
+ id "org.jetbrains.kotlin.kapt" version "1.9.25"
}
allprojects {
repositories {
mavenLocal()
- jcenter()
- maven { url "https://maven.google.com" }
- maven { url 'https://maven.fabric.io/public' }
+ mavenCentral()
+ maven { url "https://jitpack.io" }
+ maven { url 'https://maven.google.com' }
+ google()
}
}
@@ -39,7 +43,7 @@ subprojects {
afterEvaluate {project ->
if (project.name.contains('farebot')) {
check.dependsOn 'checkstyle'
- task checkstyle(type: Checkstyle) {
+ tasks.register('checkstyle', Checkstyle) {
configFile file('config/checkstyle/checkstyle.xml')
source 'src'
include '**/*.java'
@@ -62,18 +66,14 @@ subprojects {
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_7
- targetCompatibility JavaVersion.VERSION_1_7
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
lintOptions {
abortOnError true
disable 'InvalidPackage','MissingTranslation'
}
-
- dexOptions {
- dexInProcess = true
- }
}
}
}
@@ -100,7 +100,7 @@ dependencies {
ktlint 'com.github.shyiko:ktlint:0.31.0'
}
-task lintKotlin(type: JavaExec) {
+tasks.register('lintKotlin', JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "*/src/**/*.kt"
diff --git a/dependencies.gradle b/dependencies.gradle
index 387e6d1c7..4bc6ce4b5 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -1,18 +1,17 @@
ext {
vers = [
- compileSdkVersion: 28,
- targetSdkVersion: 28,
+ compileSdkVersion: 34,
+ targetSdkVersion: 34,
minSdkVersion: 21
]
def autoDisposeVersion = '0.8.0'
- def autoValueGsonVersion = '0.8.0'
- def autoValueVersion = '1.6.5'
- def daggerVersion = '2.22.1'
- def groupieVersion = '2.3.0'
- def kotlinVersion = '1.3.31'
+ def autoValueVersion = '1.11.0'
+ def daggerVersion = '2.52'
+ def groupieVersion = '2.8.1'
+ def kotlinVersion = '1.9.25'
def magellanVersion = '1.1.0'
- def roomVersion = '2.1.0-alpha07'
+ def roomVersion = '2.6.1'
libs = [
autoDispose: "com.uber.autodispose:autodispose:${autoDisposeVersion}",
@@ -21,14 +20,13 @@ ext {
autoDisposeKotlin: "com.uber.autodispose:autodispose-kotlin:${autoDisposeVersion}",
autoValue: "com.google.auto.value:auto-value:${autoValueVersion}",
autoValueAnnotations: "com.google.auto.value:auto-value-annotations:${autoValueVersion}",
- autoValueGson: "com.ryanharter.auto.value:auto-value-gson:${autoValueGsonVersion}",
- autoValueGsonAnnotations: "com.ryanharter.auto.value:auto-value-gson-annotations:${autoValueGsonVersion}",
+ autoValueGson: "com.ryanharter.auto.value:auto-value-gson:1.3.1",
+ autoValueGsonAnnotations: "com.ryanharter.auto.value:auto-value-gson-annotations:0.8.0",
checkstyle: 'com.puppycrawl.tools:checkstyle:8.20',
- crashlytics: 'com.crashlytics.sdk.android:crashlytics:2.10.0',
dagger: "com.google.dagger:dagger:${daggerVersion}",
daggerCompiler: "com.google.dagger:dagger-compiler:${daggerVersion}",
- groupie: "com.xwray:groupie:${groupieVersion}",
- groupieDatabinding: "com.xwray:groupie-databinding:${groupieVersion}",
+ groupie: "com.github.lisawray.groupie:groupie:${groupieVersion}",
+ groupieDatabinding: "com.github.lisawray.groupie:groupie-databinding:${groupieVersion}",
gson: 'com.google.code.gson:gson:2.8.5',
guava: 'com.google.guava:guava:27.1-android',
kotlinStdlib: "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlinVersion}",
@@ -36,12 +34,11 @@ ext {
playServicesMaps: 'com.google.android.gms:play-services-maps:16.1.0',
roomRuntime: "androidx.room:room-runtime:${roomVersion}",
roomCompiler: "androidx.room:room-compiler:${roomVersion}",
- rxBroadcast: 'com.cantrowitz:rxbroadcast:2.0.0',
- rxJava2: 'io.reactivex.rxjava2:rxjava:2.2.8',
- rxRelay2: 'com.jakewharton.rxrelay2:rxrelay:2.1.0',
- supportDesign: "com.google.android.material:material:1.0.0",
+ rxJava2: 'io.reactivex.rxjava2:rxjava:2.2.21',
+ rxRelay2: 'com.jakewharton.rxrelay2:rxrelay:2.1.1',
+ supportDesign: "com.google.android.material:material:1.12.0",
supportV4: "androidx.legacy:legacy-support-v4:1.0.0",
supportV7CardView: "androidx.cardview:cardview:1.0.0",
- supportV7RecyclerView: "androidx.recyclerview:recyclerview:1.0.0"
+ supportV7RecyclerView: "androidx.recyclerview:recyclerview:1.3.2"
]
}
diff --git a/farebot-app-persist/build.gradle b/farebot-app-persist/build.gradle
index c937344b8..25091ff8e 100644
--- a/farebot-app-persist/build.gradle
+++ b/farebot-app-persist/build.gradle
@@ -1,6 +1,9 @@
+plugins {
+ id "org.jetbrains.kotlin.kapt" version "1.9.25"
+}
+
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-kapt'
dependencies {
implementation libs.supportV4
@@ -15,6 +18,7 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.persist"
defaultConfig {
kapt {
arguments {
diff --git a/farebot-app-persist/src/main/AndroidManifest.xml b/farebot-app-persist/src/main/AndroidManifest.xml
index c195e65c0..e285ed300 100644
--- a/farebot-app-persist/src/main/AndroidManifest.xml
+++ b/farebot-app-persist/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/FareBotDb.kt b/farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/FareBotDb.kt
index a2570a04f..019e0216f 100644
--- a/farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/FareBotDb.kt
+++ b/farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/FareBotDb.kt
@@ -30,16 +30,16 @@ abstract class FareBotDb : RoomDatabase() {
private fun buildDatabase(context: Context): FareBotDb =
Room.databaseBuilder(context, FareBotDb::class.java, DATABASE_NAME)
.addMigrations(object : Migration(1, 2) {
- override fun migrate(database: SupportSQLiteDatabase) {
+ override fun migrate(db: SupportSQLiteDatabase) {
// Migration from Sqldelight to Room. Nothing to change.
}
})
.addMigrations(object : Migration(2, 3) {
- override fun migrate(database: SupportSQLiteDatabase) {
+ override fun migrate(db: SupportSQLiteDatabase) {
// Re-create tables with new NOT NULL `id` column.
- database.beginTransaction()
+ db.beginTransaction()
try {
- database.execSQL("""
+ db.execSQL("""
CREATE TABLE `cards_new` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`type` TEXT NOT NULL,
@@ -49,7 +49,7 @@ abstract class FareBotDb : RoomDatabase() {
);
""".trimIndent())
- database.execSQL("""
+ db.execSQL("""
CREATE TABLE `keys_new` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`card_id` TEXT NOT NULL,
@@ -59,25 +59,25 @@ abstract class FareBotDb : RoomDatabase() {
);
""".trimIndent())
- database.execSQL("""
+ db.execSQL("""
INSERT INTO `cards_new` (type, serial, data, scanned_at)
SELECT type, serial, data, scanned_at FROM cards;
""".trimIndent())
- database.execSQL("""
+ db.execSQL("""
INSERT INTO `keys_new` (card_id, card_type, key_data, created_at)
SELECT card_id, card_type, key_data, created_at FROM keys;
""".trimIndent())
- database.execSQL("DROP TABLE `cards`;")
- database.execSQL("DROP TABLE `keys`;")
+ db.execSQL("DROP TABLE `cards`;")
+ db.execSQL("DROP TABLE `keys`;")
- database.execSQL("ALTER TABLE `cards_new` RENAME TO `cards`;")
- database.execSQL("ALTER TABLE `keys_new` RENAME TO `keys`;")
+ db.execSQL("ALTER TABLE `cards_new` RENAME TO `cards`;")
+ db.execSQL("ALTER TABLE `keys_new` RENAME TO `keys`;")
- database.setTransactionSuccessful()
+ db.setTransactionSuccessful()
} finally {
- database.endTransaction()
+ db.endTransaction()
}
}
})
diff --git a/farebot-app/build.gradle b/farebot-app/build.gradle
index df5263f40..1b075ef1c 100644
--- a/farebot-app/build.gradle
+++ b/farebot-app/build.gradle
@@ -20,11 +20,12 @@
* along with this program. If not, see .
*/
+plugins {
+ id "org.jetbrains.kotlin.kapt" version "1.9.25"
+}
+
apply plugin: 'com.android.application'
-apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
-apply plugin: 'kotlin-kapt'
dependencies {
implementation project(':farebot-base')
@@ -64,57 +65,56 @@ dependencies {
implementation libs.kotlinStdlib
implementation libs.magellan
implementation libs.playServicesMaps
- implementation libs.rxBroadcast
implementation libs.rxJava2
implementation libs.rxRelay2
implementation libs.supportDesign
implementation libs.supportV4
implementation libs.supportV7CardView
implementation libs.supportV7RecyclerView
+//
+// implementation(libs.crashlytics) {
+// transitive = true
+// }
- implementation(libs.crashlytics) {
- transitive = true
- }
-
- implementation libs.dagger
- kapt libs.daggerCompiler
-}
-
-static def askPassword() {
- return 'security -q find-generic-password -w -g -l farebot-release'.execute().text.trim()
-}
+ implementation 'com.google.dagger:dagger:2.52'
+ implementation 'androidx.core:core-ktx:1.13.1'
+ implementation 'androidx.preference:preference-ktx:1.2.1'
-gradle.taskGraph.whenReady { taskGraph ->
- if(taskGraph.hasTask(':farebot-app:packageRelease')) {
- def password = askPassword()
- android.signingConfigs.release.storePassword = password
- android.signingConfigs.release.keyPassword = password
- }
+ kapt 'com.google.dagger:dagger-compiler:2.52'
}
-kapt {
- useBuildCache = true
- mapDiagnosticLocations = true
-}
+// TODO: Fixme for release
+//static def askPassword() {
+// return 'security -q find-generic-password -w -g -l farebot-release'.execute().text.trim()
+//}
+//
+//gradle.taskGraph.whenReady { taskGraph ->
+// if(taskGraph.hasTask(':farebot-app:packageRelease')) {
+// def password = askPassword()
+// android.signingConfigs.release.storePassword = password
+// android.signingConfigs.release.keyPassword = password
+// }
+//}
android {
+ namespace "com.codebutler.farebot.app"
defaultConfig {
versionCode 29
versionName '3.1.1'
multiDexEnabled true
}
- signingConfigs {
- debug {
- storeFile file('../debug.keystore')
- }
- release {
- storeFile file('../release.keystore')
- keyAlias 'ericbutler'
- storePassword ''
- keyPassword ''
- }
- }
+// signingConfigs {
+// debug {
+// storeFile file('../debug.keystore')
+// }
+// release {
+// storeFile file('../release.keystore')
+// keyAlias 'ericbutler'
+// storePassword ''
+// keyPassword ''
+// }
+// }
buildTypes {
debug {
@@ -124,12 +124,14 @@ android {
shrinkResources false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), '../config/proguard/proguard-rules.pro'
- signingConfig signingConfigs.release
+// signingConfig signingConfigs.release
}
}
-
packagingOptions {
- exclude 'META-INF/LICENSE.txt'
- exclude 'META-INF/NOTICE.txt'
+ resources {
+ excludes += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt']
+ }
}
+ compileSdk 34
+ buildToolsVersion '35.0.0'
}
diff --git a/farebot-app/src/main/AndroidManifest.xml b/farebot-app/src/main/AndroidManifest.xml
index a214f5514..5d9cd85d8 100644
--- a/farebot-app/src/main/AndroidManifest.xml
+++ b/farebot-app/src/main/AndroidManifest.xml
@@ -22,8 +22,7 @@
-->
+ xmlns:android="http://schemas.android.com/apk/res/android">
@@ -55,6 +54,7 @@
@@ -69,8 +69,9 @@
android:theme="@style/FareBot.Theme.Prefs"/>
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/analytics/Analytics.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/analytics/Analytics.kt
index b3831888e..3643a0251 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/analytics/Analytics.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/analytics/Analytics.kt
@@ -22,8 +22,6 @@
package com.codebutler.farebot.app.core.analytics
-import com.crashlytics.android.answers.Answers
-import com.crashlytics.android.answers.CustomEvent
enum class AnalyticsEventName(val value: String) {
SCAN_CARD("Scan Card"),
@@ -34,6 +32,6 @@ enum class AnalyticsEventName(val value: String) {
}
fun logAnalyticsEvent(name: AnalyticsEventName, type: String) {
- Answers.getInstance().logCustom(CustomEvent(name.value)
- .putCustomAttribute("Type", type))
+// Answers.getInstance().logCustom(CustomEvent(name.value)
+// .putCustomAttribute("Type", type))
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplication.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplication.kt
index b00848881..c4d5c7a5d 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplication.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplication.kt
@@ -25,18 +25,14 @@ package com.codebutler.farebot.app.core.app
import android.app.Application
import android.content.SharedPreferences
import android.os.StrictMode
-import com.codebutler.farebot.BuildConfig
-import com.crashlytics.android.Crashlytics
-import com.crashlytics.android.answers.Answers
-import io.fabric.sdk.android.Fabric
import java.util.Date
import javax.inject.Inject
class FareBotApplication : Application() {
companion object {
- val PREF_LAST_READ_ID = "last_read_id"
- val PREF_LAST_READ_AT = "last_read_at"
+ const val PREF_LAST_READ_ID = "last_read_id"
+ const val PREF_LAST_READ_AT = "last_read_at"
}
lateinit var component: FareBotApplicationComponent
@@ -57,18 +53,12 @@ class FareBotApplication : Application() {
.build()
component.inject(this)
-
- if (!BuildConfig.DEBUG) {
- Fabric.with(this, Answers(), Crashlytics())
- } else {
- Fabric.with(this, Answers())
- }
}
fun updateTimestamp(tagIdString: String?) {
val prefs = sharedPreferences.edit()
- prefs.putString(FareBotApplication.PREF_LAST_READ_ID, tagIdString)
- prefs.putLong(FareBotApplication.PREF_LAST_READ_AT, Date().time)
+ prefs.putString(PREF_LAST_READ_ID, tagIdString)
+ prefs.putLong(PREF_LAST_READ_AT, Date().time)
prefs.apply()
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplicationModule.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplicationModule.kt
index 225d6f336..a2886fff2 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplicationModule.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/app/FareBotApplicationModule.kt
@@ -23,7 +23,8 @@
package com.codebutler.farebot.app.core.app
import android.content.SharedPreferences
-import android.preference.PreferenceManager
+import android.os.StrictMode
+import androidx.preference.PreferenceManager
import com.codebutler.farebot.app.core.nfc.TagReaderFactory
import com.codebutler.farebot.app.core.serialize.CardKeysSerializer
import com.codebutler.farebot.app.core.serialize.gson.ByteArrayGsonTypeAdapter
@@ -58,8 +59,15 @@ import java.util.Date
class FareBotApplicationModule {
@Provides
- fun provideSharedPreferences(application: FareBotApplication): SharedPreferences =
- PreferenceManager.getDefaultSharedPreferences(application)
+ fun provideSharedPreferences(application: FareBotApplication): SharedPreferences {
+ val oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ return PreferenceManager.getDefaultSharedPreferences(application)
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy)
+ }
+ }
+
@Provides
fun provideGson(): Gson = GsonBuilder()
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/KotterKnife.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/KotterKnife.kt
index 88dd3eee7..f6ad635bf 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/KotterKnife.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/KotterKnife.kt
@@ -124,7 +124,7 @@ private val DialogFragment.viewFinder: DialogFragment.(Int) -> View?
private val SupportDialogFragment.viewFinder: SupportDialogFragment.(Int) -> View?
get() = { dialog?.findViewById(it) ?: view?.findViewById(it) }
private val Fragment.viewFinder: Fragment.(Int) -> View?
- get() = { view.findViewById(it) }
+ get() = { view?.findViewById(it) }
private val SupportFragment.viewFinder: SupportFragment.(Int) -> View?
get() = { view!!.findViewById(it) }
private val ViewHolder.viewFinder: ViewHolder.(Int) -> View?
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/nfc/NfcStream.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/nfc/NfcStream.kt
index c08c6456f..03d9e3407 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/nfc/NfcStream.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/nfc/NfcStream.kt
@@ -24,6 +24,8 @@ package com.codebutler.farebot.app.core.nfc
import android.app.Activity
import android.app.PendingIntent
+import android.content.BroadcastReceiver
+import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.nfc.NfcAdapter
@@ -32,10 +34,12 @@ import android.nfc.tech.IsoDep
import android.nfc.tech.MifareClassic
import android.nfc.tech.MifareUltralight
import android.nfc.tech.NfcF
+import android.os.Build
import android.os.Bundle
-import com.cantrowitz.rxbroadcast.RxBroadcast
+import androidx.annotation.RequiresApi
import com.codebutler.farebot.app.core.rx.LastValueRelay
import io.reactivex.Observable
+import io.reactivex.subjects.PublishSubject
class NfcStream(private val activity: Activity) {
@@ -64,7 +68,7 @@ class NfcStream(private val activity: Activity) {
val intent = Intent(ACTION)
intent.`package` = activity.packageName
- val pendingIntent = PendingIntent.getBroadcast(activity, 0, intent, 0)
+ val pendingIntent = PendingIntent.getBroadcast(activity, 0, intent, PendingIntent.FLAG_MUTABLE)
val nfcAdapter = NfcAdapter.getDefaultAdapter(activity)
nfcAdapter?.enableForegroundDispatch(activity, pendingIntent, null, TECH_LISTS)
}
@@ -74,9 +78,29 @@ class NfcStream(private val activity: Activity) {
nfcAdapter?.disableForegroundDispatch(activity)
}
+ @RequiresApi(Build.VERSION_CODES.TIRAMISU)
fun observe(): Observable {
- val broadcastIntents = RxBroadcast.fromBroadcast(activity, IntentFilter(ACTION))
- .map { it.getParcelableExtra(INTENT_EXTRA_TAG) }
- return Observable.merge(relay, broadcastIntents)
+ // Create a PublishSubject to emit broadcast events
+ val broadcastSubject = PublishSubject.create()
+
+ // Register the BroadcastReceiver manually
+ val broadcastReceiver = object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ val tag = intent.getParcelableExtra(INTENT_EXTRA_TAG)
+ if (tag != null) {
+ broadcastSubject.onNext(tag)
+ }
+ }
+ }
+
+ // Register the receiver with the IntentFilter
+ activity.registerReceiver(broadcastReceiver, IntentFilter(ACTION), Context.RECEIVER_NOT_EXPORTED)
+
+ // Return an observable that merges the relay and the broadcastSubject
+ return Observable.merge(relay, broadcastSubject)
+ .doOnDispose {
+ // Unregister the receiver when the observable is disposed to avoid leaks
+ activity.unregisterReceiver(broadcastReceiver)
+ }
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/rx/LastValueRelay.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/rx/LastValueRelay.kt
index b7fa89287..35952af62 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/rx/LastValueRelay.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/rx/LastValueRelay.kt
@@ -27,13 +27,13 @@ import com.jakewharton.rxrelay2.Relay
import io.reactivex.Observer
import java.util.concurrent.atomic.AtomicReference
-class LastValueRelay private constructor() : Relay() {
+class LastValueRelay private constructor() : Relay() {
private val relay = PublishRelay.create()
private val lastValue: AtomicReference = AtomicReference()
companion object {
- fun create(): LastValueRelay = LastValueRelay()
+ fun create(): LastValueRelay = LastValueRelay()
}
override fun accept(value: T) {
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/ui/FareBotCrossfadeTransition.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/ui/FareBotCrossfadeTransition.kt
index 93bdd4b4c..219fbd96a 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/ui/FareBotCrossfadeTransition.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/ui/FareBotCrossfadeTransition.kt
@@ -54,7 +54,7 @@ class FareBotCrossfadeTransition(context: Context) : Transition {
.alpha(0f)
.setDuration(shortAnimationDuration)
.setListener(object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator?) {
+ override fun onAnimationEnd(animation: Animator) {
viewFrom.visibility = View.GONE
callback.onAnimationEnd()
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/core/util/ExportHelper.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/core/util/ExportHelper.kt
index b50ddae07..f0614f7dc 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/core/util/ExportHelper.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/core/util/ExportHelper.kt
@@ -22,12 +22,12 @@
package com.codebutler.farebot.app.core.util
-import com.codebutler.farebot.BuildConfig
import com.codebutler.farebot.card.RawCard
import com.codebutler.farebot.card.serialize.CardSerializer
import com.codebutler.farebot.persist.CardPersister
import com.codebutler.farebot.persist.db.model.SavedCard
import com.google.gson.Gson
+import com.xwray.groupie.BuildConfig
class ExportHelper(
private val cardPersister: CardPersister,
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/bg/BackgroundTagActivity.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/bg/BackgroundTagActivity.kt
index dceb0f92d..d38923a2a 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/bg/BackgroundTagActivity.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/bg/BackgroundTagActivity.kt
@@ -33,7 +33,7 @@ class BackgroundTagActivity : Activity() {
startActivity(Intent(this, MainActivity::class.java).apply {
action = intent.action
- putExtras(intent.extras)
+ intent.extras?.let { putExtras(it) }
})
finish()
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreen.kt
index cf060c15b..5b65f5fc8 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreen.kt
@@ -25,7 +25,7 @@ package com.codebutler.farebot.app.feature.card
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.view.Menu
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.analytics.AnalyticsEventName
import com.codebutler.farebot.app.core.analytics.logAnalyticsEvent
@@ -117,6 +117,9 @@ class CardScreen(private val rawCard: RawCard<*>) : FareBotScreen TODO()
+ is TransactionViewModel.SubscriptionViewModel -> TODO()
}
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreenView.kt
index e515c3700..94d300894 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/CardScreenView.kt
@@ -28,12 +28,11 @@ import androidx.recyclerview.widget.RecyclerView
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.transit.TransitInfo
import com.jakewharton.rxrelay2.PublishRelay
import com.wealthfront.magellan.BaseScreenView
-import com.xwray.groupie.GroupAdapter
import io.reactivex.Observable
class CardScreenView(context: Context) : BaseScreenView(context) {
@@ -59,7 +58,7 @@ class CardScreenView(context: Context) : BaseScreenView(context) {
} else {
balanceTextView.text = balance
if (viewModels.isNotEmpty()) {
- recycler.adapter = GroupAdapter()
+// recycler.adapter = GroupAdapter()
recycler.adapter = TransactionAdapter(viewModels, clicksRelay)
} else {
recycler.visibility = View.GONE
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionAdapter.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionAdapter.kt
index 69eeee54c..73b4f7433 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionAdapter.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionAdapter.kt
@@ -22,21 +22,20 @@
package com.codebutler.farebot.app.feature.card
-import androidx.annotation.LayoutRes
-import androidx.recyclerview.widget.RecyclerView
import android.text.format.DateFormat
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
-import com.codebutler.farebot.R
+import androidx.annotation.LayoutRes
+import androidx.recyclerview.widget.RecyclerView
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.app.core.kotlin.inflate
import com.codebutler.farebot.app.feature.card.TransactionAdapter.TransactionViewHolder.RefillViewHolder
import com.codebutler.farebot.app.feature.card.TransactionAdapter.TransactionViewHolder.SubscriptionViewHolder
import com.codebutler.farebot.app.feature.card.TransactionAdapter.TransactionViewHolder.TripViewHolder
import com.jakewharton.rxrelay2.PublishRelay
-import com.xwray.groupie.ViewHolder
import java.util.Calendar
import java.util.Date
@@ -77,7 +76,7 @@ class TransactionAdapter(
is TransactionViewModel.SubscriptionViewModel -> TYPE_SUBSCRIPTION
}
- sealed class TransactionViewHolder(itemView: View) : ViewHolder(itemView) {
+ sealed class TransactionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
companion object {
fun wrapLayout(parent: ViewGroup, @LayoutRes layoutId: Int): View =
@@ -95,7 +94,7 @@ class TransactionAdapter(
if (item is TransactionViewModel.SubscriptionViewModel) {
header.text = header.context.getString(R.string.subscriptions)
} else {
- header.text = DateFormat.getLongDateFormat(header.context).format(item.date)
+ header.text = item.date?.let { DateFormat.getLongDateFormat(header.context).format(it) }
}
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionViewModel.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionViewModel.kt
index 112f33cdf..aae8ce46b 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionViewModel.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/TransactionViewModel.kt
@@ -24,7 +24,7 @@ package com.codebutler.farebot.app.feature.card
import android.content.Context
import androidx.annotation.DrawableRes
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.transit.Refill
import com.codebutler.farebot.transit.Subscription
import com.codebutler.farebot.transit.Trip
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedAdapter.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedAdapter.kt
index 644452b53..56bf3f304 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedAdapter.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedAdapter.kt
@@ -26,7 +26,7 @@ import androidx.recyclerview.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.inflate
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.base.ui.FareBotUiTree
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreen.kt
index 814b9122f..a340d3c09 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreen.kt
@@ -23,7 +23,7 @@
package com.codebutler.farebot.app.feature.card.advanced
import android.content.Context
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.inject.ScreenScope
import com.codebutler.farebot.app.core.ui.ActionBarOptions
import com.codebutler.farebot.app.core.ui.FareBotScreen
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreenView.kt
index 183a32b52..92af99947 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedScreenView.kt
@@ -25,7 +25,7 @@ package com.codebutler.farebot.app.feature.card.advanced
import android.content.Context
import android.view.ViewGroup
import android.widget.TabHost
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.inflate
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.base.ui.FareBotUiTree
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedTabView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedTabView.kt
index d88a4642a..9e9a62edb 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedTabView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/advanced/CardAdvancedTabView.kt
@@ -29,7 +29,7 @@ import android.util.AttributeSet
import android.widget.FrameLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.base.ui.FareBotUiTree
@@ -37,17 +37,17 @@ class CardAdvancedTabView : FrameLayout {
private val recyclerView: RecyclerView by bindView(R.id.recycler)
- constructor(context: Context?) :
+ constructor(context: Context) :
super(context)
- constructor(context: Context?, attrs: AttributeSet?) :
+ constructor(context: Context, attrs: AttributeSet?) :
super(context, attrs)
- constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
+ constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) :
super(context, attrs, defStyleAttr)
@Suppress("unused")
- constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) :
+ constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) :
super(context, attrs, defStyleAttr, defStyleRes)
fun setAdvancedUi(fareBotUiTree: FareBotUiTree) {
@@ -59,7 +59,7 @@ class CardAdvancedTabView : FrameLayout {
init {
val attrs = intArrayOf(android.R.attr.listDivider)
val ta = context.applicationContext.obtainStyledAttributes(attrs)
- divider = ta.getDrawable(0)
+ divider = ta.getDrawable(0)!!
ta.recycle()
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreen.kt
index 647704bdf..46257baca 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreen.kt
@@ -25,7 +25,7 @@ package com.codebutler.farebot.app.feature.card.map
import android.content.Context
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.inject.ScreenScope
import com.codebutler.farebot.app.core.kotlin.compact
import com.codebutler.farebot.app.core.ui.ActionBarOptions
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreenView.kt
index 53a8babfc..1013a603c 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/card/map/TripMapScreenView.kt
@@ -26,7 +26,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.Bundle
import androidx.annotation.DrawableRes
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.transit.Station
import com.codebutler.farebot.transit.Trip
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreen.kt
index cdc6e3add..d2d6f04e9 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreen.kt
@@ -23,7 +23,7 @@
package com.codebutler.farebot.app.feature.help
import android.content.Context
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.inject.ScreenScope
import com.codebutler.farebot.app.core.ui.ActionBarOptions
import com.codebutler.farebot.app.core.ui.FareBotScreen
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreenView.kt
index 745241f59..c83cd6572 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/help/HelpScreenView.kt
@@ -34,7 +34,7 @@ import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.card.CardType
import com.codebutler.farebot.transit.manly_fast_ferry.ManlyFastFerryTransitInfo
@@ -90,7 +90,7 @@ class HelpScreenView(context: Context) : BaseScreenView(context) {
name = "EZ-Link",
locationResId = R.string.location_singapore,
cardType = CardType.CEPAS,
- extraNoteResId = R.string.ezlink_card_note
+ extraNoteResId = com.codebutler.farebot.transit.ezlink.R.string.ezlink_card_note
),
SupportedCard(
imageResId = R.drawable.octopus_card,
@@ -111,7 +111,7 @@ class HelpScreenView(context: Context) : BaseScreenView(context) {
cardType = CardType.MifareClassic,
keysRequired = true,
preview = true,
- extraNoteResId = R.string.seqgo_card_note
+ extraNoteResId = com.codebutler.farebot.transit.seq_go.R.string.seqgo_card_note
),
SupportedCard(
imageResId = R.drawable.hsl_card,
@@ -133,7 +133,7 @@ class HelpScreenView(context: Context) : BaseScreenView(context) {
cardType = CardType.MifareDesfire,
keysRequired = false,
preview = false,
- extraNoteResId = R.string.myki_card_note
+ extraNoteResId = com.codebutler.farebot.transit.myki.R.string.myki_card_note
),
SupportedCard(
imageResId = R.drawable.nets_card,
@@ -157,10 +157,10 @@ class HelpScreenView(context: Context) : BaseScreenView(context) {
SupportedCard(
imageResId = R.drawable.easycard,
name = "EasyCard",
- locationResId = R.string.easycard_card_location,
+ locationResId = com.codebutler.farebot.transit.easycard.R.string.easycard_card_location,
cardType = CardType.MifareClassic,
keysRequired = true,
- extraNoteResId = R.string.easycard_card_note
+ extraNoteResId = com.codebutler.farebot.transit.easycard.R.string.easycard_card_note
),
SupportedCard(
imageResId = R.drawable.kmt_card,
@@ -168,7 +168,7 @@ class HelpScreenView(context: Context) : BaseScreenView(context) {
locationResId = R.string.location_jakarta,
cardType = CardType.FeliCa,
keysRequired = false,
- extraNoteResId = R.string.kmt_notes
+ extraNoteResId = com.codebutler.farebot.transit.kmt.R.string.kmt_notes
)
)
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryAdapter.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryAdapter.kt
index ea6329716..0b2450a76 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryAdapter.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryAdapter.kt
@@ -27,7 +27,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.app.core.kotlin.inflate
import com.jakewharton.rxrelay2.PublishRelay
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreen.kt
index 4e74d905a..8c1909b1e 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreen.kt
@@ -37,7 +37,7 @@ import android.view.Menu
import android.widget.Toast
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.inject.ScreenScope
import com.codebutler.farebot.app.core.kotlin.Optional
@@ -119,7 +119,7 @@ class HistoryScreen : FareBotScreen {
val exportClip = ClipData.newPlainText(null, exportHelper.exportCards())
- clipboardManager.primaryClip = exportClip
+ clipboardManager.setPrimaryClip(exportClip);
Toast.makeText(activity, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show()
}
R.id.share -> {
@@ -256,16 +256,13 @@ class HistoryScreen : FareBotScreen onCardsImported(cards) }
}
@ScreenScope
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreenView.kt
index 135a8c22a..b7de5f43d 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryScreenView.kt
@@ -30,7 +30,7 @@ import androidx.recyclerview.widget.RecyclerView
import android.view.Menu
import android.view.MenuItem
import android.view.View
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.kotlin.bindView
import com.jakewharton.rxrelay2.PublishRelay
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/CardStream.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/CardStream.kt
index 99917dbf4..257b4ccc7 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/CardStream.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/CardStream.kt
@@ -106,7 +106,7 @@ class CardStream(
}
class CardUnauthorizedException : Throwable() {
- override val message: String?
+ override val message: String
get() = "Unauthorized"
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreen.kt
index de2375f28..edf06c4ff 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreen.kt
@@ -30,7 +30,7 @@ import android.nfc.TagLostException
import android.provider.Settings
import androidx.appcompat.app.AlertDialog
import android.view.Menu
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.analytics.AnalyticsEventName
import com.codebutler.farebot.app.core.analytics.logAnalyticsEvent
@@ -44,7 +44,6 @@ import com.codebutler.farebot.app.feature.history.HistoryScreen
import com.codebutler.farebot.app.feature.keys.KeysScreen
import com.codebutler.farebot.app.feature.main.MainActivity.MainActivityComponent
import com.codebutler.farebot.app.feature.prefs.FareBotPreferenceActivity
-import com.crashlytics.android.Crashlytics
import com.uber.autodispose.kotlin.autoDisposable
import dagger.Component
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -124,7 +123,7 @@ class HomeScreen : FareBotScreen(),
.setPositiveButton(android.R.string.ok, null)
.show()
else -> {
- Crashlytics.logException(ex)
+// Crashlytics.logException(ex)
ErrorUtils.showErrorAlert(activity, ex)
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreenView.kt
index c0acff447..fb806302e 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/home/HomeScreenView.kt
@@ -32,10 +32,10 @@ import android.view.ViewPropertyAnimator
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
-import com.codebutler.farebot.BuildConfig
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.wealthfront.magellan.BaseScreenView
+import com.xwray.groupie.BuildConfig
@SuppressLint("ViewConstructor")
class HomeScreenView internal constructor(ctx: Context, private val listener: Listener) :
@@ -80,7 +80,7 @@ class HomeScreenView internal constructor(ctx: Context, private val listener: Li
.alpha(0f)
.setDuration(shortAnimationDuration)
.setListener(object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator?) {
+ override fun onAnimationEnd(animation: Animator) {
viewFadeOut.visibility = View.GONE
}
})
@@ -92,15 +92,15 @@ class HomeScreenView internal constructor(ctx: Context, private val listener: Li
return
}
when (error) {
- HomeScreenView.NfcError.DISABLED -> {
+ NfcError.DISABLED -> {
errorTextView.setText(R.string.nfc_off_error)
errorButton.visibility = View.VISIBLE
}
- HomeScreenView.NfcError.UNAVAILABLE -> {
+ NfcError.UNAVAILABLE -> {
errorTextView.setText(R.string.nfc_unavailable)
errorButton.visibility = View.GONE
}
- HomeScreenView.NfcError.NONE -> { /* Unreachable */ }
+ NfcError.NONE -> { /* Unreachable */ }
}
errorViewGroup.visibility = View.VISIBLE
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysAdapter.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysAdapter.kt
index fb7e57d0b..5b66ffed9 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysAdapter.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysAdapter.kt
@@ -26,7 +26,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.app.core.kotlin.inflate
import com.jakewharton.rxrelay2.PublishRelay
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreen.kt
index d9004a80b..91441a3ae 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreen.kt
@@ -24,7 +24,7 @@ package com.codebutler.farebot.app.feature.keys
import android.content.Context
import android.view.Menu
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.inject.ScreenScope
import com.codebutler.farebot.app.core.ui.ActionBarOptions
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreenView.kt
index 2c6c2b1e5..0957c218b 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeysScreenView.kt
@@ -29,7 +29,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.view.Menu
import android.view.MenuItem
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.kotlin.bindView
import com.jakewharton.rxrelay2.PublishRelay
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreen.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreen.kt
index c037d103a..ae7118d82 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreen.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreen.kt
@@ -29,7 +29,7 @@ import android.net.Uri
import android.nfc.Tag
import android.os.Environment
import androidx.appcompat.app.AlertDialog
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.inject.ScreenScope
import com.codebutler.farebot.app.core.nfc.NfcStream
@@ -93,7 +93,8 @@ class AddKeyScreen : FareBotScreen {
if (resultCode == Activity.RESULT_OK && dataIntent != null) {
- setKey(activity.contentResolver.openInputStream(dataIntent.data).readBytes())
+ dataIntent.data?.let { activity.contentResolver.openInputStream(it)?.readBytes() }
+ ?.let { setKey(it) }
}
}
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreenView.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreenView.kt
index e91e7c987..c63579dc2 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreenView.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/add/AddKeyScreenView.kt
@@ -27,7 +27,7 @@ import android.content.Context
import android.view.View
import android.widget.Button
import android.widget.TextView
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.kotlin.bindView
import com.codebutler.farebot.base.util.ByteUtils
import com.wealthfront.magellan.BaseScreenView
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/main/MainActivity.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/main/MainActivity.kt
index 7df8b0ac5..86faac441 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/main/MainActivity.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/main/MainActivity.kt
@@ -37,7 +37,7 @@ import androidx.appcompat.widget.Toolbar
import android.view.Menu
import android.view.MenuItem
import android.view.View
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.core.activity.ActivityOperations
import com.codebutler.farebot.app.core.activity.ActivityResult
import com.codebutler.farebot.app.core.activity.RequestPermissionsResult
@@ -123,7 +123,7 @@ class MainActivity : AppCompatActivity(),
navigator.onCreate(this, savedInstanceState)
}
- override fun onSaveInstanceState(outState: Bundle?) {
+ override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
navigator.onSaveInstanceState(outState)
}
diff --git a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/prefs/FareBotPreferenceActivity.kt b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/prefs/FareBotPreferenceActivity.kt
index 440af0e0b..8a37c3125 100644
--- a/farebot-app/src/main/java/com/codebutler/farebot/app/feature/prefs/FareBotPreferenceActivity.kt
+++ b/farebot-app/src/main/java/com/codebutler/farebot/app/feature/prefs/FareBotPreferenceActivity.kt
@@ -33,7 +33,7 @@ import android.preference.CheckBoxPreference
import android.preference.Preference
import android.preference.PreferenceActivity
import android.view.MenuItem
-import com.codebutler.farebot.R
+import com.codebutler.farebot.app.R
import com.codebutler.farebot.app.feature.bg.BackgroundTagActivity
@Suppress("DEPRECATION")
diff --git a/farebot-base/build.gradle b/farebot-base/build.gradle
index b63719d3c..b9dcb6cbf 100644
--- a/farebot-base/build.gradle
+++ b/farebot-base/build.gradle
@@ -1,16 +1,21 @@
+plugins {
+ id "org.jetbrains.kotlin.kapt" version "1.9.25"
+}
+
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-kapt'
dependencies {
- implementation libs.guava
- implementation libs.supportV4
- implementation libs.kotlinStdlib
+ implementation(libs.guava)
+ implementation(libs.supportV4)
+ implementation(libs.kotlinStdlib)
- compileOnly libs.autoValueAnnotations
+ compileOnly(libs.autoValueAnnotations)
- kapt libs.autoValue
+ kapt(libs.autoValue)
}
-android { }
+android {
+ namespace "com.codebutler.farebot.util"
+}
diff --git a/farebot-base/src/main/AndroidManifest.xml b/farebot-base/src/main/AndroidManifest.xml
index acd47ac15..e285ed300 100644
--- a/farebot-base/src/main/AndroidManifest.xml
+++ b/farebot-base/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-card-cepas/build.gradle b/farebot-card-cepas/build.gradle
index 4e83163c9..cc11160e1 100644
--- a/farebot-card-cepas/build.gradle
+++ b/farebot-card-cepas/build.gradle
@@ -16,5 +16,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.card.cepas"
resourcePrefix 'cepas_'
}
diff --git a/farebot-card-cepas/src/main/AndroidManifest.xml b/farebot-card-cepas/src/main/AndroidManifest.xml
index 35c62b375..e2302144a 100644
--- a/farebot-card-cepas/src/main/AndroidManifest.xml
+++ b/farebot-card-cepas/src/main/AndroidManifest.xml
@@ -22,8 +22,7 @@
-->
+ xmlns:android="http://schemas.android.com/apk/res/android">
diff --git a/farebot-card-classic/build.gradle b/farebot-card-classic/build.gradle
index 26154f9bf..776decae1 100644
--- a/farebot-card-classic/build.gradle
+++ b/farebot-card-classic/build.gradle
@@ -16,5 +16,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.card.classic"
resourcePrefix 'classic_'
}
diff --git a/farebot-card-classic/src/main/AndroidManifest.xml b/farebot-card-classic/src/main/AndroidManifest.xml
index 2909eeb71..15e6bac46 100644
--- a/farebot-card-classic/src/main/AndroidManifest.xml
+++ b/farebot-card-classic/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-card-desfire/build.gradle b/farebot-card-desfire/build.gradle
index 61ad4d235..63fc5eee1 100644
--- a/farebot-card-desfire/build.gradle
+++ b/farebot-card-desfire/build.gradle
@@ -16,5 +16,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.card.desfire"
resourcePrefix 'desfire_'
}
diff --git a/farebot-card-desfire/src/main/AndroidManifest.xml b/farebot-card-desfire/src/main/AndroidManifest.xml
index 8e4d3b7f2..e2302144a 100644
--- a/farebot-card-desfire/src/main/AndroidManifest.xml
+++ b/farebot-card-desfire/src/main/AndroidManifest.xml
@@ -22,8 +22,7 @@
-->
+ xmlns:android="http://schemas.android.com/apk/res/android">
diff --git a/farebot-card-felica/build.gradle b/farebot-card-felica/build.gradle
index c87ef40d8..772263fff 100644
--- a/farebot-card-felica/build.gradle
+++ b/farebot-card-felica/build.gradle
@@ -16,5 +16,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.card.felica"
resourcePrefix 'felica_'
}
diff --git a/farebot-card-felica/src/main/AndroidManifest.xml b/farebot-card-felica/src/main/AndroidManifest.xml
index 1bb8fa039..e285ed300 100644
--- a/farebot-card-felica/src/main/AndroidManifest.xml
+++ b/farebot-card-felica/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-card-ultralight/build.gradle b/farebot-card-ultralight/build.gradle
index 5438c0110..e89986318 100644
--- a/farebot-card-ultralight/build.gradle
+++ b/farebot-card-ultralight/build.gradle
@@ -14,5 +14,5 @@ dependencies {
}
android {
- resourcePrefix 'ultralight_'
+ namespace "com.codebutler.farebot.card.ultralight"
}
diff --git a/farebot-card-ultralight/src/main/AndroidManifest.xml b/farebot-card-ultralight/src/main/AndroidManifest.xml
index a7fdbf3a2..15e6bac46 100644
--- a/farebot-card-ultralight/src/main/AndroidManifest.xml
+++ b/farebot-card-ultralight/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-card/build.gradle b/farebot-card/build.gradle
index 623797019..ebfdcdbac 100644
--- a/farebot-card/build.gradle
+++ b/farebot-card/build.gradle
@@ -13,4 +13,6 @@ dependencies {
annotationProcessor libs.autoValue
}
-android { }
+android {
+ namespace "com.codebutler.farebot.card"
+}
diff --git a/farebot-card/src/main/AndroidManifest.xml b/farebot-card/src/main/AndroidManifest.xml
index 18e9bb138..e2302144a 100644
--- a/farebot-card/src/main/AndroidManifest.xml
+++ b/farebot-card/src/main/AndroidManifest.xml
@@ -22,8 +22,7 @@
-->
+ xmlns:android="http://schemas.android.com/apk/res/android">
diff --git a/farebot-transit-bilhete/build.gradle b/farebot-transit-bilhete/build.gradle
index 12e7aa562..d2987d64c 100644
--- a/farebot-transit-bilhete/build.gradle
+++ b/farebot-transit-bilhete/build.gradle
@@ -14,4 +14,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.bilhete_unico"
+}
diff --git a/farebot-transit-bilhete/src/main/AndroidManifest.xml b/farebot-transit-bilhete/src/main/AndroidManifest.xml
index 43ef19e75..e285ed300 100644
--- a/farebot-transit-bilhete/src/main/AndroidManifest.xml
+++ b/farebot-transit-bilhete/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-transit-clipper/build.gradle b/farebot-transit-clipper/build.gradle
index 158cec8b4..02cf935ee 100644
--- a/farebot-transit-clipper/build.gradle
+++ b/farebot-transit-clipper/build.gradle
@@ -16,4 +16,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.clipper"
+}
diff --git a/farebot-transit-clipper/src/main/AndroidManifest.xml b/farebot-transit-clipper/src/main/AndroidManifest.xml
index ef9a65c3d..e285ed300 100644
--- a/farebot-transit-clipper/src/main/AndroidManifest.xml
+++ b/farebot-transit-clipper/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-transit-easycard/build.gradle b/farebot-transit-easycard/build.gradle
index db0c03ad5..fc35606a3 100644
--- a/farebot-transit-easycard/build.gradle
+++ b/farebot-transit-easycard/build.gradle
@@ -10,5 +10,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.easycard"
resourcePrefix 'easycard_'
}
diff --git a/farebot-transit-easycard/src/main/AndroidManifest.xml b/farebot-transit-easycard/src/main/AndroidManifest.xml
index 178841a85..e285ed300 100644
--- a/farebot-transit-easycard/src/main/AndroidManifest.xml
+++ b/farebot-transit-easycard/src/main/AndroidManifest.xml
@@ -21,7 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-transit-edy/build.gradle b/farebot-transit-edy/build.gradle
index 9a6b5c770..c4925414f 100644
--- a/farebot-transit-edy/build.gradle
+++ b/farebot-transit-edy/build.gradle
@@ -14,4 +14,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.edy"
+}
diff --git a/farebot-transit-edy/src/main/AndroidManifest.xml b/farebot-transit-edy/src/main/AndroidManifest.xml
index 3f86006bc..15e6bac46 100644
--- a/farebot-transit-edy/src/main/AndroidManifest.xml
+++ b/farebot-transit-edy/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-edy/src/main/res/values/strings.xml b/farebot-transit-edy/src/main/res/values/strings.xml
index e7159aaef..59c2fecd7 100644
--- a/farebot-transit-edy/src/main/res/values/strings.xml
+++ b/farebot-transit-edy/src/main/res/values/strings.xml
@@ -1,4 +1,6 @@
#
+
+
diff --git a/farebot-transit-ezlink/build.gradle b/farebot-transit-ezlink/build.gradle
index ce4b7cc91..5b90efa13 100644
--- a/farebot-transit-ezlink/build.gradle
+++ b/farebot-transit-ezlink/build.gradle
@@ -16,4 +16,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.ezlink"
+}
diff --git a/farebot-transit-ezlink/src/main/AndroidManifest.xml b/farebot-transit-ezlink/src/main/AndroidManifest.xml
index bf72b65de..15e6bac46 100644
--- a/farebot-transit-ezlink/src/main/AndroidManifest.xml
+++ b/farebot-transit-ezlink/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-hsl/build.gradle b/farebot-transit-hsl/build.gradle
index 158cec8b4..0bb5416de 100644
--- a/farebot-transit-hsl/build.gradle
+++ b/farebot-transit-hsl/build.gradle
@@ -16,4 +16,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.hsl"
+}
diff --git a/farebot-transit-hsl/src/main/AndroidManifest.xml b/farebot-transit-hsl/src/main/AndroidManifest.xml
index 2c7decb76..15e6bac46 100644
--- a/farebot-transit-hsl/src/main/AndroidManifest.xml
+++ b/farebot-transit-hsl/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-kmt/build.gradle b/farebot-transit-kmt/build.gradle
index 6465e7b2e..b9a86aa89 100644
--- a/farebot-transit-kmt/build.gradle
+++ b/farebot-transit-kmt/build.gradle
@@ -16,4 +16,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.kmt"
+}
diff --git a/farebot-transit-kmt/src/main/AndroidManifest.xml b/farebot-transit-kmt/src/main/AndroidManifest.xml
index fa0880698..cc947c567 100644
--- a/farebot-transit-kmt/src/main/AndroidManifest.xml
+++ b/farebot-transit-kmt/src/main/AndroidManifest.xml
@@ -1,2 +1 @@
-
+
diff --git a/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTransitInfo.java b/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTransitInfo.java
index 3eda60a93..395cef99a 100644
--- a/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTransitInfo.java
+++ b/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTransitInfo.java
@@ -25,7 +25,6 @@
import androidx.annotation.Nullable;
import com.codebutler.farebot.base.util.ByteArray;
-import com.codebutler.farebot.kmt.R;
import com.codebutler.farebot.transit.Refill;
import com.codebutler.farebot.transit.Subscription;
import com.codebutler.farebot.transit.TransitInfo;
diff --git a/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTrip.java b/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTrip.java
index 25f3ee438..2390470cb 100644
--- a/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTrip.java
+++ b/farebot-transit-kmt/src/main/java/com/codebutler/farebot/transit/kmt/KMTTrip.java
@@ -24,7 +24,6 @@
import androidx.annotation.NonNull;
import com.codebutler.farebot.card.felica.FelicaBlock;
-import com.codebutler.farebot.kmt.R;
import com.codebutler.farebot.transit.Station;
import com.codebutler.farebot.transit.Trip;
import com.google.auto.value.AutoValue;
diff --git a/farebot-transit-manly/build.gradle b/farebot-transit-manly/build.gradle
index 12e7aa562..3fad3e244 100644
--- a/farebot-transit-manly/build.gradle
+++ b/farebot-transit-manly/build.gradle
@@ -14,4 +14,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit.manly_fast_ferry"
+}
diff --git a/farebot-transit-manly/src/main/AndroidManifest.xml b/farebot-transit-manly/src/main/AndroidManifest.xml
index cfe459562..15e6bac46 100644
--- a/farebot-transit-manly/src/main/AndroidManifest.xml
+++ b/farebot-transit-manly/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-myki/build.gradle b/farebot-transit-myki/build.gradle
index e11f3e00d..edaa2cfe9 100644
--- a/farebot-transit-myki/build.gradle
+++ b/farebot-transit-myki/build.gradle
@@ -15,5 +15,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.myki"
resourcePrefix 'myki_'
}
diff --git a/farebot-transit-myki/src/main/AndroidManifest.xml b/farebot-transit-myki/src/main/AndroidManifest.xml
index 5b4b2a0bc..e285ed300 100644
--- a/farebot-transit-myki/src/main/AndroidManifest.xml
+++ b/farebot-transit-myki/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-transit-octopus/build.gradle b/farebot-transit-octopus/build.gradle
index 3c1799744..dd7ee6405 100644
--- a/farebot-transit-octopus/build.gradle
+++ b/farebot-transit-octopus/build.gradle
@@ -14,5 +14,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.octopus"
resourcePrefix 'octopus_'
}
diff --git a/farebot-transit-octopus/src/main/AndroidManifest.xml b/farebot-transit-octopus/src/main/AndroidManifest.xml
index 2beb05f00..e285ed300 100644
--- a/farebot-transit-octopus/src/main/AndroidManifest.xml
+++ b/farebot-transit-octopus/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-transit-opal/build.gradle b/farebot-transit-opal/build.gradle
index ccd45c927..18db69ceb 100644
--- a/farebot-transit-opal/build.gradle
+++ b/farebot-transit-opal/build.gradle
@@ -17,5 +17,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.opal"
resourcePrefix 'opal_'
}
diff --git a/farebot-transit-opal/src/main/AndroidManifest.xml b/farebot-transit-opal/src/main/AndroidManifest.xml
index 67bf6fea8..15e6bac46 100644
--- a/farebot-transit-opal/src/main/AndroidManifest.xml
+++ b/farebot-transit-opal/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-orca/build.gradle b/farebot-transit-orca/build.gradle
index fdbc9d202..cdd4279fc 100644
--- a/farebot-transit-orca/build.gradle
+++ b/farebot-transit-orca/build.gradle
@@ -17,5 +17,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.orca"
resourcePrefix 'transit_orca_'
}
diff --git a/farebot-transit-orca/src/main/AndroidManifest.xml b/farebot-transit-orca/src/main/AndroidManifest.xml
index 010c70b0b..e285ed300 100644
--- a/farebot-transit-orca/src/main/AndroidManifest.xml
+++ b/farebot-transit-orca/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/farebot-transit-ovc/build.gradle b/farebot-transit-ovc/build.gradle
index 2715123af..da3481be9 100644
--- a/farebot-transit-ovc/build.gradle
+++ b/farebot-transit-ovc/build.gradle
@@ -16,5 +16,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.ovc"
resourcePrefix 'ovc_'
}
diff --git a/farebot-transit-ovc/src/main/AndroidManifest.xml b/farebot-transit-ovc/src/main/AndroidManifest.xml
index 6f060bbbd..15e6bac46 100644
--- a/farebot-transit-ovc/src/main/AndroidManifest.xml
+++ b/farebot-transit-ovc/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-seqgo/build.gradle b/farebot-transit-seqgo/build.gradle
index a33c9b01e..c885d7f85 100644
--- a/farebot-transit-seqgo/build.gradle
+++ b/farebot-transit-seqgo/build.gradle
@@ -17,5 +17,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.seq_go"
resourcePrefix 'seqgo_'
}
diff --git a/farebot-transit-seqgo/src/main/AndroidManifest.xml b/farebot-transit-seqgo/src/main/AndroidManifest.xml
index 511369ff1..15e6bac46 100644
--- a/farebot-transit-seqgo/src/main/AndroidManifest.xml
+++ b/farebot-transit-seqgo/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-stub/build.gradle b/farebot-transit-stub/build.gradle
index 56cf10695..6a3ad9916 100644
--- a/farebot-transit-stub/build.gradle
+++ b/farebot-transit-stub/build.gradle
@@ -17,5 +17,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.stub"
resourcePrefix 'stub_'
}
diff --git a/farebot-transit-stub/src/main/AndroidManifest.xml b/farebot-transit-stub/src/main/AndroidManifest.xml
index 231dbd848..15e6bac46 100644
--- a/farebot-transit-stub/src/main/AndroidManifest.xml
+++ b/farebot-transit-stub/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-suica/build.gradle b/farebot-transit-suica/build.gradle
index 084189c42..4afeeb2ee 100644
--- a/farebot-transit-suica/build.gradle
+++ b/farebot-transit-suica/build.gradle
@@ -17,5 +17,6 @@ dependencies {
}
android {
+ namespace "com.codebutler.farebot.transit.suica"
resourcePrefix 'suica_'
}
diff --git a/farebot-transit-suica/src/main/AndroidManifest.xml b/farebot-transit-suica/src/main/AndroidManifest.xml
index 156098780..15e6bac46 100644
--- a/farebot-transit-suica/src/main/AndroidManifest.xml
+++ b/farebot-transit-suica/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
\ No newline at end of file
diff --git a/farebot-transit-suica/src/main/java/com/codebutler/farebot/transit/suica/SuicaUtil.java b/farebot-transit-suica/src/main/java/com/codebutler/farebot/transit/suica/SuicaUtil.java
index 4f171312b..ba91e7272 100644
--- a/farebot-transit-suica/src/main/java/com/codebutler/farebot/transit/suica/SuicaUtil.java
+++ b/farebot-transit-suica/src/main/java/com/codebutler/farebot/transit/suica/SuicaUtil.java
@@ -103,51 +103,51 @@ static Date extractDate(boolean isProductSale, byte[] data) {
static String getConsoleTypeName(@NonNull Resources resources, int cType) {
switch (cType & 0xff) {
case 0x03:
- return resources.getString(R.string.felica_terminal_fare_adjustment);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_fare_adjustment);
case 0x04:
- return resources.getString(R.string.felica_terminal_portable);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_portable);
case 0x05:
- return resources.getString(R.string.felica_terminal_vehicle); // bus
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_vehicle); // bus
case 0x07:
- return resources.getString(R.string.felica_terminal_ticket);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_ticket);
case 0x08:
- return resources.getString(R.string.felica_terminal_ticket);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_ticket);
case 0x09:
- return resources.getString(R.string.felica_terminal_deposit_quick_charge);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_deposit_quick_charge);
case 0x12:
- return resources.getString(R.string.felica_terminal_tvm_tokyo_monorail);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_tvm_tokyo_monorail);
case 0x13:
- return resources.getString(R.string.felica_terminal_tvm_etc);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_tvm_etc);
case 0x14:
- return resources.getString(R.string.felica_terminal_tvm_etc);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_tvm_etc);
case 0x15:
- return resources.getString(R.string.felica_terminal_tvm_etc);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_tvm_etc);
case 0x16:
- return resources.getString(R.string.felica_terminal_ticket_gate);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_ticket_gate);
case 0x17:
- return resources.getString(R.string.felica_terminal_simple_ticket_gate);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_simple_ticket_gate);
case 0x18:
- return resources.getString(R.string.felica_terminal_booth);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_booth);
case 0x19:
- return resources.getString(R.string.felica_terminal_booth_green);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_booth_green);
case 0x1a:
- return resources.getString(R.string.felica_terminal_ticket_gate_terminal);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_ticket_gate_terminal);
case 0x1b:
- return resources.getString(R.string.felica_terminal_mobile_phone);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_mobile_phone);
case 0x1c:
- return resources.getString(R.string.felica_terminal_connection_adjustment);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_connection_adjustment);
case 0x1d:
- return resources.getString(R.string.felica_terminal_transfer_adjustment);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_transfer_adjustment);
case 0x1f:
- return resources.getString(R.string.felica_terminal_simple_deposit);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_simple_deposit);
case 0x46:
return "VIEW ALTTE";
case 0x48:
return "VIEW ALTTE";
case 0xc7:
- return resources.getString(R.string.felica_terminal_pos); // sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_pos); // sales
case 0xc8:
- return resources.getString(R.string.felica_terminal_vending); // sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_terminal_vending); // sales
default:
return String.format("Console 0x%s", Integer.toHexString(cType));
}
@@ -163,55 +163,55 @@ static String getConsoleTypeName(@NonNull Resources resources, int cType) {
static String getProcessTypeName(@NonNull Resources resources, int proc) {
switch (proc & 0xff) {
case 0x01:
- return resources.getString(R.string.felica_process_fare_exit_gate);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_fare_exit_gate);
case 0x02:
- return resources.getString(R.string.felica_process_charge);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_charge);
case 0x03:
- return resources.getString(R.string.felica_process_purchase_magnetic);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_purchase_magnetic);
case 0x04:
- return resources.getString(R.string.felica_process_fare_adjustment);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_fare_adjustment);
case 0x05:
- return resources.getString(R.string.felica_process_admission_payment);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_admission_payment);
case 0x06:
- return resources.getString(R.string.felica_process_booth_exit);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_booth_exit);
case 0x07:
- return resources.getString(R.string.felica_process_issue_new);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_issue_new);
case 0x08:
- return resources.getString(R.string.felica_process_booth_deduction);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_booth_deduction);
case 0x0d:
- return resources.getString(R.string.felica_process_bus_pitapa); // Bus
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_bus_pitapa); // Bus
case 0x0f:
- return resources.getString(R.string.felica_process_bus_iruca); // Bus
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_bus_iruca); // Bus
case 0x11:
- return resources.getString(R.string.felica_process_reissue);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_reissue);
case 0x13:
- return resources.getString(R.string.felica_process_payment_shinkansen);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_payment_shinkansen);
case 0x14:
- return resources.getString(R.string.felica_process_entry_a_autocharge);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_entry_a_autocharge);
case 0x15:
- return resources.getString(R.string.felica_process_exit_a_autocharge);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_exit_a_autocharge);
case 0x1f:
- return resources.getString(R.string.felica_process_deposit_bus); // Bus
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_deposit_bus); // Bus
case 0x23:
- return resources.getString(R.string.felica_process_purchase_special_ticket); // Bus
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_purchase_special_ticket); // Bus
case 0x46:
- return resources.getString(R.string.felica_process_merchandise_purchase); // Sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_merchandise_purchase); // Sales
case 0x48:
- return resources.getString(R.string.felica_process_bonus_charge);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_bonus_charge);
case 0x49:
- return resources.getString(R.string.felica_process_register_deposit); // Sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_register_deposit); // Sales
case 0x4a:
- return resources.getString(R.string.felica_process_merchandise_cancel); // Sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_merchandise_cancel); // Sales
case 0x4b:
- return resources.getString(R.string.felica_process_merchandise_admission); // Sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_merchandise_admission); // Sales
case 0xc6:
- return resources.getString(R.string.felica_process_merchandise_purchase_cash); // Sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_merchandise_purchase_cash); // Sales
case 0xcb:
- return resources.getString(R.string.felica_process_merchandise_admission_cash); // Sales
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_merchandise_admission_cash); // Sales
case 0x84:
- return resources.getString(R.string.felica_process_payment_thirdparty);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_payment_thirdparty);
case 0x85:
- return resources.getString(R.string.felica_process_admission_thirdparty);
+ return resources.getString(com.codebutler.farebot.card.felica.R.string.felica_process_admission_thirdparty);
default:
return String.format("Process0x%s", Integer.toHexString(proc));
}
diff --git a/farebot-transit/build.gradle b/farebot-transit/build.gradle
index d629609a8..0fc2727cc 100644
--- a/farebot-transit/build.gradle
+++ b/farebot-transit/build.gradle
@@ -14,4 +14,6 @@ dependencies {
annotationProcessor libs.autoValueGson
}
-android { }
+android {
+ namespace "com.codebutler.farebot.transit"
+}
diff --git a/farebot-transit/src/main/AndroidManifest.xml b/farebot-transit/src/main/AndroidManifest.xml
index 3bdfeaa5f..e285ed300 100644
--- a/farebot-transit/src/main/AndroidManifest.xml
+++ b/farebot-transit/src/main/AndroidManifest.xml
@@ -21,5 +21,4 @@
along with this program. If not, see .
-->
-
-
+
diff --git a/gradle.properties b/gradle.properties
index 21cece27c..cdaf81e19 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,11 +7,6 @@ org.gradle.caching=true
org.gradle.configureondemand=false
android.builder.sdkDownload=true
-android.enableBuildCache=true
-android.enableD8.desugaring=true
-
-# Still in preview
-android.enableR8=false
kotlin.incremental.usePreciseJavaTracking=true
android.useAndroidX=true
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ee69dd68d..c8c8f994c 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
+#Wed Aug 21 12:44:52 PDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists