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


Java SlidrListener类代码示例

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


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

示例1: getSlidrConfig

import com.r0adkll.slidr.model.SlidrListener; //导入依赖的package包/类
/**
 * Slidr默认配置
 * @return
 */
private static SlidrConfig getSlidrConfig(){
    return new SlidrConfig.Builder()
            // .primaryColor(getResources().getColor(R.color.primary)
            // .secondaryColor(getResources().getColor(R.color.secondary)
            .position(SlidrPosition.LEFT)
            .sensitivity(1f)
            .scrimColor(Color.BLACK)
            .scrimStartAlpha(0.8f)
            .scrimEndAlpha(0f)
            .velocityThreshold(2400)
            .distanceThreshold(0.25f)
            .edge(true)
            .edgeSize(0.18f) // The % of the screen that counts as the edge, default 18%
            .listener(new SlidrListener() {
                @Override
                public void onSlideStateChanged(int state) {

                }

                @Override
                public void onSlideChange(float percent) {

                }

                @Override
                public void onSlideOpened() {

                }

                @Override
                public void onSlideClosed() {

                }
            })
            .build();
}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:41,代码来源:SlidrUtils.java

示例2: getSlidrConfig

import com.r0adkll.slidr.model.SlidrListener; //导入依赖的package包/类
/**
 * Slidr默认配置
 * @return
 */
public static SlidrConfig getSlidrConfig(){
    return new SlidrConfig.Builder()
            // .primaryColor(getResources().getColor(R.color.primary)
            // .secondaryColor(getResources().getColor(R.color.secondary)
            .position(SlidrPosition.LEFT)
            .sensitivity(1f)
            .scrimColor(Color.BLACK)
            .scrimStartAlpha(0.8f)
            .scrimEndAlpha(0f)
            .velocityThreshold(2400)
            .distanceThreshold(0.25f)
            .edge(true)
            .edgeSize(0.18f) // The % of the screen that counts as the edge, default 18%
            .listener(new SlidrListener() {
                @Override
                public void onSlideStateChanged(int state) {

                }

                @Override
                public void onSlideChange(float percent) {

                }

                @Override
                public void onSlideOpened() {

                }

                @Override
                public void onSlideClosed() {

                }
            })
            .build();
}
 
开发者ID:NICOLITE,项目名称:Palm300Heroes,代码行数:41,代码来源:SlidrUtils.java

示例3: onCreate

import com.r0adkll.slidr.model.SlidrListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ButterKnife.inject(this);

    //this code causes the drawer to be drawn below the status bar as it clears FLAG_TRANSLUCENT_STATUS
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.setStatusBarColor(getResources().getColor(R.color.material_blue_grey_900));
    }

    setupToolbarImage();
    setupSwipeLayout();
    setupFabs();

    SlidrConfig config = new SlidrConfig.Builder().listener(new SlidrListener() {
        @Override
        public void onSlideStateChanged(int state) {
        }

        @Override
        public void onSlideChange(float percent) {

        }

        @Override
        public void onSlideOpened() {

        }

        @Override
        public void onSlideClosed() {
            setResult();
        }
    }).build();

    mSlidrInterface = Slidr.attach(this, config);
    threadPresenter.getThread(postItem.getId(), new HashMap<>());

    title.setText(postItem.getTitle());
    //if position is passed, call other method with position as param
    optionsView.setup(postItem, this);
}
 
开发者ID:Redgram,项目名称:redgram-for-reddit,代码行数:46,代码来源:ThreadActivity.java


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