GboardOnboardingUtils.java 3.65 KB
package com.bitstrips.imoji.onboarding.gboard;

import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.OvershootInterpolator;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import java.util.Iterator;
import java.util.List;

public class GboardOnboardingUtils
{
  public static final String GBOARD_PACKAGE_NAME = "com.google.android.inputmethod.latin";
  
  public static Animator fadeInAnimator(View paramView)
  {
    paramView = ObjectAnimator.ofFloat(paramView, "alpha", new float[] { 0.0F, 1.0F });
    paramView.setInterpolator(new AccelerateDecelerateInterpolator());
    paramView.setDuration(300L);
    return paramView;
  }
  
  public static boolean hasSupportedGboardVersion(Context paramContext)
  {
    Object localObject = ((InputMethodManager)paramContext.getSystemService("input_method")).getInputMethodList();
    if (localObject != null)
    {
      localObject = ((List)localObject).iterator();
      do
      {
        if (!((Iterator)localObject).hasNext()) {
          break;
        }
      } while (!"com.google.android.inputmethod.latin".equals(((InputMethodInfo)((Iterator)localObject).next()).getPackageName()));
    }
    for (int i = 1; i == 0; i = 0) {
      return false;
    }
    paramContext = paramContext.getPackageManager();
    try
    {
      paramContext = paramContext.getPackageInfo("com.google.android.inputmethod.latin", 0);
      if (paramContext.versionCode >= 26650310) {
        return true;
      }
    }
    catch (PackageManager.NameNotFoundException paramContext)
    {
      return false;
    }
    return false;
  }
  
  public static Animator pulseAnimator(View paramView)
  {
    paramView = ObjectAnimator.ofPropertyValuesHolder(paramView, new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.0F, 1.05F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.0F, 1.05F }) });
    paramView.setRepeatCount(-1);
    paramView.setRepeatMode(2);
    paramView.setDuration(750L);
    paramView.setInterpolator(new AccelerateDecelerateInterpolator());
    return paramView;
  }
  
  public static Animator slideInAnimator(View paramView)
  {
    paramView = ObjectAnimator.ofFloat(paramView, "translationY", new float[] { paramView.getHeight(), 0.0F });
    paramView.setInterpolator(new AccelerateDecelerateInterpolator());
    paramView.setDuration(300L);
    return paramView;
  }
  
  public static Animator springInAnimator(View paramView)
  {
    ObjectAnimator localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder(paramView, new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 0.5F, 1.0F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 0.5F, 1.0F }), PropertyValuesHolder.ofFloat("rotation", new float[] { -25.0F, 0.0F }) });
    localObjectAnimator.setInterpolator(new OvershootInterpolator(2.1F));
    AnimatorSet localAnimatorSet = new AnimatorSet();
    localAnimatorSet.playTogether(new Animator[] { localObjectAnimator, fadeInAnimator(paramView) });
    localAnimatorSet.setDuration(300L);
    return localAnimatorSet;
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/onboarding/gboard/GboardOnboardingUtils.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */