use of android.support.design.widget.FloatingActionButton in project AndroidDevelop by 7449.
the class SearchFragment method initActivityCreated.
@Override
protected void initActivityCreated() {
FloatingActionButton mFAB = (FloatingActionButton) getActivity().findViewById(R.id.fa_btn);
mFAB.setOnClickListener(this);
showExplanation();
mPresenter = new SearchPresenterImpl(this);
mAdapter = new XRecyclerViewAdapter<>();
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(Constant.RECYCLERVIEW_LISTVIEW, StaggeredGridLayoutManager.VERTICAL));
mRecyclerView.setAdapter(mAdapter.setLayoutId(R.layout.item_search).onXBind(this));
}
use of android.support.design.widget.FloatingActionButton in project SuperToasts by JohnPersano.
the class SuperToastFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final FloatingActionButton button = (FloatingActionButton) getActivity().findViewById(R.id.floating_action_button);
button.setOnClickListener(new View.OnClickListener() {
@Override
@SuppressWarnings("ResourceType")
public void onClick(View view) {
new SuperToast(getActivity()).setText("SuperToast").setDuration(AttributeUtils.getDuration(getActivity())).setFrame(AttributeUtils.getFrame(getActivity())).setColor(AttributeUtils.getColor(getActivity())).setAnimations(AttributeUtils.getAnimations(getActivity())).setColor(AttributeUtils.getColor(getActivity())).show();
}
});
}
use of android.support.design.widget.FloatingActionButton in project SuperToasts by JohnPersano.
the class SuperActivityToastFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
final FloatingActionButton button = (FloatingActionButton) getActivity().findViewById(R.id.floating_action_button);
button.setOnClickListener(new View.OnClickListener() {
@Override
@SuppressWarnings("ResourceType")
public void onClick(View view) {
final int containerId = AttributeUtils.getFrame(getActivity()) == Style.FRAME_LOLLIPOP || AttributeUtils.getType(getActivity()) == Style.TYPE_BUTTON ? R.id.toast_container : 0;
SuperActivityToast.create(getActivity(), new Style(), AttributeUtils.getType(getActivity()), containerId).setButtonText("UNDO").setButtonIconResource(R.drawable.ic_undo).setOnButtonClickListener("good_tag_name", null, onButtonClickListener).setProgressBarColor(Color.WHITE).setText("SuperActivityToast").setDuration(AttributeUtils.getDuration(getActivity())).setFrame(AttributeUtils.getFrame(getActivity())).setColor(AttributeUtils.getColor(getActivity())).setAnimations(AttributeUtils.getAnimations(getActivity())).show();
}
});
return super.onCreateView(inflater, container, savedInstanceState);
}
use of android.support.design.widget.FloatingActionButton in project teaTime by ancfdy.
the class PullHeaderLayout method setActionDrawable.
public void setActionDrawable(Drawable actionDrawable) {
mActionDrawable = actionDrawable;
if (mActionDrawable != null) {
if (mActionView == null) {
final int bgColor = Utils_Flyrefresh.getThemeColorFromAttrOrRes(getContext(), R.attr.colorAccent, R.color.accent);
final int pressedColor = Utils_Flyrefresh.darkerColor(bgColor, 0.8f);
final ShapeDrawable bgDrawable = new ShapeDrawable(new OvalShape());
bgDrawable.getPaint().setColor(bgColor);
mActionView = new FloatingActionButton(getContext());
mActionView.setRippleColor(pressedColor);
mActionView.setBackgroundDrawable(bgDrawable);
addView(mActionView, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
if (mFlyView == null) {
mFlyView = new ImageView(getContext());
mFlyView.setScaleType(ImageView.ScaleType.FIT_XY);
addView(mFlyView, new LayoutParams(ACTION_ICON_SIZE, ACTION_ICON_SIZE));
mFlyView.bringToFront();
float elevation = ViewCompat.getElevation(mActionView);
ViewCompat.setElevation(mFlyView, elevation + 1);
}
mFlyView.setImageDrawable(mActionDrawable);
} else {
if (mActionView != null) {
removeView(mActionView);
removeView(mFlyView);
mActionView = null;
mFlyView = null;
}
}
}
use of android.support.design.widget.FloatingActionButton in project react-native-navigation by wix.
the class FloatingActionButtonCoordinator method removeAllViews.
private void removeAllViews() {
parent.removeView(collapsedFab);
parent.removeView(expendedFab);
collapsedFab = null;
expendedFab = null;
for (FloatingActionButton action : actions) {
parent.removeView(action);
}
actions.clear();
}
Aggregations