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;
}
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;
}
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;
}
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);
}
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);
}
Aggregations