當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。