Skip to content

Commit

Permalink
remove share from remote controls (#952)
Browse files Browse the repository at this point in the history
**Background**

We can't currently share the ui with ir file

**Changes**

- Remove share from remote controls screen

**Test plan**
- Open saved remote control screen 
- See there's no share option
  • Loading branch information
makeevrserg committed Sep 13, 2024
1 parent e5f7abf commit 00dceff
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Attention: don't forget to add the flag for F-Droid before release
- [FIX] Share infrared remote after rename
- [FIX] Fix app bar colors on remote controls
- [FIX] Fix remote controls texts and favorite dropdown
- [FIX] Remove share from remote controls
- [CI] Fix merge-queue files diff
- [CI] Add https://github.com/LionZXY/detekt-decompose-rule
- [CI] Enabling detekt module for android and kmp modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ fun LocalGridComposable(
localGridComponent: LocalGridComponent,
flipperDispatchDialogApi: FlipperDispatchDialogApi,
onCallback: (LocalGridScreenDecomposeComponent.Callback) -> Unit,
onShare: () -> Unit,
modifier: Modifier = Modifier
) {
val coroutineScope = rememberCoroutineScope()
Expand Down Expand Up @@ -108,7 +107,6 @@ fun LocalGridComposable(
}
},
onFavorite = localGridComponent::toggleFavorite,
onShare = onShare,
isEmulating = loadedModel.emulatedKey != null,
isConnected = loadedModel.isConnected,
isFavorite = loadedModel.isFavorite,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import com.flipperdevices.remotecontrols.core.ui.R as RemoteControlsR
@Suppress("LongMethod")
internal fun ComposableInfraredDropDown(
onRename: () -> Unit,
onShare: () -> Unit,
onDelete: () -> Unit,
onFavorite: () -> Unit,
isEmulating: Boolean,
Expand Down Expand Up @@ -107,15 +106,6 @@ internal fun ComposableInfraredDropDown(
isActive = !isEmulating
)
Divider(modifier = Modifier.padding(horizontal = 8.dp))
ComposableInfraredDropDownItem(
text = stringResource(R.string.option_share),
painter = painterResource(DesignSystem.drawable.ic_upload),
onClick = {
onChangeState.invoke()
onShare.invoke()
}
)
Divider(modifier = Modifier.padding(horizontal = 8.dp))
ComposableInfraredDropDownItem(
text = stringResource(R.string.option_how_to_use),
painter = painterResource(R.drawable.ic_how_to_use),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.flipperdevices.remotecontrols.impl.grid.local.presentation.decompose.internal

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.datastore.core.DataStore
import com.arkivanov.decompose.ComponentContext
Expand All @@ -15,7 +13,6 @@ import com.flipperdevices.remotecontrols.api.FlipperDispatchDialogApi
import com.flipperdevices.remotecontrols.impl.grid.local.api.LocalGridScreenDecomposeComponent
import com.flipperdevices.remotecontrols.impl.grid.local.composable.LocalGridComposable
import com.flipperdevices.remotecontrols.impl.grid.local.presentation.decompose.LocalGridComponent
import com.flipperdevices.share.api.ShareBottomUIApi
import com.flipperdevices.ui.decompose.DecomposeOnBackParameter
import com.flipperdevices.ui.decompose.statusbar.ThemeStatusBarIconStyleProvider
import dagger.assisted.Assisted
Expand All @@ -32,7 +29,6 @@ class LocalGridScreenDecomposeComponentImpl @AssistedInject constructor(
@Assisted onBack: DecomposeOnBackParameter,
@Assisted private val onCallback: (Callback) -> Unit,
localGridComponentFactory: LocalGridComponent.Factory,
private val shareBottomUiApi: ShareBottomUIApi,
flipperDispatchDialogApiFactory: FlipperDispatchDialogApi.Factory,
dataStore: DataStore<Settings>
) : LocalGridScreenDecomposeComponent(componentContext) {
Expand All @@ -53,28 +49,11 @@ class LocalGridScreenDecomposeComponentImpl @AssistedInject constructor(

@Composable
override fun Render() {
shareBottomUiApi.ComposableShareBottomSheet(
provideFlipperKeyPath = { keyPath },
onSheetStateVisible = { isShown, onClose ->
val isBackPressHandled by isBackPressHandledFlow.collectAsState()
backCallback.isEnabled = isShown

LaunchedEffect(isBackPressHandled) {
if (isBackPressHandled) {
onClose()
isBackPressHandledFlow.emit(false)
}
}
},
componentContext = this
) { onShare ->
LocalGridComposable(
localGridComponent = localGridComponent,
flipperDispatchDialogApi = flipperDispatchDialogApi,
onCallback = onCallback,
onShare = onShare
)
}
LocalGridComposable(
localGridComponent = localGridComponent,
flipperDispatchDialogApi = flipperDispatchDialogApi,
onCallback = onCallback,
)
}

override fun isStatusBarIconLight(systemIsDark: Boolean): Boolean {
Expand Down

0 comments on commit 00dceff

Please sign in to comment.