use of jp.wasabeef.recyclerview.animators.LandingAnimator in project LeafPic by HoraApps.
the class AlbumsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_albums, container, false);
ButterKnife.bind(this, v);
int spanCount = columnsCount();
spacingDecoration = new GridSpacingItemDecoration(spanCount, Measure.pxToDp(3, getContext()), true);
rv.setHasFixedSize(true);
rv.addItemDecoration(spacingDecoration);
rv.setLayoutManager(new GridLayoutManager(getContext(), spanCount));
if (Prefs.animationsEnabled()) {
rv.setItemAnimator(AnimationUtils.getItemAnimator(new LandingAnimator(new OvershootInterpolator(1f))));
}
adapter = new AlbumsAdapter(getContext(), this);
refresh.setOnRefreshListener(this::displayAlbums);
rv.setAdapter(adapter);
return v;
}
use of jp.wasabeef.recyclerview.animators.LandingAnimator in project LeafPic by HoraApps.
the class RvMediaFragment method onCreateView.
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_rv_media, container, false);
ButterKnife.bind(this, v);
int spanCount = columnsCount();
spacingDecoration = new GridSpacingItemDecoration(spanCount, Measure.pxToDp(3, getContext()), true);
rv.setHasFixedSize(true);
rv.addItemDecoration(spacingDecoration);
rv.setLayoutManager(new GridLayoutManager(getContext(), spanCount));
rv.setItemAnimator(AnimationUtils.getItemAnimator(new LandingAnimator(new OvershootInterpolator(1f))));
adapter = new MediaAdapter(getContext(), album.settings.getSortingMode(), album.settings.getSortingOrder(), this);
refresh.setOnRefreshListener(this::reload);
rv.setAdapter(adapter);
return v;
}
use of jp.wasabeef.recyclerview.animators.LandingAnimator in project LeafPic by HoraApps.
the class AlertDialogsHelper method getProgressDialogWithErrors.
public static AlertDialog getProgressDialogWithErrors(ThemedActivity activity, @StringRes int title, ProgressAdapter adapter, int max) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity, activity.getDialogStyle());
View dialogLayout = activity.getLayoutInflater().inflate(R.layout.dialog_list_progress, null);
final int[] progress = { 0 };
TextView dialogTitle = dialogLayout.findViewById(R.id.text_dialog_title);
TextView progressMessage = dialogLayout.findViewById(R.id.name_folder);
((ProgressBar) dialogLayout.findViewById(org.horaapps.leafpic.R.id.progress_dialog_loading)).getIndeterminateDrawable().setColorFilter(activity.getPrimaryColor(), android.graphics.PorterDuff.Mode.SRC_ATOP);
adapter.setListener(item -> {
progress[0]++;
dialogTitle.setText(activity.getString(title, progress[0], max));
progressMessage.setText(item.getName());
});
RecyclerView rv = dialogLayout.findViewById(R.id.rv_progress);
rv.setLayoutManager(new LinearLayoutManager(activity));
rv.setHasFixedSize(true);
rv.setItemAnimator(AnimationUtils.getItemAnimator(new LandingAnimator(new OvershootInterpolator(1f))));
rv.setAdapter(adapter);
((CardView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.message_card)).setCardBackgroundColor(activity.getCardBackgroundColor());
dialogTitle.setBackgroundColor(activity.getPrimaryColor());
dialogTitle.setText(activity.getString(title, progress[0], max));
builder.setView(dialogLayout);
return builder.create();
}
use of jp.wasabeef.recyclerview.animators.LandingAnimator in project LeafPic by HoraApps.
the class BlackWhiteListActivity method initUi.
private void initUi() {
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setAdapter((adapter = new ItemsAdapter()));
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 1));
mRecyclerView.setItemAnimator(AnimationUtils.getItemAnimator(new LandingAnimator(new OvershootInterpolator(1f))));
}
Aggregations