mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 07:48:44 +01:00
refactor: move modals to separate module (#322)
This commit is contained in:
parent
dbd9688ca1
commit
5656d771d2
@ -57,6 +57,7 @@ kotlin {
|
||||
implementation(projects.coreNavigation)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreCommonui.lemmyui)
|
||||
implementation(projects.coreCommonui.modals)
|
||||
|
||||
implementation(projects.domainLemmy.data)
|
||||
implementation(projects.domainLemmy.repository)
|
||||
|
61
core-commonui/modals/build.gradle.kts
Normal file
61
core-commonui/modals/build.gradle.kts
Normal file
@ -0,0 +1,61 @@
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.compose)
|
||||
}
|
||||
|
||||
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
|
||||
kotlin {
|
||||
applyDefaultHierarchyTemplate()
|
||||
|
||||
androidTarget {
|
||||
compilations.all {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation(compose.runtime)
|
||||
implementation(compose.foundation)
|
||||
implementation(compose.material)
|
||||
implementation(compose.material3)
|
||||
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
|
||||
implementation(compose.components.resources)
|
||||
implementation(compose.materialIconsExtended)
|
||||
|
||||
implementation(libs.koin.core)
|
||||
implementation(libs.voyager.navigator)
|
||||
implementation(libs.voyager.bottomsheet)
|
||||
|
||||
implementation(projects.coreUtils)
|
||||
implementation(projects.coreAppearance)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreNavigation)
|
||||
implementation(projects.corePersistence)
|
||||
implementation(projects.coreNotifications)
|
||||
implementation(projects.domainLemmy.data)
|
||||
implementation(projects.resources)
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals"
|
||||
compileSdk = libs.versions.android.targetSdk.get().toInt()
|
||||
defaultConfig {
|
||||
minSdk = libs.versions.android.minSdk.get().toInt()
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals
|
||||
|
||||
import android.view.ActionMode
|
||||
import android.view.Menu
|
@ -0,0 +1,18 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals.di
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.platform.TextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals.CustomTextToolbar
|
||||
|
||||
@Composable
|
||||
actual fun getCustomTextToolbar(
|
||||
onShare: () -> Unit,
|
||||
onQuote: () -> Unit,
|
||||
): TextToolbar {
|
||||
return CustomTextToolbar(
|
||||
view = LocalView.current,
|
||||
onShare = onShare,
|
||||
onQuote = onQuote,
|
||||
)
|
||||
}
|
@ -32,7 +32,7 @@ import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.IconSize
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getCustomTextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals.di.getCustomTextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.utils.compose.rememberCallback
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.utils.share.getShareHelper
|
||||
import com.github.diegoberaldin.raccoonforlemmy.resources.MR
|
@ -0,0 +1,10 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals.di
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.TextToolbar
|
||||
|
||||
@Composable
|
||||
expect fun getCustomTextToolbar(
|
||||
onShare: () -> Unit,
|
||||
onQuote: () -> Unit,
|
||||
): TextToolbar
|
@ -0,0 +1,13 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals.di
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalTextToolbar
|
||||
import androidx.compose.ui.platform.TextToolbar
|
||||
|
||||
@Composable
|
||||
actual fun getCustomTextToolbar(
|
||||
onShare: () -> Unit,
|
||||
onQuote: () -> Unit,
|
||||
): TextToolbar {
|
||||
return LocalTextToolbar.current
|
||||
}
|
@ -1,9 +1,5 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.di
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.platform.TextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.CustomTextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.ban.BanUserMviModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.chat.InboxChatMviModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.communityInfo.CommunityInfoMviModel
|
||||
@ -133,18 +129,6 @@ actual fun getSelectCommunityViewModel(): SelectCommunityMviModel {
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
actual fun getCustomTextToolbar(
|
||||
onShare: () -> Unit,
|
||||
onQuote: () -> Unit,
|
||||
): TextToolbar {
|
||||
return CustomTextToolbar(
|
||||
view = LocalView.current,
|
||||
onShare = onShare,
|
||||
onQuote = onQuote,
|
||||
)
|
||||
}
|
||||
|
||||
actual fun getRemoveViewModel(
|
||||
postId: Int?,
|
||||
commentId: Int?,
|
||||
@ -181,4 +165,4 @@ actual fun getBanUserViewModel(
|
||||
)
|
||||
})
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.di
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.TextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.ban.BanUserMviModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.chat.InboxChatMviModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.communityInfo.CommunityInfoMviModel
|
||||
@ -70,12 +68,6 @@ expect fun getCreateReportViewModel(
|
||||
commentId: Int? = null,
|
||||
): CreateReportMviModel
|
||||
|
||||
@Composable
|
||||
expect fun getCustomTextToolbar(
|
||||
onShare: () -> Unit,
|
||||
onQuote: () -> Unit,
|
||||
): TextToolbar
|
||||
|
||||
expect fun getSelectCommunityViewModel(): SelectCommunityMviModel
|
||||
|
||||
expect fun getRemoveViewModel(
|
||||
|
@ -1,8 +1,5 @@
|
||||
package com.github.diegoberaldin.raccoonforlemmy.core.commonui.di
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalTextToolbar
|
||||
import androidx.compose.ui.platform.TextToolbar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.ban.BanUserMviModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.chat.InboxChatMviModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.communityInfo.CommunityInfoMviModel
|
||||
@ -231,11 +228,3 @@ object CommonUiViewModelHelper : KoinComponent {
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
actual fun getCustomTextToolbar(
|
||||
onShare: () -> Unit,
|
||||
onQuote: () -> Unit,
|
||||
): TextToolbar {
|
||||
return LocalTextToolbar.current
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ kotlin {
|
||||
implementation(projects.coreCommonui)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreCommonui.lemmyui)
|
||||
implementation(projects.coreCommonui.modals)
|
||||
implementation(projects.coreNotifications)
|
||||
|
||||
implementation(projects.domainIdentity)
|
||||
|
@ -50,6 +50,7 @@ kotlin {
|
||||
implementation(projects.coreCommonui)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreCommonui.lemmyui)
|
||||
implementation(projects.coreCommonui.modals)
|
||||
implementation(projects.coreUtils)
|
||||
implementation(projects.corePreferences)
|
||||
implementation(projects.corePersistence)
|
||||
|
@ -53,6 +53,7 @@ kotlin {
|
||||
implementation(projects.coreCommonui)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreCommonui.lemmyui)
|
||||
implementation(projects.coreCommonui.modals)
|
||||
implementation(projects.corePreferences)
|
||||
implementation(projects.coreNotifications)
|
||||
implementation(projects.corePersistence)
|
||||
|
@ -52,6 +52,7 @@ kotlin {
|
||||
implementation(projects.coreCommonui)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreCommonui.lemmyui)
|
||||
implementation(projects.coreCommonui.modals)
|
||||
implementation(projects.coreNotifications)
|
||||
|
||||
implementation(projects.domainIdentity)
|
||||
|
@ -51,6 +51,7 @@ kotlin {
|
||||
implementation(projects.coreCommonui)
|
||||
implementation(projects.coreCommonui.components)
|
||||
implementation(projects.coreCommonui.lemmyui)
|
||||
implementation(projects.coreCommonui.modals)
|
||||
implementation(projects.coreNotifications)
|
||||
implementation(projects.resources)
|
||||
implementation(projects.domainLemmy.data)
|
||||
|
@ -29,6 +29,7 @@ include(":core-md")
|
||||
include(":core-commonui")
|
||||
include(":core-commonui:components")
|
||||
include(":core-commonui:lemmyui")
|
||||
include(":core-commonui:modals")
|
||||
include(":core-notifications")
|
||||
include(":core-persistence")
|
||||
include(":core-navigation")
|
||||
|
Loading…
x
Reference in New Issue
Block a user