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


Java SwipeBackLayout类代码示例

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


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

示例1: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(
            me.imid.swipebacklayout.lib.R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {

        }
    });
}
 
开发者ID:Ztiany,项目名称:SystemBarTint,代码行数:23,代码来源:SwipeBackActivityHelper.java

示例2: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(
            R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {

        }
    });
}
 
开发者ID:libit,项目名称:lr_dialer,代码行数:23,代码来源:SwipeBackActivityHelper.java

示例3: setSwipeBackFlag

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
public void setSwipeBackFlag(SwipeBack swipeBack){
    this.swipeBack=swipeBack;
    int edgeFlag = -1;
    switch (swipeBack) {
        case NONE:
            //默认就是左边
            break;
        case LEFT:
            //默认就是左边
            edgeFlag = SwipeBackLayout.EDGE_LEFT;
            break;
        case RIGHT:
            edgeFlag= SwipeBackLayout.EDGE_RIGHT;
            break;
        case ALL:
            edgeFlag= SwipeBackLayout.EDGE_ALL;
            break;
        case BOTTOM:
            edgeFlag= SwipeBackLayout.EDGE_BOTTOM;
            break;
    }
    if (edgeFlag != -1)
        mSwipeBackLayout.setEdgeTrackingEnabled(edgeFlag);
}
 
开发者ID:luhaoaimama1,项目名称:zone-sdk,代码行数:25,代码来源:SwipeBackKind.java

示例4: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(0));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = new SwipeBackLayout(mActivity);
    mSwipeBackLayout.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
    mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
            if (state == SwipeBackLayout.STATE_IDLE && scrollPercent == 0) {
                convertActivityFromTranslucent();
            }
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            convertActivityToTranslucent();
        }

        @Override
        public void onScrollOverThreshold() {

        }
    });
}
 
开发者ID:hoyin258,项目名称:MisterWok,代码行数:27,代码来源:SwipeBackActivityHelper.java

示例5: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(
           R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {

        }
    });
}
 
开发者ID:MewX,项目名称:light-novel-library_Wenku8_Android,代码行数:23,代码来源:SwipeBackActivityHelper.java

示例6: setSwipeEdge

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
private void setSwipeEdge() {
    mSwipeEdge = (MultiSelectListPreference) findPreference(GlobalSetting.SWIPE_BACK_EDGE);
    int edge = GlobalSetting.getSwipeBackEdge();

    Set<String> edges = new HashSet<String>();
    StringBuilder summary = new StringBuilder();
    if ((edge & SwipeBackLayout.EDGE_LEFT) != 0) {
        edges.add(String.valueOf(SwipeBackLayout.EDGE_LEFT));
        summary.append(getResources().getString(R.string.swipe_edge_left)).append(" ");
    }
    if ((edge & SwipeBackLayout.EDGE_RIGHT) != 0) {
        edges.add(String.valueOf(SwipeBackLayout.EDGE_RIGHT));
        summary.append(getResources().getString(R.string.swipe_edge_right)).append(" ");
    }
    if ((edge & SwipeBackLayout.EDGE_BOTTOM) != 0) {
        edges.add(String.valueOf(SwipeBackLayout.EDGE_BOTTOM));
        summary.append(getResources().getString(R.string.swipe_edge_bottom)).append(" ");
    }
    mSwipeEdge.setValues(edges);
    mSwipeEdge.setSummary(summary.toString());
    mSwipeEdge.setOnPreferenceChangeListener(this);
}
 
开发者ID:fei-ke,项目名称:ChipHellClient,代码行数:23,代码来源:SettingFragment.java

示例7: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(0));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(
            R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
            if (state == SwipeBackLayout.STATE_IDLE && scrollPercent == 0) {
                convertActivityFromTranslucent();
            }
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            convertActivityToTranslucent();
        }

        @Override
        public void onScrollOverThreshold() {

        }
    });
}
 
开发者ID:bitjjj,项目名称:GameRecorder,代码行数:26,代码来源:SwipeBackActivityHelper.java

示例8: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(
            me.imid.swipebacklayout.lib.R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
            if (state == SwipeBackLayout.STATE_IDLE && scrollPercent == 0) {
                Utils.convertActivityFromTranslucent(mActivity);
            }
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {

        }
    });
}
 
