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


Java BottomSheetBehavior.STATE_HIDDEN属性代码示例

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


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

示例1: onStateChanged

@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
    switch (newState) {
        case BottomSheetBehavior.STATE_HIDDEN: {
            LogUtils.d("Bottom sheet hidden to dismiss");
            dismiss();
            break;
        }
        case BottomSheetBehavior.STATE_EXPANDED: {
            LogUtils.d("expanded");
            break;
        }
        case BottomSheetBehavior.STATE_COLLAPSED: {
            LogUtils.d("collapsed");
            break;
        }

    }

}
 
开发者ID:mengdd,项目名称:TodoRealm,代码行数:20,代码来源:AddListDialogFragment.java

示例2: onClick

@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btnBehavior:
            int state = behavior.getState();
            if (state == BottomSheetBehavior.STATE_EXPANDED) {
                behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
            } else if(state == BottomSheetBehavior.STATE_COLLAPSED){
                behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
            }else if(state == BottomSheetBehavior.STATE_HIDDEN){
                behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
            }
            break;
        case R.id.btnDialog:
            BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
            bottomSheetDialog.setContentView(R.layout.include_bottom_sheet_layout);
            bottomSheetDialog.show();
            break;
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:20,代码来源:BottomSheetActivity.java

示例3: onClick

@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btnBehavior:
            int state = behavior.getState();
            if (state == BottomSheetBehavior.STATE_EXPANDED) {
                behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
            } else if(state == BottomSheetBehavior.STATE_COLLAPSED){
                behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
            }else if(state == BottomSheetBehavior.STATE_HIDDEN){
                behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
            }
            break;
        case R.id.btnDialog:
            BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
            bottomSheetDialog.setContentView(R.layout.include_bottom_sheet_layout);
            bottomSheetDialog.show();
            break;
        case R.id.btn_baidumap:
            readyGo(BaiduMapSample.class);
            break;
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:23,代码来源:BottomSheetActivity.java

示例4: onClick

@Override
public void onClick(View view) {
    switch (view.getId()){
        case R.id.theme_selected :
        case R.id.fab:
            // change the state of the bottom sheet
            switch (mBottomSheetBehavior.getState()){
                case BottomSheetBehavior.STATE_HIDDEN :
                    mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
                    break;

                case BottomSheetBehavior.STATE_COLLAPSED :
                    mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
                    break;

                case BottomSheetBehavior.STATE_EXPANDED :
                    mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
                    break;
            }
            break;
    }
}
 
开发者ID:pkjvit,项目名称:Android-Multi-Theme-UI,代码行数:22,代码来源:ScrollingActivity.java

示例5: onStateChanged

@Override
public void onStateChanged(@NonNull View bottomSheet,
                           @BottomSheetBehavior.State int newState) {
    if (mCallback != null) {
        mCallback.onStateChanged(bottomSheet, newState);
    }

    if (newState == BottomSheetBehavior.STATE_HIDDEN) {
        mBehavior.setBottomSheetCallback(null);
        try {
            BottomSheetMenuDialog.super.dismiss();
        } catch (IllegalArgumentException e) {
            // ignore exception handling
        }

        // User dragged the sheet.
        if (!mClicked && !mRequestDismiss && !mRequestCancel && mOnCancelListener != null) {
            mOnCancelListener.onCancel(BottomSheetMenuDialog.this);
        }
    }
}
 
开发者ID:yuhodev,项目名称:login,代码行数:21,代码来源:BottomSheetMenuDialog.java

示例6: toggleBottomSheet

private static void toggleBottomSheet(View bottomSheet) {

        BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);

        int state = bottomSheetBehavior.getState();

        switch (state) {
            case BottomSheetBehavior.STATE_COLLAPSED:
                bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
                break;
            case BottomSheetBehavior.STATE_HIDDEN:
                bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
                break;
            case BottomSheetBehavior.STATE_EXPANDED:
                bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
                break;

        }
    }
 
开发者ID:enricocid,项目名称:Gallery-example,代码行数:19,代码来源:BottomSheetMediaActions.java

示例7: hideBottomSheet

private boolean hideBottomSheet() {
    if (mBehavior != null && mBehavior.getState() != BottomSheetBehavior.STATE_HIDDEN) {
        mBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
        return true;
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:BoxingBottomSheetActivity.java

示例8: toggleBottomSheet

private void toggleBottomSheet() {
    if (mBehavior == null) {
        return;
    }
    if (mBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN) {
        mBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    } else {
        mBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:BoxingBottomSheetActivity.java

示例9: onBackPressed

@Override
public void onBackPressed() {
    BottomSheetBehavior b = BottomSheetBehavior.from(mPanel);
    if (b.getState() != BottomSheetBehavior.STATE_HIDDEN) {
        b.setState(BottomSheetBehavior.STATE_HIDDEN);
        return;
    }
    super.onBackPressed();
}
 
开发者ID:natario1,项目名称:ViewPrinter,代码行数:9,代码来源:MainActivity.java

示例10: onStateChanged

@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
    if(isVisible() && !isDetached() || !isRemoving())
        switch (newState) {
            case BottomSheetBehavior.STATE_HIDDEN:
                dismiss();
                break;
            case BottomSheetBehavior.STATE_COLLAPSED:
                mSheetStateChangeListener.onStateCollapsed();
                break;
            case BottomSheetBehavior.STATE_EXPANDED:
                mSheetStateChangeListener.onStateExpanded();
                break;
        }
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:15,代码来源:BottomSheet.java

示例11: onStateChanged

@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
    if (newState == BottomSheetBehavior.STATE_HIDDEN) {
        mServerMessagesContainer.setVisibility(View.GONE);
        mServerMessagesListAdapter.clear();
    }
}
 
开发者ID:MCMrARM,项目名称:revolution-irc,代码行数:7,代码来源:ChatFragmentSendMessageHelper.java

示例12: onStateChanged

@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
    if (newState == BottomSheetBehavior.STATE_HIDDEN) {
        dismiss();
    }

}
 
开发者ID:AdyoOrg,项目名称:adyo-android,代码行数:7,代码来源:FilterFragment.java

示例13: showRecenterBtn

@Override
public void showRecenterBtn() {
  if (summaryBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN) {
    recenterBtn.show();
  }
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:6,代码来源:NavigationView.java

示例14: onStateChanged

@Override public void onStateChanged(@NonNull View bottomSheet, int newState) {
    if (newState == BottomSheetBehavior.STATE_HIDDEN) {
        isAlreadyHidden = true;
        onHidden();
    }
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:6,代码来源:BaseBottomSheetDialog.java

示例15: onScroll

/**
 * Listener this activity sets on the {@link MapboxMap}.
 * <p>
 * Used as a cue to hide the {@link SummaryBottomSheet} and stop the
 * camera from following location updates.
 *
 * @since 0.6.0
 */
@Override
public void onScroll() {
  if (summaryBehavior.getState() != BottomSheetBehavior.STATE_HIDDEN) {
    navigationPresenter.onMapScroll();
  }
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:14,代码来源:NavigationView.java


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