Remove other useless lazy wrapping.
This commit is contained in:
@@ -27,20 +27,18 @@ import io.element.android.libraries.usersearch.api.UserRepository
|
||||
import javax.inject.Inject
|
||||
|
||||
class AddPeoplePresenter @Inject constructor(
|
||||
private val userListPresenterFactory: UserListPresenter.Factory,
|
||||
private val userRepository: UserRepository,
|
||||
private val dataStore: CreateRoomDataStore,
|
||||
userListPresenterFactory: UserListPresenter.Factory,
|
||||
userRepository: UserRepository,
|
||||
dataStore: CreateRoomDataStore,
|
||||
) : Presenter<UserListState> {
|
||||
|
||||
private val userListPresenter by lazy {
|
||||
userListPresenterFactory.create(
|
||||
UserListPresenterArgs(
|
||||
selectionMode = SelectionMode.Multiple,
|
||||
),
|
||||
userRepository,
|
||||
dataStore.selectedUserListDataStore,
|
||||
)
|
||||
}
|
||||
private val userListPresenter = userListPresenterFactory.create(
|
||||
UserListPresenterArgs(
|
||||
selectionMode = SelectionMode.Multiple,
|
||||
),
|
||||
userRepository,
|
||||
dataStore.selectedUserListDataStore,
|
||||
)
|
||||
|
||||
@Composable
|
||||
override fun present(): UserListState {
|
||||
|
||||
@@ -40,23 +40,21 @@ import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
class CreateRoomRootPresenter @Inject constructor(
|
||||
private val presenterFactory: UserListPresenter.Factory,
|
||||
private val userRepository: UserRepository,
|
||||
private val userListDataStore: UserListDataStore,
|
||||
presenterFactory: UserListPresenter.Factory,
|
||||
userRepository: UserRepository,
|
||||
userListDataStore: UserListDataStore,
|
||||
private val matrixClient: MatrixClient,
|
||||
private val analyticsService: AnalyticsService,
|
||||
private val buildMeta: BuildMeta,
|
||||
) : Presenter<CreateRoomRootState> {
|
||||
|
||||
private val presenter by lazy {
|
||||
presenterFactory.create(
|
||||
UserListPresenterArgs(
|
||||
selectionMode = SelectionMode.Single,
|
||||
),
|
||||
userRepository,
|
||||
userListDataStore,
|
||||
)
|
||||
}
|
||||
private val presenter = presenterFactory.create(
|
||||
UserListPresenterArgs(
|
||||
selectionMode = SelectionMode.Single,
|
||||
),
|
||||
userRepository,
|
||||
userListDataStore,
|
||||
)
|
||||
|
||||
@Composable
|
||||
override fun present(): CreateRoomRootState {
|
||||
|
||||
@@ -32,18 +32,16 @@ import io.element.android.libraries.di.AppScope
|
||||
class NotificationsOptInNode @AssistedInject constructor(
|
||||
@Assisted buildContext: BuildContext,
|
||||
@Assisted plugins: List<Plugin>,
|
||||
private val presenterFactory: NotificationsOptInPresenter.Factory,
|
||||
presenterFactory: NotificationsOptInPresenter.Factory,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
|
||||
interface Callback: NodeInputs {
|
||||
interface Callback : NodeInputs {
|
||||
fun onNotificationsOptInFinished()
|
||||
}
|
||||
|
||||
private val callback = inputs<Callback>()
|
||||
|
||||
private val presenter: NotificationsOptInPresenter by lazy {
|
||||
presenterFactory.create(callback)
|
||||
}
|
||||
private val presenter: NotificationsOptInPresenter = presenterFactory.create(callback)
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
|
||||
@@ -34,7 +34,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class NotificationsOptInPresenter @AssistedInject constructor(
|
||||
private val permissionsPresenterFactory: PermissionsPresenter.Factory,
|
||||
permissionsPresenterFactory: PermissionsPresenter.Factory,
|
||||
@Assisted private val callback: NotificationsOptInNode.Callback,
|
||||
private val appCoroutineScope: CoroutineScope,
|
||||
private val permissionStateProvider: PermissionStateProvider,
|
||||
@@ -46,14 +46,13 @@ class NotificationsOptInPresenter @AssistedInject constructor(
|
||||
fun create(callback: NotificationsOptInNode.Callback): NotificationsOptInPresenter
|
||||
}
|
||||
|
||||
private val postNotificationPermissionsPresenter by lazy {
|
||||
private val postNotificationPermissionsPresenter: PermissionsPresenter =
|
||||
// Ask for POST_NOTIFICATION PERMISSION on Android 13+
|
||||
if (buildVersionSdkIntProvider.isAtLeast(Build.VERSION_CODES.TIRAMISU)) {
|
||||
permissionsPresenterFactory.create(Manifest.permission.POST_NOTIFICATIONS)
|
||||
} else {
|
||||
NoopPermissionsPresenter()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun present(): NotificationsOptInState {
|
||||
|
||||
Reference in New Issue
Block a user