Skip to content

Commit

Permalink
Merge pull request #3 from Konyaco/cache
Browse files Browse the repository at this point in the history
Release v1.4.2
  • Loading branch information
Konyaco committed Dec 11, 2021
2 parents d847d8e + 69ffd9e commit 1e35ae7
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 9 deletions.
8 changes: 6 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ android {
applicationId = "me.konyaco.collinsdictionary"
minSdk = 21
targetSdk = 31
versionCode = 3
versionCode = 5
versionName = rootProject.version as String
}

buildTypes {
getByName("release") {
isMinifyEnabled = true
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

Expand Down
41 changes: 40 additions & 1 deletion android/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,43 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
# Keep `Companion` object fields of serializable classes.
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
-if @kotlinx.serialization.Serializable class **
-keepclassmembers class <1> {
static <1>$Companion Companion;
}

# Keep `serializer()` on companion objects (both default and named) of serializable classes.
-if @kotlinx.serialization.Serializable class ** {
static **$* *;
}
-keepclassmembers class <1>$<3> {
kotlinx.serialization.KSerializer serializer(...);
}

# Keep `INSTANCE.serializer()` of serializable objects.
-if @kotlinx.serialization.Serializable class ** {
public static ** INSTANCE;
}
-keepclassmembers class <1> {
public static <1> INSTANCE;
kotlinx.serialization.KSerializer serializer(...);
}

# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault

# Serializer for classes with named companion objects are retrieved using `getDeclaredClasses`.
# If you have any, uncomment and replace classes with those containing named companion objects.
#-keepattributes InnerClasses # Needed for `getDeclaredClasses`.
#-if @kotlinx.serialization.Serializable class
#com.example.myapplication.HasNamedCompanion, # <-- List serializable classes with named companions.
#com.example.myapplication.HasNamedCompanion2
#{
# static **$* *;
#}
#-keepnames class <1>$$serializer { # -keepnames suffices; class is kept when serializer() is kept.
# static <1>$$serializer INSTANCE;
#}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ allprojects {
}

group = "me.konyaco.collinsdictionary"
version = "1.4.1"
version = "1.4.2"
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex
import me.konyaco.collinsdictionary.service.ProvideSoundPlayer
import me.konyaco.collinsdictionary.service.Word
import me.konyaco.collinsdictionary.ui.component.CobuildDictionarySection
Expand Down Expand Up @@ -79,13 +80,13 @@ fun App(data: AppViewModel.Result?, isSearching: Boolean, onSearch: (text: Strin
Spacer(Modifier.height(32.dp))
var input by remember { mutableStateOf("") }
SearchBox(
modifier = Modifier.padding(horizontal = padding).fillMaxWidth(),
modifier = Modifier.zIndex(2f).padding(horizontal = padding).fillMaxWidth(),
value = input,
onValueChange = { input = it },
onSearchClick = { onSearch(input) },
isSearching = isSearching
)
Result(Modifier.weight(1f).fillMaxWidth(), data, padding)
Result(Modifier.zIndex(1f).weight(1f).fillMaxWidth(), data, padding)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.konyaco.collinsdictionary.ui.component

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.*
Expand Down Expand Up @@ -31,7 +32,7 @@ fun SearchBox(
isSearching: Boolean,
onSearchClick: () -> Unit
) {
Column(modifier.fillMaxWidth()) {
Box(modifier.fillMaxWidth()) {
Surface(Modifier.fillMaxWidth().wrapContentHeight(), color = myColors.searchBoxBackground) {
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.CenterStart) {
BasicTextField(
Expand Down Expand Up @@ -86,8 +87,8 @@ fun SearchBox(
}
}
}
Box(Modifier.height(4.dp).fillMaxWidth()) {
androidx.compose.animation.AnimatedVisibility(
Box(Modifier.align(Alignment.BottomCenter).offset(y = 4.dp).height(4.dp).fillMaxWidth()) {
AnimatedVisibility(
isSearching,
enter = fadeIn(),
exit = fadeOut()
Expand Down

0 comments on commit 1e35ae7

Please sign in to comment.