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 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.os.Handler; | |
import android.os.SystemClock; | |
import android.view.View; | |
| |
public abstract class DoubleClickListener implements View.OnClickListener { | |
private static final long DEFAULT_QUALIFICATION_SPAN = 200; | |
private boolean isSingleEvent; | |
private final long doubleClickQualificationSpanInMillis; | |
private long timestampLastClick; | |
private final Handler handler; |
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
private fun smoothScroll(currentPosition: Int, newPosition: Int) { | |
Log.d("new_position", "$newPosition") | |
if (newPosition > currentPosition) { | |
//scroll top to bottom | |
binding.upperRecycler.scrollToPosition(newPosition - 2) | |
binding.upperRecycler.smoothSnapToPosition(newPosition - 1) { | |
//Reason for adding this is that if RecyclerView height is 0dp or match parent OR more than one items visible on the | |
// screen then instead of focus on passed position, it scroll down/up depend | |
binding.upperRecycler.scrollBy(0, -250) |
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
//Create a variable in shared viewmodel to hold the state | |
var listState: Parcelable? = null | |
//onDestroyView() in case of fragment, saved the state of layout manager attached to rv | |
bookMarkViewModel.listState = binding.recyclerViewMain.layoutManager?.onSaveInstanceState() | |
//Suppose you have move from SCREEN A to SCREEN B and on SCREEN A, you have save the state in the listState variable and when | |
//you come back to SCREEN A then you need to restore the layoutManager state as below | |
if(listState!=null){ | |
binding.recyclerViewMain.layoutManager?.onRestoreInstanceState(bookMarkViewModel.listState); |
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
class TextViewFontAwsome : androidx.appcompat.widget.AppCompatTextView { | |
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context!!, attrs, defStyle) { | |
init() | |
} | |
constructor(context: Context?, attrs: AttributeSet?) : super(context!!, attrs) { | |
init() | |
} | |
constructor(context: Context?) : super(context!!) { |
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
/** | |
* Class to Handle Operation for Media (Image etc) Files | |
* */ | |
class MediaUtils { | |
/* File Size */ | |
interface FILE { | |
companion object { | |
const val IMAGE_SIZE = 1000000 //1000 kb |
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
/* | |
* Copyright (C) 2020 Google Inc. All Rights Reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 androidx.viewpager.widget.ViewPager | |
class DynamicHeightViewPager @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : ViewPager(context, attrs) { | |
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { | |
var heightMeasureSpec = heightMeasureSpec | |
var height = 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
package com.sway.android.screens.dashboard | |
import android.content.Context | |
import android.content.Intent | |
import android.graphics.Bitmap | |
import android.graphics.Color | |
import android.graphics.drawable.BitmapDrawable | |
import android.graphics.drawable.Drawable | |
import android.os.Bundle | |
import android.view.Menu |
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 'package:mailer/mailer.dart'; | |
import 'package:mailer/smtp_server.dart'; | |
main() async { | |
String username = '[email protected]'; | |
String password = 'password'; | |
final smtpServer = gmail(username, password); | |
// Use the SmtpServer class to configure an SMTP server: | |
// final smtpServer = SmtpServer('smtp.domain.com'); |