- Android Studio Flamingo | 2022.2.1
- Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
- Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
- Windows 11 (version 10.0.22000.1817)
Android Drawable Preview | |
Android WiFiADB | |
ChroMATERIAL | |
Json To Kotlin Class | |
Kotlin Fill Class | |
MAD Scorecard | |
Material Design Icon Generator | |
Material Theme UI | |
Rainbow Brackets | |
Regex Rename Files |
If you want install application programmatically in Android 10, You need to give permission to install app for your application | |
============================================================================== | |
Steps 1: Give permission in Manifest | |
============================================================================== | |
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
============================================================================== | |
Step 2: Write provider in Android Manifest |
saveImageToPDF(layout, layout.getScreenShot(), fileName) | |
fun View.getScreenShot(): Bitmap { | |
val returnedBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) | |
val canvas = Canvas(returnedBitmap) | |
val bgDrawable = background | |
if (bgDrawable != null) bgDrawable.draw(canvas) | |
else canvas.drawColor(Color.WHITE) | |
draw(canvas) | |
return returnedBitmap |
package com.geothings.geobingan.ui | |
import android.animation.Animator | |
import android.animation.AnimatorListenerAdapter | |
import android.animation.ValueAnimator | |
import android.content.Context | |
import android.graphics.Color | |
import android.text.Spannable | |
import android.text.SpannableStringBuilder | |
import android.text.style.ForegroundColorSpan |
data class DownloadItem( | |
val bytesDownloadedSoFar: Long = -1, | |
val totalSizeBytes: Long = -1, | |
val status: Int, | |
val uri: String | |
) | |
class DownloadProgressLiveData(private val activity: Activity) : | |
LiveData<List<DownloadItem>>(), | |
CoroutineScope { |
interface CircularTimerListener { | |
fun updateDataOnTick(remainingTimeInMs: Long): String? | |
fun onTimerFinished() | |
} |
package com.toastme.widget | |
import android.text.Editable | |
import android.text.TextWatcher | |
import android.widget.EditText | |
import java.math.BigDecimal | |
import java.text.DecimalFormat | |
class NumberTextWatcher(private val editText: EditText) : TextWatcher { |
import android.text.Editable | |
import android.text.TextWatcher | |
import android.view.View | |
import android.widget.EditText | |
/** | |
* Created by Konstantin Tskhovrebov (aka @terrakok) on 18.09.17. | |
*/ | |
class SmartField<T: Any>( | |
private val editText: EditText, |
// activity with android:windowSoftInputMode="stateHidden" | |
private fun showPasswordDialog() { | |
val context = this.context ?: return | |
val editText = EditText(context) | |
editText.inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_VARIATION_PASSWORD | |
editText.filters = arrayOf(InputFilter.LengthFilter(4)) | |
val frame = FrameLayout(context) | |
frame.addView(editText) |