ThemedSpinnerAdapter.java 1.72 KB
package android.support.v7.widget;

import android.content.Context;
import android.content.res.Resources.Theme;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.widget.SpinnerAdapter;

public abstract interface ThemedSpinnerAdapter
  extends SpinnerAdapter
{
  @Nullable
  public abstract Resources.Theme getDropDownViewTheme();
  
  public abstract void setDropDownViewTheme(@Nullable Resources.Theme paramTheme);
  
  public static final class Helper
  {
    private final Context a;
    private final LayoutInflater b;
    private LayoutInflater c;
    
    public Helper(@NonNull Context paramContext)
    {
      this.a = paramContext;
      this.b = LayoutInflater.from(paramContext);
    }
    
    @NonNull
    public final LayoutInflater getDropDownViewInflater()
    {
      if (this.c != null) {
        return this.c;
      }
      return this.b;
    }
    
    @Nullable
    public final Resources.Theme getDropDownViewTheme()
    {
      if (this.c == null) {
        return null;
      }
      return this.c.getContext().getTheme();
    }
    
    public final void setDropDownViewTheme(@Nullable Resources.Theme paramTheme)
    {
      if (paramTheme == null)
      {
        this.c = null;
        return;
      }
      if (paramTheme == this.a.getTheme())
      {
        this.c = this.b;
        return;
      }
      this.c = LayoutInflater.from(new ContextThemeWrapper(this.a, paramTheme));
    }
  }
}


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