开发者ID:yrom,项目名称:AcFun-Area63,代码行数:26,代码来源:SwipeBackActivityHelper.java

示例9: initSwipeBack

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
/**
 * 界面滑动
 */
private void initSwipeBack() {
    mSwipeBackLayout = getSwipeBackLayout();
    // 滑动监听方向
    if (enableSwipe()) {
        mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
        mSwipeBackLayout.setEnableGesture(true);
    } else mSwipeBackLayout.setEnableGesture(false);
}
 
开发者ID:tengbinlive,项目名称:ooooim_android,代码行数:12,代码来源:AbsActivity.java

示例10: doAfterSetContentView

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@Override
protected void doAfterSetContentView() {
    SwipeBackLayout swipeBackLayout = getSwipeBackLayout();
    swipeBackLayout.setEnableGesture(getSwipeBackLayoutEnabled());
    if (!getSwipeBackLayoutEnabled()) {
        swipeBackLayout.setEdgeTrackingEnabled(getSwipeBackLayoutTracking());
    }
}
 
开发者ID:hljwang3874149,项目名称:ElephantReader,代码行数:9,代码来源:BaseSwipeActivity.java

示例11: onCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_news_detail);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    mProgressBar = (ProgressBar) findViewById(R.id.progress);
    mTVNewsContent = (HtmlTextView) findViewById(R.id.htNewsContent);

    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            onBackPressed();
        }
    });

    mSwipeBackLayout = getSwipeBackLayout();
    mSwipeBackLayout.setEdgeSize(ToolsUtil.getWidthInPx(this));
    mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);

    mNews = (NewsBean) getIntent().getSerializableExtra("news");

    CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    collapsingToolbar.setTitle(mNews.title);

    ((GlideImageView) findViewById(R.id.ivImage)).setImageURL(mNews.imgsrc);

    mNewsDetailPresenter = new NewsDetailPresenterImpl(getApplication(), this);
    mNewsDetailPresenter.loadNewsDetail(mNews.docid);
}
 
开发者ID:HarryXR,项目名称:SimpleNews,代码行数:32,代码来源:NewsDetailActivity.java

示例12: onCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPresenter = new WebActivityPresenter(this);
    ButterKnife.bind(this);
    mContext = this;
    // 从Intent中取出传递的参数

    mUrl = getIntent().getStringExtra(EXTRA_URL);

    WebSettings webSettings = mWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    if (PrefUtils.isEnableCache()) {
        if (NetworkUtils.isNetworkConnected()) {
            webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
        } else {
            webSettings.setCacheMode(WebSettings.LOAD_CACHE_ONLY);
        }
        webSettings.setAppCacheEnabled(true);
        webSettings.setDatabaseEnabled(true);
    }
    webSettings.setLoadWithOverviewMode(true);
    mWebView.setWebChromeClient(new ChromeClient());
    mWebView.setWebViewClient(new ViewClient());
    mWebView.loadUrl(mUrl);

    mSwipeBackLayout = getSwipeBackLayout();
    mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
}
 
开发者ID:MiracleWong,项目名称:MWZhiHuDaily,代码行数:30,代码来源:WebViewActivity.java

示例13: onCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_helper);
    getSwipeBackLayout().setSwipeMode(SwipeBackLayout.EDGE_LEFT);
    getSwipeBackLayout().setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
    TextView tv  =(TextView)findViewById(R.id.helptext);
    tv.setMovementMethod(LinkMovementMethod.getInstance());
    tv.setText(Html.fromHtml(getString(R.string.texts)));
}
 
开发者ID:coderstory,项目名称:Mi-Ki,代码行数:11,代码来源:HelperActivity.java

示例14: onCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    getSwipeBackLayout().setSwipeMode(SwipeBackLayout.FULL_SCREEN_LEFT);
    getSwipeBackLayout().setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
}
 
开发者ID:coderstory,项目名称:Mi-Ki,代码行数:8,代码来源:AboutActivity.java

示例15: onActivityCreate

import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
void onActivityCreate() {
    getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = new SwipeBackLayout(this);
    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    mSwipeBackLayout.setLayoutParams(params);
}
 
开发者ID:ZhuoKeTeam,项目名称:MasterHelper,代码行数:8,代码来源:SwipeBackActivity.java


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