Lint fixes.

This commit is contained in:
Onuray Sahin 2021-12-27 17:55:48 +03:00
parent de809d6013
commit 15fa42ba9b
7 changed files with 6 additions and 12 deletions

View File

@ -39,8 +39,6 @@ import im.vector.app.features.location.MapTilerMapView
import im.vector.app.features.location.VectorMapListener import im.vector.app.features.location.VectorMapListener
import im.vector.app.features.media.ImageContentRenderer import im.vector.app.features.media.ImageContentRenderer
import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.room.model.message.LocationInfo
import org.matrix.android.sdk.api.session.room.model.message.MessageLocationContent
import org.matrix.android.sdk.api.util.MatrixItem import org.matrix.android.sdk.api.util.MatrixItem
/** /**

View File

@ -43,7 +43,6 @@ import im.vector.app.features.location.LocationData
import im.vector.app.features.media.ImageContentRenderer import im.vector.app.features.media.ImageContentRenderer
import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.failure.Failure import org.matrix.android.sdk.api.failure.Failure
import org.matrix.android.sdk.api.session.events.model.toContent
import org.matrix.android.sdk.api.session.events.model.toModel import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.message.MessageLocationContent import org.matrix.android.sdk.api.session.room.model.message.MessageLocationContent
import org.matrix.android.sdk.api.session.room.send.SendState import org.matrix.android.sdk.api.session.room.send.SendState

View File

@ -185,7 +185,6 @@ class MessageItemFactory @Inject constructor(
highlight: Boolean, highlight: Boolean,
callback: TimelineEventController.Callback?, callback: TimelineEventController.Callback?,
attributes: AbsMessageItem.Attributes): MessageLocationItem? { attributes: AbsMessageItem.Attributes): MessageLocationItem? {
val geoUri = locationContent.locationInfo?.geoUri ?: locationContent.geoUri val geoUri = locationContent.locationInfo?.geoUri ?: locationContent.geoUri
val locationData = LocationData.create(geoUri) val locationData = LocationData.create(geoUri)

View File

@ -68,4 +68,3 @@ data class LocationData(
} }
} }
} }

View File

@ -16,21 +16,18 @@
package im.vector.app.features.location package im.vector.app.features.location
import android.content.Intent
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentLocationPreviewBinding
import javax.inject.Inject
import com.airbnb.mvrx.args import com.airbnb.mvrx.args
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.openLocation import im.vector.app.core.utils.openLocation
import im.vector.app.databinding.FragmentLocationPreviewBinding
import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider import im.vector.app.features.home.room.detail.timeline.helper.LocationPinProvider
import org.matrix.android.sdk.api.extensions.tryOrNull import javax.inject.Inject
class LocationPreviewFragment @Inject constructor( class LocationPreviewFragment @Inject constructor(
private val locationPinProvider: LocationPinProvider private val locationPinProvider: LocationPinProvider

View File

@ -16,10 +16,12 @@
package im.vector.app.features.location package im.vector.app.features.location
import android.Manifest
import android.content.Context import android.content.Context
import android.location.Location import android.location.Location
import android.location.LocationListener import android.location.LocationListener
import android.location.LocationManager import android.location.LocationManager
import androidx.annotation.RequiresPermission
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
@ -65,6 +67,7 @@ class LocationTracker @Inject constructor(
} }
} }
@RequiresPermission(anyOf = [Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION])
fun stop() { fun stop() {
locationManager?.removeUpdates(this) locationManager?.removeUpdates(this)
callback = null callback = null

View File

@ -19,7 +19,6 @@ package im.vector.app.features.location
import android.content.Context import android.content.Context
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.util.AttributeSet import android.util.AttributeSet
import com.mapbox.mapboxsdk.Mapbox
import com.mapbox.mapboxsdk.camera.CameraPosition import com.mapbox.mapboxsdk.camera.CameraPosition
import com.mapbox.mapboxsdk.geometry.LatLng import com.mapbox.mapboxsdk.geometry.LatLng
import com.mapbox.mapboxsdk.maps.MapView import com.mapbox.mapboxsdk.maps.MapView