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
#EXTM3U | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1648130,RESOLUTION=1920x1080,FRAME-RATE=25.000,CODECS="avc1.640032,mp4a.40.2" | |
https://ed.netmagcdn.com:2228/hls-playback/ee661cfc047dd68f3310fad70643fcbb125089ce26d00c2ec4b9b6e2a62c2dd620ea671bffc17171e9e4185392e044d7ef040e7ee90d417cb8e04718cdc47f9ff3e577a87ed3635abca5deb5ba4530fb97371c55ef3ba9141815045a044428247c5191bb4c8deb3387a119804092edab13f207bb6a1ffbb4eeee7e1381b4cdfe7cb400332b3c9a67d4843c5a7d0da894bdaf7dcf1f72b9205014acd4f8f43983c2257aab752a79bc88a28fe87d13b08f/index-f1-v1-a1.m3u8 | |
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=802578,RESOLUTION=1280x720,FRAME-RATE=25.000,CODECS="avc1.64001f,mp4a.40.2" | |
https://ed.netmagcdn.com:2228/hls-playback/ee661cfc047dd68f3310fad70643fcbb125089ce26d00c2ec4b9b6e2a62c2dd620ea671bffc17171e9e4185392e044d7ef040e7ee90d417cb8e04718cdc47f9ff3e577a87ed3635abca5deb5ba4530fb97371c55ef3ba9141815045a044428247c5191bb4c8deb3387a119804092edab13f207bb6a1ffbb4eeee7e1381b4cdfe7cb400332b3c9a67d4843c5a7d0da894bdaf7dcf1f72b9205014acd4f8f43983 |
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
WEBVTT | |
00:02.170 --> 00:04.136 | |
إيمو، أغمض عينيك | |
00:04.136 --> 00:05.597 | |
لماذا؟ | |
الآن! | |
00:05.597 --> 00:07.405 |
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.shivamkumarjha.animov.ui.player | |
import android.net.Uri | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.LaunchedEffect | |
import androidx.compose.runtime.remember | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.platform.LocalContext | |
import androidx.compose.ui.viewinterop.AndroidView | |
import org.videolan.libvlc.LibVLC |
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 androidx.lifecycle.LiveData | |
import androidx.lifecycle.MediatorLiveData | |
fun <T, K, R> LiveData<T>.combineWith( | |
liveData: LiveData<K>, | |
block: (T?, K?) -> R | |
): LiveData<R> { | |
val result = MediatorLiveData<R>() | |
result.addSource(this) { | |
result.value = block(this.value, liveData.value) |
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.net.ConnectivityManager | |
import android.net.NetworkCapabilities | |
import android.os.Build | |
class NetworkHelper(private val connectivityManager: ConnectivityManager) { | |
fun isNetworkConnected(): Boolean { | |
var result = false | |
when { | |
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> { |
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
recyclerview.addOnScrollListener(object : RecyclerView.OnScrollListener() { | |
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { | |
super.onScrollStateChanged(recyclerView, newState) | |
when (newState) { | |
RecyclerView.SCROLL_STATE_DRAGGING -> { | |
Log.d(TAG, "dragging") | |
} | |
RecyclerView.SCROLL_STATE_IDLE -> { | |
Log.d(TAG, "idle") | |
} |
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.example.app.ui | |
import android.content.Context | |
import android.os.Build | |
import android.os.Bundle | |
import android.util.AttributeSet | |
import android.view.inputmethod.EditorInfo | |
import android.view.inputmethod.InputConnection | |
import androidx.appcompat.widget.AppCompatEditText | |
import androidx.core.view.inputmethod.EditorInfoCompat |
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.shivamkumarjha.myapp.persistence | |
import android.content.Context | |
import androidx.datastore.core.DataStore | |
import androidx.datastore.preferences.core.Preferences | |
import androidx.datastore.preferences.core.edit | |
import androidx.datastore.preferences.core.emptyPreferences | |
import androidx.datastore.preferences.core.preferencesKey | |
import androidx.datastore.preferences.createDataStore | |
import kotlinx.coroutines.flow.Flow |
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
method to get app keyhash: | |
First declare following val with you app package name from manifest. | |
val appPackage = "com.XXX.XXX" | |
Now add below code to onCreate method of your activity and check logcat after running the app: | |
try { | |
val info: PackageInfo = packageManager.getPackageInfo( | |
appPackage, |
NewerOlder