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
| /** | |
| * A RecyclerView that only handles scroll events with the same orientation of its LayoutManager. | |
| * Avoids situations where nested recyclerviews don't receive touch events properly: | |
| */ | |
| class OrientationAwareRecyclerView @JvmOverloads constructor( | |
| context: Context, attrs: AttributeSet? = null, | |
| defStyleAttr: Int = 0 | |
| ) : | |
| RecyclerView(context, attrs, defStyleAttr) { | |
| private var lastX = 0.0f |
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 GravitySnapHelper @JvmOverloads constructor( | |
| gravity: Int, enableSnapLastItem: Boolean = false, | |
| snapListener: SnapListener? = null | |
| ) : | |
| LinearSnapHelper() { | |
| private val FLING_DISTANCE_DISABLE = -1 | |
| private val FLING_SIZE_FRACTION_DISABLE = -1f | |
| private var gravity = 0 | |
| private var isRtl = false | |
| private var snapLastItem = false |
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 CenterZoomLayoutManager : LinearLayoutManager { | |
| private var mShrinkAmount = 0.1f | |
| private val mShrinkDistance = 0.9f | |
| constructor(context: Context?, orientation: Int, reverseLayout: Boolean, shrinkAmount: Float) : super( | |
| context, | |
| orientation, | |
| reverseLayout | |
| ) { |
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.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.fragment.app.DialogFragment | |
| import androidx.fragment.app.Fragment | |
| import androidx.lifecycle.DefaultLifecycleObserver | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleOwner | |
| import androidx.viewbinding.ViewBinding |