VQMXEYWFTZ4X5CZ2X4IRFFX3MX3HXJIAICDSDR3SSNZJZI4DEFEAC <?xml version="1.0" encoding="utf-8"?><adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"><background android:drawable="@drawable/ic_launcher_background" /><foreground android:drawable="@drawable/ic_launcher_foreground" /><monochrome android:drawable="@drawable/ic_launcher_foreground" /></adaptive-icon>
<?xml version="1.0" encoding="utf-8"?><adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"><background android:drawable="@drawable/ic_launcher_background" /><foreground android:drawable="@drawable/ic_launcher_foreground" /><monochrome android:drawable="@drawable/ic_launcher_foreground" /></adaptive-icon>
<item name="windowSplashScreenBackground">@android:color/black</item><item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
<item name="windowSplashScreenBackground">@color/ic_launcher_background</item><item name="windowSplashScreenAnimatedIcon">@drawable/icon</item>
<?xml version="1.0" encoding="utf-8"?><resources><color name="ic_launcher_background">#A46CE5</color></resources>
<?xml version="1.0" encoding="utf-8"?><adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"><background android:drawable="@color/ic_launcher_background"/><foreground android:drawable="@drawable/ic_launcher_foreground"/><monochrome android:drawable="@drawable/ic_launcher_monochrome"/></adaptive-icon>
<?xml version="1.0" encoding="utf-8"?><adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"><background android:drawable="@color/ic_launcher_background"/><foreground android:drawable="@drawable/ic_launcher_foreground"/><monochrome android:drawable="@drawable/ic_launcher_monochrome"/></adaptive-icon>
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:width="48dp"android:height="48dp"android:gravity="center"><shape android:shape="oval"><solid android:color="#FFFFFF" /></shape></item><itemandroid:width="40dp"android:height="40dp"android:gravity="center"><vectorandroid:width="24dp"android:height="24dp"android:tint="#000000"android:viewportWidth="24"android:viewportHeight="24"><pathandroid:fillColor="#FF000000"android:pathData="M17.6,11.48 L19.44,8.3a0.63,0.63 0,0 0,-1.09 -0.63l-1.88,3.24a11.43,11.43 0,0 0,-8.94 0L5.65,7.67a0.63,0.63 0,0 0,-1.09 0.63L6.4,11.48A10.81,10.81 0,0 0,1 20L23,20A10.81,10.81 0,0 0,17.6 11.48ZM7,17.25A1.25,1.25 0,1 1,8.25 16,1.25 1.25,0 0,1 7,17.25ZM17,17.25A1.25,1.25 0,1 1,18.25 16,1.25 1.25,0 0,1 17,17.25Z" /></vector></item></layer-list>
<?xml version="1.0" encoding="utf-8"?><vector xmlns:android="http://schemas.android.com/apk/res/android"android:width="108dp"android:height="108dp"android:viewportWidth="108"android:viewportHeight="108"><pathandroid:fillColor="#3DDC84"android:pathData="M0,0h108v108h-108z" /><pathandroid:fillColor="#00000000"android:pathData="M9,0L9,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,0L19,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M29,0L29,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M39,0L39,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M49,0L49,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M59,0L59,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M69,0L69,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M79,0L79,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M89,0L89,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M99,0L99,108"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,9L108,9"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,19L108,19"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,29L108,29"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,39L108,39"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,49L108,49"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,59L108,59"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,69L108,69"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,79L108,79"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,89L108,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M0,99L108,99"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,29L89,29"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,39L89,39"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,49L89,49"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,59L89,59"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,69L89,69"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M19,79L89,79"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M29,19L29,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M39,19L39,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M49,19L49,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M59,19L59,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M69,19L69,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /><pathandroid:fillColor="#00000000"android:pathData="M79,19L79,89"android:strokeWidth="0.8"android:strokeColor="#33FFFFFF" /></vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"android:width="640dp"android:height="640dp"android:viewportWidth="640"android:viewportHeight="640"><pathandroid:fillColor="#FF000000"android:pathData="M251,64C242.8,64 236,70.1 235.1,78.2L229.6,128L410.5,128L405,78.2C404,70.1 397.2,64 389,64L251,64zM436.7,74.7L442.7,128.7C481.8,134 512,167.5 512,208L512,432C512,472.5 481.8,506 442.7,511.3L436.7,565.3C434,589.6 413.5,608 389,608L251,608C226.5,608 206,589.6 203.3,565.3L197.3,511.3C158.2,506 128,472.5 128,432L128,208C128,167.5 158.2,134 197.3,128.7L203.3,74.7C206,50.4 226.5,32 251,32L389,32C413.5,32 434,50.4 436.7,74.7zM414,160L208,160C181.5,160 160,181.5 160,208L160,432C160,458.5 181.5,480 208,480L432,480C458.5,480 480,458.5 480,432L480,208C480,181.5 458.5,160 432,160L414,160zM229.5,512L235,561.8C235.9,569.9 242.7,576 250.9,576L389,576C397.2,576 404,569.9 404.9,561.8L410.4,512L229.5,512zM224,288L416,288L416,224L224,224L224,288zM192,216C192,202.7 202.7,192 216,192L424,192C437.3,192 448,202.7 448,216L448,296C448,309.3 437.3,320 424,320L216,320C202.7,320 192,309.3 192,296L192,216zM192,368C192,359.2 199.2,352 208,352L240,352C248.8,352 256,359.2 256,368C256,376.8 248.8,384 240,384L208,384C199.2,384 192,376.8 192,368zM304,352L336,352C344.8,352 352,359.2 352,368C352,376.8 344.8,384 336,384L304,384C295.2,384 288,376.8 288,368C288,359.2 295.2,352 304,352zM384,368C384,359.2 391.2,352 400,352L432,352C440.8,352 448,359.2 448,368C448,376.8 440.8,384 432,384L400,384C391.2,384 384,376.8 384,368zM208,416L240,416C248.8,416 256,423.2 256,432C256,440.8 248.8,448 240,448L208,448C199.2,448 192,440.8 192,432C192,423.2 199.2,416 208,416zM288,432C288,423.2 295.2,416 304,416L336,416C344.8,416 352,423.2 352,432C352,440.8 344.8,448 336,448L304,448C295.2,448 288,440.8 288,432zM400,416L432,416C440.8,416 448,423.2 448,432C448,440.8 440.8,448 432,448L400,448C391.2,448 384,440.8 384,432C384,423.2 391.2,416 400,416z"/></vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"android:width="108dp"android:height="108dp"android:viewportWidth="640"android:viewportHeight="640"><group android:scaleX="0.67346936"android:scaleY="0.67346936"android:translateX="104.4898"android:translateY="104.4898"><pathandroid:fillColor="#FF000000"android:pathData="M251,64C242.8,64 236,70.1 235.1,78.2L229.6,128L410.5,128L405,78.2C404,70.1 397.2,64 389,64L251,64zM436.7,74.7L442.7,128.7C481.8,134 512,167.5 512,208L512,432C512,472.5 481.8,506 442.7,511.3L436.7,565.3C434,589.6 413.5,608 389,608L251,608C226.5,608 206,589.6 203.3,565.3L197.3,511.3C158.2,506 128,472.5 128,432L128,208C128,167.5 158.2,134 197.3,128.7L203.3,74.7C206,50.4 226.5,32 251,32L389,32C413.5,32 434,50.4 436.7,74.7zM414,160L208,160C181.5,160 160,181.5 160,208L160,432C160,458.5 181.5,480 208,480L432,480C458.5,480 480,458.5 480,432L480,208C480,181.5 458.5,160 432,160L414,160zM229.5,512L235,561.8C235.9,569.9 242.7,576 250.9,576L389,576C397.2,576 404,569.9 404.9,561.8L410.4,512L229.5,512zM224,288L416,288L416,224L224,224L224,288zM192,216C192,202.7 202.7,192 216,192L424,192C437.3,192 448,202.7 448,216L448,296C448,309.3 437.3,320 424,320L216,320C202.7,320 192,309.3 192,296L192,216zM192,368C192,359.2 199.2,352 208,352L240,352C248.8,352 256,359.2 256,368C256,376.8 248.8,384 240,384L208,384C199.2,384 192,376.8 192,368zM304,352L336,352C344.8,352 352,359.2 352,368C352,376.8 344.8,384 336,384L304,384C295.2,384 288,376.8 288,368C288,359.2 295.2,352 304,352zM384,368C384,359.2 391.2,352 400,352L432,352C440.8,352 448,359.2 448,368C448,376.8 440.8,384 432,384L400,384C391.2,384 384,376.8 384,368zM208,416L240,416C248.8,416 256,423.2 256,432C256,440.8 248.8,448 240,448L208,448C199.2,448 192,440.8 192,432C192,423.2 199.2,416 208,416zM288,432C288,423.2 295.2,416 304,416L336,416C344.8,416 352,423.2 352,432C352,440.8 344.8,448 336,448L304,448C295.2,448 288,440.8 288,432zM400,416L432,416C440.8,416 448,423.2 448,432C448,440.8 440.8,448 432,448L400,448C391.2,448 384,440.8 384,432C384,423.2 391.2,416 400,416z"/></group></vector>
xmlns:aapt="http://schemas.android.com/aapt"android:width="108dp"android:height="108dp"android:viewportWidth="108"android:viewportHeight="108"><path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"><aapt:attr name="android:fillColor"><gradientandroid:endX="85.84757"android:endY="92.4963"android:startX="42.9492"android:startY="49.59793"android:type="linear"><itemandroid:color="#44000000"android:offset="0.0" /><itemandroid:color="#00000000"android:offset="1.0" /></gradient></aapt:attr></path><pathandroid:fillColor="#FFFFFF"android:fillType="nonZero"android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"android:strokeWidth="1"android:strokeColor="#00000000" />
android:width="108dp"android:height="108dp"android:viewportWidth="640"android:viewportHeight="640"><group android:scaleX="0.67346936"android:scaleY="0.67346936"android:translateX="104.4898"android:translateY="104.4898"><pathandroid:fillColor="#FF000000"android:pathData="M251,64C242.8,64 236,70.1 235.1,78.2L229.6,128L410.5,128L405,78.2C404,70.1 397.2,64 389,64L251,64zM436.7,74.7L442.7,128.7C481.8,134 512,167.5 512,208L512,432C512,472.5 481.8,506 442.7,511.3L436.7,565.3C434,589.6 413.5,608 389,608L251,608C226.5,608 206,589.6 203.3,565.3L197.3,511.3C158.2,506 128,472.5 128,432L128,208C128,167.5 158.2,134 197.3,128.7L203.3,74.7C206,50.4 226.5,32 251,32L389,32C413.5,32 434,50.4 436.7,74.7zM414,160L208,160C181.5,160 160,181.5 160,208L160,432C160,458.5 181.5,480 208,480L432,480C458.5,480 480,458.5 480,432L480,208C480,181.5 458.5,160 432,160L414,160zM229.5,512L235,561.8C235.9,569.9 242.7,576 250.9,576L389,576C397.2,576 404,569.9 404.9,561.8L410.4,512L229.5,512zM224,288L416,288L416,224L224,224L224,288zM192,216C192,202.7 202.7,192 216,192L424,192C437.3,192 448,202.7 448,216L448,296C448,309.3 437.3,320 424,320L216,320C202.7,320 192,309.3 192,296L192,216zM192,368C192,359.2 199.2,352 208,352L240,352C248.8,352 256,359.2 256,368C256,376.8 248.8,384 240,384L208,384C199.2,384 192,376.8 192,368zM304,352L336,352C344.8,352 352,359.2 352,368C352,376.8 344.8,384 336,384L304,384C295.2,384 288,376.8 288,368C288,359.2 295.2,352 304,352zM384,368C384,359.2 391.2,352 400,352L432,352C440.8,352 448,359.2 448,368C448,376.8 440.8,384 432,384L400,384C391.2,384 384,376.8 384,368zM208,416L240,416C248.8,416 256,423.2 256,432C256,440.8 248.8,448 240,448L208,448C199.2,448 192,440.8 192,432C192,423.2 199.2,416 208,416zM288,432C288,423.2 295.2,416 304,416L336,416C344.8,416 352,423.2 352,432C352,440.8 344.8,448 336,448L304,448C295.2,448 288,440.8 288,432zM400,416L432,416C440.8,416 448,423.2 448,432C448,440.8 440.8,448 432,448L400,448C391.2,448 384,440.8 384,432C384,423.2 391.2,416 400,416z"/></group>
package sh.moritz.watchcalculator.presentationimport kotlin.math.roundclass FormulaSolver (val formula: String) {fun Solve(): String {if (formula.isEmpty()) {return 0.toString()}val tokens = formula.replace("×", "*").replace("÷", "/")// Simple tokenizer: split into numbers and operatorsval parts = Regex("(?<=[+\\-*/])|(?=[+\\-*/])").split(tokens).filter { it.isNotEmpty() }// First, handle * and /val stack = mutableListOf<String>()var i = 0while (i < parts.size) {val token = parts[i]when (token) {"*" -> {val prev = stack.removeLast().toDouble()val next = parts[++i].toDouble()stack.add((prev * next).toString())}"/" -> {val prev = stack.removeLast().toDouble()val next = parts[++i].toDouble()stack.add((prev / next).toString())}else -> stack.add(token)}i++}// Then, handle + and -var result = stack[0].toDouble()i = 1while (i < stack.size) {when (stack[i]) {"+" -> result += stack[++i].toDouble()"-" -> result -= stack[++i].toDouble()}i++}return (round(result*100)/100).toString().trimEnd('0').trimEnd('.')}}
Row(modifier = modifier.fillMaxWidth().background(MaterialTheme.colors.background).padding(start = 0.dp, top = 4.dp, end = 0.dp, bottom = 0.dp).align(Alignment.CenterHorizontally),) {Text(text = "asdwersadadf",color = Color.White,textAlign = TextAlign.Center,fontSize = 30.sp,modifier = Modifier.fillMaxWidth(),)}val buttonMod = modifier.padding(2.dp).height(25.dp).width(35.dp)Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = {}, modifier = buttonMod) { Text("+") }Button(onClick = {}, modifier = buttonMod) { Text("-") }Button(onClick = {}, modifier = buttonMod) { Text("×") }Button(onClick = {}, modifier = buttonMod) { Text("÷") }Button(onClick = {}, modifier = buttonMod) { Text("←") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = {}, modifier = buttonMod) { Text("7") }Button(onClick = {}, modifier = buttonMod) { Text("8") }Button(onClick = {}, modifier = buttonMod) { Text("9") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = {}, modifier = buttonMod) { Text("4") }Button(onClick = {}, modifier = buttonMod) { Text("5") }Button(onClick = {}, modifier = buttonMod) { Text("6") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = {}, modifier = buttonMod) { Text("1") }Button(onClick = {}, modifier = buttonMod) { Text("2") }Button(onClick = {}, modifier = buttonMod) { Text("3") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = {}, modifier = buttonMod) { Text("C") }Button(onClick = {}, modifier = buttonMod) { Text("0") }Button(onClick = {}, modifier = buttonMod) { Text("=") }
if (!showResult) {val buttonMod = modifier.padding(2.dp).height(25.dp).width(35.dp)Row(modifier = modifier.fillMaxWidth().background(MaterialTheme.colors.background).padding(start = 60.dp, top = 24.dp, end = 60.dp, bottom = 0.dp).align(Alignment.CenterHorizontally),) {Text(text = formula,color = Color.White,textAlign = TextAlign.Center,fontSize = 30.sp,modifier = Modifier.fillMaxWidth(),softWrap = false)Button(onClick = { formula = formula.dropLast(1) },modifier = buttonMod) { Text("←") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = { formula += "7" }, modifier = buttonMod) { Text("7") }Button(onClick = { formula += "8" }, modifier = buttonMod) { Text("8") }Button(onClick = { formula += "9" }, modifier = buttonMod) { Text("9") }Button(onClick = { formula += "+" }, modifier = buttonMod) { Text("+") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = { formula += "4" }, modifier = buttonMod) { Text("4") }Button(onClick = { formula += "5" }, modifier = buttonMod) { Text("5") }Button(onClick = { formula += "6" }, modifier = buttonMod) { Text("6") }Button(onClick = { formula += "-" }, modifier = buttonMod) { Text("-") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {Button(onClick = { formula += "1" }, modifier = buttonMod) { Text("1") }Button(onClick = { formula += "2" }, modifier = buttonMod) { Text("2") }Button(onClick = { formula += "3" }, modifier = buttonMod) { Text("3") }Button(onClick = { formula += "×" }, modifier = buttonMod) { Text("×") }}Row(modifier = modifier.background(MaterialTheme.colors.background).align(Alignment.CenterHorizontally),) {var timeout by remember { mutableStateOf<Job?>(null) }Button(onClick = { formula = "" }, modifier = buttonMod) { Text("C") }Button(onClick = { formula += "0" }, modifier = buttonMod) { Text("0") }Button(onClick = { showResult = true }, modifier = buttonMod) { Text("=") }Button(onClick = { formula += "÷" }, modifier = buttonMod) { Text("÷") }}} else {Column(verticalArrangement = Arrangement.Center,modifier = Modifier.fillMaxSize().clickable(enabled = true,onClickLabel = "Back to the calculator",onClick = {formula = ""showResult = false}),) {Text(FormulaSolver(formula).Solve(),color = MaterialTheme.colors.primary,textAlign = TextAlign.Center,fontSize = 40.sp,modifier = Modifier.fillMaxWidth(),)}
const val SECOND = 1000L