本文整理汇总了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();
}
示例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();
}
示例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);
}