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
/** | |
* Android has a very poor filtering algorithm when taking large images and turning them into | |
* thumbnails, leaving jagged edges and ugly artifacting. A work-around is to only scale down an | |
* image a little bit at a time until you have the needed image size. | |
* | |
* This algorithm isn't very efficient, but still only takes ~100 millis to turn a 4096x4096 image | |
* into a 210x210. This is acceptable if you aren't working with a large number of downsized images, | |
* where CPU may become a bottleneck. | |
*/ | |
class SmoothingResizeTransformation( |
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
@Composable | |
fun RotateScreen( | |
rotation: ScreenRotation, | |
modifier: Modifier = Modifier, | |
contentAlignment: Alignment = Alignment.TopStart, | |
content: @Composable () -> Unit | |
) { | |
BoxWithConstraints { | |
val width: Dp | |
val height: Dp |
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
import android.content.Context; | |
import android.location.Criteria; | |
import android.location.Location; | |
import android.location.LocationListener; | |
import android.location.LocationManager; | |
import android.os.Bundle; | |
import android.os.Looper; | |
import rx.Observable; | |
import rx.Subscriber; |