-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
168 changed files
with
4,511 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/dev/arkbuilders/rate/presentation/ui/CurrIcon.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package dev.arkbuilders.rate.presentation.ui | ||
|
||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.painterResource | ||
import dev.arkbuilders.rate.data.model.CurrencyCode | ||
import dev.arkbuilders.rate.presentation.utils.IconUtils | ||
|
||
@Composable | ||
fun CurrIcon(modifier: Modifier = Modifier, code: CurrencyCode) { | ||
val ctx = LocalContext.current | ||
Icon( | ||
modifier = modifier, | ||
painter = painterResource(id = IconUtils.iconForCurrCode(ctx, code)), | ||
contentDescription = code, | ||
tint = Color.Unspecified | ||
) | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/dev/arkbuilders/rate/presentation/utils/IconUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dev.arkbuilders.rate.presentation.utils | ||
|
||
import android.content.Context | ||
import dev.arkbuilders.rate.R | ||
import dev.arkbuilders.rate.data.model.CurrencyCode | ||
|
||
object IconUtils { | ||
fun iconForCurrCode(ctx: Context, code: CurrencyCode): Int { | ||
var lowercaseCode = code.lowercase() | ||
// try is reserved work, but we have Turkish lira | ||
if (lowercaseCode == "try") { | ||
lowercaseCode = "curr_try" | ||
} | ||
|
||
val drawableID = ctx.resources | ||
.getIdentifier( | ||
lowercaseCode, | ||
"drawable", | ||
ctx.packageName | ||
) | ||
|
||
return if (drawableID > 0) drawableID | ||
else R.drawable.ic_earth | ||
} | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
plugins { | ||
id("com.android.library") | ||
id("org.jetbrains.kotlin.android") | ||
} | ||
|
||
android { | ||
namespace = "dev.arkbuilders.rate.fiaticons" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 26 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation("androidx.core:core-ktx:1.13.1") | ||
implementation("androidx.appcompat:appcompat:1.6.1") | ||
implementation("com.google.android.material:material:1.12.0") | ||
testImplementation("junit:junit:4.13.2") | ||
androidTestImplementation("androidx.test.ext:junit:1.1.5") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
24 changes: 24 additions & 0 deletions
24
fiaticons/src/androidTest/java/dev/arkbuilders/rate/fiaticons/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dev.arkbuilders.rate.fiaticons | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("dev.arkbuilders.rate.fiaticons.test", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h24v24h-24z"/> | ||
<path | ||
android:pathData="M12,24C18.627,24 24,18.627 24,12C24,5.373 18.627,0 12,0C5.373,0 0,5.373 0,12C0,18.627 5.373,24 12,24Z" | ||
android:fillColor="#F0F0F0"/> | ||
<path | ||
android:pathData="M6.783,16.173L7.827,23.253C9.127,23.735 10.533,23.999 12.001,23.999C17.16,23.999 21.559,20.743 23.254,16.173H6.783Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M6.783,7.827L7.827,0.747C9.127,0.264 10.533,0 12.001,0C17.16,0 21.559,3.257 23.254,7.827H6.783Z" | ||
android:fillColor="#6DA544"/> | ||
<path | ||
android:pathData="M0,12C0,17.16 3.257,21.558 7.826,23.254V0.747C3.257,2.442 0,6.841 0,12Z" | ||
android:fillColor="#A2001D"/> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h24v24h-24z"/> | ||
<path | ||
android:pathData="M17.216,1.191C15.639,0.428 13.869,0 11.999,0C10.129,0 8.359,0.428 6.782,1.191L5.738,12L6.782,22.809C8.359,23.572 10.129,24 11.999,24C13.869,24 15.639,23.572 17.216,22.809L18.26,12L17.216,1.191Z" | ||
android:fillColor="#D80027"/> | ||
<path | ||
android:pathData="M6.783,1.191C2.769,3.132 0,7.243 0,12C0,16.758 2.769,20.868 6.783,22.809V1.191Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M17.217,1.191V22.809C21.231,20.868 23.999,16.758 23.999,12C23.999,7.243 21.231,3.132 17.217,1.191Z" | ||
android:fillColor="#496E2D"/> | ||
<path | ||
android:pathData="M12,7.827C9.695,7.827 7.826,9.695 7.826,12.001C7.826,14.306 9.695,16.174 12,16.174C14.305,16.174 16.174,14.306 16.174,12.001C16.174,9.695 14.305,7.827 12,7.827ZM12,14.609C10.559,14.609 9.391,13.441 9.391,12.001C9.391,10.56 10.559,9.392 12,9.392C13.441,9.392 14.609,10.56 14.609,12.001C14.609,13.441 13.441,14.609 12,14.609Z" | ||
android:fillColor="#FFDA44"/> | ||
<path | ||
android:pathData="M12,10.436C11.424,10.436 10.957,10.903 10.957,11.479V13.045H13.044V11.479C13.044,10.903 12.577,10.436 12,10.436Z" | ||
android:fillColor="#FFDA44"/> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h24v24h-24z"/> | ||
<path | ||
android:pathData="M12,24C18.627,24 24,18.627 24,12C24,5.373 18.627,0 12,0C5.373,0 0,5.373 0,12C0,18.627 5.373,24 12,24Z" | ||
android:fillColor="#D80027"/> | ||
<path | ||
android:pathData="M18.782,8.907H14.436C14.704,8.627 14.869,8.246 14.869,7.827C14.869,6.963 14.168,6.262 13.304,6.262C12.759,6.262 12.28,6.54 11.999,6.962C11.719,6.54 11.24,6.262 10.695,6.262C9.831,6.262 9.13,6.963 9.13,7.827C9.13,8.246 9.295,8.627 9.563,8.907H5.217C5.217,10.06 6.221,10.994 7.373,10.994H7.304C7.304,12.147 8.238,13.081 9.391,13.081C9.391,13.455 9.489,13.805 9.661,14.108L7.93,15.839L9.258,17.167L11.142,15.283C11.216,15.31 11.292,15.332 11.371,15.347L10.232,17.917L11.999,19.827L13.766,17.917L12.628,15.346C12.707,15.332 12.783,15.31 12.857,15.283L14.741,17.167L16.069,15.839L14.338,14.108C14.51,13.805 14.608,13.455 14.608,13.081C15.761,13.081 16.695,12.147 16.695,10.994H16.625C17.778,10.994 18.782,10.06 18.782,8.907Z" | ||
android:fillColor="#000000"/> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h24v24h-24z"/> | ||
<path | ||
android:pathData="M12,24C18.627,24 24,18.627 24,12C24,5.373 18.627,0 12,0C5.373,0 0,5.373 0,12C0,18.627 5.373,24 12,24Z" | ||
android:fillColor="#FFDA44"/> | ||
<path | ||
android:pathData="M11.999,24C15.936,24 19.431,22.104 21.619,19.175H2.379C4.567,22.104 8.062,24 11.999,24Z" | ||
android:fillColor="#0052B4"/> | ||
<path | ||
android:pathData="M24,12C24,5.373 18.627,0 12,0C5.373,0 0,5.373 0,12C0,13.419 0.247,14.78 0.699,16.044H23.301C23.753,14.78 24,13.419 24,12Z" | ||
android:fillColor="#0052B4"/> | ||
<path | ||
android:pathData="M8.214,7.696L8.861,9.689H10.957L9.261,10.92L9.909,12.913L8.214,11.682L6.518,12.913L7.166,10.92L5.471,9.689H7.566L8.214,7.696Z" | ||
android:fillColor="#F0F0F0"/> | ||
<path | ||
android:pathData="M4.614,5.609L5.003,6.805H6.26L5.243,7.544L5.632,8.74L4.614,8.001L3.597,8.74L3.986,7.544L2.969,6.805H4.226L4.614,5.609Z" | ||
android:fillColor="#F0F0F0"/> | ||
</group> | ||
</vector> |
Oops, something went wrong.