From 624a71112f6ce5538bdf853ff9c9525a97250a81 Mon Sep 17 00:00:00 2001 From: Peter Laggner Date: Fri, 17 Sep 2021 23:40:40 +0200 Subject: [PATCH 01/23] wip after template fork --- .idea/.name | 1 + .idea/compiler.xml | 2 +- .idea/misc.xml | 3 ++- README.md | 5 +++-- .../androidtemplate/MainActivity.kt | 19 +++++++++++++++++++ 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 .idea/.name diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..c682b02 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +android-template \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index fb7f4a8..61a9130 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1c3230b..76b7d8b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,7 @@ - + + diff --git a/README.md b/README.md index ab76cf0..392045a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ -# android-template +# RaCooin -Template for Android Projects. +From **Ra**te and **Coin** # TODO - Add CI Workflow to publish to google play - Add Jetpack Compose once stable +- Design Logo diff --git a/app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt b/app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt index 0e77a67..84b69ed 100644 --- a/app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt +++ b/app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt @@ -4,6 +4,22 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.material.Text +import androidx.lifecycle.lifecycleScope +import io.ktor.client.* +import io.ktor.client.request.* + +//curl -X 'GET' \ +//'https://api.coingecko.com/api/v3/simple/price?ids=ethereum%2Cbitcoin&vs_currencies=eur' \ +//-H 'accept: application/json' + +//{ +// "bitcoin": { +// "eur": 40196 +//}, +// "ethereum": { +// "eur": 2877.36 +//} +//} class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -11,5 +27,8 @@ class MainActivity : ComponentActivity() { setContent { Text("Hello there") } + lifecycleScope.launchWhenResumed { + HttpClient().get("test.com") + } } } From 6bece8f950f810ac79ee910b6e1a68c64c33b9f1 Mon Sep 17 00:00:00 2001 From: Peter Laggner Date: Thu, 23 Sep 2021 23:46:13 +0200 Subject: [PATCH 02/23] increase arrow version --- app/build.gradle.kts | 2 ++ buildSrc/src/main/kotlin/com/greyhairredbear/Dependencies.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 16eacbb..34b7ac9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -53,6 +53,8 @@ dependencies { implementation(Core.STD_LIB) implementation(Core.KOTLINX_COROUTINES) + implementation(Core.ARROW_CORE) + implementation(Server.KTOR_CLIENT_CORE) implementation(Server.KTOR_CLIENT_ANDROID) implementation(Server.KTOR_CLIENT_SERIALIATION) diff --git a/buildSrc/src/main/kotlin/com/greyhairredbear/Dependencies.kt b/buildSrc/src/main/kotlin/com/greyhairredbear/Dependencies.kt index d6e18f5..9ca267c 100644 --- a/buildSrc/src/main/kotlin/com/greyhairredbear/Dependencies.kt +++ b/buildSrc/src/main/kotlin/com/greyhairredbear/Dependencies.kt @@ -13,7 +13,7 @@ object Versions { const val BUILD_TOOLS_VERSION = "7.0.2" const val KOTLIN_COROUTINES_VERSION = "1.5.1" - const val ARROW_VERSION = "0.13.2" + const val ARROW_VERSION = "1.0.0" const val KTOR_VERSION = "1.6.2" const val KOTEST_VERSION = "4.6.2" From de7ef79ec6366a54e5ebcd7a302226a2cf4c0ba5 Mon Sep 17 00:00:00 2001 From: Peter Laggner Date: Fri, 24 Sep 2021 01:10:55 +0200 Subject: [PATCH 03/23] fetch data from coingecko API (TODO: refactor into API client, use cases, etc) --- .idea/codeStyles/Project.xml | 5 +++ .idea/compiler.xml | 2 +- .idea/misc.xml | 2 +- app/build.gradle.kts | 4 +++ app/src/main/AndroidManifest.xml | 3 ++ .../androidtemplate/MainActivity.kt | 34 +++++++++++++++++-- 6 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 7643783..f663132 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,6 +1,11 @@ + + diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 61a9130..fb7f4a8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 76b7d8b..0861a72 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,7 +1,7 @@ - + diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 34b7ac9..31f3e41 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -59,6 +59,10 @@ dependencies { implementation(Server.KTOR_CLIENT_ANDROID) implementation(Server.KTOR_CLIENT_SERIALIATION) + // TODO + implementation("io.ktor:ktor-client-logging:1.6.2") + implementation("ch.qos.logback:logback-classic:1.2.6") + implementation(Compose.COMPOSE_UI) implementation(Compose.COMPOSE_MATERIAL) implementation(Compose.COMPOSE_UI_TOOLING_PREVIEW) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1a7a400..3ade62e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ + + + Date: Fri, 24 Sep 2021 01:16:00 +0200 Subject: [PATCH 04/23] rename project --- .idea/.name | 1 - .../{androidtemplate => racooin}/ExampleInstrumentedTest.kt | 4 ++-- app/src/main/AndroidManifest.xml | 4 ++-- .../{androidtemplate => racooin}/MainActivity.kt | 2 +- app/src/main/res/values-night/themes.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- app/src/main/res/values/themes.xml | 2 +- .../{androidtemplate => racooin}/ExampleKotestTest.kt | 2 +- buildSrc/src/main/kotlin/com/greyhairredbear/AppInfo.kt | 4 ++-- settings.gradle.kts | 2 +- 10 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 .idea/.name rename app/src/androidTest/java/com/greyhairredbear/{androidtemplate => racooin}/ExampleInstrumentedTest.kt (81%) rename app/src/main/java/com/greyhairredbear/{androidtemplate => racooin}/MainActivity.kt (97%) rename app/src/test/java/com/greyhairredbear/{androidtemplate => racooin}/ExampleKotestTest.kt (94%) diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index c682b02..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -android-template \ No newline at end of file diff --git a/app/src/androidTest/java/com/greyhairredbear/androidtemplate/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/greyhairredbear/racooin/ExampleInstrumentedTest.kt similarity index 81% rename from app/src/androidTest/java/com/greyhairredbear/androidtemplate/ExampleInstrumentedTest.kt rename to app/src/androidTest/java/com/greyhairredbear/racooin/ExampleInstrumentedTest.kt index 106cae2..cfd47b1 100644 --- a/app/src/androidTest/java/com/greyhairredbear/androidtemplate/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/com/greyhairredbear/racooin/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.greyhairredbear.androidtemplate +package com.greyhairredbear.racooin import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -19,6 +19,6 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.greyhairredbear.androidtemplate", appContext.packageName) + assertEquals("com.greyhairredbear.racooin", appContext.packageName) } } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3ade62e..c09e0e9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.greyhairredbear.racooin"> @@ -11,7 +11,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.AndroidTemplate" + android:theme="@style/Theme.Racooin" android:fullBackupContent="@xml/backup_descriptor"> diff --git a/app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt b/app/src/main/java/com/greyhairredbear/racooin/MainActivity.kt similarity index 97% rename from app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt rename to app/src/main/java/com/greyhairredbear/racooin/MainActivity.kt index 14ac66c..75262d3 100644 --- a/app/src/main/java/com/greyhairredbear/androidtemplate/MainActivity.kt +++ b/app/src/main/java/com/greyhairredbear/racooin/MainActivity.kt @@ -1,4 +1,4 @@ -package com.greyhairredbear.androidtemplate +package com.greyhairredbear.racooin import android.os.Bundle import androidx.activity.ComponentActivity diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index f9bebc1..c84da4f 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ -