Skip to content

Instantly share code, notes, and snippets.

View VahidGarousi's full-sized avatar
😎

Vahid Garousi VahidGarousi

😎
View GitHub Profile
@fvilarino
fvilarino / pager_final_implementation.kt
Last active September 1, 2022 00:13
Pager - final implementation
@Composable
fun <T : Any> Pager(
items: List<T>,
modifier: Modifier = Modifier,
orientation: Orientation = Orientation.Horizontal,
initialIndex: Int = 0,
/*@FloatRange(from = 0.0, to = 1.0)*/
itemFraction: Float = 1f,
itemSpacing: Dp = 0.dp,
/*@FloatRange(from = 0.0, to = 1.0)*/
@maiconhellmann
maiconhellmann / DateExtension.kt
Last active August 17, 2023 07:36
Date extensions wrote in Kotlin
import java.text.SimpleDateFormat
import java.util.*
/**
* Pattern: yyyy-MM-dd HH:mm:ss
*/
fun Date.formatToServerDateTimeDefaults(): String{
val sdf= SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
return sdf.format(this)
}
@bapspatil
bapspatil / ExoPlayerDemoFragment.java
Last active May 10, 2020 09:32
Generic code to set up ExoPlayer in a Fragment
/*
** Created by bapspatil
*/
public class ExoPlayerDemoFragment extends Fragment {
@BindView(R.id.video_exoplayer_view) SimpleExoPlayerView mPlayerView;
private SimpleExoPlayer mPlayer;
private Unbinder unbinder;
public ExoPlayerDemoFragment() {
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active June 15, 2023 04:22
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {