diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-03 17:48:47 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-09 10:16:10 +0100 |
commit | c86b10625c3dc22588ac432022087797ed18d06e (patch) | |
tree | c5c8dc9acceb738c4faa5abe1ebd65c1c751098c /android | |
parent | 2c9ca62c6f756ac097a57cd4b560fd71521aef37 (diff) |
android: fix mHandleType initialization
Change-Id: I40df42b941ab1fbf9d847772e8b5c0ddea5cfcb7
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java index 61f5355534e4..36472a53aa40 100644 --- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java +++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/TextSelectionHandle.java @@ -55,12 +55,18 @@ public class TextSelectionHandle extends ImageView implements View.OnTouchListen TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TextSelectionHandle); int handleType = a.getInt(R.styleable.TextSelectionHandle_handleType, 0x01); - if (handleType == 0x01) { - mHandleType = HandleType.START; - } else if (handleType == 0x02) { - mHandleType = HandleType.MIDDLE; - } else if (handleType == 0x03) { - mHandleType = HandleType.END; + switch (handleType) { + case 1: + mHandleType = HandleType.START; + break; + case 2: + mHandleType = HandleType.MIDDLE; + break; + case 3: + mHandleType = HandleType.END; + break; + default: + throw new RuntimeException("Unknown text handle id"); } mIsRTL = false; |