Remove dead code.
This commit is contained in:
committed by
Benoit Marty
parent
8e36776c5f
commit
976ee893e2
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.element.android.features.preferences.impl.about
|
||||
|
||||
sealed interface AboutEvents {
|
||||
object MyEvent : AboutEvents
|
||||
}
|
||||
@@ -25,15 +25,8 @@ class AboutPresenter @Inject constructor() : Presenter<AboutState> {
|
||||
@Composable
|
||||
override fun present(): AboutState {
|
||||
|
||||
fun handleEvents(event: AboutEvents) {
|
||||
when (event) {
|
||||
AboutEvents.MyEvent -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
return AboutState(
|
||||
elementLegals = getAllLegals(),
|
||||
eventSink = ::handleEvents
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
|
||||
package io.element.android.features.preferences.impl.about
|
||||
|
||||
// TODO add your ui models. Remove the eventSink if you don't have events.
|
||||
// Do not use default value, so no member get forgotten in the presenters.
|
||||
data class AboutState(
|
||||
val elementLegals: List<ElementLegal>,
|
||||
val eventSink: (AboutEvents) -> Unit
|
||||
)
|
||||
|
||||
@@ -27,5 +27,4 @@ open class AboutStateProvider : PreviewParameterProvider<AboutState> {
|
||||
|
||||
fun aAboutState() = AboutState(
|
||||
elementLegals = getAllLegals(),
|
||||
eventSink = {}
|
||||
)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.element.android.features.preferences.impl.analytics
|
||||
|
||||
sealed interface AnalyticsSettingsEvents {
|
||||
object MyEvent : AnalyticsSettingsEvents
|
||||
}
|
||||
@@ -29,15 +29,8 @@ class AnalyticsSettingsPresenter @Inject constructor(
|
||||
override fun present(): AnalyticsSettingsState {
|
||||
val analyticsState = analyticsPresenter.present()
|
||||
|
||||
fun handleEvents(event: AnalyticsSettingsEvents) {
|
||||
when (event) {
|
||||
AnalyticsSettingsEvents.MyEvent -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
return AnalyticsSettingsState(
|
||||
analyticsState = analyticsState,
|
||||
eventSink = ::handleEvents
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,4 @@ import io.element.android.features.analytics.api.preferences.AnalyticsPreference
|
||||
// Do not use default value, so no member get forgotten in the presenters.
|
||||
data class AnalyticsSettingsState(
|
||||
val analyticsState: AnalyticsPreferencesState,
|
||||
val eventSink: (AnalyticsSettingsEvents) -> Unit
|
||||
)
|
||||
|
||||
@@ -28,5 +28,4 @@ open class AnalyticsSettingsStateProvider : PreviewParameterProvider<AnalyticsSe
|
||||
|
||||
fun aAnalyticsSettingsState() = AnalyticsSettingsState(
|
||||
analyticsState = aAnalyticsPreferencesState(),
|
||||
eventSink = {}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user