I hereby claim:
- I am rezaiyan on github.
- I am rezaiyan (https://keybase.io/rezaiyan) on keybase.
- I have a public key ASCIL3cT6Mr4wkhTVwCcwM3APTtPGesOSSBd3sMDra_Znwo
To claim this, I am signing this object:
private void addTab(TextView tv) { | |
View v = tab.getCustomView(); | |
if (v instanceof TextView) { | |
tv.setScaleX(0f); | |
tv.setScaleY(0f); | |
tv.animate() | |
.scaleX(1f) | |
.scaleY(1f) | |
.setInterpolator(new FastOutSlowInInterpolator()) | |
.setDuration(450) |
package com.daimajia.slider.library; | |
import android.support.v7.widget.RecyclerView; | |
/** | |
* Created by Rezaiyan on 9/18/2017. | |
*/ | |
public abstract class HidingScrollListener extends RecyclerView.OnScrollListener { | |
private static final int HIDE_THRESHOLD = 20; |
public class CustomToast { | |
public static void showToast(Context context,String message) { | |
Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT); | |
toast.setGravity(Gravity.BOTTOM, toast.getXOffset() / 3, toast.getYOffset() / 3); | |
TextView textView = new TextView(context); | |
textView.setBackgroundColor(Color.DKGRAY); | |
textView.setTextColor(Color.WHITE); | |
textView.setTypeface(FontManager.Iransens(context)); |
//Start View | |
Intent intent = new Intent(context, SearchActivity.class); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
ActivityOptions options = ActivityOptions. | |
makeSceneTransitionAnimation(getActivity(), v, "transition"); | |
startActivity(intent, options.toBundle()); | |
}else | |
startActivity(intent); | |
//End View |
//Old endless recyclerview methodology | |
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
super.onScrolled(recyclerView, dx, dy); | |
visibleItemCount = recyclerView.getChildCount(); | |
totalItemCount = gridLayoutManager.getItemCount(); | |
firstVisibleItem = gridLayoutManager.findFirstVisibleItemPosition(); | |
if (loading) { |
Glide.with(context).load(Api.getPosterPath(holder.movie.getPosterPath())) | |
.asBitmap() | |
.diskCacheStrategy(DiskCacheStrategy.RESULT) | |
.into(new BitmapImageViewTarget(holder.poster) | |
{ | |
@Override | |
public void onResourceReady(Bitmap bitmap, GlideAnimation anim) | |
{ | |
super.onResourceReady(bitmap, anim); |
private int lastPosition = 0; | |
private void setAnimation(View viewToAnimate, int position) { | |
if (position > lastPosition) { | |
Animation animation = AnimationUtils.loadAnimation(context, R.anim.fadei_list); | |
viewToAnimate.startAnimation(animation); | |
lastPosition = position; | |
} | |
} |
public abstract class AlertBuilder { | |
public abstract void ok(); | |
public AlertDialog.Builder create(Context context, String message) { | |
final AlertDialog.Builder builder; | |
builder = new AlertDialog.Builder(context); | |
builder.setMessage(message) | |
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { |
I hereby claim:
To claim this, I am signing this object: