Using @AndroidEntryPoint in Fragment

This commit is contained in:
Maxime NATUREL 2022-05-23 10:40:52 +02:00
parent 5265856772
commit c46aaa24a5
2 changed files with 8 additions and 6 deletions

View File

@ -64,7 +64,6 @@ import im.vector.app.features.home.room.list.RoomListFragment
import im.vector.app.features.home.room.threads.list.views.ThreadListFragment
import im.vector.app.features.location.LocationPreviewFragment
import im.vector.app.features.location.LocationSharingFragment
import im.vector.app.features.location.live.map.LocationLiveMapViewFragment
import im.vector.app.features.login.LoginCaptchaFragment
import im.vector.app.features.login.LoginFragment
import im.vector.app.features.login.LoginGenericTextInputFormFragment
@ -995,8 +994,8 @@ interface FragmentModule {
@FragmentKey(LocationPreviewFragment::class)
fun bindLocationPreviewFragment(fragment: LocationPreviewFragment): Fragment
@Binds
/*@Binds
@IntoMap
@FragmentKey(LocationLiveMapViewFragment::class)
fun bindLocationLiveMapViewFragment(fragment: LocationLiveMapViewFragment): Fragment
fun bindLocationLiveMapViewFragment(fragment: LocationLiveMapViewFragment): Fragment*/
}

View File

@ -24,6 +24,7 @@ import androidx.lifecycle.lifecycleScope
import com.airbnb.mvrx.args
import com.mapbox.mapboxsdk.maps.MapboxMapOptions
import com.mapbox.mapboxsdk.maps.SupportMapFragment
import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R
import im.vector.app.core.extensions.addFragment
import im.vector.app.core.platform.VectorBaseFragment
@ -34,9 +35,11 @@ import javax.inject.Inject
/**
* Screen showing a map with all the current users sharing their live location in room.
*/
class LocationLiveMapViewFragment @Inject constructor(
private val urlMapProvider: UrlMapProvider,
) : VectorBaseFragment<FragmentLiveLocationMapBinding>() {
@AndroidEntryPoint
class LocationLiveMapViewFragment : VectorBaseFragment<FragmentLiveLocationMapBinding>() {
@Inject
lateinit var urlMapProvider: UrlMapProvider
private val args: LocationLiveMapViewArgs by args()