Search in sources :

Example 1 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 2 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 3 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project HotFix by dodola.

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);
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
        }
    });
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Example 4 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project NewPipe by TeamNewPipe.

the class VideoItemDetailFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    Activity a = getActivity();
    infoItemBuilder = new InfoItemBuilder(a, a.findViewById(android.R.id.content));
    if (android.os.Build.VERSION.SDK_INT < 18) {
        playVideoButton = (FloatingActionButton) a.findViewById(R.id.play_video_button);
    }
    thumbnailWindowLayout = a.findViewById(R.id.detail_stream_thumbnail_window_layout);
    Button backgroundButton = (Button) a.findViewById(R.id.detail_stream_thumbnail_window_background_button);
    // Otherwise the applications would crash.
    if (backgroundButton != null) {
        streamingServiceId = getArguments().getInt(NavStack.SERVICE_ID);
        String videoUrl = getArguments().getString(NavStack.URL);
        StreamInfoWorker siw = StreamInfoWorker.getInstance();
        siw.search(streamingServiceId, videoUrl, getActivity());
        autoPlayEnabled = getArguments().getBoolean(AUTO_PLAY);
        if (Build.VERSION.SDK_INT >= 18) {
            ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
            thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {

                // This is used to synchronize the thumbnailWindowButton and the playVideoButton
                // inside the ScrollView with the actual size of the thumbnail.
                //todo: onLayoutChage sometimes not triggered
                // background buttons area seem to overlap the thumbnail view
                // So although you just clicked slightly beneath the thumbnail the action still
                // gets triggered.
                @Override
                public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
                    RelativeLayout.LayoutParams newWindowLayoutParams = (RelativeLayout.LayoutParams) thumbnailWindowLayout.getLayoutParams();
                    newWindowLayoutParams.height = bottom - top;
                    thumbnailWindowLayout.setLayoutParams(newWindowLayoutParams);
                    //noinspection SuspiciousNameCombination
                    initialThumbnailPos.set(top, left);
                }
            });
        }
    }
}
Also used : Button(android.widget.Button) FloatingActionButton(android.support.design.widget.FloatingActionButton) RelativeLayout(android.widget.RelativeLayout) ReCaptchaActivity(org.schabi.newpipe.ReCaptchaActivity) ExoPlayerActivity(org.schabi.newpipe.player.ExoPlayerActivity) AppCompatActivity(android.support.v7.app.AppCompatActivity) PlayVideoActivity(org.schabi.newpipe.player.PlayVideoActivity) ErrorActivity(org.schabi.newpipe.report.ErrorActivity) Activity(android.app.Activity) InfoItemBuilder(org.schabi.newpipe.info_list.InfoItemBuilder) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) Point(android.graphics.Point)

Example 5 with FloatingActionButton

use of android.support.design.widget.FloatingActionButton in project actor-platform by actorapp.

the class ComposeFabFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View res = inflater.inflate(R.layout.fragment_fab, container, false);
    FloatingActionButton fabRoot = (FloatingActionButton) res.findViewById(R.id.fab);
    fabRoot.setImageResource(R.drawable.ic_edit_white_24dp);
    fabRoot.setBackgroundTintList(new ColorStateList(new int[][] { new int[] { android.R.attr.state_pressed }, StateSet.WILD_CARD }, new int[] { ActorSDK.sharedActor().style.getFabPressedColor(), ActorSDK.sharedActor().style.getFabColor() }));
    fabRoot.setRippleColor(ActorSDK.sharedActor().style.getFabPressedColor());
    fabRoot.setOnClickListener(v -> startActivity(new Intent(getActivity(), ComposeActivity.class)));
    return res;
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) ColorStateList(android.content.res.ColorStateList) Intent(android.content.Intent) View(android.view.View) Nullable(android.support.annotation.Nullable)

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