Skip to content

Commit

Permalink
Merge pull request #52 from HLCaptain/feature-compose
Browse files Browse the repository at this point in the history
v0.1.1-alpha update, dependency upgrade, fixes, UI enhancements
  • Loading branch information
HLCaptain authored Feb 9, 2023
2 parents 3d07687 + 1d3a8c1 commit 31de1f4
Show file tree
Hide file tree
Showing 77 changed files with 2,381 additions and 1,119 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=HLCaptain_jay-android&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=HLCaptain_jay-android)

<p align="center">
<img alt="Jay app's icon" src="assets/JayIcon.png" width="40%"/>
<img alt="Jay app's icon" src="assets/JayIcon.png" width="20%"/>
</p>

In short, Jay is providing data to decide on local problems and in the transportation field. Jay should be easy to use and available to have as much impact as possible.
Expand Down
65 changes: 35 additions & 30 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand All @@ -23,7 +23,7 @@ plugins {
id 'kotlin-kapt'
id 'kotlin-android'
id 'com.google.dagger.hilt.android'
id 'com.google.devtools.ksp' version '1.7.21-1.0.8' // Depends on your kotlin version
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' // Depends on your kotlin version
id 'de.mannodermaus.android-junit5'
id 'kotlin-parcelize'
id 'org.jetbrains.kotlin.plugin.serialization'
Expand All @@ -39,8 +39,8 @@ android {
applicationId "illyan.jay"
minSdk 21
targetSdk 33
versionCode 1
versionName "0.1.0"
versionCode 3
versionName "0.1.1-alpha"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -50,31 +50,32 @@ android {

buildTypes {
debug {
debuggable true
buildConfigField 'String', "MapboxAccessToken", "\"$MAPBOX_ACCESS_TOKEN\""
buildConfigField 'String', "MapboxDownloadsToken", "\"$MAPBOX_DOWNLOADS_TOKEN\""
buildConfigField 'String', "MapboxSdkRegistryToken", "\"$SDK_REGISTRY_TOKEN\""
}
release {
initWith debug
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField 'String', "MapboxAccessToken", "\"$MAPBOX_ACCESS_TOKEN\""
buildConfigField 'String', "MapboxDownloadsToken", "\"$MAPBOX_DOWNLOADS_TOKEN\""
buildConfigField 'String', "MapboxSdkRegistryToken", "\"$SDK_REGISTRY_TOKEN\""
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "1.4.0-alpha02"
kotlinCompilerExtensionVersion "1.4.0"
}
packagingOptions {
resources {
Expand All @@ -101,29 +102,33 @@ android {

dependencies {
// Core
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.7.21'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.0'
implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.collection:collection-ktx:1.2.0" // The Collection extensions contain utility functions for working with Android's memory-efficient collection libraries, including ArrayMap, LongSparseArray, LruCache, and others.
implementation "androidx.appcompat:appcompat:1.5.1"
implementation "androidx.appcompat:appcompat:1.6.0"
implementation 'androidx.activity:activity-ktx:1.6.1'
implementation "com.google.android.material:material:1.7.0"
implementation "com.google.android.material:material:1.8.0"

// Compose
def activity_version = '1.6.1'
def lifecycle_version = '2.5.1'
def activity_version = '1.7.0-alpha04'
def lifecycle_version = '2.6.0-alpha05'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation 'androidx.compose.material3:material3:1.1.0-alpha03'
implementation 'androidx.compose.material3:material3:1.1.0-alpha05'
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.ui:ui-util:$compose_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-compose:$lifecycle_version"
implementation "androidx.activity:activity-compose:$activity_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
implementation "androidx.compose.foundation:foundation:$compose_version"

// Scrollbar
implementation 'com.github.HLCaptain:compose-scrollbar:0.0.3-alpha'

// TODO: implement some way to use bio auth
// Biometric Auth
//implementation "androidx.biometric:biometric:1.2.0-alpha05"
Expand All @@ -136,18 +141,18 @@ dependencies {
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"

// Mapbox
implementation "com.mapbox.maps:android:10.8.0"
implementation "com.mapbox.search:mapbox-search-android-ui:1.0.0-beta.35"
implementation "com.mapbox.navigation:android:2.8.0"
implementation "com.mapbox.maps:android:10.11.0-beta.1"
implementation "com.mapbox.search:mapbox-search-android-ui:1.0.0-beta.44"
implementation "com.mapbox.navigation:android:2.11.0-beta.1"

// Accompanist
def accompanist_version = '0.27.0'
def accompanist_version = '0.29.1-alpha'
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
implementation "com.google.accompanist:accompanist-permissions:$accompanist_version"
implementation "com.google.accompanist:accompanist-placeholder-material:$accompanist_version"

// Hilt
def hilt_version = '2.44.1'
def hilt_version = '2.44.2'
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
Expand All @@ -156,7 +161,7 @@ dependencies {
implementation 'com.jakewharton.timber:timber:5.0.1'

// Navigation
def compose_nav_version = '1.7.30-beta'
def compose_nav_version = '1.8.33-beta'
implementation "io.github.raamcosta.compose-destinations:animations-core:$compose_nav_version"
ksp "io.github.raamcosta.compose-destinations:ksp:$compose_nav_version"

Expand All @@ -169,7 +174,7 @@ dependencies {
implementation "com.squareup.retrofit2:converter-gson:2.9.0"

// Room
def room_version = '2.4.3'
def room_version = '2.5.0'
implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
Expand All @@ -191,8 +196,8 @@ dependencies {
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"

// Google services
implementation 'com.google.android.gms:play-services-location:20.0.0'
implementation 'com.google.android.gms:play-services-auth:20.3.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.android.gms:play-services-auth:20.4.1'
implementation 'com.google.maps.android:android-maps-utils:2.4.0'
implementation 'com.google.maps.android:maps-utils-ktx:3.4.0'

Expand Down Expand Up @@ -221,11 +226,11 @@ dependencies {
androidTestImplementation "io.mockk:mockk-android:$mockk_version"

// Other testing tools
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'

// Espresso
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'androidx.test:runner:1.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'

// Desugaring
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/illyan/jay/data/disk/DataStoreModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/illyan/jay/data/disk/RoomModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/illyan/jay/data/sensor/MapboxModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
15 changes: 6 additions & 9 deletions app/src/main/java/illyan/jay/di/AppModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down Expand Up @@ -27,8 +27,9 @@ import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.auth.ktx.auth
import com.google.firebase.crashlytics.ktx.crashlytics
import com.google.firebase.ktx.Firebase
import com.mapbox.search.MapboxSearchSdk
import com.mapbox.search.SearchEngine
import com.mapbox.search.SearchEngineSettings
import com.mapbox.search.ServiceProvider
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand Down Expand Up @@ -74,19 +75,17 @@ object AppModule {
@Provides
@Singleton
fun provideSearchEngine() =
MapboxSearchSdk.createSearchEngineWithBuiltInDataProviders(
SearchEngine.createSearchEngineWithBuiltInDataProviders(
SearchEngineSettings(accessToken = BuildConfig.MapboxSdkRegistryToken)
)

@Provides
@Singleton
fun provideHistoryDataProvider() =
MapboxSearchSdk.serviceProvider.historyDataProvider()
fun provideHistoryDataProvider() = ServiceProvider.INSTANCE.historyDataProvider()

@Provides
@Singleton
fun provideFavoritesDataProvider() =
MapboxSearchSdk.serviceProvider.favoritesDataProvider()
fun provideFavoritesDataProvider() = ServiceProvider.INSTANCE.favoritesDataProvider()

@Provides
@CoroutineScopeIO
Expand Down Expand Up @@ -115,5 +114,3 @@ object AppModule {
@Singleton
fun provideAnalytics() = Firebase.analytics
}


18 changes: 18 additions & 0 deletions app/src/main/java/illyan/jay/di/CoroutineContextQualifier.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright (c) 2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
* This file is part of Jay.
*
* Jay is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
* Jay is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jay.
* If not, see <https://www.gnu.org/licenses/>.
*/

package illyan.jay.di

import javax.inject.Qualifier
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/illyan/jay/di/CoroutineScopeQualifier.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Balázs Püspök-Kiss (Illyan)
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
Expand Down
52 changes: 52 additions & 0 deletions app/src/main/java/illyan/jay/domain/Mapping.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2023 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
* This file is part of Jay.
*
* Jay is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
* Jay is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jay.
* If not, see <https://www.gnu.org/licenses/>.
*/

package illyan.jay.domain

import com.mapbox.search.record.FavoriteRecord
import com.mapbox.search.record.IndexableRecord
import com.mapbox.search.result.SearchResult
import com.mapbox.search.result.SearchResultType

fun IndexableRecord.toFavoriteRecord() = FavoriteRecord(
address = address,
categories = categories,
coordinate = coordinate,
descriptionText = descriptionText,
id = id,
makiIcon = makiIcon,
metadata = metadata,
name = name,
routablePoints = routablePoints,
type = type
)

fun SearchResult.toFavoriteRecord(
type: SearchResultType = types.firstOrNull() ?: SearchResultType.PLACE
) = FavoriteRecord(
address = address,
categories = categories,
coordinate = coordinate,
descriptionText = descriptionText,
id = id,
makiIcon = makiIcon,
metadata = metadata,
name = name,
routablePoints = routablePoints,
type = type
)
Loading

0 comments on commit 31de1f4

Please sign in to comment.