Skip to content

Commit

Permalink
Small code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai-Cristian Condrea committed Jul 15, 2024
1 parent 9b6c9a7 commit b021f96
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 106 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Version 5.0.0:
- Major : Migrated to same ver
- Reworked the entire project strucutre in jetpack compose for better performance and compatibility
- Reduced the app size
- Now the app is more interactive and resposive
- A new and improved media3 player
- Added a new API and now the app syncronizezs with it, showing new lessons without updating the app.

# Version 4.0_r1:
- Added language support for Hungarian.
- Reworked language system, making it more accurate and user-friendly.
Expand Down
13 changes: 5 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ android {
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
versionNameSuffix = "-release"
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
Expand All @@ -58,7 +57,6 @@ android {
debug {
multiDexEnabled = true
isDebuggable = true
versionNameSuffix = "-debug"
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
Expand Down Expand Up @@ -147,15 +145,14 @@ dependencies {

// Kotlin
implementation(libs.kotlinx.coroutines.android)

implementation("io.ktor:ktor-client-core:2.3.4")
implementation("io.ktor:ktor-client-cio:2.3.4")
implementation("io.ktor:ktor-client-content-negotiation:2.3.4")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.4")
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.cio)
implementation(libs.ktor.client.content.negotiation)
implementation(libs.ktor.serialization.kotlinx.json)

// Other
implementation(libs.lottie.compose)
implementation("io.coil-kt:coil-compose:2.6.0")
implementation(libs.coil.compose)
implementation(libs.glide)

// Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Card
import androidx.compose.material3.CircularProgressIndicator
Expand All @@ -30,6 +31,7 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
Expand Down Expand Up @@ -171,6 +173,7 @@ fun LessonCard(title: String, imageResource: String, onClick: () -> Unit) {
modifier = Modifier
.fillMaxWidth()
.bounceClick()
.clip(RoundedCornerShape(12.dp))
.clickable(onClick = onClick)
.aspectRatio(2.06f / 1f),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import io.ktor.client.engine.cio.CIO
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.client.request.get
import io.ktor.serialization.kotlinx.json.json
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

class LessonRepository {
private val client = HttpClient(CIO) {
Expand All @@ -17,10 +19,10 @@ class LessonRepository {
}
}

suspend fun getLessonData(): List<UiLessonsAsset> {
suspend fun getLessonData(): List<UiLessonsAsset> = withContext(Dispatchers.IO) {
val url =
"https://script.googleusercontent.com/macros/echo?user_content_key=IqfXaaMa5_xVh9PXgCkTSSvJ5oXI2E6ovHb-xZ-9oeDNzYVvgbAQub1KyRTJ8iBLSdRQS9gDeA6vYWII3idMI7fMbNijCwsvm5_BxDlH2jW0nuo2oDemN9CCS2h10ox_1xSncGQajx_ryfhECjZEnJ73NK6pJWSpPRfbuzxijC-yIhItdrlA4B3P1J--f1LjXLtmxSn7AD8ey3pHscewS7Oo7Ec-OFT-mp7LnhIc8L9DWUmcQiBQTNz9Jw9Md8uu&lib=MSUzLTgsn65WMd0y5_jDbxNmCwTyR-I_G"
return try {
"https://script.googleusercontent.com/macros/echo?user_content_key=IqfXaaMa5_xVh9PXgCkTSSvJ5oXI2E6ovHb-xZ-9oeDNzYVvgbAQub1KyRTJ8iBLSdRQS9gDeA6vYWII3idMI7fMbNijCwsvm5_BxDlH2jW0nuo2oDemN9CCS2h10ox_1xSncGQajx_ryfhECjZEnJ73NK6pJWSpPRfbuzxijC-yIhItdrlA4B3P1J--f1LjXLtmxSn7AD8ey3pHscewS7Oo7Ec-OFT-mp7LnhIc8L9DWUmcQiBQTNz9Jw9Md8uu&lib=MSUzLTgsn65WMd0y5_jDbxNmCwTyR-I_G"
return@withContext try {
val response: ApiResponse = client.get(url).body()
response.data.map { networkLesson ->
UiLessonsAsset(
Expand Down
Binary file removed app/src/main/res/drawable-hdpi/im_lesson1.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/im_lesson2.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-ldpi/im_lesson1.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-ldpi/im_lesson2.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/im_lesson1.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/im_lesson2.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/im_lesson1.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/im_lesson2.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/im_lesson1.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/im_lesson2.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxxhdpi/im_lesson1.webp
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxxhdpi/im_lesson2.webp
Binary file not shown.
Binary file removed app/src/main/res/raw/anim_about.lottie
Binary file not shown.
Binary file removed app/src/main/res/raw/anim_feedback.lottie
Binary file not shown.
Binary file removed app/src/main/res/raw/lesson1.ogg
Binary file not shown.
Binary file removed app/src/main/res/raw/lesson2.ogg
Binary file not shown.
25 changes: 0 additions & 25 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
<resources>
<string-array name="currency">
<item>AUD $</item> <!-- Australian Dollar -->
<item>BRL R$</item> <!-- Brazilian Real -->
<item>CAD $</item> <!-- Canadian Dollar -->
<item>CHF</item> <!-- Swiss Franc -->
<item>CNY ¥</item> <!-- Chinese Yuan -->
<item>EUR €</item> <!-- Euro -->
<item>GBP £</item> <!-- British Pound Sterling -->
<item>HKD $</item> <!-- Hong Kong Dollar -->
<item>INR ₹</item> <!-- Indian Rupee -->
<item>JPY ¥</item> <!-- Japanese Yen -->
<item>KRW ₩</item> <!-- South Korean Won -->
<item>MXN $</item> <!-- Mexican Peso -->
<item>NOK kr</item> <!-- Norwegian Krone -->
<item>NZD $</item> <!-- New Zealand Dollar -->
<item>RON</item> <!-- Romanian Leu -->
<item>RUB ₽</item> <!-- Russian Ruble -->
<item>SAR ﷼</item> <!-- Saudi Riyal -->
<item>SEK kr</item> <!-- Swedish Krona -->
<item>SGD $</item> <!-- Singapore Dollar -->
<item>TRY ₺</item> <!-- Turkish Lira -->
<item>USD $</item> <!-- United States Dollar -->
<item>ZAR R</item> <!-- South African Rand -->
</string-array>

<string-array name="preference_language_entries">
<item>@string/bulgarian</item>
<item>@string/english</item>
Expand Down
69 changes: 2 additions & 67 deletions app/src/main/res/values/strings.xml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/src/main/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="openSettings"
android:enabled="true"
android:icon="@mipmap/ic_shortcut_settings"
android:shortcutId="openSettings"
android:shortcutShortLabel="@string/settings">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="com.d4rk.englishwithlidia.plus.ui.settings.SettingsActivity"
android:targetPackage="com.d4rk.englishwithlidia.plus" />
android:targetPackage="com.d4rk.englishwithlidia.plus"
android:targetClass="com.d4rk.englishwithlidia.plus.ui.settings.SettingsActivity"/>
</shortcut>
</shortcuts>
10 changes: 10 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
agp = "8.5.1"
appcompat = "1.7.0"
appUpdateKtx = "2.1.0"
coilCompose = "2.6.0"
composeBom = "2024.06.00"
coreKtx = "1.13.1"
billing = "7.0.0"
datastoreCore = "1.1.1"
glide = "4.16.0"
graphicsShapes = "1.0.0-beta01"
ktorClientContentNegotiation = "2.3.12"
ktorClientCio = "2.3.4"
ktorClientCore = "2.3.12"
ktorSerializationKotlinxJson = "2.3.12"
lifecycle = "2.8.3"
lottieCompose = "4.0.0"
material = "1.12.0"
Expand Down Expand Up @@ -65,6 +70,7 @@ androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref =
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomKtx" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomKtx" }
androidx-ui = { module = "androidx.compose.ui:ui" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coilCompose" }
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesAndroid" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
Expand All @@ -78,6 +84,10 @@ firebase-perf = { module = "com.google.firebase:firebase-perf" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktorClientCio" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktorClientContentNegotiation" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorClientCore" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorSerializationKotlinxJson" }
lottie-compose = { module = "com.airbnb.android:lottie-compose", version.ref = "lottieCompose" }
material = { module = "com.google.android.material:material", version.ref = "material" }
play-services-ads = { module = "com.google.android.gms:play-services-ads", version.ref = "playServicesAds" }
Expand Down

0 comments on commit b021f96

Please sign in to comment.