Skip to content

Commit

Permalink
Update dependencies, update to SDK 35 and delete unnecessary composables
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluchu committed Sep 19, 2024
1 parent 5632477 commit 9dac709
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 338 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ plugins {
}

android {
compileSdk = 34
compileSdk = 35
defaultConfig {
applicationId = "com.jeluchu.composer"
minSdk = 22
targetSdk = 34
targetSdk = 35
versionCode = 1
versionName = "1.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ fun NavGraphBuilder.toolbarsNav(nav: Destinations) {
composable(Feature.CENTER_TOOBARS.nav) {
CenterToolbarActionsPreview()
}

composable(Feature.LARGE_TOOBARS.nav) {
// Soon
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
jchucomponents = "2.0.0-alpha15"
jchucomponents = "2.0.0-alpha17"
agp = "8.5.2"
kotlin = "2.0.0"
dokka = "1.9.20"
androidx-activity = "1.9.1"
androidx-compose = "1.6.8"
androidx-lifecycle = "2.8.4"
androidx-navigation = "2.7.7"
androidx-activity = "1.9.2"
androidx-compose = "1.7.2"
androidx-lifecycle = "2.8.6"
androidx-navigation = "2.8.1"
com-squareup-okhttp3 = "4.12.0"
com-squareup-retrofit2 = "2.11.0"
coil-kt = "2.6.0"
Expand All @@ -23,7 +23,7 @@ androidx-compose-foundation = { module = "androidx.compose.foundation:foundation
androidx-compose-foundation-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidx-compose" }
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "androidx-compose" }
androidx-compose-material-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "androidx-compose" }
androidx-compose-material3 = "androidx.compose.material3:material3:1.2.1"
androidx-compose-material3 = "androidx.compose.material3:material3:1.3.0"
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "androidx-compose" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidx-compose" }
androidx-compose-ui-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-compose" }
Expand Down
4 changes: 2 additions & 2 deletions jchucomponents-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {

android {
namespace = "com.jeluchu.jchucomponents.core"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 34
targetSdk = 35
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
4 changes: 2 additions & 2 deletions jchucomponents-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {

android {
namespace = "com.jeluchu.jchucomponents.ktx"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 34
targetSdk = 35
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ fun Bitmap.scaleBitmap(maxBytes: Long = SIZE_2MB_BYTES.toLong()): Bitmap? {
val newWidthPx = floor(currentWidth * scaleFactor).toInt()
val newHeightPx = floor(currentHeight * scaleFactor).toInt()
return Bitmap.createScaledBitmap(this, newWidthPx, newHeightPx, true)
}
}

internal val Bitmap.safeConfig: Bitmap.Config
get() = config ?: Bitmap.Config.ARGB_8888
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ fun Int?.orEmpty(defaultValue: Int = Int.empty()) = this ?: defaultValue
fun Int.isNotEmpty() = this != Int.empty()
fun Long.bytesToMeg(): String = (this / (1024L * 1024L)).toString()

fun Double.Companion.empty() = 0.0
fun Double?.orEmpty(defaultValue: Double = Double.empty()): Double = this ?: defaultValue

fun Float.Companion.empty() = 0f
fun Float?.orEmpty(defaultValue: Float = Float.empty()): Float = this ?: defaultValue

Expand Down
4 changes: 2 additions & 2 deletions jchucomponents-pay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {

android {
namespace = "com.jeluchu.jchucomponents.pay"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 34
targetSdk = 35
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
4 changes: 2 additions & 2 deletions jchucomponents-prefs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ plugins {

android {
namespace = "com.jeluchu.jchucomponents.prefs"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 34
targetSdk = 35
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
4 changes: 2 additions & 2 deletions jchucomponents-qr/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {

android {
namespace = "com.jeluchu.jchucomponents.qr"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 34
targetSdk = 35
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
4 changes: 2 additions & 2 deletions jchucomponents-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ plugins {

android {
namespace = "com.jeluchu.jchucomponents.ui"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
targetSdk = 34
targetSdk = 35
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private suspend fun Bitmap.blur(
val width = (sentBitmap.width * scale).roundToInt()
val height = (sentBitmap.height * scale).roundToInt()
sentBitmap = Bitmap.createScaledBitmap(sentBitmap, width, height, false)
val bitmap = sentBitmap.copy(sentBitmap.config, true)
val bitmap = sentBitmap.copy(sentBitmap.safeConfig, true)
if (radius < 1) {
return@withContext null
}
Expand Down Expand Up @@ -242,4 +242,7 @@ private suspend fun Bitmap.blur(
bitmap.setPixels(pix, 0, w, 0, 0, w, h)
sentBitmap.recycle()
return@withContext bitmap
}
}

internal val Bitmap.safeConfig: Bitmap.Config
get() = config ?: Bitmap.Config.ARGB_8888
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import com.jeluchu.jchucomponents.ui.extensions.toPainter
import com.jeluchu.jchucomponents.ktx.strings.empty
import com.jeluchu.jchucomponents.ui.R
import com.jeluchu.jchucomponents.ui.extensions.modifier.cornerRadius
import com.jeluchu.jchucomponents.ui.foundation.text.AutoSizeText
import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableStateOf
import com.jeluchu.jchucomponents.ui.themes.cosmicLatte
import com.jeluchu.jchucomponents.ui.themes.darkGreen
Expand Down Expand Up @@ -148,14 +147,13 @@ fun LinearProgressbar(
contentColor = if (enabled) linearProgressCounter.content
else linearProgressCounter.disabledContent
) {
AutoSizeText(
Text(
modifier = Modifier.padding(
vertical = 2.dp,
horizontal = 8.dp
),
text = if (enabled) "${numberTimes.toInt()}/${maxNumber.toInt()}" else "- / -",
style = style,
maxTextSize = 14.sp,
textAlign = TextAlign.Center,
)
}
Expand Down Expand Up @@ -260,22 +258,21 @@ fun LinearProgressbar(
contentColor = if (enabled) linearProgressCounter.content
else linearProgressCounter.disabledContent
) {
AutoSizeText(
Text(
modifier = Modifier.padding(
vertical = 2.dp,
horizontal = 8.dp
),
text = if (enabled) "${numberTimes.toInt()}/${maxNumber.toInt()}" else "- / -",
style = style,
maxTextSize = 14.sp,
textAlign = TextAlign.Center,
)
}
}
}

@Immutable
class LinearProgressCustom constructor(
class LinearProgressCustom(
val disabledIndicator: Color = milky.copy(.2f),
val backgroundIndicator: Color = Color.LightGray.copy(.3f),
val foregroundIndicator: Color = milky,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldColors
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
Expand Down Expand Up @@ -72,8 +73,8 @@ fun CountTextField(
TextField(
modifier = Modifier.fillMaxWidth(),
value = textState,
colors = TextFieldDefaults.textFieldColors(
containerColor = countField.backgroundColor,
colors = TextFieldDefaults.colors(
focusedContainerColor = countField.backgroundColor,
cursorColor = countField.cursorColor,
disabledLabelColor = countField.disabledLabelColor,
focusedIndicatorColor = Color.Transparent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fun Toolbar(
maxLines = 1
)
},
colors = TopAppBarDefaults.smallTopAppBarColors(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = topBarSettings.backgroundColor
),
navigationIcon = {
Expand Down
Loading

0 comments on commit 9dac709

Please sign in to comment.