Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Mar 16, 2024
1 parent e3ea871 commit fbdf1b3
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 53 deletions.
22 changes: 11 additions & 11 deletions composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/Theme.Material.Light.NoActionBar">
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/Theme.Material.Light.NoActionBar">
<activity
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
android:name=".MainActivity">
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Expand Down
36 changes: 18 additions & 18 deletions composeApp/src/androidMain/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="1080"
android:viewportHeight="1080"
android:autoMirrored="true">
<group android:scaleX="0.65"
android:scaleY="0.65"
android:translateX="189"
android:translateY="189">
android:width="108dp"
android:height="108dp"
android:viewportWidth="1080"
android:viewportHeight="1080"
android:autoMirrored="true">
<group android:scaleX="0.65"
android:scaleY="0.65"
android:translateX="189"
android:translateY="189">

<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M653.6,710.4L540,824Q481.1,882.9 398,882.9Q314.9,882.9 256,824Q197.1,765.1 197.1,682Q197.1,598.9 256,540L369.6,426.4L426.4,483.2L312.8,596.8Q277.3,632.3 277.3,682Q277.3,731.7 312.8,767.2Q348.3,802.7 398,802.7Q447.7,802.7 483.2,767.2L596.8,653.6L653.6,710.4ZM454.8,682L398,625.2L625.2,398L682,454.8L454.8,682ZM710.4,653.6L653.6,596.8L767.2,483.2Q802.7,447.7 802.7,398Q802.7,348.3 767.2,312.8Q731.7,277.3 682,277.3Q632.3,277.3 596.8,312.8L483.2,426.4L426.4,369.6L540,256Q598.9,197.1 682,197.1Q765.1,197.1 824,256Q882.9,314.9 882.9,398Q882.9,481.1 824,540L710.4,653.6Z"
android:strokeWidth="0"
android:strokeColor="#FFFFFF"
android:strokeLineCap="butt"
android:strokeLineJoin="miter" />
</group>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M653.6,710.4L540,824Q481.1,882.9 398,882.9Q314.9,882.9 256,824Q197.1,765.1 197.1,682Q197.1,598.9 256,540L369.6,426.4L426.4,483.2L312.8,596.8Q277.3,632.3 277.3,682Q277.3,731.7 312.8,767.2Q348.3,802.7 398,802.7Q447.7,802.7 483.2,767.2L596.8,653.6L653.6,710.4ZM454.8,682L398,625.2L625.2,398L682,454.8L454.8,682ZM710.4,653.6L653.6,596.8L767.2,483.2Q802.7,447.7 802.7,398Q802.7,348.3 767.2,312.8Q731.7,277.3 682,277.3Q632.3,277.3 596.8,312.8L483.2,426.4L426.4,369.6L540,256Q598.9,197.1 682,197.1Q765.1,197.1 824,256Q882.9,314.9 882.9,398Q882.9,481.1 824,540L710.4,653.6Z"
android:strokeWidth="0"
android:strokeColor="#FFFFFF"
android:strokeLineCap="butt"
android:strokeLineJoin="miter"/>
</group>
</vector>
26 changes: 13 additions & 13 deletions composeApp/src/androidMain/res/drawable/link.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:autoMirrored="true"
android:viewportWidth="1080"
android:viewportHeight="1080">
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:autoMirrored="true"
android:viewportWidth="1080"
android:viewportHeight="1080">

