Search in sources :

Example 11 with BottomSheetDialog

use of com.google.android.material.bottomsheet.BottomSheetDialog in project FlexibleAdapter by davideas.

the class BottomSheetSectionDialog method onCreateDialog.

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mBottomSheetDialog = new BottomSheetDialog(getActivity(), R.style.AppTheme_BottomSheetDialog);
    mBottomSheetDialog.setContentView(getArguments().getInt(ARG_LAYOUT));
    mBottomSheetDialog.findViewById(R.id.select_item_type).setOnClickListener(this);
    mBottomSheetDialog.findViewById(R.id.select_item_type).setOnTouchListener(new SimpleOnTouchListener(getContext()));
    mBottomSheetDialog.findViewById(R.id.select_reference_button).setOnClickListener(this);
    mBottomSheetDialog.findViewById(R.id.select_reference_button).setOnTouchListener(new SimpleOnTouchListener(getContext()));
    mBottomSheetDialog.findViewById(R.id.new_item).setOnClickListener(this);
    createPopUps();
    return mBottomSheetDialog;
}
Also used : BottomSheetDialog(com.google.android.material.bottomsheet.BottomSheetDialog) SimpleOnTouchListener(eu.davidea.common.SimpleOnTouchListener) NonNull(androidx.annotation.NonNull)

Example 12 with BottomSheetDialog

use of com.google.android.material.bottomsheet.BottomSheetDialog in project FlexibleAdapter by davideas.

the class BottomSheetDecorationDialog method onCreateDialog.

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mBottomSheetDialog = new BottomSheetDialog(getActivity(), R.style.AppTheme_BottomSheetDialog);
    mBottomSheetDialog.setContentView(getArguments().getInt(ARG_LAYOUT));
    setListener();
    configureEdges();
    configureDividers();
    return mBottomSheetDialog;
}
Also used : BottomSheetDialog(com.google.android.material.bottomsheet.BottomSheetDialog) NonNull(androidx.annotation.NonNull)

Example 13 with BottomSheetDialog

use of com.google.android.material.bottomsheet.BottomSheetDialog in project Signal-Android by WhisperSystems.

the class ConfirmPaymentFragment method onCreateDialog.

@Override
@NonNull
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
    BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
    dialog.getBehavior().setHideable(false);
    return dialog;
}
Also used : BottomSheetDialog(com.google.android.material.bottomsheet.BottomSheetDialog) NonNull(androidx.annotation.NonNull)

Example 14 with BottomSheetDialog

use of com.google.android.material.bottomsheet.BottomSheetDialog in project simperium-android by Simperium.

the class LoginBottomSheetDialogFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View layout = inflater.inflate(R.layout.sheet_login, null);
    AppCompatButton buttonEmail = layout.findViewById(R.id.button_email);
    buttonEmail.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mLoginSheetListener.onLoginSheetEmailClicked();
        }
    });
    AppCompatButton buttonOther = layout.findViewById(R.id.button_other);
    buttonOther.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mLoginSheetListener.onLoginSheetOtherClicked();
        }
    });
    if (getDialog() != null) {
        getDialog().setContentView(layout);
        // Set peek height to full height of view (i.e. set STATE_EXPANDED) to avoid buttons
        // being off screen when bottom sheet is shown.
        getDialog().setOnShowListener(new DialogInterface.OnShowListener() {

            @Override
            public void onShow(DialogInterface dialogInterface) {
                BottomSheetDialog bottomSheetDialog = (BottomSheetDialog) dialogInterface;
                FrameLayout bottomSheet = bottomSheetDialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
                if (bottomSheet != null) {
                    BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);
                    behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
                    behavior.setSkipCollapsed(true);
                }
            }
        });
    }
    return super.onCreateView(inflater, container, savedInstanceState);
}
Also used : BottomSheetDialog(com.google.android.material.bottomsheet.BottomSheetDialog) BottomSheetBehavior(com.google.android.material.bottomsheet.BottomSheetBehavior) DialogInterface(android.content.DialogInterface) FrameLayout(android.widget.FrameLayout) View(android.view.View) AppCompatButton(androidx.appcompat.widget.AppCompatButton) Nullable(androidx.annotation.Nullable)

