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
/* | |
Matin Nasiri | |
mnasirii829@gmail.com | |
https:linkedin.com/in/matinnasiri01 | |
I hope you are well when you read this file | |
*/ |
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
inline fun <reified T : Serializable> Intent.getSerializable(key: String): T = when { | |
SDK_INT >= 33 -> getSerializableExtra(key, T::class.java)!! | |
else -> getSerializableExtra(key) as T | |
} | |
inline fun <reified T : Parcelable> Intent.getParcelable(key: String): T = when { | |
SDK_INT >= 33 -> getParcelableExtra(key, T::class.java)!! | |
else -> getParcelableExtra(key)!! | |
} |
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
/** | |
* Shimmer Effect Use Custom Code In Compose. | |
* @param[customColorList] You can set Your custom color for effect | |
*/ | |
fun Modifier.shimmerEffect(customColorList: List<Color>? = null): Modifier = composed { | |
var size by remember { | |
mutableStateOf(IntSize.Zero) | |
} | |
val transition = rememberInfiniteTransition(label = "") |
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
class NetworkChecker(private val context: Context) { | |
val isInternetConnected :Boolean | |
get() { | |
var result = false | |
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |