当前位置: 首页>>代码示例>>Java>>正文


Java SmartRefreshLayout类代码示例

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


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

示例1: getSpinnerStyle

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
    if (mSpinnerStyle != null) {
        return mSpinnerStyle;
    }
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
        if (mSpinnerStyle != null) {
            return mSpinnerStyle;
        }
    }
    if (params != null) {
        if (params.height == ViewGroup.LayoutParams.MATCH_PARENT) {
            return mSpinnerStyle = SpinnerStyle.Scale;
        }
    }
    return mSpinnerStyle = SpinnerStyle.Translate;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:RefreshHeaderWrapper.java

示例2: getSpinnerStyle

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public SpinnerStyle getSpinnerStyle() {
    if (mSpinnerStyle != null) {
        return mSpinnerStyle;
    }
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
        if (mSpinnerStyle != null) {
            return mSpinnerStyle;
        }
    }
    if (params != null) {
        if (params.height == 0) {
            return mSpinnerStyle = SpinnerStyle.Scale;
        }
    }
    return mSpinnerStyle = SpinnerStyle.Translate;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:RefreshFooterWrapper.java

示例3: onCreate

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_animation_picture);
    picturesRv = (RecyclerView) findViewById(R.id.rv_picture);
    smartRefreshLayout = (SmartRefreshLayout) findViewById(R.id.smart_refresh_layout_picture);
    smartRefreshLayout.setOnRefreshLoadmoreListener(this);
    LayoutManager layoutManager = new GridLayoutManager(this,3);
    picturesRv.setLayoutManager(layoutManager);
    pictureAdapter = new PictureAdapter(pictureList,this);
    picturesRv.setAdapter(pictureAdapter);
    if(!pictureList.isEmpty()){
        smartRefreshLayout.finishLoadmore();
        smartRefreshLayout.finishRefresh();
        pictureAdapter.notifyDataSetChanged();
    }else {
    smartRefreshLayout.autoRefresh();
    }
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:20,代码来源:AnimationPicture.java

示例4: onViewCreated

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的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

示例5: getSpinnerStyle

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
    if (mSpinnerStyle != null) {
        return mSpinnerStyle;
    }
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
        if (mSpinnerStyle != null) {
            return mSpinnerStyle;
        }
    }
    if (params != null) {
        if (params.height == 0) {
            return mSpinnerStyle = SpinnerStyle.Scale;
        }
    }
    return mSpinnerStyle = SpinnerStyle.Translate;
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:21,代码来源:RefreshFooterWrapper.java

示例6: onInitialized

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(RefreshKernel kernel, int height, int extendHeight) {
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        kernel.requestDrawBackgoundForHeader(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RefreshHeaderWrapper.java

示例7: onInitialized

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(RefreshKernel kernel, int height, int extendHeight) {
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        kernel.requestDrawBackgoundForFooter(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RefreshFooterWrapper.java

示例8: onCreateView

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.news_layout,container,false);
    newsRecycler = (RecyclerView) view.findViewById(R.id.rv_news);
    smartRefreshLayout = (SmartRefreshLayout) view.findViewById(R.id.smart_refresh_layout_news);
    smartRefreshLayout.setOnRefreshLoadmoreListener(this);
    LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    newsRecycler.setLayoutManager(layoutManager);
    newsAdapter = new NewsAdapter(newsList);
    newsRecycler.setAdapter(newsAdapter);
    newsRecycler.addItemDecoration(new DividerItemDecoration(getContext()));
    return view;
}
 
开发者ID:NicoLiutong,项目名称:miaosou,代码行数:16,代码来源:NewsFragment.java

示例9: SmartRefreshWebLayout

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
public SmartRefreshWebLayout(Activity activity){

        View mView=activity.getLayoutInflater().inflate(R.layout.fragment_srl_web,null);
        View smarkView = mView.findViewById(R.id.smarkLayout);
        mSmartRefreshLayout = (SmartRefreshLayout) smarkView;
        mWebView = (WebView) mSmartRefreshLayout.findViewById(R.id.webView);

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

示例10: onCreate

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    SmartRefreshLayout.setDefaultRefreshHeaderCreater(new DefaultRefreshHeaderCreater() {
        @NonNull
        @Override
        public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
            BezierRadarHeader header = new BezierRadarHeader(context);
            layout.setPrimaryColorsId(R.color.colorPrimary, android.R.color.white);
            return header;
        }
    });
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:14,代码来源:App.java

示例11: initCtrls

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
private void initCtrls() {
    mUINavigationBar = (UINavigationBar) findViewById(R.id.id_nav_bar);
    mRefreshLayout = (SmartRefreshLayout) findViewById(R.id.id_refresh_layout);
    mRecyclerView = (RecyclerView) findViewById(R.id.id_recycler_view);

    mUINavigationBar.setNavBarTitle("微头条");
    mUINavigationBar.setNavBarRightImg(R.drawable.micro_add_friend);
    mUINavigationBar.setNavBarLeftImg(-1);
    mUINavigationBar.setOnNavigationBarClickListener(new UINavigationBar.OnNavigationBarClickListener() {
        @Override
        public void onNavigationBarRightClicked() {
            logD("onNavigationBarRightClicked");
        }
    });
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:16,代码来源:MicroMainFragment.java

示例12: initViews

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
protected void initViews() {
    mRefreshLayout = (SmartRefreshLayout) findViewById(R.id.id_refresh_layout);
    mRecyclerView = (RecyclerView) findViewById(R.id.id_recycler_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));


    mRefreshLayout.setOnRefreshListener(this);
    mRefreshLayout.setOnLoadmoreListener(this);
    mRefreshLayout.autoRefresh(0);
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:13,代码来源:TestActivity.java

示例13: onInitialized

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(@NonNull RefreshKernel kernel, int height, int extendHeight) {
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        kernel.requestDrawBackgoundForHeader(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:8,代码来源:RefreshHeaderWrapper.java

示例14: onInitialized

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(@NonNull RefreshKernel kernel, int height, int extendHeight) {
    ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
    if (params instanceof SmartRefreshLayout.LayoutParams) {
        kernel.requestDrawBackgoundForFooter(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
    }
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:8,代码来源:RefreshFooterWrapper.java

示例15: restore

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
private static void restore() {
    SmartRefreshLayout.setDefaultRefreshHeaderCreater(new DefaultRefreshHeaderCreater() {
        @NonNull
        @Override
        public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
            layout.setPrimaryColorsId(R.color.colorPrimary, android.R.color.white);//全局设置主题颜色
            return new ClassicsHeader(context).setTimeFormat(new DynamicTimeFormat("更新于 %s"));
        }
    });
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:11,代码来源:AssignDefaultUsingActivity.java


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