Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f0b8637
Init watch app module
hieuwu Dec 19, 2024
85f55d7
Implement quick pair item
hieuwu Dec 21, 2024
604e0e2
Update quick pair class
hieuwu Dec 22, 2024
9566b52
Update composables
hieuwu Dec 22, 2024
21c8768
Tweak UI
hieuwu Dec 22, 2024
f7f7979
Tweak spacing
hieuwu Dec 25, 2024
67d3215
Display empty and quick pairs list
hieuwu Dec 25, 2024
7726f4e
Display empty and quick pairs list
hieuwu Dec 25, 2024
1bbef9a
Create viewmodel with fake data
hieuwu Dec 25, 2024
52a9aaf
Create option item
hieuwu Dec 26, 2024
c63aa8e
Implement add quick pair screen
hieuwu Dec 26, 2024
63fbd61
Create viewmodel
hieuwu Dec 26, 2024
eb9dd00
Implement options screen
hieuwu Dec 28, 2024
e0996f4
Improve list effect
hieuwu Jan 7, 2025
ae36e64
Extract composable and improve imports
hieuwu Jan 7, 2025
0c5a42a
Improve list effect
hieuwu Jan 7, 2025
3f29554
Set up navigation
hieuwu Jan 7, 2025
03e816f
Tweak UI
hieuwu Jan 7, 2025
2531ec5
Create UI
hieuwu Mar 29, 2025
8579c03
Merge branch 'main' into feature/watchapp-quick-pairs
hieuwu Sep 6, 2025
58290f3
Create options screen
hieuwu Sep 6, 2025
eacf309
Add new pair screens
hieuwu Sep 6, 2025
dc5aaaa
Add composables
hieuwu Sep 6, 2025
29bddf6
Refactor so that class be free from di code
hieuwu Sep 6, 2025
c7020b1
Setup hilt for di
hieuwu Sep 6, 2025
9fbff91
Set up di and db
hieuwu Sep 6, 2025
5f6cde7
Set up di and db
hieuwu Sep 6, 2025
6d99793
Clone di graph
hieuwu Sep 6, 2025
e8255bd
Set up hilt
hieuwu Sep 6, 2025
d595fb6
Init data
hieuwu Sep 6, 2025
80b9a52
Set up compose viewmodel
hieuwu Sep 6, 2025
778d74e
Implement search screen
hieuwu Sep 6, 2025
57be820
Fix wrong annotation
hieuwu Sep 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.9.1" apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.ksp)
id("com.google.gms.google-services") version "4.4.2" apply false
id("com.google.firebase.crashlytics") version "3.0.1" apply false
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
id("com.google.dagger.hilt.android") version "2.56.2" apply false
}

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import android.content.Context
import android.webkit.WebSettings
import okhttp3.OkHttpClient
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class OkHttpClientBuilder @Inject constructor(val context: Context) {
fun build(): OkHttpClient {
val agent = WebSettings.getDefaultUserAgent(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import java.time.OffsetDateTime
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class TimestampRepoImpl @Inject constructor(private val dao: TimestampDao) : TimestampRepo {
override suspend fun rememberTimestamp(type: TimestampType) =
dao.insert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import dev.arkbuilders.rate.core.data.network.api.CryptoAPI
import dev.arkbuilders.rate.core.domain.model.CurrencyRate
import dev.arkbuilders.rate.core.domain.model.CurrencyType
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class CryptoCurrencyDataSource @Inject constructor(
private val cryptoAPI: CryptoAPI,
private val cryptoRateResponseMapper: CryptoRateResponseMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class CurrencyInfoDataSource @Inject constructor(
private val ctx: Context,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import kotlinx.coroutines.withContext
import java.time.Duration
import java.time.OffsetDateTime
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class CurrencyRepoImpl @Inject constructor(
private val fiatDataSource: FiatCurrencyDataSource,
private val cryptoDataSource: CryptoCurrencyDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.time.OffsetDateTime
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class FallbackRatesProvider @Inject constructor(
private val ctx: Context,
private val fiatRateResponseMapper: FiatRateResponseMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import dev.arkbuilders.rate.core.data.network.api.FiatAPI
import dev.arkbuilders.rate.core.domain.model.CurrencyRate
import dev.arkbuilders.rate.core.domain.model.CurrencyType
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class FiatCurrencyDataSource @Inject constructor(
private val fiatAPI: FiatAPI,
private val fiatRateResponseMapper: FiatRateResponseMapper,
Expand Down
2 changes: 1 addition & 1 deletion core/db/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
ksp(libs.androidx.room.compiler)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.room.testing)
// androidTestImplementation(libs.androidx.room.testing)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package dev.arkbuilders.rate.core.di.modules
import android.content.Context
import dagger.Module
import dagger.Provides
import dev.arkbuilders.rate.core.data.mapper.CryptoRateResponseMapper
import dev.arkbuilders.rate.core.data.mapper.FiatRateResponseMapper
import dev.arkbuilders.rate.core.data.network.NetworkStatusImpl
import dev.arkbuilders.rate.core.data.preferences.PrefsImpl
import dev.arkbuilders.rate.core.data.repo.AnalyticsManagerImpl
Expand Down Expand Up @@ -35,6 +37,34 @@ import javax.inject.Singleton

@Module
class RepoModule {
@Singleton
@Provides
fun provideFCryptoRateResponseMapper(): CryptoRateResponseMapper {
return CryptoRateResponseMapper()
}

@Singleton
@Provides
fun provideFiatRateResponseMapper(): FiatRateResponseMapper {
return FiatRateResponseMapper()
}

@Singleton
@Provides
fun provideFallbackRatesProvider(
context: Context,
fiatRateResponseMapper: FiatRateResponseMapper,
cryptoRateResponseMapper: CryptoRateResponseMapper,
buildConfigFieldsProvider: BuildConfigFieldsProvider,
): FallbackRatesProvider {
return FallbackRatesProvider(
context,
fiatRateResponseMapper,
cryptoRateResponseMapper,
buildConfigFieldsProvider,
)
}

@Singleton
@Provides
fun currencyRepo(
Expand Down
13 changes: 13 additions & 0 deletions core/presentation/src/main/res/drawable/ic_update.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="21dp"
android:height="20dp"
android:viewportWidth="21"
android:viewportHeight="20">
<path
android:pathData="M12.167,18.333C12.167,18.333 12.874,18.232 15.803,15.303C18.732,12.374 18.732,7.625 15.803,4.696C14.766,3.658 13.499,2.988 12.167,2.686M12.167,18.333H17.167M12.167,18.333L12.167,13.333M8.833,1.666C8.833,1.666 8.126,1.767 5.197,4.696C2.268,7.625 2.268,12.374 5.197,15.303C6.234,16.34 7.501,17.011 8.833,17.313M8.833,1.666L3.833,1.666M8.833,1.666L8.833,6.666"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#384250"
android:strokeLineCap="round"/>
</vector>
2 changes: 2 additions & 0 deletions core/presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
<string name="delete">Delete</string>
<string name="re_use">Re-use</string>
<string name="edit">Edit</string>
<string name="update">Update</string>

<string name="options">Options</string>
<string name="oops_request_time_out">Oops, request time out!</string>
<string name="check_connection_and_refresh">Please check your connection and refresh the page to try again.</string>
Expand Down
20 changes: 18 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[versions]
composeNavigation = "1.3.0"
hilt = "2.56.2"
kotlin = "2.1.20"
agp = "8.1.4"
playServicesWearable = "18.2.0"
coreKtx = "1.15.0"
minSdk = "26"
compileSdk = "35"
ksp = "2.1.20-1.0.32"

androidApp = "8.9.1"
arkAbout = "0.2.0"
activityCompose = "1.10.1"
composeDestinationsVersion = "2.1.0"
Expand Down Expand Up @@ -37,8 +40,13 @@ material = "1.12.0"
gson = "2.11.0"
reorderable = "2.4.3"
playReview = "2.0.2"
composeBom = "2023.08.00"
composeMaterial = "1.2.1"
composeFoundation = "1.2.1"
coreSplashscreen = "1.0.1"

[libraries]
androidx-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "composeNavigation" }
ark-about = { module = "dev.arkbuilders.components:about", version.ref = "arkAbout" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
Expand All @@ -49,7 +57,6 @@ androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtim
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomRuntime" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomRuntime" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomRuntime" }
androidx-room-testing = { module = "androidx.room:room-testing", version.ref = "roomRuntime" }

androidx-ui = { module = "androidx.compose.ui:ui", version.ref = "composeUi" }
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "composeUi" }
Expand All @@ -69,6 +76,8 @@ dagger = { module = "com.google.dagger:dagger", version.ref = "dagger" }
dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }

hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
play-review = { group = "com.google.android.play", name = "review", version.ref = "playReview" }
play-review-ktx = { group = "com.google.android.play", name = "review-ktx", version.ref = "playReview" }

Expand All @@ -90,8 +99,15 @@ androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref =
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
reorderable = { group = "sh.calvin.reorderable", name = "reorderable", version.ref = "reorderable" }
play-services-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version.ref = "playServicesWearable" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-compose-material = { group = "androidx.wear.compose", name = "compose-material", version.ref = "composeMaterial" }
androidx-compose-foundation = { group = "androidx.wear.compose", name = "compose-foundation", version.ref = "composeFoundation" }
androidx-core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "coreSplashscreen" }

[plugins]
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp"}
android-application = { id = "com.android.application", version.ref = "androidApp"}
4 changes: 3 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import java.util.Properties

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
gradlePluginPortal()
maven {
setUrl("https://jitpack.io")
}
Expand Down Expand Up @@ -54,6 +54,8 @@ include(":feature:quickwidget")
include(":feature:search")
include(":feature:settings")
include(":feature:onboarding")
include(":watchapp")


fun getLocalProps(): Properties {
val props = Properties()
Expand Down
1 change: 1 addition & 0 deletions watchapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
89 changes: 89 additions & 0 deletions watchapp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.compose.compiler)
alias(libs.plugins.ksp)
id("com.google.dagger.hilt.android")
}
android {
namespace = "dev.arkbuilders.rate.watchapp"
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
applicationId = "dev.arkbuilders.rate.watchapp"
minSdk = libs.versions.minSdk.get().toInt()
versionCode = 1
versionName = "1.0"
vectorDrawables {
useSupportLibrary = true
}

}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.8"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {
implementation(project(":core:db"))
implementation(project(":core:data"))

implementation(project(":cryptoicons"))
implementation(project(":fiaticons"))
implementation(project(":feature:quick"))
implementation(project(":core:domain"))
implementation(project(":core:presentation"))
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")


implementation(libs.retrofit)
implementation(libs.converter.gson)
implementation(libs.logging.interceptor)

implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
implementation(libs.play.services.wearable)
// implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation (libs.androidx.compose.navigation )// Or the latest version

implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.core.splashscreen)
implementation(libs.material3)
implementation(libs.navigation.compose)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}
8 changes: 8 additions & 0 deletions watchapp/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore the IconLocation for the Tile preview images -->
<issue id="IconLocation">
<ignore path="res/drawable/tile_preview.png" />
<ignore path="res/drawable-round/tile_preview.png" />
</issue>
</lint>
21 changes: 21 additions & 0 deletions watchapp/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Loading
Loading