本文整理汇总了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() {
}
});
}
示例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() {
}
});
}
示例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);
}
示例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() {
}
});
}
示例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() {
}
});
}
示例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);
}
示例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() {
}
});
}
示例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() {
}
});
}
示例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);
}
示例10: doAfterSetContentView
import me.imid.swipebacklayout.lib.SwipeBackLayout; //导入依赖的package包/类
@Override
protected void doAfterSetContentView() {
SwipeBackLayout swipeBackLayout = getSwipeBackLayout();
swipeBackLayout.setEnableGesture(getSwipeBackLayoutEnabled());
if (!getSwipeBackLayoutEnabled()) {
swipeBackLayout.setEdgeTrackingEnabled(getSwipeBackLayoutTracking());
}
}
示例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);
}
示例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);
}
示例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)));
}
示例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);
}
示例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);
}