• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RefreshLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.scwang.smartrefresh.layout.api.RefreshLayout的典型用法代码示例。如果您正苦于以下问题:Java RefreshLayout类的具体用法?Java RefreshLayout怎么用?Java RefreshLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RefreshLayout类属于com.scwang.smartrefresh.layout.api包,在下文中一共展示了RefreshLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    mState = newState;
    switch (newState) {
        case None:
            break;
        case PullDownToRefresh:
            mFinished = false;
            mCircleView.setVisibility(VISIBLE);
            mCircleView.setScaleX(1);
            mCircleView.setScaleY(1);
            break;
        case ReleaseToRefresh:
            break;
        case Refreshing:
            break;
    }
}
 
开发者ID:zengcanxiang,项目名称:MVP-Practice-Project-Template,代码行数:19,代码来源:MaterialHeader.java


示例2: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    switch (newState) {
        case None:
            mRippleView.setVisibility(GONE);
            mDotView.setAlpha(1);
            mDotView.setVisibility(VISIBLE);
            break;
        case PullDownToRefresh:
            mProgressView.setScaleX(0);
            mProgressView.setScaleY(0);
            break;
        case PullToUpLoad:
            break;
        case Refreshing:
            break;
        case Loading:
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:BezierRadarHeader.java


示例3: onRefreshReleased

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onRefreshReleased(RefreshLayout layout, int headerHeight, int extendHeight) {
    mLastFirstBounds = 0;
    mWaveView.animationDropCircle();
    mCircleView.makeProgressTransparent();
    mCircleView.startProgress();
    ValueAnimator animator = ValueAnimator.ofFloat(0, 0);
    animator.setDuration(500);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            mCircleView.setTranslationY(
                    mWaveView.getCurrentCircleCenterY() + mCircleView.getHeight() / 2.f);
        }
    });
    animator.start();
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:19,代码来源:WaveSwipeHeader.java


示例4: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    switch (newState) {
        case None:
            restoreRefreshLayoutBackground();
        case PullDownToRefresh:
            mHeaderText.setText(REFRESH_HEADER_PULLDOWN);
            mArrowView.setVisibility(VISIBLE);
            mProgressView.setVisibility(GONE);
            mArrowView.animate().rotation(0);
            break;
        case Refreshing:
            mHeaderText.setText(REFRESH_HEADER_REFRESHING);
            mProgressView.setVisibility(VISIBLE);
            mArrowView.setVisibility(GONE);
            break;
        case ReleaseToRefresh:
            mHeaderText.setText(REFRESH_HEADER_RELEASE);
            mArrowView.animate().rotation(180);
            replaceRefreshLayoutBackground(refreshLayout);
            break;
    }
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:24,代码来源:ClassicsHeader.java


示例5: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    mState = newState;
    switch (newState) {
        case None:
            break;
        case PullDownToRefresh:
            mCircleView.showArrow(true);
            mCircleView.scaleWithKeepingAspectRatio(1f);
            mCircleView.makeProgressTransparent();
            break;
        case PullDownCanceled:
            mCircleView.showArrow(false);
            mCircleView.setProgressRotation(0);
            mCircleView.setProgressStartEndTrim(0f, 0f);
            mWaveView.startWaveAnimation(mLastFirstBounds);
            mLastFirstBounds = 0;
            break;
        case ReleaseToRefresh:
            break;
        case Refreshing:
            break;
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:25,代码来源:WaveSwipeHeader.java


示例6: onFinish

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
    if (!mLoadmoreFinished) {
        if (mProgressDrawable != null) {
            mProgressDrawable.stop();
        } else {
            mProgressView.animate().rotation(0).setDuration(300);
        }
        mProgressView.setVisibility(GONE);
        if (success) {
            mTitleText.setText(REFRESH_FOOTER_FINISH);
        } else {
            mTitleText.setText(REFRESH_FOOTER_FAILED);
        }
        return mFinishDuration;
    }
    return 0;
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:19,代码来源:ClassicsFooter.java


示例7: onCreate

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_practice_feedlist);

    final Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

    final RefreshLayout refreshLayout = (RefreshLayout) findViewById(R.id.refreshLayout);
    if (isFirstEnter) {
        isFirstEnter = false;
        refreshLayout.autoRefresh();
    }

}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:21,代码来源:FeedlistPracticeActivity.java


示例8: refresh

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
private void refresh() {
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            if(MyApp.isLogin()){
                getData(PULL_REFRESH);
            }else{
                showToast("请先登录哦~");
                mhandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        swipeRefreshLayout.finishRefresh();
                    }
                },1000);

            }

        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:21,代码来源:FocusFragment.java


