Skip to content

Commit f9419b2

Browse files
committed
Rebase onto origin/master
1 parent 54945de commit f9419b2

File tree

7 files changed

+39
-14
lines changed

7 files changed

+39
-14
lines changed

data/src/main/java/com/shifthackz/aisdv1/data/repository/BackupRepositoryImpl.kt

+10-10
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ internal class BackupRepositoryImpl(
6868
KEY_SWARM_MODEL to swarmUiModel,
6969
KEY_DEMO_MODE to demoMode,
7070
KEY_DEVELOPER_MODE to developerMode,
71-
KEY_LOCAL_DIFFUSION_CUSTOM_MODEL_PATH to localDiffusionCustomModelPath,
72-
KEY_ALLOW_LOCAL_DIFFUSION_CANCEL to localDiffusionAllowCancel,
73-
KEY_LOCAL_DIFFUSION_SCHEDULER_THREAD to localDiffusionSchedulerThread,
71+
KEY_LOCAL_DIFFUSION_CUSTOM_MODEL_PATH to localOnnxCustomModelPath,
72+
KEY_ALLOW_LOCAL_DIFFUSION_CANCEL to localOnnxAllowCancel,
73+
KEY_LOCAL_DIFFUSION_SCHEDULER_THREAD to localOnnxSchedulerThread,
7474
KEY_MONITOR_CONNECTIVITY to monitorConnectivity,
7575
KEY_AI_AUTO_SAVE to autoSaveAiResults,
7676
KEY_SAVE_TO_MEDIA_STORE to saveToMediaStore,
@@ -86,8 +86,8 @@ internal class BackupRepositoryImpl(
8686
KEY_STABILITY_AI_ENGINE_ID_KEY to stabilityAiEngineId,
8787
KEY_ON_BOARDING_COMPLETE to onBoardingComplete,
8888
KEY_FORCE_SETUP_AFTER_UPDATE to forceSetupAfterUpdate,
89-
KEY_LOCAL_MODEL_ID to localModelId,
90-
KEY_LOCAL_NN_API to localUseNNAPI,
89+
KEY_LOCAL_MODEL_ID to localOnnxModelId,
90+
KEY_LOCAL_NN_API to localOnnxUseNNAPI,
9191
KEY_DESIGN_DYNAMIC_COLORS to designUseSystemColorPalette,
9292
KEY_DESIGN_SYSTEM_DARK_THEME to designUseSystemDarkTheme,
9393
KEY_DESIGN_DARK_THEME to designDarkTheme,
@@ -139,13 +139,13 @@ internal class BackupRepositoryImpl(
139139
preferenceManager.developerMode = value as Boolean
140140
}
141141
KEY_LOCAL_DIFFUSION_CUSTOM_MODEL_PATH -> {
142-
preferenceManager.localDiffusionCustomModelPath = value as String
142+
preferenceManager.localOnnxCustomModelPath = value as String
143143
}
144144
KEY_ALLOW_LOCAL_DIFFUSION_CANCEL -> {
145-
preferenceManager.localDiffusionAllowCancel = value as Boolean
145+
preferenceManager.localOnnxAllowCancel = value as Boolean
146146
}
147147
KEY_LOCAL_DIFFUSION_SCHEDULER_THREAD -> {
148-
preferenceManager.localDiffusionSchedulerThread = value as SchedulersToken
148+
preferenceManager.localOnnxSchedulerThread = value as SchedulersToken
149149
}
150150
KEY_MONITOR_CONNECTIVITY -> {
151151
preferenceManager.monitorConnectivity = value as Boolean
@@ -193,10 +193,10 @@ internal class BackupRepositoryImpl(
193193
preferenceManager.forceSetupAfterUpdate = value as Boolean
194194
}
195195
KEY_LOCAL_MODEL_ID -> {
196-
preferenceManager.localModelId = value as String
196+
preferenceManager.localOnnxModelId = value as String
197197
}
198198
KEY_LOCAL_NN_API -> {
199-
preferenceManager.localUseNNAPI = value as Boolean
199+
preferenceManager.localOnnxUseNNAPI = value as Boolean
200200
}
201201
KEY_DESIGN_DYNAMIC_COLORS -> {
202202
preferenceManager.designUseSystemColorPalette = value as Boolean

presentation/src/main/java/com/shifthackz/aisdv1/presentation/navigation/NavigationRoute.kt

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ sealed interface NavigationRoute {
2828
@Serializable
2929
data object Donate : NavigationRoute
3030

31+
@Serializable
32+
data object Backup : NavigationRoute
33+
3134
@Serializable
3235
data class Onboarding(val source: LaunchSource) : NavigationRoute
3336

presentation/src/main/java/com/shifthackz/aisdv1/presentation/navigation/graph/MainNavGraph.kt

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import androidx.navigation.compose.composable
66
import androidx.navigation.toRoute
77
import com.shifthackz.aisdv1.presentation.model.LaunchSource
88
import com.shifthackz.aisdv1.presentation.navigation.NavigationRoute
9+
import com.shifthackz.aisdv1.presentation.screen.backup.BackupScreen
910
import com.shifthackz.aisdv1.presentation.screen.debug.DebugMenuScreen
1011
import com.shifthackz.aisdv1.presentation.screen.donate.DonateScreen
1112
import com.shifthackz.aisdv1.presentation.screen.gallery.detail.GalleryDetailScreen
@@ -85,6 +86,10 @@ fun NavGraphBuilder.mainNavGraph() {
8586
DonateScreen()
8687
}
8788

89+
composable<NavigationRoute.Backup> {
90+
BackupScreen()
91+
}
92+
8893
composable<NavigationRoute.Onboarding>(
8994
typeMap = mapOf(
9095
typeOf<LaunchSource>() to NavType.EnumType(LaunchSource::class.java)

presentation/src/main/java/com/shifthackz/aisdv1/presentation/navigation/router/main/MainRouterImpl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal class MainRouterImpl : MainRouter {
6060
}
6161

6262
override fun navigateToBackup() {
63-
effectSubject.onNext(NavigationEffect.Navigate.Route(Constants.ROUTE_BACKUP))
63+
effectSubject.onNext(NavigationEffect.Navigate.Route(navRoute = NavigationRoute.Backup))
6464
}
6565

6666
override fun navigateToGalleryDetails(itemId: Long) {

presentation/src/main/java/com/shifthackz/aisdv1/presentation/screen/backup/BackupScreen.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.foundation.background
88
import androidx.compose.foundation.layout.Column
99
import androidx.compose.foundation.layout.fillMaxWidth
1010
import androidx.compose.foundation.layout.height
11+
import androidx.compose.foundation.layout.navigationBarsPadding
1112
import androidx.compose.foundation.layout.padding
1213
import androidx.compose.foundation.pager.HorizontalPager
1314
import androidx.compose.foundation.pager.rememberPagerState
@@ -25,14 +26,16 @@ import androidx.compose.material3.Text
2526
import androidx.compose.runtime.Composable
2627
import androidx.compose.runtime.LaunchedEffect
2728
import androidx.compose.ui.Modifier
29+
import androidx.compose.ui.platform.testTag
2830
import androidx.compose.ui.res.stringResource
2931
import androidx.compose.ui.tooling.preview.Preview
3032
import androidx.compose.ui.unit.dp
3133
import com.shifthackz.aisdv1.core.model.asUiText
32-
import com.shifthackz.aisdv1.core.ui.MviComponent
3334
import com.shifthackz.aisdv1.presentation.screen.backup.forms.BackupOperationForm
3435
import com.shifthackz.aisdv1.presentation.screen.backup.forms.CreateBackupForm
36+
import com.shifthackz.aisdv1.presentation.screen.setup.ServerSetupScreenTags
3537
import com.shifthackz.aisdv1.presentation.widget.toolbar.StepBar
38+
import com.shifthackz.android.core.mvi.MviComponent
3639
import org.koin.androidx.compose.koinViewModel
3740
import com.shifthackz.aisdv1.core.localization.R as LocalizationR
3841

@@ -101,6 +104,7 @@ private fun BackupScreenContent(
101104
bottomBar = {
102105
Button(
103106
modifier = Modifier
107+
.navigationBarsPadding()
104108
.height(height = 68.dp)
105109
.background(MaterialTheme.colorScheme.background)
106110
.fillMaxWidth()

presentation/src/main/java/com/shifthackz/aisdv1/presentation/screen/settings/SettingsScreen.kt

+4
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ fun SettingsScreen() {
125125
}
126126

127127
SettingsEffect.ShareLogFile -> ReportProblemEmailComposer().invoke(context)
128+
128129
is SettingsEffect.OpenUrl -> context.openUrl(effect.url)
130+
129131
SettingsEffect.DeveloperModeUnlocked -> context.showToast(
130132
LocalizationR.string.debug_action_unlock,
131133
)
@@ -220,6 +222,8 @@ private fun ContentSettingsState(
220222
.fillMaxWidth()
221223
.padding(top = 4.dp, start = 4.dp)
222224

225+
Spacer(modifier = Modifier.height(56.dp))
226+
223227
if (!state.onBoardingDemo) {
224228
//region MAIN SETTINGS
225229
SettingsHeader(

presentation/src/main/java/com/shifthackz/aisdv1/presentation/screen/setup/ServerSetupScreen.kt

+11-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ import androidx.compose.ui.unit.dp
4343
import com.shifthackz.aisdv1.core.common.appbuild.BuildInfoProvider
4444
import com.shifthackz.aisdv1.core.common.extensions.openUrl
4545
import com.shifthackz.aisdv1.core.common.extensions.showToast
46+
import com.shifthackz.aisdv1.core.model.asUiText
4647
import com.shifthackz.android.core.mvi.MviComponent
4748
import com.shifthackz.aisdv1.domain.entity.ServerSource
4849
import com.shifthackz.aisdv1.presentation.modal.ModalRenderer
49-
import com.shifthackz.aisdv1.presentation.screen.setup.components.ConfigurationStepBar
5050
import com.shifthackz.aisdv1.presentation.screen.setup.steps.ConfigurationStep
5151
import com.shifthackz.aisdv1.presentation.screen.setup.steps.SourceSelectionStep
5252
import com.shifthackz.aisdv1.presentation.utils.PermissionUtil
53+
import com.shifthackz.aisdv1.presentation.widget.toolbar.StepBar
5354
import com.shifthackz.aisdv1.core.localization.R as LocalizationR
5455

5556
@Composable
@@ -139,7 +140,15 @@ fun ServerSetupScreenContent(
139140
WindowInsets(0, 0, 0, 0)
140141
},
141142
)
142-
ConfigurationStepBar(currentStep = state.step)
143+
StepBar(
144+
steps = ServerSetupState.Step.entries,
145+
currentStep = state.step,
146+
) { step ->
147+
when (step) {
148+
ServerSetupState.Step.SOURCE -> LocalizationR.string.srv_step_1
149+
ServerSetupState.Step.CONFIGURE -> LocalizationR.string.srv_step_2
150+
}.asUiText()
151+
}
143152
}
144153
},
145154
bottomBar = {

0 commit comments

Comments
 (0)