mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Hilt: remove usage of ScreenComponent
This commit is contained in:
parent
188b4887ba
commit
ac1e4e9e9c
82 changed files with 211 additions and 1428 deletions
|
@ -27,7 +27,7 @@ import androidx.core.content.getSystemService
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.core.utils.PERMISSIONS_FOR_TAKING_PHOTO
|
||||
|
|
|
@ -43,7 +43,6 @@ import dagger.hilt.android.HiltAndroidApp
|
|||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.extensions.configureAndStart
|
||||
import im.vector.app.core.extensions.startSyncing
|
||||
import im.vector.app.core.extensions.singletonEntryPoint
|
||||
import im.vector.app.core.rx.RxConfig
|
||||
import im.vector.app.features.call.webrtc.WebRtcCallManager
|
||||
import im.vector.app.features.configuration.VectorConfiguration
|
||||
|
@ -54,6 +53,7 @@ import im.vector.app.features.notifications.NotificationDrawerManager
|
|||
import im.vector.app.features.notifications.NotificationUtils
|
||||
import im.vector.app.features.pin.PinLocker
|
||||
import im.vector.app.features.popup.PopupAlertManager
|
||||
import im.vector.app.features.rageshake.VectorFileLogger
|
||||
import im.vector.app.features.rageshake.VectorUncaughtExceptionHandler
|
||||
import im.vector.app.features.room.VectorRoomDisplayNameFallbackProvider
|
||||
import im.vector.app.features.settings.VectorLocale
|
||||
|
@ -98,6 +98,7 @@ class VectorApplication :
|
|||
@Inject lateinit var pinLocker: PinLocker
|
||||
@Inject lateinit var callManager: WebRtcCallManager
|
||||
@Inject lateinit var invitesAcceptor: InvitesAcceptor
|
||||
@Inject lateinit var vectorFileLogger: VectorFileLogger
|
||||
|
||||
// font thread handler
|
||||
private var fontThreadHandler: Handler? = null
|
||||
|
@ -127,7 +128,7 @@ class VectorApplication :
|
|||
if (BuildConfig.DEBUG) {
|
||||
Timber.plant(Timber.DebugTree())
|
||||
}
|
||||
Timber.plant(singletonEntryPoint().vectorFileLogger())
|
||||
Timber.plant(vectorFileLogger)
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Stetho.initializeWithDefaults(this)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* Copyright 2019 New Vector Ltd
|
||||
* Copyright (c) 2021 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
|
||||
* 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,
|
||||
|
@ -16,7 +16,15 @@
|
|||
|
||||
package im.vector.app.core.di
|
||||
|
||||
interface HasScreenInjector {
|
||||
import androidx.fragment.app.FragmentFactory
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import dagger.hilt.EntryPoint
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityComponent
|
||||
|
||||
fun injector(): ScreenComponent
|
||||
@InstallIn(ActivityComponent::class)
|
||||
@EntryPoint
|
||||
interface ActivityEntryPoint {
|
||||
fun fragmentFactory(): FragmentFactory
|
||||
fun viewModelFactory(): ViewModelProvider.Factory
|
||||
}
|
|
@ -21,6 +21,8 @@ import androidx.fragment.app.Fragment
|
|||
import androidx.fragment.app.FragmentFactory
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityComponent
|
||||
import dagger.hilt.migration.DisableInstallInCheck
|
||||
import dagger.multibindings.IntoMap
|
||||
import im.vector.app.features.attachments.preview.AttachmentsPreviewFragment
|
||||
|
@ -158,7 +160,7 @@ import im.vector.app.features.usercode.ShowUserCodeFragment
|
|||
import im.vector.app.features.userdirectory.UserListFragment
|
||||
import im.vector.app.features.widgets.WidgetFragment
|
||||
|
||||
@DisableInstallInCheck
|
||||
@InstallIn(ActivityComponent::class)
|
||||
@Module
|
||||
interface FragmentModule {
|
||||
/**
|
||||
|
|
File diff suppressed because it is too large
Load diff
37
vector/src/main/java/im/vector/app/core/di/HomeModule.kt
Normal file
37
vector/src/main/java/im/vector/app/core/di/HomeModule.kt
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2021 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 im.vector.app.core.di
|
||||
|
||||
import android.os.Handler
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityComponent
|
||||
import im.vector.app.features.home.room.detail.timeline.TimelineEventControllerHandler
|
||||
import im.vector.app.features.home.room.detail.timeline.helper.TimelineAsyncHelper
|
||||
|
||||
@Module
|
||||
@InstallIn(ActivityComponent::class)
|
||||
object HomeModule {
|
||||
@Provides
|
||||
@JvmStatic
|
||||
@TimelineEventControllerHandler
|
||||
fun providesTimelineBackgroundHandler(): Handler {
|
||||
return TimelineAsyncHelper.getBackgroundHandler()
|
||||
}
|
||||
|
||||
}
|
|
@ -1,140 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019 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 im.vector.app.core.di
|
||||
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentFactory
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import dagger.BindsInstance
|
||||
import dagger.Component
|
||||
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.preference.UserAvatarPreference
|
||||
import im.vector.app.features.call.CallControlsBottomSheet
|
||||
import im.vector.app.features.crypto.recover.BootstrapBottomSheet
|
||||
import im.vector.app.features.crypto.verification.VerificationBottomSheet
|
||||
import im.vector.app.features.home.HomeModule
|
||||
import im.vector.app.features.home.room.detail.JoinReplacementRoomBottomSheet
|
||||
import im.vector.app.features.home.room.detail.readreceipts.DisplayReadReceiptsBottomSheet
|
||||
import im.vector.app.features.home.room.detail.timeline.action.MessageActionsBottomSheet
|
||||
import im.vector.app.features.home.room.detail.timeline.edithistory.ViewEditHistoryBottomSheet
|
||||
import im.vector.app.features.home.room.detail.timeline.reactions.ViewReactionsBottomSheet
|
||||
import im.vector.app.features.home.room.detail.upgrade.MigrateRoomBottomSheet
|
||||
import im.vector.app.features.home.room.detail.widget.RoomWidgetsBottomSheet
|
||||
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsBottomSheet
|
||||
import im.vector.app.features.invite.AutoAcceptInvites
|
||||
import im.vector.app.features.invite.VectorInviteView
|
||||
import im.vector.app.features.matrixto.MatrixToBottomSheet
|
||||
import im.vector.app.features.navigation.Navigator
|
||||
import im.vector.app.features.pin.PinLocker
|
||||
import im.vector.app.features.rageshake.BugReporter
|
||||
import im.vector.app.features.rageshake.RageShake
|
||||
import im.vector.app.features.reactions.widget.ReactionButton
|
||||
import im.vector.app.features.roommemberprofile.devices.DeviceListBottomSheet
|
||||
import im.vector.app.features.roomprofile.alias.detail.RoomAliasBottomSheet
|
||||
import im.vector.app.features.roomprofile.settings.historyvisibility.RoomHistoryVisibilityBottomSheet
|
||||
import im.vector.app.features.roomprofile.settings.joinrule.RoomJoinRuleBottomSheet
|
||||
import im.vector.app.features.settings.devices.DeviceVerificationInfoBottomSheet
|
||||
import im.vector.app.features.spaces.InviteRoomSpaceChooserBottomSheet
|
||||
import im.vector.app.features.spaces.LeaveSpaceBottomSheet
|
||||
import im.vector.app.features.spaces.SpaceSettingsMenuBottomSheet
|
||||
import im.vector.app.features.spaces.invite.SpaceInviteBottomSheet
|
||||
import im.vector.app.features.spaces.share.ShareSpaceBottomSheet
|
||||
import im.vector.app.features.ui.UiStateRepository
|
||||
import im.vector.app.features.widgets.permissions.RoomWidgetPermissionBottomSheet
|
||||
import im.vector.app.features.workers.signout.SignOutBottomSheetDialogFragment
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
@Component(
|
||||
dependencies = [
|
||||
SingletonEntryPoint::class
|
||||
],
|
||||
modules = [
|
||||
ViewModelModule::class,
|
||||
FragmentModule::class,
|
||||
HomeModule::class,
|
||||
ScreenModule::class
|
||||
]
|
||||
)
|
||||
@ScreenScope
|
||||
interface ScreenComponent {
|
||||
|
||||
/* ==========================================================================================
|
||||
* Shortcut to VectorComponent elements
|
||||
* ========================================================================================== */
|
||||
|
||||
fun activeSessionHolder(): ActiveSessionHolder
|
||||
fun fragmentFactory(): FragmentFactory
|
||||
fun viewModelFactory(): ViewModelProvider.Factory
|
||||
fun bugReporter(): BugReporter
|
||||
fun rageShake(): RageShake
|
||||
fun navigator(): Navigator
|
||||
fun pinLocker(): PinLocker
|
||||
fun errorFormatter(): ErrorFormatter
|
||||
fun uiStateRepository(): UiStateRepository
|
||||
fun unrecognizedCertificateDialog(): UnrecognizedCertificateDialog
|
||||
fun autoAcceptInvites(): AutoAcceptInvites
|
||||
fun appCoroutineScope(): CoroutineScope
|
||||
|
||||
/* ==========================================================================================
|
||||
* BottomSheets
|
||||
* ========================================================================================== */
|
||||
|
||||
fun inject(bottomSheet: MessageActionsBottomSheet)
|
||||
fun inject(bottomSheet: ViewReactionsBottomSheet)
|
||||
fun inject(bottomSheet: ViewEditHistoryBottomSheet)
|
||||
fun inject(bottomSheet: DisplayReadReceiptsBottomSheet)
|
||||
fun inject(bottomSheet: RoomListQuickActionsBottomSheet)
|
||||
fun inject(bottomSheet: RoomAliasBottomSheet)
|
||||
fun inject(bottomSheet: RoomHistoryVisibilityBottomSheet)
|
||||
fun inject(bottomSheet: RoomJoinRuleBottomSheet)
|
||||
fun inject(bottomSheet: VerificationBottomSheet)
|
||||
fun inject(bottomSheet: DeviceVerificationInfoBottomSheet)
|
||||
fun inject(bottomSheet: DeviceListBottomSheet)
|
||||
fun inject(bottomSheet: BootstrapBottomSheet)
|
||||
fun inject(bottomSheet: RoomWidgetPermissionBottomSheet)
|
||||
fun inject(bottomSheet: RoomWidgetsBottomSheet)
|
||||
fun inject(bottomSheet: CallControlsBottomSheet)
|
||||
fun inject(bottomSheet: SignOutBottomSheetDialogFragment)
|
||||
fun inject(bottomSheet: MatrixToBottomSheet)
|
||||
fun inject(bottomSheet: ShareSpaceBottomSheet)
|
||||
fun inject(bottomSheet: SpaceSettingsMenuBottomSheet)
|
||||
fun inject(bottomSheet: InviteRoomSpaceChooserBottomSheet)
|
||||
fun inject(bottomSheet: SpaceInviteBottomSheet)
|
||||
fun inject(bottomSheet: JoinReplacementRoomBottomSheet)
|
||||
fun inject(bottomSheet: MigrateRoomBottomSheet)
|
||||
fun inject(bottomSheet: LeaveSpaceBottomSheet)
|
||||
|
||||
/* ==========================================================================================
|
||||
* Others
|
||||
* ========================================================================================== */
|
||||
|
||||
fun inject(view: VectorInviteView)
|
||||
fun inject(preference: UserAvatarPreference)
|
||||
fun inject(button: ReactionButton)
|
||||
|
||||
/* ==========================================================================================
|
||||
* Factory
|
||||
* ========================================================================================== */
|
||||
|
||||
@Component.Factory
|
||||
interface Factory {
|
||||
fun create(deps: SingletonEntryPoint,
|
||||
@BindsInstance context: FragmentActivity
|
||||
): ScreenComponent
|
||||
}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* Copyright 2019 New Vector Ltd
|
||||
* Copyright (c) 2021 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
|
||||
* 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,
|
||||
|
@ -20,11 +20,13 @@ import androidx.appcompat.app.AppCompatActivity
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.migration.DisableInstallInCheck
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityComponent
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import im.vector.app.core.glide.GlideApp
|
||||
|
||||
@Module
|
||||
@DisableInstallInCheck
|
||||
@InstallIn(ActivityComponent::class)
|
||||
object ScreenModule {
|
||||
|
||||
@Provides
|
||||
|
@ -33,6 +35,6 @@ object ScreenModule {
|
|||
|
||||
@Provides
|
||||
@JvmStatic
|
||||
@ScreenScope
|
||||
@ActivityScoped
|
||||
fun providesSharedViewPool() = RecyclerView.RecycledViewPool()
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019 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 im.vector.app.core.di
|
||||
|
||||
import javax.inject.Scope
|
||||
|
||||
@Scope
|
||||
@MustBeDocumented
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class ScreenScope
|
|
@ -20,7 +20,8 @@ import androidx.lifecycle.ViewModel
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.migration.DisableInstallInCheck
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ActivityComponent
|
||||
import dagger.multibindings.IntoMap
|
||||
import im.vector.app.core.platform.ConfigurationViewModel
|
||||
import im.vector.app.features.call.SharedKnownCallsViewModel
|
||||
|
@ -43,7 +44,7 @@ import im.vector.app.features.spaces.SpacePreviewSharedActionViewModel
|
|||
import im.vector.app.features.spaces.people.SpacePeopleSharedActionViewModel
|
||||
import im.vector.app.features.userdirectory.UserListSharedActionViewModel
|
||||
|
||||
@DisableInstallInCheck
|
||||
@InstallIn(ActivityComponent::class)
|
||||
@Module
|
||||
interface ViewModelModule {
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ import com.bumptech.glide.util.Util
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.jakewharton.rxbinding3.view.clicks
|
||||
import dagger.hilt.EntryPoints
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
import im.vector.app.BuildConfig
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ActivityEntryPoint
|
||||
import im.vector.app.core.di.SingletonEntryPoint
|
||||
import im.vector.app.core.di.DaggerScreenComponent
|
||||
import im.vector.app.core.di.HasVectorInjector
|
||||
import im.vector.app.core.dialogs.DialogLocker
|
||||
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog
|
||||
|
@ -184,19 +184,19 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
|
|||
@CallSuper
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
Timber.i("onCreate Activity ${javaClass.simpleName}")
|
||||
val screenComponentDeps = singletonEntryPoint()
|
||||
val screenComponent = DaggerScreenComponent.factory().create(screenComponentDeps, this)
|
||||
val singletonEntryPoint = singletonEntryPoint()
|
||||
val activityEntryPoint = EntryPointAccessors.fromActivity(this, ActivityEntryPoint::class.java)
|
||||
ThemeUtils.setActivityTheme(this, getOtherThemes())
|
||||
fragmentFactory = screenComponent.fragmentFactory()
|
||||
fragmentFactory = activityEntryPoint.fragmentFactory()
|
||||
supportFragmentManager.fragmentFactory = fragmentFactory
|
||||
viewModelFactory = activityEntryPoint.viewModelFactory()
|
||||
super.onCreate(savedInstanceState)
|
||||
viewModelFactory = screenComponent.viewModelFactory()
|
||||
configurationViewModel = viewModelProvider.get(ConfigurationViewModel::class.java)
|
||||
bugReporter = screenComponentDeps.bugReporter()
|
||||
pinLocker = screenComponentDeps.pinLocker()
|
||||
navigator = screenComponentDeps.navigator()
|
||||
activeSessionHolder = screenComponentDeps.activeSessionHolder()
|
||||
vectorPreferences = screenComponentDeps.vectorPreferences()
|
||||
bugReporter = singletonEntryPoint.bugReporter()
|
||||
pinLocker = singletonEntryPoint.pinLocker()
|
||||
navigator = singletonEntryPoint.navigator()
|
||||
activeSessionHolder = singletonEntryPoint.activeSessionHolder()
|
||||
vectorPreferences = singletonEntryPoint.vectorPreferences()
|
||||
configurationViewModel.activityRestarter.observe(this) {
|
||||
if (!it.hasBeenHandled) {
|
||||
// Recreate the Activity because configuration has changed
|
||||
|
@ -208,7 +208,7 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
|
|||
navigator.openPinCode(this, pinStartForActivityResult, PinMode.AUTH)
|
||||
}
|
||||
}
|
||||
sessionListener = screenComponentDeps.sessionListener()
|
||||
sessionListener = singletonEntryPoint.sessionListener()
|
||||
sessionListener.globalErrorLiveData.observeEvent(this) {
|
||||
handleGlobalError(it)
|
||||
}
|
||||
|
|
|
@ -33,10 +33,8 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior
|
|||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import com.jakewharton.rxbinding3.view.clicks
|
||||
import dagger.hilt.EntryPoints
|
||||
import im.vector.app.core.di.SingletonEntryPoint
|
||||
import im.vector.app.core.di.DaggerScreenComponent
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
import im.vector.app.core.di.ActivityEntryPoint
|
||||
import im.vector.app.core.utils.DimensionConverter
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
|
@ -49,8 +47,6 @@ import java.util.concurrent.TimeUnit
|
|||
*/
|
||||
abstract class VectorBaseBottomSheetDialogFragment<VB : ViewBinding> : BottomSheetDialogFragment(), MavericksView {
|
||||
|
||||
private lateinit var screenComponent: ScreenComponent
|
||||
|
||||
/* ==========================================================================================
|
||||
* View
|
||||
* ========================================================================================== */
|
||||
|
@ -124,17 +120,11 @@ abstract class VectorBaseBottomSheetDialogFragment<VB : ViewBinding> : BottomShe
|
|||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
val screenComponentDeps = EntryPoints.get(
|
||||
vectorBaseActivity.applicationContext,
|
||||
SingletonEntryPoint::class.java)
|
||||
screenComponent = DaggerScreenComponent.factory().create(screenComponentDeps, vectorBaseActivity)
|
||||
viewModelFactory = screenComponent.viewModelFactory()
|
||||
val activityEntryPoint = EntryPointAccessors.fromActivity(vectorBaseActivity, ActivityEntryPoint::class.java)
|
||||
viewModelFactory = activityEntryPoint.viewModelFactory()
|
||||
super.onAttach(context)
|
||||
injectWith(screenComponent)
|
||||
}
|
||||
|
||||
protected open fun injectWith(injector: ScreenComponent) = Unit
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
Timber.i("onResume BottomSheet ${javaClass.simpleName}")
|
||||
|
|
|
@ -35,12 +35,10 @@ import com.bumptech.glide.util.Util.assertMainThread
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.jakewharton.rxbinding3.view.clicks
|
||||
import dagger.hilt.EntryPoints
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.SingletonEntryPoint
|
||||
import im.vector.app.core.di.DaggerScreenComponent
|
||||
import im.vector.app.core.di.HasScreenInjector
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.di.ActivityEntryPoint
|
||||
|
||||
import im.vector.app.core.dialogs.UnrecognizedCertificateDialog
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.singletonEntryPoint
|
||||
|
@ -53,7 +51,7 @@ import io.reactivex.disposables.Disposable
|
|||
import timber.log.Timber
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView, HasScreenInjector {
|
||||
abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView {
|
||||
|
||||
protected val vectorBaseActivity: VectorBaseActivity<*> by lazy {
|
||||
activity as VectorBaseActivity<*>
|
||||
|
@ -63,8 +61,6 @@ abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView,
|
|||
* Navigator and other common objects
|
||||
* ========================================================================================== */
|
||||
|
||||
private lateinit var screenComponent: ScreenComponent
|
||||
|
||||
protected lateinit var navigator: Navigator
|
||||
protected lateinit var errorFormatter: ErrorFormatter
|
||||
protected lateinit var unrecognizedCertificateDialog: UnrecognizedCertificateDialog
|
||||
|
@ -98,13 +94,13 @@ abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView,
|
|||
* ========================================================================================== */
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
val screenComponentDeps = context.singletonEntryPoint()
|
||||
screenComponent = DaggerScreenComponent.factory().create(screenComponentDeps, vectorBaseActivity)
|
||||
navigator = screenComponent.navigator()
|
||||
errorFormatter = screenComponent.errorFormatter()
|
||||
unrecognizedCertificateDialog = screenComponent.unrecognizedCertificateDialog()
|
||||
viewModelFactory = screenComponent.viewModelFactory()
|
||||
childFragmentManager.fragmentFactory = screenComponent.fragmentFactory()
|
||||
val singletonEntryPoint = context.singletonEntryPoint()
|
||||
val activityEntryPoint = EntryPointAccessors.fromActivity(vectorBaseActivity,ActivityEntryPoint::class.java)
|
||||
navigator = singletonEntryPoint.navigator()
|
||||
errorFormatter = singletonEntryPoint.errorFormatter()
|
||||
unrecognizedCertificateDialog = singletonEntryPoint.unrecognizedCertificateDialog()
|
||||
viewModelFactory = activityEntryPoint.viewModelFactory()
|
||||
childFragmentManager.fragmentFactory = activityEntryPoint.fragmentFactory()
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
|
@ -165,10 +161,6 @@ abstract class VectorBaseFragment<VB : ViewBinding> : Fragment(), MavericksView,
|
|||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun injector(): ScreenComponent {
|
||||
return screenComponent
|
||||
}
|
||||
|
||||
/* ==========================================================================================
|
||||
* Restorable
|
||||
* ========================================================================================== */
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.startSyncing
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.platform.SimpleFragmentActivity
|
||||
import im.vector.app.core.utils.openUrlInChromeCustomTab
|
||||
|
|
|
@ -23,10 +23,12 @@ import android.view.ViewGroup
|
|||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import com.airbnb.mvrx.activityViewModel
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.databinding.BottomSheetCallControlsBinding
|
||||
|
||||
@AndroidEntryPoint
|
||||
class CallControlsBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetCallControlsBinding>() {
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetCallControlsBinding {
|
||||
return BottomSheetCallControlsBinding.inflate(inflater, container, false)
|
||||
|
|
|
@ -43,7 +43,6 @@ import com.google.android.material.card.MaterialCardView
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.core.utils.PERMISSIONS_FOR_AUDIO_IP_CALL
|
||||
|
|
|
@ -35,7 +35,7 @@ import com.facebook.react.modules.core.PermissionListener
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityJitsiBinding
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityCallTransferBinding
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.core.platform.SimpleFragmentActivity
|
||||
import im.vector.app.core.platform.WaitingViewData
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.dialogs.ExportKeysDialog
|
||||
import im.vector.app.core.extensions.observeEvent
|
||||
import im.vector.app.core.extensions.queryExportKeys
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.platform.SimpleFragmentActivity
|
||||
|
|
|
@ -33,8 +33,9 @@ import androidx.fragment.app.FragmentManager
|
|||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
|
@ -46,6 +47,7 @@ import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
|
|||
import javax.inject.Inject
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@AndroidEntryPoint
|
||||
class BootstrapBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetBootstrapBinding>() {
|
||||
|
||||
@Parcelize
|
||||
|
@ -60,10 +62,6 @@ class BootstrapBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetBoot
|
|||
|
||||
private val viewModel by fragmentViewModel(BootstrapSharedViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetBootstrapBinding {
|
||||
return BottomSheetBootstrapBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -28,8 +28,9 @@ import com.airbnb.mvrx.Mavericks
|
|||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
|
@ -61,6 +62,7 @@ import timber.log.Timber
|
|||
import javax.inject.Inject
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@AndroidEntryPoint
|
||||
class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetVerificationBinding>() {
|
||||
|
||||
@Parcelize
|
||||
|
@ -83,10 +85,6 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetV
|
|||
|
||||
private val viewModel by fragmentViewModel(VerificationBottomSheetViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetVerificationBinding {
|
||||
return BottomSheetVerificationBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import com.airbnb.mvrx.withState
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.core.extensions.toMvRxBundle
|
||||
|
|
|
@ -38,7 +38,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
|||
import im.vector.app.AppStateHandler
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.hideKeyboard
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
|
|
|
@ -25,8 +25,9 @@ import com.airbnb.mvrx.Loading
|
|||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.Uninitialized
|
||||
import com.airbnb.mvrx.parentFragmentViewModel
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.epoxy.ClickListener
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.platform.ButtonStateView
|
||||
|
@ -34,6 +35,7 @@ import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
|||
import im.vector.app.databinding.BottomSheetTombstoneJoinBinding
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class JoinReplacementRoomBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetTombstoneJoinBinding>() {
|
||||
|
||||
|
@ -43,10 +45,6 @@ class JoinReplacementRoomBottomSheet :
|
|||
@Inject
|
||||
lateinit var errorFormatter: ErrorFormatter
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
private val viewModel: RoomDetailViewModel by parentFragmentViewModel()
|
||||
|
||||
override val showExpanded: Boolean
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.hideKeyboard
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.core.platform.ToolbarConfigurable
|
||||
|
|
|
@ -23,8 +23,8 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import com.airbnb.mvrx.Mavericks
|
||||
import com.airbnb.mvrx.args
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -43,6 +43,7 @@ data class DisplayReadReceiptArgs(
|
|||
/**
|
||||
* Bottom sheet displaying list of read receipts for a given event ordered by descending timestamp
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class DisplayReadReceiptsBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListWithTitleBinding>(),
|
||||
DisplayReadReceiptsController.Listener {
|
||||
|
@ -53,10 +54,6 @@ class DisplayReadReceiptsBottomSheet :
|
|||
|
||||
private lateinit var sharedActionViewModel: MessageSharedActionViewModel
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListWithTitleBinding {
|
||||
return BottomSheetGenericListWithTitleBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import androidx.appcompat.widget.SearchView
|
|||
import com.airbnb.mvrx.Mavericks
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivitySearchBinding
|
||||
|
|
|
@ -21,7 +21,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -32,6 +32,7 @@ import javax.inject.Inject
|
|||
/**
|
||||
* Bottom sheet fragment that shows a message preview with list of contextual actions
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class MessageActionsBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListBinding>(),
|
||||
MessageActionsEpoxyController.MessageActionsEpoxyControllerListener {
|
||||
|
@ -44,10 +45,6 @@ class MessageActionsBottomSheet :
|
|||
|
||||
private lateinit var sharedActionViewModel: MessageSharedActionViewModel
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListBinding {
|
||||
return BottomSheetGenericListBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ import android.view.ViewGroup
|
|||
import com.airbnb.mvrx.Mavericks
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -35,6 +35,7 @@ import javax.inject.Inject
|
|||
/**
|
||||
* Bottom sheet displaying list of edits for a given event ordered by timestamp
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class ViewEditHistoryBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListWithTitleBinding>() {
|
||||
|
||||
|
@ -42,10 +43,6 @@ class ViewEditHistoryBottomSheet :
|
|||
|
||||
@Inject lateinit var epoxyController: ViewEditHistoryEpoxyController
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListWithTitleBinding {
|
||||
return BottomSheetGenericListWithTitleBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -19,16 +19,16 @@ package im.vector.app.features.home.room.detail.timeline.helper
|
|||
import android.graphics.drawable.Drawable
|
||||
import androidx.vectordrawable.graphics.drawable.Animatable2Compat
|
||||
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenScope
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.features.home.room.detail.timeline.MessageColorProvider
|
||||
import im.vector.app.features.home.room.detail.timeline.item.MessageFileItem
|
||||
import org.matrix.android.sdk.api.session.file.ContentDownloadStateTracker
|
||||
import javax.inject.Inject
|
||||
|
||||
@ScreenScope
|
||||
@ActivityScoped
|
||||
class ContentDownloadStateTrackerBinder @Inject constructor(private val activeSessionHolder: ActiveSessionHolder,
|
||||
private val messageColorProvider: MessageColorProvider,
|
||||
private val errorFormatter: ErrorFormatter) {
|
||||
|
|
|
@ -22,9 +22,9 @@ import android.view.ViewGroup
|
|||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenScope
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.utils.TextUtils
|
||||
|
@ -33,7 +33,7 @@ import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker
|
|||
import org.matrix.android.sdk.api.session.room.send.SendState
|
||||
import javax.inject.Inject
|
||||
|
||||
@ScreenScope
|
||||
@ActivityScoped
|
||||
class ContentUploadStateTrackerBinder @Inject constructor(private val activeSessionHolder: ActiveSessionHolder,
|
||||
private val messageColorProvider: MessageColorProvider,
|
||||
private val errorFormatter: ErrorFormatter) {
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
package im.vector.app.features.home.room.detail.timeline.helper
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import im.vector.app.core.di.ScreenScope
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ScreenScope
|
||||
@ActivityScoped
|
||||
class TimelineMediaSizeProvider @Inject constructor() {
|
||||
|
||||
var recyclerView: RecyclerView? = null
|
||||
|
|
|
@ -18,10 +18,10 @@ package im.vector.app.features.home.room.detail.timeline.helper
|
|||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import im.vector.app.core.di.ScreenScope
|
||||
import dagger.hilt.android.scopes.ActivityScoped
|
||||
import javax.inject.Inject
|
||||
|
||||
@ScreenScope
|
||||
@ActivityScoped
|
||||
class VoiceMessagePlaybackTracker @Inject constructor() {
|
||||
|
||||
private val mainHandler = Handler(Looper.getMainLooper())
|
||||
|
|
|
@ -23,8 +23,8 @@ import android.view.ViewGroup
|
|||
import com.airbnb.mvrx.Mavericks
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -38,6 +38,7 @@ import javax.inject.Inject
|
|||
/**
|
||||
* Bottom sheet displaying list of reactions for a given event ordered by timestamp
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class ViewReactionsBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListWithTitleBinding>(),
|
||||
ViewReactionsEpoxyController.Listener {
|
||||
|
@ -48,10 +49,6 @@ class ViewReactionsBottomSheet :
|
|||
|
||||
@Inject lateinit var epoxyController: ViewReactionsEpoxyController
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListWithTitleBinding {
|
||||
return BottomSheetGenericListWithTitleBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -27,8 +27,9 @@ import com.airbnb.mvrx.Loading
|
|||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -36,6 +37,7 @@ import im.vector.app.databinding.BottomSheetRoomUpgradeBinding
|
|||
import kotlinx.parcelize.Parcelize
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MigrateRoomBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetRoomUpgradeBinding>(){
|
||||
|
||||
|
@ -54,15 +56,10 @@ class MigrateRoomBottomSheet :
|
|||
|
||||
override val showExpanded = true
|
||||
|
||||
@Inject
|
||||
lateinit var errorFormatter: ErrorFormatter
|
||||
@Inject lateinit var errorFormatter: ErrorFormatter
|
||||
|
||||
val viewModel: MigrateRoomViewModel by fragmentViewModel()
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun invalidate() = withState(viewModel) { state ->
|
||||
views.headerText.setText(if (state.isPublic) R.string.upgrade_public_room else R.string.upgrade_private_room)
|
||||
|
||||
|
|
|
@ -22,8 +22,9 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import com.airbnb.mvrx.parentFragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -39,6 +40,7 @@ import javax.inject.Inject
|
|||
/**
|
||||
* Bottom sheet displaying active widgets in a room
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class RoomWidgetsBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListWithTitleBinding>(),
|
||||
RoomWidgetsController.Listener {
|
||||
|
@ -49,10 +51,6 @@ class RoomWidgetsBottomSheet :
|
|||
|
||||
private val roomDetailViewModel: RoomDetailViewModel by parentFragmentViewModel()
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListWithTitleBinding {
|
||||
return BottomSheetGenericListWithTitleBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import android.os.Bundle
|
|||
import androidx.appcompat.widget.SearchView
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityFilteredRoomsBinding
|
||||
|
|
|
@ -26,8 +26,8 @@ import com.airbnb.mvrx.args
|
|||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
|
@ -56,6 +56,7 @@ data class RoomListActionsArgs(
|
|||
/**
|
||||
* Bottom sheet fragment that shows room information with list of contextual actions
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class RoomListQuickActionsBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListBinding>(),
|
||||
RoomListQuickActionsEpoxyController.Listener {
|
||||
|
@ -71,10 +72,6 @@ class RoomListQuickActionsBottomSheet :
|
|||
|
||||
override val showExpanded = true
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListBinding {
|
||||
return BottomSheetGenericListBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
|
|
|
@ -23,7 +23,6 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|||
import androidx.core.view.updateLayoutParams
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.HasScreenInjector
|
||||
import im.vector.app.databinding.VectorInviteViewBinding
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.core.utils.toast
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.google.android.material.appbar.MaterialToolbar
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.POP_BACK_STACK_EXCLUSIVE
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.google.android.material.appbar.MaterialToolbar
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.POP_BACK_STACK_EXCLUSIVE
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
|
|
|
@ -28,8 +28,9 @@ import com.airbnb.mvrx.Mavericks
|
|||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.databinding.BottomSheetMatrixToCardBinding
|
||||
|
@ -39,6 +40,7 @@ import org.matrix.android.sdk.api.session.permalinks.PermalinkData
|
|||
import javax.inject.Inject
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MatrixToBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetMatrixToCardBinding>() {
|
||||
|
||||
|
@ -49,10 +51,6 @@ class MatrixToBottomSheet :
|
|||
|
||||
@Inject lateinit var avatarRenderer: AvatarRenderer
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
var interactionListener: InteractionListener? = null
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetMatrixToCardBinding {
|
||||
|
|
|
@ -22,7 +22,7 @@ import android.os.Bundle
|
|||
import androidx.core.net.toUri
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityBigImageViewerBinding
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.google.zxing.Result
|
|||
import com.google.zxing.ResultMetadataType
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivitySimpleBinding
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityBugReportBinding
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.jakewharton.rxbinding3.widget.queryTextChanges
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.EmojiCompatFontProvider
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.observeEvent
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityEmojiReactionPickerBinding
|
||||
|
|
|
@ -26,7 +26,6 @@ import androidx.core.content.withStyledAttributes
|
|||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.EmojiCompatWrapper
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.HasScreenInjector
|
||||
import im.vector.app.core.utils.DimensionConverter
|
||||
import im.vector.app.core.utils.TextUtils
|
||||
import im.vector.app.databinding.ReactionButtonBinding
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
import im.vector.app.core.extensions.popBackstack
|
||||
|
|
|
@ -22,7 +22,7 @@ import android.os.Bundle
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.platform.ToolbarConfigurable
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.platform.ToolbarConfigurable
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
|
|
|
@ -27,8 +27,9 @@ import androidx.fragment.app.Fragment
|
|||
import com.airbnb.mvrx.Mavericks
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -38,6 +39,7 @@ import kotlinx.parcelize.Parcelize
|
|||
import javax.inject.Inject
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DeviceListBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetWithFragmentsBinding>() {
|
||||
|
||||
|
@ -49,10 +51,6 @@ class DeviceListBottomSheet :
|
|||
|
||||
@Inject lateinit var viewModelFactory: DeviceListBottomSheetViewModel.Factory
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
viewModel.observeViewEvents {
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
|
|
|
@ -24,7 +24,8 @@ import android.view.ViewGroup
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -44,6 +45,7 @@ data class RoomAliasBottomSheetArgs(
|
|||
/**
|
||||
* Bottom sheet fragment that shows room alias information with list of contextual actions
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class RoomAliasBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListBinding>(),
|
||||
RoomAliasBottomSheetController.Listener {
|
||||
|
@ -56,10 +58,6 @@ class RoomAliasBottomSheet :
|
|||
|
||||
override val showExpanded = true
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListBinding {
|
||||
return BottomSheetGenericListBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ import android.os.Parcelable
|
|||
import android.view.View
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
import im.vector.app.core.ui.bottomsheet.BottomSheetGeneric
|
||||
import im.vector.app.core.ui.bottomsheet.BottomSheetGenericController
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
@ -33,16 +34,13 @@ data class RoomHistoryVisibilityBottomSheetArgs(
|
|||
val currentRoomHistoryVisibility: RoomHistoryVisibility
|
||||
) : Parcelable
|
||||
|
||||
@AndroidEntryPoint
|
||||
class RoomHistoryVisibilityBottomSheet : BottomSheetGeneric<RoomHistoryVisibilityState, RoomHistoryVisibilityRadioAction>() {
|
||||
|
||||
private lateinit var roomHistoryVisibilitySharedActionViewModel: RoomHistoryVisibilitySharedActionViewModel
|
||||
@Inject lateinit var controller: RoomHistoryVisibilityController
|
||||
private val viewModel: RoomHistoryVisibilityViewModel by fragmentViewModel(RoomHistoryVisibilityViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getController(): BottomSheetGenericController<RoomHistoryVisibilityState, RoomHistoryVisibilityRadioAction> = controller
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
|
|
|
@ -21,7 +21,8 @@ import android.os.Parcelable
|
|||
import android.view.View
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
import im.vector.app.core.ui.bottomsheet.BottomSheetGeneric
|
||||
import im.vector.app.core.ui.bottomsheet.BottomSheetGenericController
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
@ -44,16 +45,13 @@ data class RoomJoinRuleBottomSheetArgs(
|
|||
val parentSpaceName: String?
|
||||
) : Parcelable
|
||||
|
||||
@AndroidEntryPoint
|
||||
class RoomJoinRuleBottomSheet : BottomSheetGeneric<RoomJoinRuleState, RoomJoinRuleRadioAction>() {
|
||||
|
||||
private lateinit var roomJoinRuleSharedActionViewModel: RoomJoinRuleSharedActionViewModel
|
||||
@Inject lateinit var controller: RoomJoinRuleController
|
||||
private val viewModel: RoomJoinRuleViewModel by fragmentViewModel(RoomJoinRuleViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getController(): BottomSheetGenericController<RoomJoinRuleState, RoomJoinRuleRadioAction> = controller
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import androidx.preference.Preference
|
|||
import androidx.preference.PreferenceFragmentCompat
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityVectorSettingsBinding
|
||||
|
|
|
@ -22,13 +22,9 @@ import android.view.View
|
|||
import androidx.annotation.CallSuper
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.EntryPoints
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.SingletonEntryPoint
|
||||
import im.vector.app.core.di.DaggerScreenComponent
|
||||
import im.vector.app.core.di.HasScreenInjector
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.singletonEntryPoint
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.core.utils.toast
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
|
@ -36,7 +32,7 @@ import io.reactivex.disposables.Disposable
|
|||
import org.matrix.android.sdk.api.session.Session
|
||||
import timber.log.Timber
|
||||
|
||||
abstract class VectorSettingsBaseFragment : PreferenceFragmentCompat(), HasScreenInjector {
|
||||
abstract class VectorSettingsBaseFragment : PreferenceFragmentCompat() {
|
||||
|
||||
val vectorActivity: VectorBaseActivity<*> by lazy {
|
||||
activity as VectorBaseActivity<*>
|
||||
|
@ -47,7 +43,6 @@ abstract class VectorSettingsBaseFragment : PreferenceFragmentCompat(), HasScree
|
|||
// members
|
||||
protected lateinit var session: Session
|
||||
protected lateinit var errorFormatter: ErrorFormatter
|
||||
private lateinit var screenComponent: ScreenComponent
|
||||
|
||||
abstract val preferenceXmlRes: Int
|
||||
|
||||
|
@ -58,20 +53,10 @@ abstract class VectorSettingsBaseFragment : PreferenceFragmentCompat(), HasScree
|
|||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
val screenComponentDeps = EntryPoints.get(
|
||||
vectorActivity.applicationContext,
|
||||
SingletonEntryPoint::class.java)
|
||||
screenComponent = DaggerScreenComponent.factory().create(screenComponentDeps, vectorActivity)
|
||||
val singletonEntryPoint = context.singletonEntryPoint()
|
||||
super.onAttach(context)
|
||||
session = screenComponent.activeSessionHolder().getActiveSession()
|
||||
errorFormatter = screenComponent.errorFormatter()
|
||||
injectWith(injector())
|
||||
}
|
||||
|
||||
protected open fun injectWith(injector: ScreenComponent) = Unit
|
||||
|
||||
override fun injector(): ScreenComponent {
|
||||
return screenComponent
|
||||
session = singletonEntryPoint.activeSessionHolder().getActiveSession()
|
||||
errorFormatter = singletonEntryPoint.errorFormatter()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
|
@ -25,7 +25,8 @@ import com.airbnb.mvrx.Mavericks
|
|||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.parentFragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
|
@ -39,6 +40,7 @@ data class DeviceVerificationInfoArgs(
|
|||
val deviceId: String
|
||||
) : Parcelable
|
||||
|
||||
@AndroidEntryPoint
|
||||
class DeviceVerificationInfoBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetGenericListWithTitleBinding>(),
|
||||
DeviceVerificationInfoBottomSheetController.Callback {
|
||||
|
@ -48,11 +50,6 @@ class DeviceVerificationInfoBottomSheet :
|
|||
private val sharedViewModel: DevicesViewModel by parentFragmentViewModel(DevicesViewModel::class)
|
||||
|
||||
@Inject lateinit var deviceVerificationInfoViewModelFactory: DeviceVerificationInfoBottomSheetViewModel.Factory
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
@Inject lateinit var controller: DeviceVerificationInfoBottomSheetController
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetGenericListWithTitleBinding {
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.features.MainActivity
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
import im.vector.app.features.MainActivity
|
||||
|
|
|
@ -23,14 +23,16 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import com.airbnb.mvrx.args
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.databinding.BottomSheetSpaceInviteChooserBinding
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class InviteRoomSpaceChooserBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetSpaceInviteChooserBinding>() {
|
||||
|
||||
@Parcelize
|
||||
|
@ -53,10 +55,6 @@ class InviteRoomSpaceChooserBottomSheet : VectorBaseBottomSheetDialogFragment<Bo
|
|||
|
||||
var interactionListener: InteractionListener? = null
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetSpaceInviteChooserBinding {
|
||||
return BottomSheetSpaceInviteChooserBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -32,8 +32,9 @@ import com.airbnb.mvrx.args
|
|||
import com.airbnb.mvrx.parentFragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import com.jakewharton.rxbinding3.widget.checkedChanges
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
|
@ -49,6 +50,7 @@ import me.gujun.android.span.span
|
|||
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class LeaveSpaceBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetLeaveSpaceBinding>() {
|
||||
|
||||
val settingsViewModel: SpaceMenuViewModel by parentFragmentViewModel()
|
||||
|
@ -60,10 +62,6 @@ class LeaveSpaceBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetLea
|
|||
@Inject lateinit var colorProvider: ColorProvider
|
||||
@Inject lateinit var errorFormatter: ErrorFormatter
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
data class Args(
|
||||
val spaceId: String
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.airbnb.mvrx.withState
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.toMvRxBundle
|
||||
import im.vector.app.core.platform.SimpleFragmentActivity
|
||||
import im.vector.app.features.spaces.create.ChoosePrivateSpaceTypeFragment
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.Mavericks
|
|||
import com.airbnb.mvrx.viewModel
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivitySimpleBinding
|
||||
|
|
|
@ -26,7 +26,8 @@ import com.airbnb.mvrx.Success
|
|||
import com.airbnb.mvrx.args
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.databinding.BottomSheetSpaceSettingsBinding
|
||||
|
@ -46,6 +47,7 @@ data class SpaceBottomSheetSettingsArgs(
|
|||
val spaceId: String
|
||||
) : Parcelable
|
||||
|
||||
@AndroidEntryPoint
|
||||
class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetSpaceSettingsBinding>(){
|
||||
|
||||
@Inject lateinit var navigator: Navigator
|
||||
|
@ -64,10 +66,6 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomS
|
|||
|
||||
override val showExpanded = true
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
var isLastAdmin: Boolean = false
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetSpaceSettingsBinding {
|
||||
|
|
|
@ -30,8 +30,9 @@ import com.airbnb.mvrx.Uninitialized
|
|||
import com.airbnb.mvrx.args
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.platform.ButtonStateView
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.core.utils.toast
|
||||
|
@ -43,6 +44,7 @@ import kotlinx.parcelize.Parcelize
|
|||
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class SpaceInviteBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetInvitedToSpaceBinding>() {
|
||||
|
||||
interface InteractionListener {
|
||||
|
@ -57,18 +59,11 @@ class SpaceInviteBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetIn
|
|||
val spaceId: String
|
||||
) : Parcelable
|
||||
|
||||
@Inject
|
||||
lateinit var avatarRenderer: AvatarRenderer
|
||||
|
||||
@Inject
|
||||
lateinit var spaceCardRenderer: SpaceCardRenderer
|
||||
@Inject lateinit var avatarRenderer: AvatarRenderer
|
||||
@Inject lateinit var spaceCardRenderer: SpaceCardRenderer
|
||||
|
||||
private val viewModel: SpaceInviteBottomSheetViewModel by fragmentViewModel(SpaceInviteBottomSheetViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override val showExpanded = true
|
||||
|
||||
private val inviteArgs: Args by args()
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.google.android.material.appbar.MaterialToolbar
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.extensions.hideKeyboard
|
||||
|
|
|
@ -28,7 +28,7 @@ import com.airbnb.mvrx.withState
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragmentToBackstack
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.extensions.hideKeyboard
|
||||
|
|
|
@ -25,8 +25,9 @@ import androidx.core.view.isVisible
|
|||
import androidx.fragment.app.FragmentManager
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.core.utils.startSharePlainTextIntent
|
||||
|
@ -35,6 +36,7 @@ import im.vector.app.features.invite.InviteUsersToRoomActivity
|
|||
import kotlinx.parcelize.Parcelize
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class ShareSpaceBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetSpaceInviteBinding>(){
|
||||
|
||||
@Parcelize
|
||||
|
@ -47,10 +49,6 @@ class ShareSpaceBottomSheet : VectorBaseBottomSheetDialogFragment<BottomSheetSpa
|
|||
|
||||
private val viewModel: ShareSpaceViewModel by fragmentViewModel(ShareSpaceViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): BottomSheetSpaceInviteBinding {
|
||||
return BottomSheetSpaceInviteBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.extensions.replaceFragment
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.commitTransaction
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
|
|
|
@ -23,7 +23,7 @@ import android.webkit.WebView
|
|||
import androidx.annotation.CallSuper
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.databinding.ActivityVectorWebViewBinding
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.airbnb.mvrx.viewModel
|
|||
import com.google.android.material.appbar.MaterialToolbar
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.addFragment
|
||||
import im.vector.app.core.platform.ToolbarConfigurable
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
|
|
|
@ -26,8 +26,9 @@ import android.view.ViewGroup
|
|||
import com.airbnb.mvrx.Mavericks
|
||||
import com.airbnb.mvrx.activityViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.extensions.withArgs
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.databinding.BottomSheetRoomWidgetPermissionBinding
|
||||
|
@ -36,6 +37,7 @@ import im.vector.app.features.widgets.WidgetArgs
|
|||
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class RoomWidgetPermissionBottomSheet :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetRoomWidgetPermissionBinding>() {
|
||||
|
||||
|
@ -49,10 +51,6 @@ class RoomWidgetPermissionBottomSheet :
|
|||
|
||||
override val showExpanded = true
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
// Use this if you don't need the full activity view model
|
||||
var directListener: ((Boolean) -> Unit)? = null
|
||||
|
||||
|
|
|
@ -31,8 +31,9 @@ import com.airbnb.mvrx.withState
|
|||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ScreenComponent
|
||||
|
||||
import im.vector.app.core.dialogs.ExportKeysDialog
|
||||
import im.vector.app.core.extensions.queryExportKeys
|
||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||
|
@ -45,6 +46,7 @@ import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
|
|||
import javax.inject.Inject
|
||||
|
||||
// TODO this needs to be refactored to current standard and remove legacy
|
||||
@AndroidEntryPoint
|
||||
class SignOutBottomSheetDialogFragment :
|
||||
VectorBaseBottomSheetDialogFragment<BottomSheetLogoutAndBackupBinding>(){
|
||||
|
||||
|
@ -60,10 +62,6 @@ class SignOutBottomSheetDialogFragment :
|
|||
|
||||
private val viewModel: SignoutCheckViewModel by fragmentViewModel(SignoutCheckViewModel::class)
|
||||
|
||||
override fun injectWith(injector: ScreenComponent) {
|
||||
injector.inject(this)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.refreshRemoteStateIfNeeded()
|
||||
|
|
Loading…
Reference in a new issue