Search in sources :

Example 11 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project cw-omnibus by commonsguy.

the class AsyncDemoFragment method onViewCreated.

@Override
public void onViewCreated(View v, Bundle savedInstanceState) {
    super.onViewCreated(v, savedInstanceState);
    getListView().setScrollbarFadingEnabled(false);
    setListAdapter(adapter);
    FloatingActionButton fab = (FloatingActionButton) v.findViewById(R.id.refresh);
    fab.setOnClickListener(this);
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton)

Example 12 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project cheesesquare by chrisbanes.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    final ActionBar ab = getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
        setupDrawerContent(navigationView);
    }
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    if (viewPager != null) {
        setupViewPager(viewPager);
    }
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Here's a Snackbar", Snackbar.LENGTH_LONG).setAction("Action", null).show();
        }
    });
    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);
}
Also used : NavigationView(android.support.design.widget.NavigationView) TabLayout(android.support.design.widget.TabLayout) FloatingActionButton(android.support.design.widget.FloatingActionButton) ViewPager(android.support.v4.view.ViewPager) NavigationView(android.support.design.widget.NavigationView) View(android.view.View) AdapterView(android.widget.AdapterView) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Example 13 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project materialistic by hidroh.

the class AppUtilsTest method testFullscreenButton.

@Test
public void testFullscreenButton() {
    ActivityController<TestListActivity> controller = Robolectric.buildActivity(TestListActivity.class);
    TestListActivity activity = controller.create().get();
    FloatingActionButton fab = new FloatingActionButton(activity);
    AppUtils.toggleFabAction(fab, null, false);
    fab.performClick();
    assertThat(shadowOf(LocalBroadcastManager.getInstance(activity)).getSentBroadcastIntents()).isNotEmpty();
    controller.destroy();
}
Also used : TestListActivity(io.github.hidroh.materialistic.test.TestListActivity) FloatingActionButton(android.support.design.widget.FloatingActionButton) Test(org.junit.Test)

Example 14 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project animate by hitherejoe.

the class ForegroundFrame method addContentView.

private void addContentView(FrameLayout container) {
    inflate(getContext(), R.layout.layout_frame, this);
    FloatingActionButton floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_quiz);
    floatingActionButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            ViewPropertyAnimatorCompat animatorCompat = buildAnimation(v);
            animatorCompat.setListener(new ViewPropertyAnimatorListener() {

                @Override
                public void onAnimationStart(View view) {
                }

                @Override
                public void onAnimationEnd(View view) {
                    doStuff();
                }

                @Override
                public void onAnimationCancel(View view) {
                }
            });
        }
    });
}
Also used : ViewPropertyAnimatorListener(android.support.v4.view.ViewPropertyAnimatorListener) FloatingActionButton(android.support.design.widget.FloatingActionButton) ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) View(android.view.View)

Example 15 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project MaterialDrawer by mikepenz.

the class CollapsingToolbarActivity method fillFab.

private void fillFab() {
    final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.floating_action_button);
    fab.setImageDrawable(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_favorite).actionBar().color(Color.WHITE));
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) IconicsDrawable(com.mikepenz.iconics.IconicsDrawable)

Aggregations

FloatingActionButton (android.support.design.widget.FloatingActionButton)84 View (android.view.View)58 Toolbar (android.support.v7.widget.Toolbar)28 TextView (android.widget.TextView)20 ImageView (android.widget.ImageView)16 Intent (android.content.Intent)13 RecyclerView (android.support.v7.widget.RecyclerView)12 ColorStateList (android.content.res.ColorStateList)9 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)9 Bundle (android.os.Bundle)7 NavigationView (android.support.design.widget.NavigationView)7 TabLayout (android.support.design.widget.TabLayout)7 ViewPager (android.support.v4.view.ViewPager)7 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 ListView (android.widget.ListView)5 DrawerLayout (android.support.v4.widget.DrawerLayout)4 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)4