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
// Call this handleSamplingAndRotationBitmap method | |
private fun handleSamplingAndRotationBitmap(context: Context, selectedImage: Uri): Bitmap? { | |
val MAX_HEIGHT = 1024 | |
val MAX_WIDTH = 1024 | |
// First decode with inJustDecodeBounds=true to check dimensions | |
val options = BitmapFactory.Options() | |
options.inJustDecodeBounds = true | |
var imageStream = context.contentResolver.openInputStream(selectedImage) | |
BitmapFactory.decodeStream(imageStream, null, options) |
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.content.Context | |
import android.util.AttributeSet | |
import android.widget.SeekBar | |
import java.math.BigDecimal | |
class CustomSeekbar : androidx.appcompat.widget.AppCompatSeekBar, SeekBar.OnSeekBarChangeListener { | |
var mMax = 100.0f | |
var mMin = 0.0f |
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.content.ContentUris; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Environment; | |
import android.provider.DocumentsContract; | |
import android.provider.MediaStore; | |
import android.provider.OpenableColumns; |
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.app.Dialog | |
import android.content.Context | |
import android.content.DialogInterface | |
import android.content.res.Resources | |
import android.graphics.Color | |
import android.graphics.drawable.ColorDrawable | |
import android.view.* | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.lifecycle.DefaultLifecycleObserver |
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
::App Gradle:: | |
plugins { | |
id ("com.android.application") | |
id ("org.jetbrains.kotlin.android") | |
} | |
dependencies { | |
implementation ("androidx.core:core-ktx:1.15.0") | |
implementation ("androidx.appcompat:appcompat:1.7.0") |
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.annotation.TargetApi; | |
import android.app.AppOpsManager; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.text.TextUtils; | |
import java.lang.reflect.Method; | |
// MIUI. Redefining Android. |
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
::Project Gradle:: | |
plugins { | |
id("com.android.application") version "8.7.3" apply false | |
id("org.jetbrains.kotlin.android") version "2.0.0" apply false | |
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false | |
} | |
############################################################################################### |