This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.annotation.SuppressLint | |
| import android.graphics.Rect | |
| import android.os.Build | |
| import android.view.View | |
| import android.view.ViewTreeObserver | |
| import androidx.core.view.updatePaddingRelative | |
| class UnderKeyboardViewElevator(private val decorView: View, private val contentView: View) { | |
| private var initialPaddingBottom: Int = contentView.paddingBottom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kotlin.math.absoluteValue | |
| import kotlin.math.roundToInt | |
| private const val NORTH = "N" | |
| private const val SOUTH = "S" | |
| private const val EAST = "E" | |
| private const val WEST = "W" | |
| fun convertDecimalToDegrees(lat: Double, lng: Double): String = "${convertLat(lat)} ${convertLng(lng)}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MainActivity : ActivityCompat { | |
| private lateinit var bordersListener: ViewTreeObserver.OnGlobalLayoutListener | |
| private var statusBarHeight = 0 | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| val decorView = window.decorView | |
| bordersListener = ViewTreeObserver.OnGlobalLayoutListener { | |
| val r = Rect() |
OlderNewer