Exemplo n.º 1
0
 public void error() {
   if (!mInflated) {
     mToastCanceled = true;
     return;
   }
   mView.error();
   slideUp();
 }
Exemplo n.º 2
0
 public void success() {
   if (!mInflated) {
     mToastCanceled = true;
     return;
   }
   mView.success();
   slideUp();
 }
Exemplo n.º 3
0
 private void slideUp() {
   ViewPropertyAnimator.animate(mView)
       .setStartDelay(1000)
       .alpha(0f)
       .translationY(-mView.getHeight() + mTranslationY)
       .setInterpolator(new AccelerateInterpolator())
       .setDuration(300)
       .start();
 }
Exemplo n.º 4
0
 public LoadToast show() {
   if (!mInflated) {
     mShowCalled = true;
     return this;
   }
   mView.show();
   ViewHelper.setTranslationX(mView, (mParentView.getWidth() - mView.getWidth()) / 2);
   ViewHelper.setAlpha(mView, 0f);
   ViewHelper.setTranslationY(mView, -mView.getHeight() + mTranslationY);
   // mView.setVisibility(View.VISIBLE);
   ViewPropertyAnimator.animate(mView)
       .alpha(1f)
       .translationY(25 + mTranslationY)
       .setInterpolator(new DecelerateInterpolator())
       .setDuration(300)
       .setStartDelay(0)
       .start();
   return this;
 }
Exemplo n.º 5
0
 public LoadToast setProgressColor(int color) {
   mView.setProgressColor(color);
   return this;
 }
Exemplo n.º 6
0
 public LoadToast setBackgroundColor(int color) {
   mView.setBackgroundColor(color);
   return this;
 }
Exemplo n.º 7
0
 public LoadToast setTextColor(int color) {
   mView.setTextColor(color);
   return this;
 }
Exemplo n.º 8
0
 public LoadToast setText(String message) {
   mText = message;
   mView.setText(mText);
   return this;
 }