Skip to content

Commit

Permalink
Merge pull request #3528 from wordpress-mobile/issue/3521-underline-c…
Browse files Browse the repository at this point in the history
…rash-marshmallow

Fix #3521: using underline in the editor was crashing Android 6.0
  • Loading branch information
nbradbury committed Dec 16, 2015
2 parents 76303db + c02487d commit 763fda9
Showing 1 changed file with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,18 @@
package org.wordpress.android.util.helpers;

import android.os.Parcel;
import android.text.ParcelableSpan;
import android.text.TextPaint;
import android.text.style.CharacterStyle;
import android.text.style.UpdateAppearance;
import android.text.style.UnderlineSpan;

public class WPUnderlineSpan extends CharacterStyle
implements UpdateAppearance, ParcelableSpan {
/**
* WPUnderlineSpan is used as an alternative class to UnderlineSpan. UnderlineSpan is used by EditText auto
* correct, so it can get mixed up with our formatting.
*/
public class WPUnderlineSpan extends UnderlineSpan {
public WPUnderlineSpan() {
super();
}

public WPUnderlineSpan(Parcel src) {
}

public int getSpanTypeId() {
return 6;
}

public int describeContents() {
return 0;
}

public void writeToParcel(Parcel dest, int flags) {
}

@Override
public void updateDrawState(TextPaint ds) {
ds.setUnderlineText(true);
super(src);
}
}

0 comments on commit 763fda9

Please sign in to comment.