SearchViewCompat.java 9.67 KB
package android.support.v4.widget;

import android.app.SearchManager;
import android.content.ComponentName;
import android.content.Context;
import android.os.Build.VERSION;
import android.view.View;
import android.widget.SearchView;
import android.widget.SearchView.OnCloseListener;
import android.widget.SearchView.OnQueryTextListener;
import fa.1;
import fa.2;
import fa.a;
import fa.b;

public final class SearchViewCompat
{
  private static final c a = new d();
  
  static
  {
    if (Build.VERSION.SDK_INT >= 14)
    {
      a = new b();
      return;
    }
    if (Build.VERSION.SDK_INT >= 11)
    {
      a = new a();
      return;
    }
  }
  
  public static CharSequence getQuery(View paramView)
  {
    return a.a(paramView);
  }
  
  public static boolean isIconified(View paramView)
  {
    return a.b(paramView);
  }
  
  public static boolean isQueryRefinementEnabled(View paramView)
  {
    return a.d(paramView);
  }
  
  public static boolean isSubmitButtonEnabled(View paramView)
  {
    return a.c(paramView);
  }
  
  public static View newSearchView(Context paramContext)
  {
    return a.a(paramContext);
  }
  
  public static void setIconified(View paramView, boolean paramBoolean)
  {
    a.a(paramView, paramBoolean);
  }
  
  public static void setImeOptions(View paramView, int paramInt)
  {
    a.b(paramView, paramInt);
  }
  
  public static void setInputType(View paramView, int paramInt)
  {
    a.c(paramView, paramInt);
  }
  
  public static void setMaxWidth(View paramView, int paramInt)
  {
    a.a(paramView, paramInt);
  }
  
  public static void setOnCloseListener(View paramView, OnCloseListener paramOnCloseListener)
  {
    a.a(paramView, paramOnCloseListener);
  }
  
  public static void setOnQueryTextListener(View paramView, OnQueryTextListener paramOnQueryTextListener)
  {
    a.a(paramView, paramOnQueryTextListener);
  }
  
  public static void setQuery(View paramView, CharSequence paramCharSequence, boolean paramBoolean)
  {
    a.a(paramView, paramCharSequence, paramBoolean);
  }
  
  public static void setQueryHint(View paramView, CharSequence paramCharSequence)
  {
    a.a(paramView, paramCharSequence);
  }
  
  public static void setQueryRefinementEnabled(View paramView, boolean paramBoolean)
  {
    a.c(paramView, paramBoolean);
  }
  
  public static void setSearchableInfo(View paramView, ComponentName paramComponentName)
  {
    a.a(paramView, paramComponentName);
  }
  
  public static void setSubmitButtonEnabled(View paramView, boolean paramBoolean)
  {
    a.b(paramView, paramBoolean);
  }
  
  public static abstract interface OnCloseListener
  {
    public abstract boolean onClose();
  }
  
  @Deprecated
  public static abstract class OnCloseListenerCompat
    implements SearchViewCompat.OnCloseListener
  {
    public boolean onClose()
    {
      return false;
    }
  }
  
  public static abstract interface OnQueryTextListener
  {
    public abstract boolean onQueryTextChange(String paramString);
    
    public abstract boolean onQueryTextSubmit(String paramString);
  }
  
  @Deprecated
  public static abstract class OnQueryTextListenerCompat
    implements SearchViewCompat.OnQueryTextListener
  {
    public boolean onQueryTextChange(String paramString)
    {
      return false;
    }
    
    public boolean onQueryTextSubmit(String paramString)
    {
      return false;
    }
  }
  
