How to Create BottomApp Bar in Sketchware
//OnCreate
bap = new com.google.android.material.bottomappbar.BottomAppBar(this);
bap.getContext().setTheme(R.style.AppTheme_AppBarOverlay | R.style.AppTheme_PopupOverlay);
bap.setBackgroundTint(getColorStateList(R.color.colorPrimary));
bap.setFabAlignmentMode(com.google.android.material.bottomappbar.BottomAppBar.FAB_ALIGNMENT_MODE_END);
bap.setElevation(16);
androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams lp = new androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams(androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams.FILL_PARENT, 130);
lp.gravity = Gravity.BOTTOM;
bap.setLayoutParams(lp);
bap.setId(View.generateViewId());
((ViewGroup)_fab.getParent()).addView(bap);
((androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams)_fab.getLayoutParams()).setAnchorId(bap.getId());
bap.setFabCradleMargin(15);
}
private com.google.android.material.bottomappbar.BottomAppBar bap;
private void doNothing() {
//CheckBox onclick
bap.setFabAlignmentMode(com.google.android.material.bottomappbar.BottomAppBar.FAB_ALIGNMENT_MODE_CENTER);
Comments
Post a Comment