gp.java 4.12 KB
import android.content.Context;
import android.os.Build.VERSION;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v4.widget.ListViewAutoScrollHelper;
import android.support.v7.appcompat.R.attr;
import android.support.v7.widget.ListViewCompat;
import android.view.MotionEvent;
import android.view.View;

public class gp
  extends ListViewCompat
{
  private boolean f;
  private boolean g;
  private boolean h;
  private ViewPropertyAnimatorCompat i;
  private ListViewAutoScrollHelper j;
  
  public gp(Context paramContext, boolean paramBoolean)
  {
    super(paramContext, null, R.attr.dropDownListViewStyle);
    this.g = paramBoolean;
    setCacheColorHint(0);
  }
  
  public boolean hasFocus()
  {
    return (this.g) || (super.hasFocus());
  }
  
  public boolean hasWindowFocus()
  {
    return (this.g) || (super.hasWindowFocus());
  }
  
  public boolean isFocused()
  {
    return (this.g) || (super.isFocused());
  }
  
  public boolean isInTouchMode()
  {
    return ((this.g) && (this.f)) || (super.isInTouchMode());
  }
  
  public boolean onForwardedEvent(MotionEvent paramMotionEvent, int paramInt)
  {
    int k = MotionEventCompat.getActionMasked(paramMotionEvent);
    label41:
    View localView1;
    switch (k)
    {
    default: 
      paramInt = 0;
    case 3: 
      for (bool = true;; bool = false)
      {
        if ((!bool) || (paramInt != 0))
        {
          this.h = false;
          setPressed(false);
          drawableStateChanged();
          localView1 = getChildAt(this.mMotionPosition - getFirstVisiblePosition());
          if (localView1 != null) {
            localView1.setPressed(false);
          }
          if (this.i != null)
          {
            this.i.cancel();
            this.i = null;
          }
        }
        if (!bool) {
          break;
        }
        if (this.j == null) {
          this.j = new ListViewAutoScrollHelper(this);
        }
        this.j.setEnabled(true);
        this.j.onTouch(this, paramMotionEvent);
        label152:
        return bool;
        paramInt = 0;
      }
    }
    for (boolean bool = false;; bool = true)
    {
      int m = paramMotionEvent.findPointerIndex(paramInt);
      if (m < 0)
      {
        paramInt = 0;
        bool = false;
        break label41;
      }
      paramInt = (int)paramMotionEvent.getX(m);
      m = (int)paramMotionEvent.getY(m);
      int n = pointToPosition(paramInt, m);
      if (n == -1)
      {
        paramInt = 1;
        break label41;
      }
      localView1 = getChildAt(n - getFirstVisiblePosition());
      float f1 = paramInt;
      float f2 = m;
      this.h = true;
      if (Build.VERSION.SDK_INT >= 21) {
        drawableHotspotChanged(f1, f2);
      }
      if (!isPressed()) {
        setPressed(true);
      }
      layoutChildren();
      if (this.mMotionPosition != -1)
      {
        View localView2 = getChildAt(this.mMotionPosition - getFirstVisiblePosition());
        if ((localView2 != null) && (localView2 != localView1) && (localView2.isPressed())) {
          localView2.setPressed(false);
        }
      }
      this.mMotionPosition = n;
      float f3 = localView1.getLeft();
      float f4 = localView1.getTop();
      if (Build.VERSION.SDK_INT >= 21) {
        localView1.drawableHotspotChanged(f1 - f3, f2 - f4);
      }
      if (!localView1.isPressed()) {
        localView1.setPressed(true);
      }
      positionSelectorLikeTouchCompat(n, localView1, f1, f2);
      setSelectorEnabled(false);
      refreshDrawableState();
      if (k != 1) {
        break;
      }
      performItemClick(localView1, n, getItemIdAtPosition(n));
      break;
      if (this.j == null) {
        break label152;
      }
      this.j.setEnabled(false);
      return bool;
    }
  }
  
  public void setListSelectionHidden(boolean paramBoolean)
  {
    this.f = paramBoolean;
  }
  
  protected boolean touchModeDrawsInPressedStateCompat()
  {
    return (this.h) || (super.touchModeDrawsInPressedStateCompat());
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/gp.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */