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


Java BottomSheetBehavior.from方法代码示例

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


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

示例1: toggleBottomSheet

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
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,代码行数:20,代码来源:BottomSheetMediaActions.java

示例2: ui

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
protected void ui(View rootView) {
    albumArt = (ImageView) rootView.findViewById(R.id.albumArt);
    queuerv = (RecyclerView) rootView.findViewById(R.id.commonrv);
    favButton = (ImageButton) rootView.findViewById(R.id.action_favorite);
    moreMenu = (ImageButton) rootView.findViewById(R.id.menu_button);
    shuffleButton = (ImageView) rootView.findViewById(R.id.shuffle_song);
    repeatButton = (ImageView) rootView.findViewById(R.id.repeat_song);
    playpausebutton = (ImageView) rootView.findViewById(R.id.play_pause_toggle);
    next = (ImageView) rootView.findViewById(R.id.next);
    prev = (ImageView) rootView.findViewById(R.id.prev);
    currentDur = (TextView) rootView.findViewById(R.id.currentDur);
    totalDur = (TextView) rootView.findViewById(R.id.totalDur);
    songArtist = (TextView) rootView.findViewById(R.id.song_artist);
    songTitle = (TextView) rootView.findViewById(R.id.song_title);
    seekbar = (SeekBar) rootView.findViewById(R.id.seekbar);
    lrcView = (TextView) rootView.findViewById(R.id.lyrics);
    bottomsheetLyrics = (FrameLayout) rootView.findViewById(R.id.bottomsheetLyrics);
    bottomSheetBehavior = BottomSheetBehavior.from(bottomsheetLyrics);
    diagonalLayout = (DiagonalLayout) rootView.findViewById(R.id.diagonalLayout);
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:22,代码来源:Playing3Fragment.java

示例3: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
    View view = View.inflate(getContext(), R.layout.dialog_bottom_sheet, null);
    dialog.setContentView(view);
    mBehavior = BottomSheetBehavior.from((View) view.getParent());
    dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    imPay = (ImageView) view.findViewById(R.id.im_pay);
    return dialog;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:TMVPFragment.java

示例4: updateUI

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
protected void updateUI() {
    editText.setBackgroundColor(ContextCompat.getColor(getApplicationContext(),android.R.color.transparent));
    mBehavior = BottomSheetBehavior.from(new BottomSheetBuilder(this, coordinatorLayout)
            .setMode(BottomSheetBuilder.MODE_GRID)
            .setBackgroundColorResource(R.color.colorDarkKnight)
            .setItemTextColorResource(R.color.white)
            .setMenu(R.menu.menu_attachments)
            .setItemClickListener(this).createView());
    mBehavior.setBottomSheetCallback(null);
    toggleModes();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:13,代码来源:ComposerActivity.java

示例5: initiateTheScreenTextAndAnimation

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
public void initiateTheScreenTextAndAnimation() {
    mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
    vibrator = (Vibrator) getActivity().getSystemService(Context.VIBRATOR_SERVICE);
    chanceFromPreference = presenter.LoadBadgeCountFromInteractor();
    //check if there is any chance and show the user how many time s/he can try.
    //I don't like "else{}"s :)
    if(chanceFromPreference >0) chanceCounterTV.setText(" فرصت‌های باقی مانده: "+"\n"+ chanceFromPreference);
    if(chanceFromPreference <=0) chanceCounterTV.setText("فرصت های شما تمام شده :(");
    //Adding an animation as a button with lottie
    lAnimation.setAnimation("refresh.json");
    //shitty setting for bad animation
    lAnimation.setProgress(1);
}
 
开发者ID:01sadra,项目名称:Detoxiom,代码行数:15,代码来源:NewQuoteFragment.java

示例6: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
    View view = View.inflate(getActivity(), R.layout.bottom_sheet_video_list, null);
    TextView textView = (TextView) view.findViewById(R.id.item_link);
    textView.setText(videoUrl);
    textView.setOnClickListener(this);
    view.findViewById(R.id.item_copy).setOnClickListener(this);
    dialog.setContentView(view);
    behavior = BottomSheetBehavior.from((View) view.getParent());
    return dialog;
}
 
开发者ID:mingdroid,项目名称:tumbviewer,代码行数:13,代码来源:PostBottomSheet.java

示例7: setUpBotomSheet

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
private void setUpBotomSheet() {
    mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
    //initially set hidden(in case there are no pharmacies around).Not working
    mBottomSheetBehavior.setHideable(true);
    mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);


}
 
开发者ID:cahergil,项目名称:Farmacias,代码行数:9,代码来源:MapTabFragment.java

示例8: show

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
public void show() {
    if (getContext().getResources().getBoolean(R.bool.is_tablet)) {
        final int peekHeight = getContext().getResources().getDimensionPixelSize(R.dimen.tablet_bottom_sheet_peekheight);

        BottomSheetBehavior<View> bsBehaviour = BottomSheetBehavior.from((View) contentView.getParent());
        bsBehaviour.setPeekHeight(peekHeight);
    }

    super.show();
}
 
开发者ID:mozilla-mobile,项目名称:firefox-tv,代码行数:12,代码来源:OpenWithFragment.java

示例9: onCreate

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_boxing_bottom_sheet);
    createToolbar();

    FrameLayout bottomSheet = (FrameLayout) findViewById(R.id.content_layout);
    mBehavior = BottomSheetBehavior.from(bottomSheet);
    mBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);

    mImage = (ImageView) findViewById(R.id.media_result);
    mImage.setOnClickListener(this);
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:14,代码来源:BoxingBottomSheetActivity.java

示例10: initView

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
private void initView() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    btnBottomSheetControl = (Button) findViewById(R.id.btn_bottom_sheet_control);
    btnBottomDialogControl = (Button) findViewById(R.id.btn_bottom_dialog_control);

    mBottomSheetBehavior = BottomSheetBehavior.from(findViewById(R.id.tab_layout));

    initListener();
    initDialog();
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:13,代码来源:BottomSheetActivity.java

示例11: onCreate

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_zhihu);

    initToolbar();
    initData();
    initView();
    initListener();

    FooterBehavior footerBehavior = FooterBehavior.from(fab);
    footerBehavior.setOnStateChangedListener(onStateChangedListener);
    mBottomSheetBehavior = BottomSheetBehavior.from(findViewById(R.id.tab_layout));
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:15,代码来源:ZhiHuActivity.java

示例12: onCreateDialog

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
    View view = View.inflate(getContext(), R.layout.dialog_bottom_sheet1, null);
    dialog.setContentView(view);
    mBehavior = BottomSheetBehavior.from((View) view.getParent());
    return dialog;
}
 
开发者ID:AweiLoveAndroid,项目名称:BottomSheetDialogDemo,代码行数:10,代码来源:FullSheetDialogFragment.java

示例13: initView

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
protected void initView() {
    setOnClickListener(this, R.id.btnBehavior, R.id.btnDialog,R.id.btn_baidumap);

    View bottomSheet = findViewById(R.id.bottom_sheet);
    if (bottomSheet != null) {
        behavior = BottomSheetBehavior.from(bottomSheet);
        behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:11,代码来源:BottomSheetActivity.java

示例14: onCreate

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.bottom_sheet_activity);

    setOnClickListener(this, R.id.btnBehavior, R.id.btnDialog);

    View bottomSheet = findViewById(R.id.bottom_sheet);
    if (bottomSheet != null) {
        behavior = BottomSheetBehavior.from(bottomSheet);
        behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);

    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:15,代码来源:BottomSheetActivity.java

示例15: getDefaultBottomSheetBehaviour

import android.support.design.widget.BottomSheetBehavior; //导入方法依赖的package包/类
private BottomSheetBehavior getDefaultBottomSheetBehaviour(View bottomSheetView) {
	BottomSheetBehavior behavior = BottomSheetBehavior.from((View) bottomSheetView.getParent());
	behavior.setPeekHeight(getContext().getResources().getDisplayMetrics().heightPixels/3);
	return behavior;
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:6,代码来源:StreamFragment.java


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