itag Code | Container | Content | Resolution | Bitrate | Range | VR / 3D |
---|---|---|---|---|---|---|
5 | flv | audio/video | 240p | - | - | - |
6 | flv | audio/video | 270p | - | - | - |
17 | 3gp | audio/video | 144p | - | - | - |
18 | mp4 | audio/video | 360p | - | - | - |
22 | mp4 | audio/video | 720p | - | - | - |
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
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", | |
"code": "AX" |
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
// Random terminal tip #1 | |
//You'll see this message if you git commit without a message (-m) | |
// You can get out of it with two steps: | |
// 1.a. Type a multi-line message to move foward with the commit. | |
// 1.b. Leave blank to abort the commit. | |
// 2. Hit "esc" then type ":wq" and hit enter to save your choice. Viola! | |
# Please enter the commit message for your changes. Lines starting | |
# with '#' will be ignored, and an empty message aborts the commit. |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
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
// UPDATE: Everyone finding this gist via Google! | |
// Modern kotlinx.coroutines has out-of-the-box support for asyncLazy with the following expression: | |
// val myLazyValue = async(start = CoroutineStart.LAZY) { ... } | |
// Use myLazyValue.await() when you need it | |
// ---------------- public api ---------------- | |
public interface AsyncLazy<out T> { | |
public suspend fun value(): T | |
public fun isInitialized(): Boolean |
Answer: As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle.
To navigate transitions between stages of the activity lifecycle, the Activity class provides a core set of six callbacks: onCreate()
, onStart()
, onResume()
, onPause()
, onStop()
, and onDestroy()
. The system invokes each of these callbacks as an activity enters a new state.
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
/** | |
* Starts collecting a flow when the lifecycle is started, and **cancels** the collection on stop. | |
* This is different from `lifecycleScope.launchWhenStarted { flow.collect{...} }`, in which case | |
* the coroutine is just suspended on stop. | |
*/ | |
inline fun <reified T> Flow<T>.collectWhileStarted( | |
lifecycleOwner: LifecycleOwner, | |
noinline action: suspend (T) -> Unit | |
) { | |
object : DefaultLifecycleObserver { |
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
public class PlayPauseView extends AppCompatImageView { | |
public static final int STATE_PLAY = 1; | |
public static final int STATE_PAUSE = 2; | |
private AnimatedVectorDrawableCompat mPlayToPauseAnim, mPauseToPlay; | |
private Animation mFadeOutAnim, mFadeInAnim; | |
public PlayPauseView(Context context) { | |
super(context); | |
Init(context); |
NewerOlder