UIHelper

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
@ColorInt
fun adjustAlpha(@ColorInt color: Int, factor: Float): Int
Link copied to clipboard
fun Activity.changeStatusBarState(hide: Boolean)
Link copied to clipboard
fun Context.checkWrite(): Boolean
Link copied to clipboard
Link copied to clipboard
@ColorInt
fun Context.colorFromAttribute(@AttrRes attribute: Int): Int
Link copied to clipboard
fun createPaletteAsync(url: String, bitmap: Bitmap, callback: (Palette) -> Unit)
Link copied to clipboard
fun Dialog?.dismissSafe()
fun Dialog?.dismissSafe(activity: Activity?)
Link copied to clipboard
fun Activity.enableEdgeToEdgeCompat()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun fixSystemBarsPadding(v: View, @DimenRes heightResId: Int? = null, @DimenRes widthResId: Int? = null, padTop: Boolean = true, padBottom: Boolean = true, padLeft: Boolean = true, padRight: Boolean = true, overlayCutout: Boolean = true, fixIme: Boolean = false)
Link copied to clipboard
Link copied to clipboard
@ColorInt
fun Context.getResourceColor(@AttrRes resource: Int, alphaFactor: Float = 1.0f): Int
Link copied to clipboard
fun Context.getSpanCount(isHorizontal: Boolean = false): Int
Link copied to clipboard
fun Context.getStatusBarHeight(): Int
Link copied to clipboard
fun Activity.hideKeyboard()
fun Fragment.hideKeyboard()
fun hideKeyboard(view: View?)
Link copied to clipboard
fun Activity.hideSystemUI()
Link copied to clipboard
fun Context?.isBottomLayout(): Boolean
Link copied to clipboard
fun Activity?.navigate(navigationId: Int, args: Bundle? = null, navOptions: NavOptions? = null)
Link copied to clipboard
fun Context.openActivity(activity: Class<*>, args: Bundle? = null, baseIntent: Intent? = null)
Link copied to clipboard
fun FragmentActivity.popCurrentPage(fromBackPressedCallback: String? = null)

If you want to call this from a BackPressedCallback, pass the name of the callback to temporarily disable it

Link copied to clipboard
fun populateChips(view: ChipGroup?, tags: List<String>, @StyleRes style: Int = R.style.ChipFilled, @AttrRes textColor: Int? = R.attr.white)
Link copied to clipboard
fun View.popupMenuNoIcons(items: List<Pair<Int, Int>>, onMenuItemClick: MenuItem.() -> Unit): PopupMenu

id, stringRes

Link copied to clipboard
fun View.popupMenuNoIconsAndNoStringRes(items: List<Pair<Int, String>>, onMenuItemClick: MenuItem.() -> Unit): PopupMenu

id, string

Link copied to clipboard
fun Activity.requestRW()
Link copied to clipboard
Link copied to clipboard
fun setListViewHeightBasedOnItems(listView: ListView?)

Sets ListView height dynamically based on the height of the items.

Link copied to clipboard
fun Activity.setNavigationBarColorCompat(@AttrRes resourceId: Int)
Link copied to clipboard
fun showInputMethod(view: View?)
Link copied to clipboard
fun Activity.showSystemUI()