Example 15 with BottomSheetDialog

use of com.google.android.material.bottomsheet.BottomSheetDialog in project SmoothRefreshLayout by dkzwm.

the class TestBottomSheetDialogActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_bottom_sheet_dialog);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setTitle(R.string.test_bottom_sheet_dialog);
    findViewById(R.id.button_test_bottom_sheet_dialog_open).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mSheetDialog == null) {
                mSheetDialog = new BottomSheetDialog(v.getContext());
                mSheetDialog.setContentView(mRootView);
                FrameLayout bottomSheet = mSheetDialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
                if (bottomSheet != null) {
                    ViewGroup.LayoutParams layoutParams = bottomSheet.getLayoutParams();
                    layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
                    bottomSheet.setLayoutParams(layoutParams);
                }
            }
            mSheetDialog.show();
        }
    });
    mRootView = getLayoutInflater().inflate(R.layout.layout_bottom_sheet, null);
    RecyclerView recyclerView = mRootView.findViewById(R.id.recyclerView_test_bottom_sheet_dialog);
    recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
    recyclerView.setHasFixedSize(true);
    mAdapter = new RecyclerViewAdapter(this, getLayoutInflater());
    List<String> list = DataUtil.createList(mCount, 60);
    mCount = list.size();
    mAdapter.updateData(list);
    recyclerView.setAdapter(mAdapter);
    mRefreshLayout = mRootView.findViewById(R.id.smoothRefreshLayout_test_bottom_sheet_dialog);
    mRefreshLayout.setDisableRefresh(true);
    mRefreshLayout.setDisableLoadMore(false);
    mRefreshLayout.setEnableAutoLoadMore(true);
    mRefreshLayout.setOnRefreshListener(new RefreshingListenerAdapter() {

        @Override
        public void onLoadingMore() {
            mHandler.postDelayed(new Runnable() {

                @Override
                public void run() {
                    List<String> list = DataUtil.createList(mCount, 15);
                    mCount += list.size();
                    mAdapter.appendData(list);
                    mRefreshLayout.refreshComplete();
                }
            }, 2000);
        }
    });
    mRefreshLayout.setDisableLoadMoreWhenContentNotFull(true);
    mRefreshLayout.autoRefresh(false);
}
Also used : RefreshingListenerAdapter(me.dkzwm.widget.srl.RefreshingListenerAdapter) RecyclerViewAdapter(me.dkzwm.widget.srl.sample.adapter.RecyclerViewAdapter) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) BottomSheetDialog(com.google.android.material.bottomsheet.BottomSheetDialog) GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) FrameLayout(android.widget.FrameLayout) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Aggregations

BottomSheetDialog (com.google.android.material.bottomsheet.BottomSheetDialog)25 View (android.view.View)20 TextView (android.widget.TextView)13 SuppressLint (android.annotation.SuppressLint)12 BindView (butterknife.BindView)12 NonNull (androidx.annotation.NonNull)8 RecyclerView (androidx.recyclerview.widget.RecyclerView)7 BottomSheetBehavior (com.google.android.material.bottomsheet.BottomSheetBehavior)4 ProgramLogoView (vision.genesis.clientapp.ui.ProgramLogoView)4 Window (android.view.Window)3 FrameLayout (android.widget.FrameLayout)3 ListView (android.widget.ListView)3 SearchView (androidx.appcompat.widget.SearchView)3 DialogInterface (android.content.DialogInterface)2 AdapterView (android.widget.AdapterView)2 Nullable (androidx.annotation.Nullable)2 DefaultItemAnimator (androidx.recyclerview.widget.DefaultItemAnimator)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 MaterialShapeDrawable (com.google.android.material.shape.MaterialShapeDrawable)2 SortDialogAdapter (org.odk.collect.android.adapters.SortDialogAdapter)2