  static class a
    extends SearchViewCompat.d
  {
    protected static void e(View paramView)
    {
      if (paramView == null) {
        throw new IllegalArgumentException("searchView must be non-null");
      }
      if (!(paramView instanceof SearchView)) {
        throw new IllegalArgumentException("searchView must be an instance ofandroid.widget.SearchView");
      }
    }
    
    public View a(Context paramContext)
    {
      return new SearchView(paramContext);
    }
    
    public final CharSequence a(View paramView)
    {
      e(paramView);
      return ((SearchView)paramView).getQuery();
    }
    
    public final void a(View paramView, int paramInt)
    {
      e(paramView);
      ((SearchView)paramView).setMaxWidth(paramInt);
    }
    
    public final void a(View paramView, ComponentName paramComponentName)
    {
      e(paramView);
      paramView = (SearchView)paramView;
      paramView.setSearchableInfo(((SearchManager)paramView.getContext().getSystemService("search")).getSearchableInfo(paramComponentName));
    }
    
    public final void a(View paramView, final SearchViewCompat.OnCloseListener paramOnCloseListener)
    {
      e(paramView);
      paramOnCloseListener = new fa.2(new fa.a()
      {
        public final boolean a()
        {
          return paramOnCloseListener.onClose();
        }
      });
      ((SearchView)paramView).setOnCloseListener((SearchView.OnCloseListener)paramOnCloseListener);
    }
    
    public final void a(View paramView, final SearchViewCompat.OnQueryTextListener paramOnQueryTextListener)
    {
      e(paramView);
      paramOnQueryTextListener = new fa.1(new fa.b()
      {
        public final boolean a(String paramAnonymousString)
        {
          return paramOnQueryTextListener.onQueryTextSubmit(paramAnonymousString);
        }
        
        public final boolean b(String paramAnonymousString)
        {
          return paramOnQueryTextListener.onQueryTextChange(paramAnonymousString);
        }
      });
      ((SearchView)paramView).setOnQueryTextListener((SearchView.OnQueryTextListener)paramOnQueryTextListener);
    }
    
    public final void a(View paramView, CharSequence paramCharSequence)
    {
      e(paramView);
      ((SearchView)paramView).setQueryHint(paramCharSequence);
    }
    
    public final void a(View paramView, CharSequence paramCharSequence, boolean paramBoolean)
    {
      e(paramView);
      ((SearchView)paramView).setQuery(paramCharSequence, paramBoolean);
    }
    
    public final void a(View paramView, boolean paramBoolean)
    {
      e(paramView);
      ((SearchView)paramView).setIconified(paramBoolean);
    }
    
    public final void b(View paramView, boolean paramBoolean)
    {
      e(paramView);
      ((SearchView)paramView).setSubmitButtonEnabled(paramBoolean);
    }
    
    public final boolean b(View paramView)
    {
      e(paramView);
      return ((SearchView)paramView).isIconified();
    }
    
    public final void c(View paramView, boolean paramBoolean)
    {
      e(paramView);
      ((SearchView)paramView).setQueryRefinementEnabled(paramBoolean);
    }
    
    public final boolean c(View paramView)
    {
      e(paramView);
      return ((SearchView)paramView).isSubmitButtonEnabled();
    }
    
    public final boolean d(View paramView)
    {
      e(paramView);
      return ((SearchView)paramView).isQueryRefinementEnabled();
    }
  }
  
  static final class b
    extends SearchViewCompat.a
  {
    public final View a(Context paramContext)
    {
      return new SearchViewCompatIcs.MySearchView(paramContext);
    }
    
    public final void b(View paramView, int paramInt)
    {
      e(paramView);
      ((SearchView)paramView).setImeOptions(paramInt);
    }
    
    public final void c(View paramView, int paramInt)
    {
      e(paramView);
      ((SearchView)paramView).setInputType(paramInt);
    }
  }
  
  static abstract interface c
  {
    public abstract View a(Context paramContext);
    
    public abstract CharSequence a(View paramView);
    
    public abstract void a(View paramView, int paramInt);
    
    public abstract void a(View paramView, ComponentName paramComponentName);
    
    public abstract void a(View paramView, SearchViewCompat.OnCloseListener paramOnCloseListener);
    
    public abstract void a(View paramView, SearchViewCompat.OnQueryTextListener paramOnQueryTextListener);
    
    public abstract void a(View paramView, CharSequence paramCharSequence);
    
    public abstract void a(View paramView, CharSequence paramCharSequence, boolean paramBoolean);
    
    public abstract void a(View paramView, boolean paramBoolean);
    
    public abstract void b(View paramView, int paramInt);
    
    public abstract void b(View paramView, boolean paramBoolean);
    
    public abstract boolean b(View paramView);
    
    public abstract void c(View paramView, int paramInt);
    
    public abstract void c(View paramView, boolean paramBoolean);
    
    public abstract boolean c(View paramView);
    
    public abstract boolean d(View paramView);
  }
  
  static class d
    implements SearchViewCompat.c
  {
    public View a(Context paramContext)
    {
      return null;
    }
    
    public CharSequence a(View paramView)
    {
      return null;
    }
    
    public void a(View paramView, int paramInt) {}
    
    public void a(View paramView, ComponentName paramComponentName) {}
    
    public void a(View paramView, SearchViewCompat.OnCloseListener paramOnCloseListener) {}
    
    public void a(View paramView, SearchViewCompat.OnQueryTextListener paramOnQueryTextListener) {}
    
    public void a(View paramView, CharSequence paramCharSequence) {}
    
    public void a(View paramView, CharSequence paramCharSequence, boolean paramBoolean) {}
    
    public void a(View paramView, boolean paramBoolean) {}
    
    public void b(View paramView, int paramInt) {}
    
    public void b(View paramView, boolean paramBoolean) {}
    
    public boolean b(View paramView)
    {
      return true;
    }
    
    public void c(View paramView, int paramInt) {}
    
    public void c(View paramView, boolean paramBoolean) {}
    
    public boolean c(View paramView)
    {
      return false;
    }
    
    public boolean d(View paramView)
    {
      return false;
    }
  }
}


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