use of com.devpaul.materiallibrary.behaviors.MaterialFabDefaultBehavior in project MaterialLibrary by DeveloperPaul123.
the class BaseFabListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
coordinatorLayout = new CoordinatorLayout(this);
coordinatorLayout.setLayoutParams(params);
CoordinatorLayout.LayoutParams coorLayoutParams = new CoordinatorLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
coorLayoutParams.setBehavior(new MaterialFabDefaultBehavior());
coorLayoutParams.gravity = Gravity.BOTTOM | Gravity.RIGHT;
materialFloatingActionButton = new MaterialFloatingActionButton(this);
materialFloatingActionButton.setLayoutParams(coorLayoutParams);
coordinatorLayout.addView(materialFloatingActionButton);
getHomeLayout().addView(coordinatorLayout);
ScrollListener scrollListener = new ScrollListener();
scrollListener.setListView(getListView());
scrollListener.setScrollThreshold(getResources().getDimensionPixelOffset(R.dimen.material_library_scroll_threshold));
getListView().setOnScrollListener(scrollListener);
materialFloatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onActionButtonClicked();
}
});
isShowing = true;
}
use of com.devpaul.materiallibrary.behaviors.MaterialFabDefaultBehavior in project MaterialLibrary by DeveloperPaul123.
the class BaseRecyclerFabActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
coordinatorLayout = new CoordinatorLayout(this);
coordinatorLayout.setLayoutParams(params);
CoordinatorLayout.LayoutParams coorLayoutParams = new CoordinatorLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
coorLayoutParams.setBehavior(new MaterialFabDefaultBehavior());
coorLayoutParams.gravity = Gravity.BOTTOM | Gravity.RIGHT;
materialFloatingActionButton = new MaterialFloatingActionButton(this);
materialFloatingActionButton.setLayoutParams(coorLayoutParams);
coordinatorLayout.addView(materialFloatingActionButton);
getHomeLayout().addView(coordinatorLayout);
ScrollListener scrollListener = new ScrollListener();
scrollListener.setRecyclerView(getRecyclerView());
scrollListener.setScrollThreshold(getResources().getDimensionPixelOffset(R.dimen.material_library_scroll_threshold));
getRecyclerView().addOnScrollListener(scrollListener);
materialFloatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onActionButtonClicked();
}
});
isShowing = true;
}
Aggregations