示例9: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    switch (newState) {
        case None:
        case PullDownToRefresh:
            mHeaderText.setText("下拉开始刷新");
            mArrowView.setVisibility(VISIBLE);//显示下拉箭头
            mProgressView.setVisibility(GONE);//隐藏动画
            mArrowView.animate().rotation(0);//还原箭头方向
            break;
        case Refreshing:
            mHeaderText.setText("正在刷新");
            mProgressView.setVisibility(VISIBLE);//显示加载动画
            mArrowView.setVisibility(GONE);//隐藏箭头
            break;
        case ReleaseToRefresh:
            mHeaderText.setText("释放立即刷新");
            mArrowView.animate().rotation(180);//显示箭头改为朝上
            break;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:CustomUsingActivity.java


示例10: onRefresh

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onRefresh(RefreshLayout refreshlayout) {
    mRefreshLayout.getLayout().postDelayed(new Runnable() {
        @Override
        public void run() {
            mRecyclerView.setAdapter(new BaseRecyclerAdapter<Item>(Arrays.asList(Item.values()), simple_list_item_2,EmptyLayoutUsingFragmentInner.this) {
                @Override
                protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) {
                    holder.text(android.R.id.text1, model.name());
                    holder.text(android.R.id.text2, model.name);
                    holder.textColorId(android.R.id.text2, R.color.colorTextAssistant);
                }
            });
            mRefreshLayout.finishRefresh();
            mEmptyLayout.setVisibility(View.GONE);
        }
    }, 2000);
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:19,代码来源:EmptyLayoutUsingFragmentInner.java


示例11: onViewCreated

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    final SmartRefreshLayout mSmartRefreshLayout= (SmartRefreshLayout) this.mSmartRefreshWebLayout.getLayout();

    final WebView mWebView=this.mSmartRefreshWebLayout.getWeb();
    mSmartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            mAgentWeb.getLoader().reload();

            mSmartRefreshLayout.postDelayed(new Runnable() {
                @Override
                public void run() {
                    mSmartRefreshLayout.finishRefresh();
                }
            },2000);
        }
    });
    mSmartRefreshLayout.autoRefresh();



}
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:26,代码来源:SmartRefreshWebFragment.java


示例12: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    mState = newState;
    if (newState == RefreshState.None) {
        mDropOutOverFlow = false;
    }
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:8,代码来源:DropboxHeader.java


示例13: onRefreshReleased

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onRefreshReleased(RefreshLayout layout, int headerHeight, int extendHeight) {
    if (mProgressDrawable != null) {
        mProgressDrawable.start();
    } else {
        Drawable drawable = mProgressView.getDrawable();
        if (drawable instanceof Animatable) {
            ((Animatable) drawable).start();
        } else {
            mProgressView.animate().rotation(36000).setDuration(100000);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:ClassicsHeader.java


示例14: setScrollBoundaryDecider

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
/**
 * 设置滚动边界
 */
@Override
public RefreshLayout setScrollBoundaryDecider(ScrollBoundaryDecider boundary) {
    mScrollBoundaryDecider = boundary;
    if (mRefreshContent != null) {
        mRefreshContent.setScrollBoundaryDecider(boundary);
    }
    return this;
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:12,代码来源:SmartRefreshLayout.java


示例15: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
    public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
        switch (newState) {
            case None:
//                restoreRefreshLayoutBackground();
                mLastUpdateText.setVisibility(mEnableLastTime ? VISIBLE : GONE);
            case PullDownToRefresh:
                mTitleText.setText(REFRESH_HEADER_PULLDOWN);
                mArrowView.setVisibility(VISIBLE);
                mProgressView.setVisibility(GONE);
                mArrowView.animate().rotation(0);
                break;
            case Refreshing:
            case RefreshReleased:
                mTitleText.setText(REFRESH_HEADER_REFRESHING);
                mProgressView.setVisibility(VISIBLE);
                mArrowView.setVisibility(GONE);
                break;
            case ReleaseToRefresh:
                mTitleText.setText(REFRESH_HEADER_RELEASE);
                mArrowView.animate().rotation(180);
//                replaceRefreshLayoutBackground(refreshLayout);
                break;
            case Loading:
                mArrowView.setVisibility(GONE);
                mProgressView.setVisibility(GONE);
                mLastUpdateText.setVisibility(GONE);
                mTitleText.setText(REFRESH_HEADER_LOADING);
                break;
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:32,代码来源:ClassicsHeader.java


示例16: onFinish

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
    mProgress.stop();
    mCircleView.animate().scaleX(0).scaleY(0);
    mFinished = true;
    return 0;
}
 
开发者ID:zengcanxiang,项目名称:MVP-Practice-Project-Template,代码行数:8,代码来源:MaterialHeader.java


示例17: onStateChanged

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public void onStateChanged(RefreshLayout refreshLayout, RefreshState oldState, RefreshState newState) {
    mState = newState;
    if (newState == RefreshState.None) {
        mAppreciation = 0;
        mCloudX1 = mCloudX2 = mCloudX3 = -mCloudDrawable.getBounds().width();
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:9,代码来源:DeliveryHeader.java


示例18: onFinish

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
    mProgressDrawable.stop();//停止动画
    if (success){
        mHeaderText.setText("刷新完成");
    } else {
        mHeaderText.setText("刷新失败");
    }
    return 500;//延迟500毫秒之后再弹回
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:11,代码来源:CustomUsingActivity.java


示例19: replaceRefreshLayoutBackground

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
private void replaceRefreshLayoutBackground(RefreshLayout refreshLayout) {
    if (restoreRunable == null && mSpinnerStyle == SpinnerStyle.FixedBehind) {
        restoreRunable = new Runnable() {
            Drawable drawable = refreshLayout.getLayout().getBackground();
            @Override
            public void run() {
                refreshLayout.getLayout().setBackgroundDrawable(drawable);
            }
        };
        refreshLayout.getLayout().setBackgroundDrawable(getBackground());
    }
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:13,代码来源:ClassicsHeader.java


示例20: onFinish

import com.scwang.smartrefresh.layout.api.RefreshLayout; //导入依赖的package包/类
@Override
public int onFinish(RefreshLayout layout, boolean success) {
    if (mIsRefreshing) {
        finishRefresh();
    }
    return super.onFinish(layout, success);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:FlyRefreshHeader.java



注:本文中的com.scwang.smartrefresh.layout.api.RefreshLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Position类代码示例发布时间:2022-05-21
下一篇:
Java OneofDescriptor类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap