KerningSpannableFactory.java 1.46 KB
package com.bitstrips.imoji.ui;

import android.text.Spannable;
import android.text.Spannable.Factory;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.style.ScaleXSpan;

public class KerningSpannableFactory
  extends Spannable.Factory
{
  private final float a;
  
  public KerningSpannableFactory(float paramFloat)
  {
    this.a = (4.0F * paramFloat);
  }
  
  public Spannable newSpannable(CharSequence paramCharSequence)
  {
    if (paramCharSequence == null) {
      return null;
    }
    if (paramCharSequence.length() < 2)
    {
      if ((paramCharSequence instanceof Spannable)) {
        return (Spannable)paramCharSequence;
      }
      return new SpannableString(paramCharSequence);
    }
    if ((paramCharSequence instanceof SpannableStringBuilder)) {}
    for (SpannableStringBuilder localSpannableStringBuilder = (SpannableStringBuilder)paramCharSequence;; localSpannableStringBuilder = new SpannableStringBuilder(paramCharSequence))
    {
      int i = paramCharSequence.length() - 1;
      while (i > 0)
      {
        localSpannableStringBuilder.insert(i, " ");
        localSpannableStringBuilder.setSpan(new ScaleXSpan(this.a), i, i + 1, 33);
        i -= 1;
      }
    }
    return localSpannableStringBuilder;
  }
}


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