Search in sources :

Example 36 with FloatingActionButton

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));
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) SearchPresenterImpl(com.codekk.search.presenter.SearchPresenterImpl)

Example 37 with FloatingActionButton

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();
        }
    });
}
Also used : SuperToast(com.github.johnpersano.supertoasts.library.SuperToast) FloatingActionButton(android.support.design.widget.FloatingActionButton) View(android.view.View)

Example 38 with FloatingActionButton

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);
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) Style(com.github.johnpersano.supertoasts.library.Style) View(android.view.View)

Example 39 with FloatingActionButton

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;
        }
    }
}
Also used : ShapeDrawable(android.graphics.drawable.ShapeDrawable) FloatingActionButton(android.support.design.widget.FloatingActionButton) ImageView(android.widget.ImageView) OvalShape(android.graphics.drawable.shapes.OvalShape)

Example 40 with FloatingActionButton

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();
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton)

Aggregations

FloatingActionButton (android.support.design.widget.FloatingActionButton)79 View (android.view.View)56 Toolbar (android.support.v7.widget.Toolbar)29 TextView (android.widget.TextView)18 ImageView (android.widget.ImageView)15 Intent (android.content.Intent)12 RecyclerView (android.support.v7.widget.RecyclerView)11 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)9 ColorStateList (android.content.res.ColorStateList)8 Bundle (android.os.Bundle)8 NavigationView (android.support.design.widget.NavigationView)8 TabLayout (android.support.design.widget.TabLayout)8 ViewPager (android.support.v4.view.ViewPager)8 ActionBar (android.support.v7.app.ActionBar)7 UiController (android.support.test.espresso.UiController)6 ViewAction (android.support.test.espresso.ViewAction)6 AdapterView (android.widget.AdapterView)6 DrawerLayout (android.support.v4.widget.DrawerLayout)4 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)4 MenuItem (android.view.MenuItem)4