From 87f1eb390dac4bd3b3dbe28b4cd7595a3d28cb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9luchu?= Date: Sun, 15 Jan 2023 10:53:30 +0100 Subject: [PATCH] Migration TextFields, Dropdown and Progress --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 5 +- .../java/com/jeluchu/composer/MainActivity.kt | 18 +- .../res/drawable/ic_launcher_background.xml | 3 +- .../res/mipmap-anydpi-v26/ic_launcher.xml | 3 +- .../mipmap-anydpi-v26/ic_launcher_round.xml | 3 +- app/src/main/res/values/colors.xml | 3 +- build.gradle | 2 +- gradle/libs.versions.toml | 2 +- gradle/wrapper/gradle-wrapper.properties | 10 +- .../src/main/AndroidManifest.xml | 4 +- .../core/failure/FailureHandle.kt | 1 + .../utils/JsonConverterObjectToString.kt | 2 +- .../utils/location/LocationUtils.kt | 6 +- .../utils/mediaplayer/MediaPlayerHolder.kt | 3 +- .../utils/network/NetworkBoundResource.kt | 2 +- .../utils/network/NetworkUtils.kt | 2 +- .../utils/network/RetrofitClient.kt | 2 +- .../utils/network/interceptors/Interceptor.kt | 4 +- .../utils/validators/Validators.kt | 3 +- .../ui/composables/dropdown/DropdownItem.kt | 168 +++++++++++++++++ .../progress/CircularProgressbar.kt | 4 +- .../progress/LinearProgressbar.kt | 15 +- .../textfields/CountTextField.kt | 66 ++++--- .../textfields/SearchTexField.kt} | 59 +++--- .../migration/dropdown/DropdownItemOption.kt | 79 -------- .../ui/migration/toolbars/CardToolbar.kt | 136 -------------- .../ui/migration/toolbars/SimpleToolbar.kt | 22 ++- .../ui/migration/toolbars/Toolbar.kt | 176 ++++++++++++++++++ .../ui/{migration => }/shapes/DottedShape.kt | 2 +- .../ui/{migration => }/shapes/WavyShape.kt | 2 +- .../src/main/res/drawable/ic_arrow_left.xml | 9 + .../src/main/res/drawable/ic_btn_qrcode.xml | 39 ++++ 33 files changed, 543 insertions(+), 314 deletions(-) create mode 100644 jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/dropdown/DropdownItem.kt rename jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/{migration => composables}/progress/CircularProgressbar.kt (97%) rename jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/{migration => composables}/progress/LinearProgressbar.kt (90%) rename jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/{migration => composables}/textfields/CountTextField.kt (57%) rename jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/{migration/textfields/SearchWithLabelTexField.kt => composables/textfields/SearchTexField.kt} (69%) delete mode 100644 jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/dropdown/DropdownItemOption.kt delete mode 100644 jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/CardToolbar.kt create mode 100644 jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/Toolbar.kt rename jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/{migration => }/shapes/DottedShape.kt (95%) rename jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/{migration => }/shapes/WavyShape.kt (96%) create mode 100644 jchucomponents-ui/src/main/res/drawable/ic_arrow_left.xml create mode 100644 jchucomponents-ui/src/main/res/drawable/ic_btn_qrcode.xml diff --git a/app/build.gradle b/app/build.gradle index 5a8e048e..8e846ceb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,7 +44,7 @@ android { } namespace 'com.jeluchu.composer' - + } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 03bad426..b6671acd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - - + diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/core/failure/FailureHandle.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/core/failure/FailureHandle.kt index fa07d165..8ca7610f 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/core/failure/FailureHandle.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/core/failure/FailureHandle.kt @@ -18,5 +18,6 @@ fun Failure?.handleFailure() = when (this) { is Failure.NetworkConnection -> "Network Connection Failed: $errorMessage" is Failure.ServerError -> "Server Failed (Code: $errorCode): $errorMessage" is Failure.CustomError -> errorMessage + is Failure.LegacyError -> errorMessage else -> "Unknow Error" } \ No newline at end of file diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/JsonConverterObjectToString.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/JsonConverterObjectToString.kt index 3586a986..af46998f 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/JsonConverterObjectToString.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/JsonConverterObjectToString.kt @@ -9,8 +9,8 @@ package com.jeluchu.jchucomponents.utils import com.google.gson.TypeAdapter import com.google.gson.stream.JsonReader import com.google.gson.stream.JsonWriter -import org.json.JSONObject import java.io.IOException +import org.json.JSONObject class JsonConverterObjectToString : TypeAdapter() { diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/location/LocationUtils.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/location/LocationUtils.kt index 7dc6f44d..ab458909 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/location/LocationUtils.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/location/LocationUtils.kt @@ -6,7 +6,11 @@ package com.jeluchu.jchucomponents.utils.location -import kotlin.math.* +import kotlin.math.atan2 +import kotlin.math.cos +import kotlin.math.pow +import kotlin.math.sin +import kotlin.math.sqrt /** * Calculate distance between two points in latitude and longitude taking diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/mediaplayer/MediaPlayerHolder.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/mediaplayer/MediaPlayerHolder.kt index 31542e44..ba001d9c 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/mediaplayer/MediaPlayerHolder.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/mediaplayer/MediaPlayerHolder.kt @@ -63,7 +63,8 @@ class MediaPlayerHolder(context: Context) : PlayerAdapter { } else 0F override val currentTime: String - get() = if (mMediaPlayer != null) mMediaPlayer?.currentPosition?.milliSecondsToTimer().orEmpty() + get() = if (mMediaPlayer != null) mMediaPlayer?.currentPosition?.milliSecondsToTimer() + .orEmpty() else "" override val totalTime: String diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkBoundResource.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkBoundResource.kt index 124d1cf4..44658c42 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkBoundResource.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkBoundResource.kt @@ -8,12 +8,12 @@ package com.jeluchu.jchucomponents.utils.network import com.jeluchu.jchucomponents.core.exception.Failure import com.jeluchu.jchucomponents.utils.network.models.Resource +import java.io.IOException import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.emitAll import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.map import retrofit2.HttpException -import java.io.IOException inline fun networkBoundResource( crossinline query: () -> Flow, diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkUtils.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkUtils.kt index 8f302883..1aa5797c 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkUtils.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/NetworkUtils.kt @@ -7,9 +7,9 @@ package com.jeluchu.jchucomponents.utils.network import com.jeluchu.jchucomponents.utils.network.NetworkUtils.saveResponseBodyToFile -import okhttp3.ResponseBody import java.io.File import java.io.FileOutputStream +import okhttp3.ResponseBody /** * diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/RetrofitClient.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/RetrofitClient.kt index f16099db..2964aa66 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/RetrofitClient.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/RetrofitClient.kt @@ -9,12 +9,12 @@ package com.jeluchu.jchucomponents.utils.network import android.content.Context import com.jeluchu.jchucomponents.utils.network.interceptors.DebugInterceptor import com.jeluchu.jchucomponents.utils.network.interceptors.Interceptor +import java.util.concurrent.TimeUnit import okhttp3.ConnectionPool import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Converter import retrofit2.Retrofit -import java.util.concurrent.TimeUnit object RetrofitClient { diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/interceptors/Interceptor.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/interceptors/Interceptor.kt index 6f4a676a..31fbb8e1 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/interceptors/Interceptor.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/network/interceptors/Interceptor.kt @@ -7,10 +7,10 @@ package com.jeluchu.jchucomponents.utils.network.interceptors import android.os.Build -import okhttp3.Interceptor -import okhttp3.Response import java.text.Normalizer import java.util.* +import okhttp3.Interceptor +import okhttp3.Response class Interceptor( private val interceptorHeaders: InterceptorHeaders diff --git a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/validators/Validators.kt b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/validators/Validators.kt index 9f50d659..b8b58ffc 100644 --- a/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/validators/Validators.kt +++ b/jchucomponents-core/src/main/java/com/jeluchu/jchucomponents/utils/validators/Validators.kt @@ -54,5 +54,6 @@ object Validators { fun String.isLocal() = !isEmptyString() && (startsWith("http://") || startsWith("https://")) - fun CharSequence.isEmptyString(): Boolean = this.isEmpty() || this.toString().equals("null", true) + fun CharSequence.isEmptyString(): Boolean = + this.isEmpty() || this.toString().equals("null", true) } \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/dropdown/DropdownItem.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/dropdown/DropdownItem.kt new file mode 100644 index 00000000..a42f0acc --- /dev/null +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/dropdown/DropdownItem.kt @@ -0,0 +1,168 @@ +/* + * + * Copyright 2022 Jeluchu + * + */ + +package com.jeluchu.jchucomponents.ui.composables.dropdown + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.sizeIn +import androidx.compose.material.ContentAlpha +import androidx.compose.material.LocalContentAlpha +import androidx.compose.material3.Icon +import androidx.compose.material3.LocalTextStyle +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.MenuDefaults +import androidx.compose.material3.ProvideTextStyle +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.TextLayoutResult +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextDecoration +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.dp +import com.jeluchu.jchucomponents.ktx.strings.empty +import com.jeluchu.jchucomponents.ui.R + +@Composable +fun DropdownItem( + onClick: () -> Unit, + modifier: Modifier = Modifier, + enabled: Boolean = true, + contentPadding: PaddingValues = MenuDefaults.DropdownMenuItemContentPadding, + interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, + content: @Composable RowScope.() -> Unit +) { + DropdownMenuItemContent( + onClick = onClick, + modifier = modifier, + enabled = enabled, + contentPadding = contentPadding, + interactionSource = interactionSource, + content = content + ) +} + +@Composable +fun DropdownItemOption( + title: String, + dropdownItemIcon: DropdownItemIcon = DropdownItemIcon(), + dropdownItemText: DropdownItemText = DropdownItemText(), + style: TextStyle = LocalTextStyle.current +) { + with(dropdownItemIcon) { + Icon( + modifier = modifier, + imageVector = ImageVector.vectorResource(id = icon), + tint = tint, + contentDescription = String.empty() + ) + } + + with(dropdownItemText) { + Text( + text = title, + textAlign = textAlign, + modifier = modifier.padding(start = 15.dp), + color = color, + fontSize = fontSize, + fontStyle = fontStyle, + fontWeight = fontWeight, + fontFamily = fontFamily, + letterSpacing = letterSpacing, + textDecoration = textDecoration, + lineHeight = lineHeight, + overflow = overflow, + softWrap = softWrap, + maxLines = maxLines, + onTextLayout = onTextLayout, + style = style + ) + } +} + +@Immutable +class DropdownItemIcon constructor( + val modifier: Modifier = Modifier, + @DrawableRes val icon: Int = R.drawable.ic_btn_share, + val tint: Color = Color.DarkGray +) + +@Immutable +class DropdownItemText constructor( + val modifier: Modifier = Modifier, + val color: Color = Color.Unspecified, + val fontSize: TextUnit = TextUnit.Unspecified, + val fontStyle: FontStyle? = null, + val fontWeight: FontWeight? = null, + val fontFamily: FontFamily? = null, + val letterSpacing: TextUnit = TextUnit.Unspecified, + val textDecoration: TextDecoration? = null, + val textAlign: TextAlign? = null, + val maxLines: Int = Int.MAX_VALUE, + val lineHeight: TextUnit = TextUnit.Unspecified, + val overflow: TextOverflow = TextOverflow.Clip, + val softWrap: Boolean = true, + val onTextLayout: (TextLayoutResult) -> Unit = {} +) + +private val DropdownMenuItemDefaultMinWidth = 112.dp +private val DropdownMenuItemDefaultMaxWidth = 280.dp +private val DropdownMenuItemDefaultMinHeight = 48.dp + +@Composable +internal fun DropdownMenuItemContent( + onClick: () -> Unit, + modifier: Modifier = Modifier, + enabled: Boolean = true, + contentPadding: PaddingValues = MenuDefaults.DropdownMenuItemContentPadding, + interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, + content: @Composable RowScope.() -> Unit +) { + Row( + modifier = modifier + .clickable( + enabled = enabled, + onClick = onClick, + interactionSource = interactionSource, + indication = null + ) + .fillMaxWidth() + .sizeIn( + minWidth = DropdownMenuItemDefaultMinWidth, + maxWidth = DropdownMenuItemDefaultMaxWidth, + minHeight = DropdownMenuItemDefaultMinHeight + ) + .padding(contentPadding), + verticalAlignment = Alignment.CenterVertically + ) { + val typography = MaterialTheme.typography + ProvideTextStyle(typography.titleMedium) { + val contentAlpha = if (enabled) ContentAlpha.high else ContentAlpha.disabled + CompositionLocalProvider(LocalContentAlpha provides contentAlpha) { + content() + } + } + } +} \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/progress/CircularProgressbar.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/progress/CircularProgressbar.kt similarity index 97% rename from jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/progress/CircularProgressbar.kt rename to jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/progress/CircularProgressbar.kt index c5001b5e..66292974 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/progress/CircularProgressbar.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/progress/CircularProgressbar.kt @@ -4,7 +4,7 @@ * */ -package com.jeluchu.jchucomponents.ui.migration.progress +package com.jeluchu.jchucomponents.ui.composables.progress import androidx.annotation.DrawableRes import androidx.compose.animation.core.animateFloatAsState @@ -14,7 +14,7 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material.Icon +import androidx.compose.material3.Icon import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/progress/LinearProgressbar.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt similarity index 90% rename from jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/progress/LinearProgressbar.kt rename to jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt index 6db64b5a..01d19e0a 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/progress/LinearProgressbar.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt @@ -4,16 +4,21 @@ * */ -package com.jeluchu.jchucomponents.ui.migration.progress +package com.jeluchu.jchucomponents.ui.composables.progress import androidx.annotation.DrawableRes import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.tween import androidx.compose.foundation.Canvas import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.* -import androidx.compose.material.Icon -import androidx.compose.material.LocalTextStyle +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Icon +import androidx.compose.material3.LocalTextStyle import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -140,6 +145,6 @@ fun LinearProgressbar( @Composable fun LinearProgressbarPreview() { LinearProgressbar( - icon = R.drawable.ic_up_arrow + icon = R.drawable.ic_btn_share ) } \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/textfields/CountTextField.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/textfields/CountTextField.kt similarity index 57% rename from jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/textfields/CountTextField.kt rename to jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/textfields/CountTextField.kt index bab951c9..09e337a2 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/textfields/CountTextField.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/textfields/CountTextField.kt @@ -4,23 +4,33 @@ * */ -package com.jeluchu.jchucomponents.ui.migration.textfields +package com.jeluchu.jchucomponents.ui.composables.textfields import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.TextField -import androidx.compose.material.* import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Close -import androidx.compose.runtime.* +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.LocalTextStyle +import androidx.compose.material3.Text +import androidx.compose.material3.TextField +import androidx.compose.material3.TextFieldDefaults +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.jeluchu.jchucomponents.ktx.strings.empty +import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableStateOf /** * @@ -33,23 +43,21 @@ import com.jeluchu.jchucomponents.ktx.strings.empty * * @param title title to be displayed at the top of the EditText / TextField * @param maxLength maximum number of characters the user can type - * @param backgroundColor the lambda to be invoked when this icon is pressed - * @param disabledLabelColor color to be displayed when Edit Text / Text Field is disabled - * @param counterTextColor color of the counter (text) that appears below the Edit Text / Text Field + * @param countField from here you can customise the text and TextField colours + * @param styleLabel customise the style of the text * */ +@OptIn(ExperimentalMaterial3Api::class) @Composable fun CountTextField( title: String, maxLength: Int, - backgroundColor: Color, - disabledLabelColor: Color, - counterTextColor: Color -) { + countField: CountField = CountField(), + styleLabel: TextStyle = LocalTextStyle.current +) = Column { - Column { - var textState by remember { mutableStateOf(String.empty()) } + var textState by rememberMutableStateOf(String.empty()) Text( text = title, @@ -57,16 +65,17 @@ fun CountTextField( .fillMaxWidth() .padding(bottom = 4.dp), textAlign = TextAlign.Start, - color = counterTextColor + color = countField.counterTextColor, + style = styleLabel ) TextField( modifier = Modifier.fillMaxWidth(), value = textState, colors = TextFieldDefaults.textFieldColors( - backgroundColor = backgroundColor, - cursorColor = Color.Black, - disabledLabelColor = disabledLabelColor, + containerColor = countField.backgroundColor, + cursorColor = countField.cursorColor, + disabledLabelColor = countField.disabledLabelColor, focusedIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent ), @@ -75,6 +84,7 @@ fun CountTextField( }, shape = RoundedCornerShape(8.dp), singleLine = true, + textStyle = styleLabel, trailingIcon = { if (textState.isNotEmpty()) { IconButton(onClick = { textState = "" }) { @@ -92,23 +102,29 @@ fun CountTextField( .fillMaxWidth() .padding(top = 4.dp), textAlign = TextAlign.End, - color = counterTextColor + color = countField.counterTextColor, + style = styleLabel ) } -} - +@Immutable +class CountField constructor( + val cursorColor: Color = Color.DarkGray, + val counterTextColor: Color = Color.DarkGray, + val disabledLabelColor: Color = Color.DarkGray, + val backgroundColor: Color = Color.White +) @Preview @Composable fun CountTextFieldPreview() { - CountTextField( title = "Name", maxLength = 110, - backgroundColor = Color(0xffd8e6ff), - disabledLabelColor = Color(0xffd8e6ff), - counterTextColor = Color(0xff76a9ff) + countField = CountField( + backgroundColor = Color(0xffd8e6ff), + disabledLabelColor = Color(0xffd8e6ff), + counterTextColor = Color(0xff76a9ff) + ) ) - } \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/textfields/SearchWithLabelTexField.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/textfields/SearchTexField.kt similarity index 69% rename from jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/textfields/SearchWithLabelTexField.kt rename to jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/textfields/SearchTexField.kt index 76f34a96..bc74a0b1 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/textfields/SearchWithLabelTexField.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/composables/textfields/SearchTexField.kt @@ -4,26 +4,27 @@ * */ -package com.jeluchu.jchucomponents.ui.migration.textfields +package com.jeluchu.jchucomponents.ui.composables.textfields import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions -import androidx.compose.material.Icon -import androidx.compose.material.IconButton -import androidx.compose.material.LocalTextStyle -import androidx.compose.material.Text -import androidx.compose.material.TextField -import androidx.compose.material.TextFieldDefaults import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Search +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.LocalTextStyle +import androidx.compose.material3.Text +import androidx.compose.material3.TextField +import androidx.compose.material3.TextFieldDefaults import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -41,27 +42,25 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.jeluchu.jchucomponents.ktx.strings.empty +@OptIn(ExperimentalMaterial3Api::class) @Composable -fun SearchView( +fun SearchTextField( modifier: Modifier = Modifier, state: MutableState, labelText: String = String.empty(), styleLabel: TextStyle = LocalTextStyle.current, focusManager: FocusManager = LocalFocusManager.current, - colorLabelText: Color = Color.DarkGray, - cornerRadious: Dp = 15.dp, - bgContent: Color = Color.DarkGray, - bgCard: Color = Color.White + searchField: SearchField = SearchField(), ) = TextField( modifier = modifier - .clip(RoundedCornerShape(cornerRadious)) - .background(bgCard) - .fillMaxWidth(), + .fillMaxWidth() + .clip(RoundedCornerShape(searchField.cornerRadious)) + .background(searchField.backgroundColor), label = { Text( text = labelText, style = styleLabel, - color = colorLabelText + color = searchField.labelColor ) }, value = state.value, @@ -72,19 +71,19 @@ fun SearchView( onValueChange = { value -> state.value = value }, colors = TextFieldDefaults.textFieldColors( - textColor = bgContent, + textColor = searchField.contentColor, disabledTextColor = Color.Transparent, - backgroundColor = bgCard, + containerColor = searchField.backgroundColor, focusedIndicatorColor = Color.Transparent, errorIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent, disabledIndicatorColor = Color.Transparent, - cursorColor = bgContent + cursorColor = searchField.contentColor ), leadingIcon = { Icon( Icons.Default.Search, - tint = bgContent, + tint = searchField.contentColor, contentDescription = "", modifier = Modifier .padding(15.dp) @@ -98,9 +97,9 @@ fun SearchView( }, ) { Icon( - Icons.Filled.Close, - tint = bgContent, - contentDescription = "", + imageVector = Icons.Filled.Close, + tint = searchField.contentColor, + contentDescription = String.empty(), modifier = Modifier .padding(15.dp) .size(24.dp) @@ -118,9 +117,17 @@ fun SearchView( ) ) -@Preview(showBackground = true) +@Immutable +class SearchField constructor( + val labelColor: Color = Color.DarkGray, + val cornerRadious: Dp = 15.dp, + val contentColor: Color = Color.DarkGray, + val backgroundColor: Color = Color.White +) + +@Preview @Composable fun SearchViewPreview() { val textState = remember { mutableStateOf(String.empty()) } - SearchView(state = textState) + SearchTextField(state = textState) } \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/dropdown/DropdownItemOption.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/dropdown/DropdownItemOption.kt deleted file mode 100644 index 6f939f9a..00000000 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/dropdown/DropdownItemOption.kt +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Copyright 2022 Jeluchu - * - */ - -package com.jeluchu.jchucomponents.ui.migration.dropdown - -import androidx.compose.foundation.layout.padding -import androidx.compose.material.Icon -import androidx.compose.material.LocalTextStyle -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.res.vectorResource -import androidx.compose.ui.text.TextLayoutResult -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.text.style.TextDecoration -import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.unit.TextUnit -import androidx.compose.ui.unit.dp -import com.jeluchu.jchucomponents.ktx.strings.empty - -@Composable -fun DropdownItemOption( - iconModifier: Modifier = Modifier, - icon: Int, - iconTint: Color = Color.DarkGray, - title: String, - textModifier: Modifier = Modifier, - color: Color = Color.Unspecified, - fontSize: TextUnit = TextUnit.Unspecified, - fontStyle: FontStyle? = null, - fontWeight: FontWeight? = null, - fontFamily: FontFamily? = null, - letterSpacing: TextUnit = TextUnit.Unspecified, - textDecoration: TextDecoration? = null, - textAlign: TextAlign? = null, - maxLines: Int = Int.MAX_VALUE, - lineHeight: TextUnit = TextUnit.Unspecified, - overflow: TextOverflow = TextOverflow.Clip, - softWrap: Boolean = true, - onTextLayout: (TextLayoutResult) -> Unit = {}, - style: TextStyle = LocalTextStyle.current, -) { - - Icon( - modifier = iconModifier, - imageVector = ImageVector.vectorResource(id = icon), - tint = iconTint, - contentDescription = String.empty() - ) - - Text( - text = title, - textAlign = textAlign, - modifier = textModifier.padding(start = 15.dp), - color = color, - fontSize = fontSize, - fontStyle = fontStyle, - fontWeight = fontWeight, - fontFamily = fontFamily, - letterSpacing = letterSpacing, - textDecoration = textDecoration, - lineHeight = lineHeight, - overflow = overflow, - softWrap = softWrap, - maxLines = maxLines, - onTextLayout = onTextLayout, - style = style - ) - -} \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/CardToolbar.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/CardToolbar.kt deleted file mode 100644 index 1d552a15..00000000 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/CardToolbar.kt +++ /dev/null @@ -1,136 +0,0 @@ -/* - * - * Copyright 2022 Jeluchu - * - */ - -package com.jeluchu.jchucomponents.ui.migration.toolbars - -import androidx.compose.foundation.background -import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource -import androidx.compose.foundation.layout.* -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Icon -import androidx.compose.material.IconButton -import androidx.compose.material.Surface -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp -import androidx.constraintlayout.compose.ConstraintLayout - -@Composable -fun TopBar( - modifier: Modifier, - titleBar: String, - colorBar: Color, - iconAction: Int = 0, - leftIcon: Int, - navigateToCustomAction: () -> Unit = {}, - navigateToBackScreen: () -> Unit, -) { - - val interactionSource = remember { MutableInteractionSource() } - - Surface( - modifier = modifier, - color = colorBar - ) { - - Row( - modifier = Modifier.fillMaxWidth() - ) { - - ConstraintLayout( - modifier = Modifier.height(52.dp) - ) { - - val (box, title) = createRefs() - - Box( - modifier = Modifier - .clip( - RoundedCornerShape( - topStart = 0.dp, - bottomStart = 0.dp, - topEnd = 6.dp, - bottomEnd = 6.dp - ) - ) - .background(Color.White) - .constrainAs(box) { - start.linkTo(parent.start, margin = 0.dp) - top.linkTo(parent.top, margin = 5.dp) - bottom.linkTo(parent.bottom, margin = 5.dp) - } - ) { - - Row { - - IconButton( - modifier = Modifier.then(Modifier.size(40.dp)), - onClick = {}, - ) { - Icon( - modifier = Modifier.clickable( - indication = null, - interactionSource = remember { interactionSource }, - onClick = { navigateToBackScreen() } - ), - painter = painterResource(id = leftIcon), - contentDescription = null - ) - } - - if (iconAction != 0) { - - IconButton( - modifier = Modifier.then(Modifier.size(40.dp)), - onClick = {}, - ) { - Icon( - modifier = Modifier - .padding(5.dp) - .clickable( - indication = null, - interactionSource = remember { interactionSource }, - onClick = { navigateToCustomAction() } - ), - painter = painterResource(id = iconAction), - contentDescription = null - ) - } - - } - - } - - } - - Spacer(modifier = Modifier.fillMaxWidth()) - - Text( - titleBar, - fontWeight = FontWeight.Bold, - fontSize = 24.sp, - color = Color.White, - modifier = Modifier.constrainAs(title) { - end.linkTo(parent.end, margin = 12.dp) - top.linkTo(parent.top, margin = 0.dp) - bottom.linkTo(parent.bottom, margin = 0.dp) - }) - - } - - } - - } - -} \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/SimpleToolbar.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/SimpleToolbar.kt index d26e0f02..01e63daa 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/SimpleToolbar.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/SimpleToolbar.kt @@ -7,7 +7,12 @@ package com.jeluchu.jchucomponents.ui.migration.toolbars import androidx.compose.foundation.layout.padding -import androidx.compose.material.* +import androidx.compose.material.Icon +import androidx.compose.material.IconButton +import androidx.compose.material.Text +import androidx.compose.material3.LocalTextStyle +import androidx.compose.material3.MaterialTheme +import androidx.compose.material.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -15,10 +20,13 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.jeluchu.jchucomponents.ktx.strings.empty +import com.jeluchu.jchucomponents.ui.R import com.jeluchu.jchucomponents.ui.foundation.text.MarqueeText +import com.jeluchu.jchucomponents.ui.themes.artichoke @Composable fun SimpleToolbar( @@ -65,4 +73,16 @@ fun SimpleToolbar( } } ) +} + +@Preview +@Composable +fun ToolbarSPreview() { + SimpleToolbar( + title = "titleBar", + backgroundColor = artichoke, + leftIcon = R.drawable.ic_arrow_left, + style = MaterialTheme.typography.titleLarge, + navigateAction = { } + ) } \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/Toolbar.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/Toolbar.kt new file mode 100644 index 00000000..f14069ff --- /dev/null +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/toolbars/Toolbar.kt @@ -0,0 +1,176 @@ +/* + * + * Copyright 2022 Jeluchu + * + */ + +package com.jeluchu.jchucomponents.ui.migration.toolbars + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.LocalTextStyle +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.jeluchu.jchucomponents.ktx.strings.empty +import com.jeluchu.jchucomponents.ui.R +import com.jeluchu.jchucomponents.ui.extensions.modifier.noRippleClickable + +@Composable +fun Toolbar( + modifier: Modifier = Modifier, + title: String = String.empty(), + shapeActions: Shape = RoundedCornerShape( + topStart = 0.dp, + bottomStart = 0.dp, + topEnd = 6.dp, + bottomEnd = 6.dp + ), + style: TextStyle = LocalTextStyle.current, + topBarSettings: TopBarSettings = TopBarSettings(), + navigateToCustomAction: () -> Unit, + navigateToBackScreen: () -> Unit +) = Box( + modifier = modifier + .fillMaxWidth() + .height(52.dp) + .background(topBarSettings.backgroundColor) +) { + Row( + modifier = Modifier + .clip(shapeActions) + .background(topBarSettings.actionsBackgroundColor) + .align(Alignment.CenterStart) + ) { + Icon( + modifier = Modifier + .size(40.dp) + .padding(8.dp) + .clip(CircleShape) + .clickable(onClick = navigateToBackScreen), + tint = topBarSettings.tintActionsColor, + imageVector = ImageVector.vectorResource(id = R.drawable.ic_arrow_left), + contentDescription = null + ) + Icon( + modifier = Modifier + .size(40.dp) + .padding(8.dp) + .noRippleClickable { navigateToCustomAction() }, + tint = topBarSettings.tintActionsColor, + imageVector = ImageVector.vectorResource(id = topBarSettings.actionIcon), + contentDescription = null + ) + } + + Text( + text = title, + fontSize = 20.sp, + color = topBarSettings.contentColor, + style = style, + textAlign = TextAlign.End, + modifier = Modifier + .fillMaxWidth() + .align(Alignment.CenterEnd) + .padding(end = 10.dp) + ) +} + + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun Toolbar( + modifier: Modifier = Modifier, + title: String = String.empty(), + topBarSettings: TopBarSettings = TopBarSettings(), + style: TextStyle = LocalTextStyle.current, + navigateToBackScreen: () -> Unit +) = TopAppBar( + modifier = modifier, + title = { + Text( + modifier = Modifier + .fillMaxWidth() + .padding(end = 5.dp), + text = title, + fontSize = 20.sp, + color = topBarSettings.contentColor, + style = style, + textAlign = TextAlign.End, + maxLines = 1 + ) + }, + colors = TopAppBarDefaults.smallTopAppBarColors( + containerColor = topBarSettings.backgroundColor + ), + navigationIcon = { + Icon( + modifier = Modifier + .size(40.dp) + .padding(8.dp) + .clip(CircleShape) + .clickable(onClick = navigateToBackScreen), + tint = topBarSettings.contentColor, + imageVector = ImageVector.vectorResource(id = R.drawable.ic_arrow_left), + contentDescription = null + ) + } +) + +@Immutable +class TopBarSettings constructor( + @DrawableRes val actionIcon: Int = R.drawable.ic_btn_qrcode, + val contentColor: Color = Color.DarkGray, + val actionsBackgroundColor: Color = Color.DarkGray, + val tintActionsColor: Color = Color.White, + val backgroundColor: Color = Color.White +) + +@Preview +@Composable +fun ToolbarActionsPreview() { + Toolbar( + modifier = Modifier, + title = "Villagers", + topBarSettings = TopBarSettings( + actionIcon = R.drawable.ic_btn_qrcode + ), + navigateToCustomAction = { }, + navigateToBackScreen = { } + ) +} + +@Preview +@Composable +fun ToolbarPreview() { + Toolbar( + modifier = Modifier, + title = "Villagers", + navigateToBackScreen = { } + ) +} \ No newline at end of file diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/shapes/DottedShape.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/shapes/DottedShape.kt similarity index 95% rename from jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/shapes/DottedShape.kt rename to jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/shapes/DottedShape.kt index 4d9caee0..468fb6ee 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/shapes/DottedShape.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/shapes/DottedShape.kt @@ -4,7 +4,7 @@ * */ -package com.jeluchu.jchucomponents.ui.migration.shapes +package com.jeluchu.jchucomponents.ui.shapes import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Rect diff --git a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/shapes/WavyShape.kt b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/shapes/WavyShape.kt similarity index 96% rename from jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/shapes/WavyShape.kt rename to jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/shapes/WavyShape.kt index eb619ef7..cc21f1d8 100644 --- a/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/migration/shapes/WavyShape.kt +++ b/jchucomponents-ui/src/main/java/com/jeluchu/jchucomponents/ui/shapes/WavyShape.kt @@ -4,7 +4,7 @@ * */ -package com.jeluchu.jchucomponents.ui.migration.shapes +package com.jeluchu.jchucomponents.ui.shapes import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Rect diff --git a/jchucomponents-ui/src/main/res/drawable/ic_arrow_left.xml b/jchucomponents-ui/src/main/res/drawable/ic_arrow_left.xml new file mode 100644 index 00000000..cbeec706 --- /dev/null +++ b/jchucomponents-ui/src/main/res/drawable/ic_arrow_left.xml @@ -0,0 +1,9 @@ + + + diff --git a/jchucomponents-ui/src/main/res/drawable/ic_btn_qrcode.xml b/jchucomponents-ui/src/main/res/drawable/ic_btn_qrcode.xml new file mode 100644 index 00000000..52239b08 --- /dev/null +++ b/jchucomponents-ui/src/main/res/drawable/ic_btn_qrcode.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + +