Skip to content

Instantly share code, notes, and snippets.

View build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile project(':shapeloading')
}
View ids_sticky_nav_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="id_stickynavlayout_topview" type="id"/>
<item name="id_stickynavlayout_viewpager" type="id"/>
<item name="id_stickynavlayout_indicator" type="id"/>
<item name="id_stickynavlayout_innerscrollview" type="id"/>
</resources>
View MainActivity.kt
package com.dennis.doublepull
import android.graphics.drawable.AnimationDrawable
import android.os.Bundle
import android.view.View
import android.view.ViewTreeObserver
import android.widget.RelativeLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
View ScrollBodyDelegate.kt
package dennis.pull.delegate
import android.view.MotionEvent
import android.view.View
import dennis.pull.ScrollState
import dennis.pull.listener.OnStateChangeListener
class ScrollBodyDelegate(private val mTargetView: View) : ScrollerDelegate(mTargetView) {
View ScrollHeaderDelegate.kt
package dennis.pull.delegate
import android.view.View
class ScrollHeaderDelegate(private val mTargetView: View) : ScrollerDelegate(mTargetView) {
var isScrollShow: Boolean = false
private var mDuration = NORMAL_DURATION
fun scrollShow() {
View PullScrollView.kt
package dennis.pull.widget
import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.ScrollView
import dennis.pull.ScrollState
import dennis.pull.delegate.ScrollViewDelegate
import dennis.pull.listener.OnScrollChangedListener
View ScrollViewDelegate.kt
package dennis.pull.delegate
import android.view.MotionEvent
import android.view.View
import dennis.pull.ScrollState
import dennis.pull.listener.OnScrollChangedListener
class ScrollViewDelegate {
@Dmuasya
Dmuasya / ScrollAdapter.kt
Last active Dec 7, 2020
ScrollAdapter.kt
View ScrollAdapter.kt
package com.dennis.doublepull.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.dennis.doublepull.R
class ScrollAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
View main_out.xml
<?xml version="1.0" encoding="utf-8"?>
<dennis.pull.widget.PullScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
View main_in.xml
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_rcv"
android:layout_width="match_parent"
android:layout_height="match_parent" />