Alphabetical

A children's app

by Sepideh Miller (@sepzilla)

An App for Toddlers

  • Visually appealing
  • Aurally interesting
  • Easy to navigate

Visual Appeal

  • Images
  • Custom Fonts

Images

Custom Fonts


LayoutInflater inflater = LayoutInflater.from(mContext);
TextView layout = (TextView) inflater.inflate(
	R.layout.textview_alphabet, container, false);
layout.setText(alphabet);

Typeface face = Typeface.createFromAsset(mContext.getAssets(), 
	"fonts/ChalkboardSE.ttc");
layout.setTypeface(face);
						

Aural Interest


public class AlphabetSoundPlayer {
  public AlphabetSoundPlayer(Context context) {
    mAssets = context.getAssets();
    mSoundPool = new SoundPool(MAX_SOUNDS, 
		AudioManager.STREAM_MUSIC, 0);
    loadSounds();
  }
  private void loadSounds() {...}
  private void load(Sound sound) throws IOException {...}
  public void play(Sound sound) {...}
  public void release() {
    mSoundPool.release();
  }
}
					

Ease of Navigation

ViewPager

Adding a ViewPager lets the user navigate by swiping.

ViewPager

Starting the Next Activity


mViewPager.addOnPageChangeListener(
  new ViewPager.SimpleOnPageChangeListener() {

  @Override
  public void onPageScrollStateChanged(int state) {
    if (adapter.getCount() - 1 == mViewPager.getCurrentItem() &&
        state == ViewPager.SCROLL_STATE_DRAGGING) {
	      startFinishActivity();
	}
  }
}
						

boolean dragLastPage;

@Override
public void onPageSelected(int position) {
   dragLastPage = false;
   super.onPageSelected(position);
}

@Override
public void onPageScrollStateChanged(int state) {
    if (adapter.getCount() - 1 == mViewPager.getCurrentItem() &&
        state == ViewPager.SCROLL_STATE_DRAGGING) {
        dragLastPage = true;
    }

    if (dragLastPage && state == ViewPager.SCROLL_STATE_IDLE) {
        startFinishActivity();
    }
}
						

Finish Activity