decrease lint warnings

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-06-07 13:09:31 +02:00 committed by Andy Scherzinger
parent ffdc630b76
commit 60827afe5c
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
4 changed files with 13 additions and 9 deletions

View File

@ -19,6 +19,7 @@ import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.view.ViewCompat
import androidx.emoji.widget.EmojiTextView
import autodagger.AutoInjector
@ -122,8 +123,8 @@ class IncomingLocationMessageViewHolder(incomingView: View) : MessageHolders
// do nothing, avatar is set
} else if (message.actorType == "bots" && message.actorId == "changelog") {
val layers = arrayOfNulls<Drawable>(2)
layers[0] = context?.getDrawable(R.drawable.ic_launcher_background)
layers[1] = context?.getDrawable(R.drawable.ic_launcher_foreground)
layers[0] = AppCompatResources.getDrawable(context!!, R.drawable.ic_launcher_background)
layers[1] = AppCompatResources.getDrawable(context!!, R.drawable.ic_launcher_foreground)
val layerDrawable = LayerDrawable(layers)
messageUserAvatarView?.setImageDrawable(DisplayUtils.getRoundedDrawable(layerDrawable))
} else if (message.actorType == "bots") {

View File

@ -17,6 +17,7 @@ import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.view.ViewCompat
import androidx.emoji.widget.EmojiTextView
import autodagger.AutoInjector
@ -203,7 +204,7 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
}
readStatusDrawableInt?.let { drawableInt ->
context?.resources?.getDrawable(drawableInt, null)?.let {
AppCompatResources.getDrawable(context!!, drawableInt)?.let {
it.setColorFilter(context?.resources!!.getColor(R.color.white60), PorterDuff.Mode.SRC_ATOP)
checkMark?.setImageDrawable(it)
}

View File

@ -238,7 +238,7 @@ class LocationPickerController(args: Bundle) : BaseController(args), SearchView.
myLocation = GeoPoint(13.0, 52.0)
var zoomToCurrentPositionAllowed = !receivedChosenGeocodingResult
locationOverlay.runOnFirstFix(Runnable {
locationOverlay.runOnFirstFix {
myLocation = locationOverlay.myLocation
if (zoomToCurrentPositionAllowed) {
activity!!.runOnUiThread {
@ -246,16 +246,16 @@ class LocationPickerController(args: Bundle) : BaseController(args), SearchView.
mapController?.setCenter(myLocation)
}
}
})
}
if (receivedChosenGeocodingResult && geocodedLat != 0.0 && geocodedLon != 0.0) {
mapController?.setCenter(GeoPoint(geocodedLat, geocodedLon))
}
btCenterMap?.setOnClickListener(View.OnClickListener {
btCenterMap?.setOnClickListener {
mapController?.animateTo(myLocation)
moveToCurrentLocationWasClicked = true
})
}
map?.addMapListener(DelayedMapListener(object : MapListener {
override fun onScroll(paramScrollEvent: ScrollEvent): Boolean {
@ -422,7 +422,7 @@ class LocationPickerController(args: Bundle) : BaseController(args), SearchView.
}
companion object {
private val TAG = "LocationPickerController"
private val REQUEST_PERMISSIONS_REQUEST_CODE = 1
private const val TAG = "LocationPicker"
private const val REQUEST_PERMISSIONS_REQUEST_CODE = 1
}
}

View File

@ -49,6 +49,8 @@ buildscript {
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 3600, 'seconds'
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
allprojects {