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();
}
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);
}
}
});
}
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();
}
});
}
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();
}
});
}
Aggregations