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
package com.d4vidi | |
import android.content.Context | |
import android.graphics.Rect | |
import android.support.annotation.Px | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
/** | |
* A [RecyclerView decorator][RecyclerView.ItemDecoration] which, if applied over a recycler view |
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 MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val recyclerView = findViewById<RecyclerView>(R.id.recycler_view) | |
// Usual setups | |
recyclerView.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false) | |
recyclerView.adapter = ... | |
// Decorator set-up |
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
package com.d4vidi | |
import android.support.annotation.Px | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.PagerSnapHelper | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.view.ViewTreeObserver | |
data class VisiblePageState( |
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
package com.d4vidi.vp2rv.core | |
import android.support.annotation.Px | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
data class VisiblePageState( | |
var index: Int, | |
var view: View, |
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
RVPagerSnapHelperListenable().attachToRecyclerView( | |
recyclerView, | |
object : RVPagerStateListener { | |
override fun onPageScroll(pagesState: List<VisiblePageState>) {/*...*/} | |
override fun onPageSelected(index: Int) {/*...*/} | |
override fun onScrollStateChanged(state: RVPageScrollState) {/*...*/} | |
}) |
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
package com.parashuram; | |
import android.os.Process; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.ViewTreeObserver; | |
import com.facebook.react.ReactInstanceManager; | |
import com.facebook.react.ReactNativeHost; | |
import com.facebook.react.bridge.ReactContext; |
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
package com.und0.vocabularymate.x.utils | |
import androidx.annotation.MainThread | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.MutableLiveData | |
import androidx.lifecycle.Observer | |
import java.util.concurrent.atomic.AtomicInteger | |
/** | |
* A [MutableLiveData] variant that introduces a _volatile_ behavior. Namely, it has no "memory" of values set |
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
android { | |
buildTypes { | |
release { | |
minifyEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} | |
// ... | |
} |
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
### proguard-rules.pro ### | |
# Standard rules for my App: | |
-keep class this.and.That { *; } | |
-dontwarn com.on.** |
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
android { | |
buildTypes { | |
release { | |
minifyEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
// Also consider the library's custom ProGuard rules | |
proguardFiles "${project(':thelibrary').projectDir}/proguard-rules-app.pro" | |
} | |
} |
OlderNewer