BirthdaySignUpFragment.java 3.47 KB
package com.bitstrips.imoji.ui.fragments;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.DatePicker.OnDateChangedListener;
import android.widget.EditText;
import java.text.DateFormat;
import java.util.Calendar;

public class BirthdaySignUpFragment
  extends Fragment
  implements DatePicker.OnDateChangedListener
{
  OnBirthdaySelectedListener a;
  Calendar b;
  private EditText c;
  private DatePicker d;
  private Button e;
  
  public void onAttach(Activity paramActivity)
  {
    super.onAttach(paramActivity);
    try
    {
      this.a = ((OnBirthdaySelectedListener)paramActivity);
      paramActivity.setTitle(2131230861);
      return;
    }
    catch (ClassCastException localClassCastException)
    {
      throw new ClassCastException(paramActivity.toString() + " must implement OnBirthdaySelectedListener");
    }
  }
  
  public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
  {
    paramLayoutInflater = paramLayoutInflater.inflate(2130903109, paramViewGroup, false);
    this.c = ((EditText)paramLayoutInflater.findViewById(2131689722));
    this.d = ((DatePicker)paramLayoutInflater.findViewById(2131689719));
    this.e = ((Button)paramLayoutInflater.findViewById(2131689720));
    this.c.addTextChangedListener(new TextWatcher()
    {
      public final void afterTextChanged(Editable paramAnonymousEditable)
      {
        Button localButton = BirthdaySignUpFragment.a(BirthdaySignUpFragment.this);
        if (!TextUtils.isEmpty(paramAnonymousEditable.toString())) {}
        for (boolean bool = true;; bool = false)
        {
          localButton.setEnabled(bool);
          return;
        }
      }
      
      public final void beforeTextChanged(CharSequence paramAnonymousCharSequence, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3) {}
      
      public final void onTextChanged(CharSequence paramAnonymousCharSequence, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3) {}
    });
    this.e.setOnClickListener(new View.OnClickListener()
    {
      public final void onClick(View paramAnonymousView)
      {
        BirthdaySignUpFragment.this.a.onBirthdaySelected(BirthdaySignUpFragment.this.b);
      }
    });
    paramViewGroup = Calendar.getInstance();
    this.d.init(paramViewGroup.get(1) - 1, paramViewGroup.get(2), paramViewGroup.get(5), this);
    return paramLayoutInflater;
  }
  
  public void onDateChanged(DatePicker paramDatePicker, int paramInt1, int paramInt2, int paramInt3)
  {
    if (this.c != null)
    {
      paramDatePicker = Calendar.getInstance();
      DateFormat localDateFormat = DateFormat.getDateInstance(1);
      paramDatePicker.set(paramInt1, paramInt2, paramInt3);
      this.b = paramDatePicker;
      this.c.setText(localDateFormat.format(paramDatePicker.getTime()));
    }
  }
  
  public static abstract interface OnBirthdaySelectedListener
  {
    public abstract void onBirthdaySelected(Calendar paramCalendar);
  }
}


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