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


Java BottomSheetBehavior.setBottomSheetCallback方法代码示例

本文整理汇总了Java中android.support.design.widget.BottomSheetBehavior.setBottomSheetCallback方法的典型用法代码示例。如果您正苦于以下问题:Java BottomSheetBehavior.setBottomSheetCallback方法的具体用法?Java BottomSheetBehavior.setBottomSheetCallback怎么用?Java BottomSheetBehavior.setBottomSheetCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.design.widget.BottomSheetBehavior的用法示例。


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

示例1: setupDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
public void setupDialog(Dialog dialog, int style) {
    LogUtils.footPrint();
    super.setupDialog(dialog, style);
    View contentView = View.inflate(getContext(), R.layout.fragment_add_list_dialog, null);
    dialog.setContentView(contentView);
    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
    CoordinatorLayout.Behavior behavior = params.getBehavior();

    if (behavior != null && behavior instanceof BottomSheetBehavior) {
        BottomSheetBehavior bottomSheetBehavior = ((BottomSheetBehavior) behavior);
        bottomSheetBehavior.setBottomSheetCallback(bottomSheetBehaviorCallback);
    }

    ButterKnife.bind(this, contentView);

    Window window = dialog.getWindow();
    if (window != null) {
        window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    }

    presenter = new AddListPresenter(TodoRepository.getInstance());
    presenter.attachView(this);
}
 
开发者ID:mengdd,项目名称:TodoRealm,代码行数:25,代码来源:AddListDialogFragment.java

示例2: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog mSheet = super.onCreateDialog(savedInstanceState);
    View contentView = View.inflate(getContext(), R.layout.bottom_sheet_message, null);
    mSheet.setContentView(contentView);

    unbinder = ButterKnife.bind(this, mSheet);

    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
    CoordinatorLayout.Behavior behavior = params.getBehavior();

    if (behavior != null && behavior instanceof BottomSheetBehavior) {
        bottomSheetBehavior = (BottomSheetBehavior) behavior;
        bottomSheetBehavior.setBottomSheetCallback(mBottomSheetBehaviorCallback);
    }

    onPostCreate(this);
    return mSheet;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:21,代码来源:BottomSheetMessage.java

示例3: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog mSheet = super.onCreateDialog(savedInstanceState);
    View contentView = View.inflate(getContext(), R.layout.bottom_sheet_emoticons, null);
    mSheet.setContentView(contentView);

    unbinder = ButterKnife.bind(this, mSheet);

    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
    CoordinatorLayout.Behavior behavior = params.getBehavior();

    if (behavior != null && behavior instanceof BottomSheetBehavior) {
        bottomSheetBehavior = (BottomSheetBehavior) behavior;
        bottomSheetBehavior.setBottomSheetCallback(mBottomSheetBehaviorCallback);
    }

    onPostCreate(this);
    return mSheet;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:21,代码来源:BottomSheetEmoticon.java

示例4: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog mSheet = super.onCreateDialog(savedInstanceState);
    View contentView = View.inflate(getContext(), R.layout.bottom_sheet_share, null);
    mSheet.setContentView(contentView);
    unbinder = ButterKnife.bind(this, mSheet);
    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
    CoordinatorLayout.Behavior behavior = params.getBehavior();
    if (behavior != null && behavior instanceof BottomSheetBehavior) {
        bottomSheetBehavior = (BottomSheetBehavior) behavior;
        bottomSheetBehavior.setBottomSheetCallback(mBottomSheetBehaviorCallback);
    }
    onPostCreate(this);
    return mSheet;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:17,代码来源:BottomSheetShare.java

示例5: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog mSheet = super.onCreateDialog(savedInstanceState);
    View contentView = View.inflate(getContext(), R.layout.bottom_sheet_recycler, null);
    mSheet.setContentView(contentView);

    unbinder = ButterKnife.bind(this, mSheet);

    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
    CoordinatorLayout.Behavior behavior = params.getBehavior();

    if (behavior != null && behavior instanceof BottomSheetBehavior) {
        bottomSheetBehavior = (BottomSheetBehavior) behavior;
        bottomSheetBehavior.setPeekHeight(ScreenUtil.dip2px(getContext(), PEEK_HEIGHT));
        bottomSheetBehavior.setBottomSheetCallback(mBottomSheetBehaviorCallback);
    }

    mToolbar.setNavigationIcon(R.drawable.ic_close_white_24dp);
    mToolbar.setNavigationOnClickListener(this);

    onPostCreate(this);
    return mSheet;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:25,代码来源:BottomSheetUsers.java

示例6: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog mSheet = super.onCreateDialog(savedInstanceState);
    View contentView = View.inflate(getContext(), R.layout.bottom_sheet_recycler, null);
    mSheet.setContentView(contentView);

    unbinder = ButterKnife.bind(this, mSheet);

    CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
    CoordinatorLayout.Behavior behavior = params.getBehavior();

    if (behavior != null && behavior instanceof BottomSheetBehavior) {
        bottomSheetBehavior = (BottomSheetBehavior) behavior;
        bottomSheetBehavior.setPeekHeight(ScreenUtil.dip2px(getContext(), PEEK_HEIGHT));
        bottomSheetBehavior.setBottomSheetCallback(mBottomSheetBehaviorCallback);
    }


    mToolbar.setNavigationIcon(R.drawable.ic_close_white_24dp);
    mToolbar.setNavigationOnClickListener(this);

    mToolbar.inflateMenu(R.menu.menu_generic_detail);
    mToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            Toast.makeText(getContext(), "Showing your current favour state", Toast.LENGTH_SHORT).show();
            return true;
        }
    });

    mFavourite = mToolbar.getMenu().findItem(R.id.action_favor_state);
    onPostCreate(this);
    return mSheet;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:36,代码来源:BottomSheetLikes.java


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