<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M653.6,710.4L540,824Q481.1,882.9 398,882.9Q314.9,882.9 256,824Q197.1,765.1 197.1,682Q197.1,598.9 256,540L369.6,426.4L426.4,483.2L312.8,596.8Q277.3,632.3 277.3,682Q277.3,731.7 312.8,767.2Q348.3,802.7 398,802.7Q447.7,802.7 483.2,767.2L596.8,653.6L653.6,710.4ZM454.8,682L398,625.2L625.2,398L682,454.8L454.8,682ZM710.4,653.6L653.6,596.8L767.2,483.2Q802.7,447.7 802.7,398Q802.7,348.3 767.2,312.8Q731.7,277.3 682,277.3Q632.3,277.3 596.8,312.8L483.2,426.4L426.4,369.6L540,256Q598.9,197.1 682,197.1Q765.1,197.1 824,256Q882.9,314.9 882.9,398Q882.9,481.1 824,540L710.4,653.6Z"
android:strokeWidth="0"
android:strokeColor="#FFFFFF"
android:strokeLineCap="butt"
android:strokeLineJoin="miter" />
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M653.6,710.4L540,824Q481.1,882.9 398,882.9Q314.9,882.9 256,824Q197.1,765.1 197.1,682Q197.1,598.9 256,540L369.6,426.4L426.4,483.2L312.8,596.8Q277.3,632.3 277.3,682Q277.3,731.7 312.8,767.2Q348.3,802.7 398,802.7Q447.7,802.7 483.2,767.2L596.8,653.6L653.6,710.4ZM454.8,682L398,625.2L625.2,398L682,454.8L454.8,682ZM710.4,653.6L653.6,596.8L767.2,483.2Q802.7,447.7 802.7,398Q802.7,348.3 767.2,312.8Q731.7,277.3 682,277.3Q632.3,277.3 596.8,312.8L483.2,426.4L426.4,369.6L540,256Q598.9,197.1 682,197.1Q765.1,197.1 824,256Q882.9,314.9 882.9,398Q882.9,481.1 824,540L710.4,653.6Z"
android:strokeWidth="0"
android:strokeColor="#FFFFFF"
android:strokeLineCap="butt"
android:strokeLineJoin="miter"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowDropDown
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
Expand All @@ -29,7 +32,6 @@ import `in`.procyk.compose.calendar.rememberSelectableCalendarState
import `in`.procyk.compose.calendar.year.YearMonth
import `in`.procyk.shin.component.ShinComponent
import `in`.procyk.shin.model.ShortenedProtocol
import toNullable

@Composable
internal fun ShortenRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -24,7 +23,6 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import applyIf

@Composable
internal fun ShortenResponse(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import kotlinx.datetime.*
import kotlinx.datetime.Instant
import kotlinx.datetime.LocalDate
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime

fun Instant.toLocalDate(): LocalDate =
toLocalDateTime(TimeZone.currentSystemDefault()).date
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package `in`.procyk.shin.ui.util

import com.arkivanov.decompose.Cancellation
import com.arkivanov.decompose.value.MutableValue
import com.arkivanov.decompose.value.Value
import com.arkivanov.essenty.lifecycle.Lifecycle
Expand Down
3 changes: 2 additions & 1 deletion composeApp/src/iosMain/kotlin/StateKeeperUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ fun save(coder: NSCoder, state: SerializableContainer) {
@Suppress("unused")
@OptIn(ExperimentalForeignApi::class, BetaInteropApi::class)
fun restore(coder: NSCoder): SerializableContainer? {
val string = coder.decodeTopLevelObjectOfClass(aClass = NSString, forKey = STATE_KEY, error = null) as? String? ?: return null
val string = coder.decodeTopLevelObjectOfClass(aClass = NSString, forKey = STATE_KEY, error = null) as? String?
?: return null
return try {
json.decodeFromString(SerializableContainer.serializer(), string)
} catch (e: Exception) {
Expand Down
5 changes: 2 additions & 3 deletions server/src/main/kotlin/in/procyk/shin/Routes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ import io.github.cdimascio.dotenv.Dotenv
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.server.resources.*
import io.ktor.server.resources.get as getResource
import io.ktor.server.response.*
import io.ktor.server.routing.*
import io.ktor.util.pipeline.*
import kotlinx.coroutines.*
import io.ktor.server.routing.post as postBody
import org.koin.ktor.ext.inject
import kotlin.time.Duration
import kotlin.time.Duration.Companion.hours
import io.ktor.server.resources.get as getResource
import io.ktor.server.routing.post as postBody

@OptIn(DelicateCoroutinesApi::class)
internal fun Application.installRoutes(): Routing = routing {
Expand Down
1 change: 0 additions & 1 deletion server/src/main/kotlin/in/procyk/shin/db/Database.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package `in`.procyk.shin.db

import RedirectType
import `in`.procyk.shin.util.env
import io.github.cdimascio.dotenv.Dotenv
import org.jetbrains.exposed.sql.Database
Expand Down

0 comments on commit fbdf1b3

Please sign in to comment.