This file contains 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
/** | |
* EditText that only allows input of IP Addresses, using the Phone | |
* input type, and automatically inserts periods at the earliest appropriate | |
* interval. | |
*/ | |
// Note; this probably isn't the best pattern for this - a Factory of Decorator | |
// pattern would have made more sense, rather than inheritance. However, this | |
// pattern is consistent with how other android Widgets are invoked, so I went | |
// with this to prevent confusion |
This file contains 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
fun getPointByDistanceAndBearing(lat: Double, lon: Double, bearing: Double, distanceKm: Double): Pair<Double, Double> { | |
val earthRadius = 6378.1 | |
val bearingR = Math.toRadians(bearing) | |
val latR = Math.toRadians(lat) | |
val lonR = Math.toRadians(lon) | |
val distanceToRadius = distanceKm / earthRadius |
This file contains 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
package com.example.lib.screenshots; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.graphics.Bitmap; | |
import android.graphics.Rect; | |
import android.os.Handler; | |
import android.view.PixelCopy; | |
import android.view.View; |