本文整理汇总了Java中com.r0adkll.slidr.model.SlidrInterface类的典型用法代码示例。如果您正苦于以下问题:Java SlidrInterface类的具体用法?Java SlidrInterface怎么用?Java SlidrInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SlidrInterface类属于com.r0adkll.slidr.model包,在下文中一共展示了SlidrInterface类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Window window = getWindow();
// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// window.setStatusBarColor(Color.TRANSPARENT);
//}
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// Window window = getWindow();
// //透明状态栏
// window.setFlags(
// WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
// WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// //透明导航栏
// window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
//}
//绑定向右滑动退出
SlidrInterface slidrInterface = Slidr.attach(this, SlidrUtils.getSlidrConfig());
}
开发者ID:NICOLITE,项目名称:Palm300Heroes,代码行数:25,代码来源:BaseActivity.java
示例2: onSetWebView
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
@Override
public void onSetWebView(String url, boolean flag) {
initWebClient();
photoView.setVisibility(View.GONE);
swipeRefreshLayout.setVisibility(View.VISIBLE);
// 是否为头条的网站
if (flag) {
webView.loadDataWithBaseURL(null, url, "text/html", "utf-8", null);
} else {
webView.loadUrl(shareUrl);
}
SlidrInterface slidrInterface = ((PhotoContentActivity) getActivity()).getSlidrInterface();
if (slidrInterface != null) {
slidrInterface.unlock();
}
}
开发者ID:iMeiji,项目名称:Toutiao,代码行数:19,代码来源:PhotoContentFragment.java
示例3: replace
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
/**
* Attach a slider mechanism to a fragment view replacing an internal view
*
* @param oldScreen the view within a fragment to replace
* @param config the slider configuration to attach with
* @return a {@link com.r0adkll.slidr.model.SlidrInterface} that allows
* the user to lock/unlock the sliding mechanism for whatever purpose.
*/
@NonNull
public static SlidrInterface replace(@NonNull final View oldScreen, @NonNull final SlidrConfig config) {
ViewGroup parent = (ViewGroup) oldScreen.getParent();
ViewGroup.LayoutParams params = oldScreen.getLayoutParams();
parent.removeView(oldScreen);
// Setup the slider panel and attach it
final SliderPanel panel = new SliderPanel(oldScreen.getContext(), oldScreen, config);
panel.setId(R.id.slidable_panel);
oldScreen.setId(R.id.slidable_content);
panel.addView(oldScreen);
parent.addView(panel, 0, params);
// Set the panel slide listener for when it becomes closed or opened
panel.setOnPanelSlideListener(new FragmentPanelSlideListener(oldScreen, config));
// Return the lock interface
return panel.getDefaultInterface();
}
开发者ID:r0adkll,项目名称:Slidr,代码行数:29,代码来源:Slidr.java
示例4: getSlidrInterface
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
public SlidrInterface getSlidrInterface() {
return slidrInterface;
}
开发者ID:iMeiji,项目名称:Toutiao,代码行数:4,代码来源:PhotoContentActivity.java
示例5: attach
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
/**
* Attach a slideable mechanism to an activity that adds the slide to dismiss functionality
* and allows for the statusbar to transition between colors
*
* @param activity the activity to attach the slider to
* @param statusBarColor1 the primaryDark status bar color of the interface that this will slide back to
* @param statusBarColor2 the primaryDark status bar color of the activity this is attaching to that will transition
* back to the statusBarColor1 color
*
* @return a {@link com.r0adkll.slidr.model.SlidrInterface} that allows
* the user to lock/unlock the sliding mechanism for whatever purpose.
*/
public static SlidrInterface attach(final Activity activity, final int statusBarColor1, final int statusBarColor2){
// Hijack the decorview
ViewGroup decorView = (ViewGroup)activity.getWindow().getDecorView();
View oldScreen = decorView.getChildAt(0);
decorView.removeViewAt(0);
// Setup the slider panel and attach it to the decor
final SliderPanel panel = new SliderPanel(activity, oldScreen);
panel.setId(R.id.slidable_panel);
oldScreen.setId(R.id.slidable_content);
panel.addView(oldScreen);
decorView.addView(panel, 0);
// Set the panel slide listener for when it becomes closed or opened
panel.setOnPanelSlideListener(new SliderPanel.OnPanelSlideListener() {
private final ArgbEvaluator mEvaluator = new ArgbEvaluator();
@Override
public void onStateChanged(int state) {
}
@Override
public void onClosed() {
activity.finish();
activity.overridePendingTransition(0, 0);
}
@Override
public void onOpened() {}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onSlideChange(float percent) {
// Interpolate the statusbar color
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
statusBarColor1 != -1 && statusBarColor2 != -1){
int newColor = (int) mEvaluator.evaluate(percent, statusBarColor1, statusBarColor2);
activity.getWindow().setStatusBarColor(newColor);
}
}
});
// Setup the lock interface
SlidrInterface slidrInterface = new SlidrInterface() {
@Override
public void lock() {
panel.lock();
}
@Override
public void unlock() {
panel.unlock();
}
};
// Return the lock interface
return slidrInterface;
}
开发者ID:azimkhan917,项目名称:Slide-Master,代码行数:74,代码来源:Slidr.java
示例6: attach
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
/**
* Attach a slideable mechanism to an activity that adds the slide to dismiss functionality
* and allows for the statusbar to transition between colors
*
* @param activity the activity to attach the slider to
* @param statusBarColor1 the primaryDark status bar color of the interface that this will slide back to
* @param statusBarColor2 the primaryDark status bar color of the activity this is attaching to that will transition
* back to the statusBarColor1 color
* @return a {@link com.r0adkll.slidr.model.SlidrInterface} that allows
* the user to lock/unlock the sliding mechanism for whatever purpose.
*/
@NonNull
public static SlidrInterface attach(@NonNull Activity activity, @ColorInt int statusBarColor1,
@ColorInt int statusBarColor2) {
// Setup the slider panel and attach it to the decor
final SliderPanel panel = attachSliderPanel(activity, null);
// Set the panel slide listener for when it becomes closed or opened
panel.setOnPanelSlideListener(new ColorPanelSlideListener(activity, statusBarColor1, statusBarColor2));
// Return the lock interface
return panel.getDefaultInterface();
}
开发者ID:r0adkll,项目名称:Slidr,代码行数:25,代码来源:Slidr.java
示例7: getDefaultInterface
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
/**
* Get the default {@link SlidrInterface} from which to control the panel with after attachment
*/
public SlidrInterface getDefaultInterface() {
return defaultSlidrInterface;
}
开发者ID:r0adkll,项目名称:Slidr,代码行数:7,代码来源:SliderPanel.java
示例8: onPageSelected
import com.r0adkll.slidr.model.SlidrInterface; //导入依赖的package包/类
@Override
public void onPageSelected(int position) {
presenter.doSetPosition(position);
tv_hint.setText(position + 1 + "/" + presenter.doGetImageCount());
SlidrInterface slidrInterface = ((PhotoContentActivity) getActivity()).getSlidrInterface();
if (slidrInterface != null) {
if (position == 0) {
slidrInterface.unlock();
} else {
slidrInterface.lock();
}
}
}
开发者ID:iMeiji,项目名称:Toutiao,代码行数:15,代码来源:PhotoContentFragment.java
注:本文中的com.r0adkll.slidr.model.SlidrInterface类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论