All snippets tagged with android

Page 3 of 7
 

Prevent screenshots

If your app contains privacy sensitive data, such as a banking app, a password manager, an app for ‘buying surprise gifts for your loved one’ or an app for looking up the spelling of words like ‘colleague’ - then you might want to add extra protection.

Read more…

Multiline EditText with wrapping

Lock your app with a biometric lock after X minutes of inactivity

If your app contains privacy sensitive data, such as a banking app, a password manager, an app for ‘buying surprise gifts for your loved one’ or an app for looking up the spelling of words like ‘colleague’ - then you might want to add extra protection.

Read more…

Using a theme to show a splash or placeholder while activity loads

Rule: never ever implement a splash screen using a separate activity. Splash screens should be used to show something while the app loads, and is not a way to delay app launch just to show a logo.

Read more…

FontUtil - several styling options for text

Simple alert dialog fragment

Handle links in a TextView

Checks if a TextView is ellipsized.

Note that this doesn’t just check if the TextView has ellipsizing enabled, it actually checks if the size of the TextView is too short for the full text to appear.

Read more…

Shared element transitions

Circular reveal animation

These are the three steps to show the Material Design circular animation when launching an Activity. Make sure to only use this animation when it makes sense - it is meant to make it clear to the user that a button results in the screen being opened.

Read more…

(Popup)Menus

Play a sound using the MediaPlayer

Important: make mMediaPlayer a field, because otherwise the garbage collector will clean up the mediaplayer while the sound is still playing, causing it to be cut off!

Read more…

Playing a video with ExoPlayer

This recipe shows how to create a video player using ExoPlayer. ExoPlayer is the de-facto video player for Android, and is capable of playing pretty much anything. You can use it to play on or offline files, or streaming formats.

Read more…

Playing a video with ExoPlayer in Jetpack Compose

Show an animated Gif in Compose