OnboardingFormBaseActivity.java 1.85 KB
package com.bitstrips.imoji.ui;

import android.graphics.drawable.Drawable;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import com.bitstrips.imoji.ui.views.Form.ValidationCallbacksActivity;

public class OnboardingFormBaseActivity
  extends BitmojiBaseActivity
  implements Form.ValidationCallbacksActivity
{
  protected Button mMainButton;
  protected Menu mOptionsMenu;
  
  protected void disableButtons()
  {
    if (this.mMainButton != null) {
      this.mMainButton.setEnabled(false);
    }
    setTopButtonEnabled(false);
  }
  
  protected void enableButtons()
  {
    if (this.mMainButton != null) {
      this.mMainButton.setEnabled(true);
    }
    setTopButtonEnabled(true);
  }
  
  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    this.mOptionsMenu = paramMenu;
    disableButtons();
    return true;
  }
  
  public void onDestroy()
  {
    if ((this.mOptionsMenu != null) && (this.mOptionsMenu.size() > 0)) {
      this.mOptionsMenu.getItem(0).getIcon().setAlpha(255);
    }
    super.onDestroy();
  }
  
  public void onInvalidData()
  {
    disableButtons();
  }
  
  public void onValidData()
  {
    enableButtons();
  }
  
  protected void setMainButton(Button paramButton)
  {
    this.mMainButton = paramButton;
  }
  
  protected void setTopButtonEnabled(boolean paramBoolean)
  {
    if ((this.mOptionsMenu == null) || (this.mOptionsMenu.size() == 0)) {
      return;
    }
    this.mOptionsMenu.getItem(0).setEnabled(paramBoolean);
    Drawable localDrawable = this.mOptionsMenu.getItem(0).getIcon();
    if (paramBoolean) {}
    for (int i = 255;; i = 125)
    {
      localDrawable.setAlpha(i);
      return;
    }
  }
}


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