app/src/main/java/me/zhanghai/android/douya/ui/FlexibleSpaceContentRecyclerView.java

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * Copyright (c) 2016 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
 * All Rights Reserved.
 */

package me.zhanghai.android.douya.ui;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class FlexibleSpaceContentRecyclerView extends RecyclerView
        implements FlexibleSpaceContentView {

    private int mScroll;

    public FlexibleSpaceContentRecyclerView(Context context) {
        super(context);

        init();
    }

    public FlexibleSpaceContentRecyclerView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);

        init();
    }

    public FlexibleSpaceContentRecyclerView(Context context, @Nullable AttributeSet attrs,
                                            int defStyle) {
        super(context, attrs, defStyle);

        init();
    }

    private void init() {
        // Do not save the current scroll position. Always store scrollY as 0 and delegate
        // responsibility of saving state to FlexibleSpaceLayout.
        setSaveEnabled(false);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent e) {
        return false;
    }

    @Override
    public boolean onTouchEvent(MotionEvent e) {
        return false;
    }

    @Override
    public void onScrolled(int dx, int dy) {
        mScroll += dy;
    }

    @Override
    public void scrollTo(int scroll) {
后面还有 7 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。