Search in sources :

Example 26 with FloatingActionButton

use of com.google.android.material.floatingactionbutton.FloatingActionButton in project Slide by ccrama.

the class SettingsSubreddit method reloadSubList.

public void reloadSubList() {
    changedSubs.clear();
    List<String> allSubs = UserSubscriptions.sort(UserSubscriptions.getAllUserSubreddits(this));
    // Check which subreddits are different
    ColorPreferences colorPrefs = new ColorPreferences(SettingsSubreddit.this);
    int defaultFont = colorPrefs.getFontStyle().getColor();
    for (String s : allSubs) {
        if (Palette.getColor(s) != Palette.getDefaultColor() || SettingValues.prefs.contains(Reddit.PREF_LAYOUT + s) || colorPrefs.getFontStyleSubreddit(s).getColor() != defaultFont || SettingValues.prefs.contains("picsenabled" + s.toLowerCase(Locale.ENGLISH))) {
            changedSubs.add(s);
        }
    }
    mSettingsSubAdapter = new SettingsSubAdapter(this, changedSubs);
    recycler.setAdapter(mSettingsSubAdapter);
    final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.post_floating_action_button);
    recycler.addOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            if (dy <= 0 && fab.getId() != 0) {
                fab.show();
            } else {
                fab.hide();
            }
        }

        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            super.onScrollStateChanged(recyclerView, newState);
        }
    });
    fab.show();
}
Also used : ColorPreferences(me.ccrama.redditslide.Visuals.ColorPreferences) FloatingActionButton(com.google.android.material.floatingactionbutton.FloatingActionButton) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 27 with FloatingActionButton

use of com.google.android.material.floatingactionbutton.FloatingActionButton in project mapbox-plugins-android by mapbox.

the class RegionSelectionFragment method bindClickListeners.

private void bindClickListeners() {
    FloatingActionButton button = rootView.findViewById(R.id.mapbox_offline_select_region_button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (getSelectedCallback() != null) {
                getSelectedCallback().onSelected(createRegion(), regionName);
            }
        }
    });
}
Also used : FloatingActionButton(com.google.android.material.floatingactionbutton.FloatingActionButton) MapView(com.mapbox.mapboxsdk.maps.MapView) View(android.view.View) TextView(android.widget.TextView)

Example 28 with FloatingActionButton

use of com.google.android.material.floatingactionbutton.FloatingActionButton in project mapbox-plugins-android by mapbox.

the class PlacePickerActivity method addPlaceSelectedButton.

private void addPlaceSelectedButton() {
    FloatingActionButton placeSelectedButton = findViewById(R.id.place_chosen_button);
    placeSelectedButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (carmenFeature == null && includeReverseGeocode) {
                Snackbar.make(bottomSheet, getString(R.string.mapbox_plugins_place_picker_not_valid_selection), LENGTH_LONG).show();
                return;
            }
            placeSelected();
        }
    });
}
Also used : FloatingActionButton(com.google.android.material.floatingactionbutton.FloatingActionButton) ImageView(android.widget.ImageView) MapView(com.mapbox.mapboxsdk.maps.MapView) View(android.view.View)

Example 29 with FloatingActionButton

use of com.google.android.material.floatingactionbutton.FloatingActionButton in project BaseProject by fly803.

the class FileImageActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_file_image);
    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) {
            // ScreenShotUtils.getViewBitmapPath(FileImageActivity.this,view);
            ScreenShotUtils.getViewBitmapPath(FileImageActivity.this, view, "BaseProject", "ScreenShot.png");
            Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
        }
    });
}
Also used : FloatingActionButton(com.google.android.material.floatingactionbutton.FloatingActionButton) View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

FloatingActionButton (com.google.android.material.floatingactionbutton.FloatingActionButton)29 View (android.view.View)19 RecyclerView (androidx.recyclerview.widget.RecyclerView)8 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)7 TextView (android.widget.TextView)6 Toolbar (androidx.appcompat.widget.Toolbar)6 Bundle (android.os.Bundle)5 ImageView (android.widget.ImageView)5 Intent (android.content.Intent)4 AdapterView (android.widget.AdapterView)4 ListView (android.widget.ListView)4 ArrayList (java.util.ArrayList)4 MainActivity (app.insti.activity.MainActivity)3 CardInterface (app.insti.interfaces.CardInterface)3 DialogInterface (android.content.DialogInterface)2 SharedPreferences (android.content.SharedPreferences)2 Point (android.graphics.Point)2 Uri (android.net.Uri)2 TextPaint (android.text.TextPaint)2 GenericAdapter (app.insti.adapter.GenericAdapter)2