mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Remove Showkase from the project.
This commit is contained in:
@@ -94,7 +94,6 @@ dependencies {
|
||||
implementation(libs.androidx.datastore.preferences)
|
||||
implementation(libs.serialization.json)
|
||||
api(projects.features.preferences.api)
|
||||
implementation(libs.showkase)
|
||||
|
||||
implementation(platform(libs.network.okhttp.bom))
|
||||
implementation(libs.network.okhttp)
|
||||
|
||||
-10
@@ -8,10 +8,8 @@
|
||||
|
||||
package io.element.android.features.preferences.impl.developer
|
||||
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.airbnb.android.showkase.models.Showkase
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.Node
|
||||
import com.bumble.appyx.core.plugin.Plugin
|
||||
@@ -20,7 +18,6 @@ import dev.zacsweers.metro.AssistedInject
|
||||
import io.element.android.annotations.ContributesNode
|
||||
import io.element.android.features.preferences.api.ExtraDeveloperOptionsRenderer
|
||||
import io.element.android.libraries.architecture.callback
|
||||
import io.element.android.libraries.designsystem.showkase.getBrowserIntent
|
||||
import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@ContributesNode(SessionScope::class)
|
||||
@@ -47,17 +44,10 @@ class DeveloperSettingsNode(
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val activity = requireNotNull(LocalActivity.current)
|
||||
fun openShowkase() {
|
||||
val intent = Showkase.getBrowserIntent(activity)
|
||||
activity.startActivity(intent)
|
||||
}
|
||||
|
||||
val state = presenter.present()
|
||||
DeveloperSettingsView(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onOpenShowkase = ::openShowkase,
|
||||
onPushHistoryClick = callback::navigateToPushHistory,
|
||||
onBackClick = callback::onDone,
|
||||
extraOptions = { extraDeveloperOptionsRenderer.Render(Modifier) },
|
||||
|
||||
-3
@@ -44,7 +44,6 @@ import io.mhssn.colorpicker.ColorPickerType
|
||||
@Composable
|
||||
fun DeveloperSettingsView(
|
||||
state: DeveloperSettingsState,
|
||||
onOpenShowkase: () -> Unit,
|
||||
onPushHistoryClick: () -> Unit,
|
||||
onBackClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
@@ -84,7 +83,6 @@ fun DeveloperSettingsView(
|
||||
// Note: this is OK to hardcode strings in this debug screen.
|
||||
AppDeveloperSettingsView(
|
||||
state = state.appDeveloperSettingsState,
|
||||
onOpenShowkase = onOpenShowkase,
|
||||
)
|
||||
SessionCategory(deviceId = state.deviceId)
|
||||
NotificationCategory(
|
||||
@@ -255,7 +253,6 @@ internal fun DeveloperSettingsViewPreview(
|
||||
) = ElementPreview {
|
||||
DeveloperSettingsView(
|
||||
state = state,
|
||||
onOpenShowkase = {},
|
||||
onPushHistoryClick = {},
|
||||
onBackClick = {},
|
||||
)
|
||||
|
||||
-10
@@ -7,10 +7,8 @@
|
||||
|
||||
package io.element.android.features.preferences.impl.developer.appsettings
|
||||
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.airbnb.android.showkase.models.Showkase
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.Node
|
||||
import com.bumble.appyx.core.plugin.Plugin
|
||||
@@ -21,7 +19,6 @@ import io.element.android.annotations.ContributesNode
|
||||
import io.element.android.features.preferences.api.ExtraDeveloperOptionsRenderer
|
||||
import io.element.android.features.preferences.api.PreferencesEntryPoint
|
||||
import io.element.android.libraries.architecture.callback
|
||||
import io.element.android.libraries.designsystem.showkase.getBrowserIntent
|
||||
|
||||
@ContributesNode(AppScope::class)
|
||||
@AssistedInject
|
||||
@@ -35,17 +32,10 @@ class AppDeveloperSettingsNode(
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val activity = requireNotNull(LocalActivity.current)
|
||||
fun openShowkase() {
|
||||
val intent = Showkase.getBrowserIntent(activity)
|
||||
activity.startActivity(intent)
|
||||
}
|
||||
|
||||
val state = presenter.present()
|
||||
AppDeveloperSettingsPage(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onOpenShowkase = ::openShowkase,
|
||||
onBackClick = callback::onDone,
|
||||
extraOptions = { extraDeveloperOptionsRenderer.Render(Modifier) },
|
||||
)
|
||||
|
||||
-3
@@ -21,7 +21,6 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
@Composable
|
||||
fun AppDeveloperSettingsPage(
|
||||
state: AppDeveloperSettingsState,
|
||||
onOpenShowkase: () -> Unit,
|
||||
onBackClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
extraOptions: @Composable () -> Unit = {},
|
||||
@@ -38,7 +37,6 @@ fun AppDeveloperSettingsPage(
|
||||
) {
|
||||
AppDeveloperSettingsView(
|
||||
state = state,
|
||||
onOpenShowkase = onOpenShowkase,
|
||||
modifier = Modifier.padding(top = 8.dp)
|
||||
)
|
||||
extraOptions()
|
||||
@@ -50,7 +48,6 @@ fun AppDeveloperSettingsPage(
|
||||
internal fun AppDeveloperSettingsPagePreview() = ElementPreview {
|
||||
AppDeveloperSettingsPage(
|
||||
state = anAppDeveloperSettingsState(),
|
||||
onOpenShowkase = {},
|
||||
onBackClick = {},
|
||||
)
|
||||
}
|
||||
|
||||
-10
@@ -42,7 +42,6 @@ import kotlinx.collections.immutable.toImmutableList
|
||||
@Composable
|
||||
fun AppDeveloperSettingsView(
|
||||
state: AppDeveloperSettingsState,
|
||||
onOpenShowkase: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Column(
|
||||
@@ -82,14 +81,6 @@ fun AppDeveloperSettingsView(
|
||||
)
|
||||
}
|
||||
}
|
||||
PreferenceCategory(title = "Showkase") {
|
||||
ListItem(
|
||||
content = {
|
||||
Text("Open Showkase browser")
|
||||
},
|
||||
onClick = onOpenShowkase
|
||||
)
|
||||
}
|
||||
RageshakePreferencesView(
|
||||
state = state.rageshakeState,
|
||||
)
|
||||
@@ -186,6 +177,5 @@ internal fun AppDeveloperSettingsViewPreview(
|
||||
) = ElementPreview {
|
||||
AppDeveloperSettingsView(
|
||||
state = state,
|
||||
onOpenShowkase = {},
|
||||
)
|
||||
}
|
||||
|
||||
-17
@@ -70,21 +70,6 @@ class DeveloperSettingsViewTest : RobolectricTest() {
|
||||
eventsRecorder.assertSingle(DeveloperSettingsEvent.OpenPushRules)
|
||||
}
|
||||
|
||||
@Config(qualifiers = "h2000dp")
|
||||
@Test
|
||||
fun `clicking on open showkase invokes the expected callback`() = runAndroidComposeUiTest {
|
||||
val eventsRecorder = EventsRecorder<DeveloperSettingsEvent>(expectEvents = false)
|
||||
ensureCalledOnce {
|
||||
setDeveloperSettingsView(
|
||||
state = aDeveloperSettingsState(
|
||||
eventSink = eventsRecorder
|
||||
),
|
||||
onOpenShowkase = it
|
||||
)
|
||||
onNodeWithText("Open Showkase browser").performClick()
|
||||
}
|
||||
}
|
||||
|
||||
@Config(qualifiers = "h2400dp")
|
||||
@Test
|
||||
fun `clicking on clear cache emits the expected event`() = runAndroidComposeUiTest {
|
||||
@@ -101,14 +86,12 @@ class DeveloperSettingsViewTest : RobolectricTest() {
|
||||
|
||||
private fun AndroidComposeUiTest<ComponentActivity>.setDeveloperSettingsView(
|
||||
state: DeveloperSettingsState,
|
||||
onOpenShowkase: () -> Unit = EnsureNeverCalled(),
|
||||
onPushHistoryClick: () -> Unit = EnsureNeverCalled(),
|
||||
onBackClick: () -> Unit = EnsureNeverCalled()
|
||||
) {
|
||||
setContent {
|
||||
DeveloperSettingsView(
|
||||
state = state,
|
||||
onOpenShowkase = onOpenShowkase,
|
||||
onPushHistoryClick = onPushHistoryClick,
|
||||
onBackClick = onBackClick,
|
||||
)
|
||||
|
||||
-17
@@ -64,21 +64,6 @@ class AppDeveloperSettingsPageTest : RobolectricTest() {
|
||||
eventsRecorder.assertSingle(AppDeveloperSettingsEvent.SetCustomElementCallBaseUrl("https://call.element.dev"))
|
||||
}
|
||||
|
||||
@Config(qualifiers = "h2000dp")
|
||||
@Test
|
||||
fun `clicking on open showkase invokes the expected callback`() = runAndroidComposeUiTest {
|
||||
val eventsRecorder = EventsRecorder<AppDeveloperSettingsEvent>(expectEvents = false)
|
||||
ensureCalledOnce {
|
||||
setAppDeveloperSettingsView(
|
||||
state = anAppDeveloperSettingsState(
|
||||
eventSink = eventsRecorder
|
||||
),
|
||||
onOpenShowkase = it
|
||||
)
|
||||
onNodeWithText("Open Showkase browser").performClick()
|
||||
}
|
||||
}
|
||||
|
||||
@Config(qualifiers = "h1024dp")
|
||||
@Test
|
||||
fun `clicking on log level emits the expected event`() = runAndroidComposeUiTest {
|
||||
@@ -96,13 +81,11 @@ class AppDeveloperSettingsPageTest : RobolectricTest() {
|
||||
|
||||
private fun AndroidComposeUiTest<ComponentActivity>.setAppDeveloperSettingsView(
|
||||
state: AppDeveloperSettingsState,
|
||||
onOpenShowkase: () -> Unit = EnsureNeverCalled(),
|
||||
onBackClick: () -> Unit = EnsureNeverCalled(),
|
||||
) {
|
||||
setContent {
|
||||
AppDeveloperSettingsPage(
|
||||
state = state,
|
||||
onOpenShowkase = onOpenShowkase,
|
||||
onBackClick = onBackClick,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user