aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/layout/setup_welcome_video.xml1
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/ButtonSwitcher.java3
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/WordListPreference.java3
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java26
-rw-r--r--java/src/com/android/inputmethod/latin/setup/SetupActivity.java8
5 files changed, 28 insertions, 13 deletions
diff --git a/java/res/layout/setup_welcome_video.xml b/java/res/layout/setup_welcome_video.xml
index da59ec883..09cef988b 100644
--- a/java/res/layout/setup_welcome_video.xml
+++ b/java/res/layout/setup_welcome_video.xml
@@ -29,6 +29,7 @@
android:layout_height="0dp" />
<VideoView
android:id="@+id/setup_welcome_video"
+ android:background="@color/setup_background"
android:layout_weight="@integer/setup_welcome_video_weight_in_screen"
android:layout_marginTop="@dimen/setup_welcome_video_vertical_margin"
android:layout_marginBottom="@dimen/setup_welcome_video_vertical_margin"
diff --git a/java/src/com/android/inputmethod/dictionarypack/ButtonSwitcher.java b/java/src/com/android/inputmethod/dictionarypack/ButtonSwitcher.java
index 391a15c97..5ab94a429 100644
--- a/java/src/com/android/inputmethod/dictionarypack/ButtonSwitcher.java
+++ b/java/src/com/android/inputmethod/dictionarypack/ButtonSwitcher.java
@@ -126,6 +126,7 @@ public class ButtonSwitcher extends FrameLayout {
new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animation) {
+ if (newStatus != mStatus) return;
animateButton(newButton, ANIMATION_IN);
}
});
@@ -144,8 +145,10 @@ public class ButtonSwitcher extends FrameLayout {
final float outerX = getWidth();
final float innerX = button.getX() - button.getTranslationX();
if (ANIMATION_IN == direction) {
+ button.setClickable(true);
return button.animate().translationX(0);
} else {
+ button.setClickable(false);
return button.animate().translationX(outerX - innerX);
}
}
diff --git a/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java b/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java
index 1cf9196b5..e14055b50 100644
--- a/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java
+++ b/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java
@@ -219,8 +219,9 @@ public final class WordListPreference extends Preference {
final ListView listView = (ListView)parent;
final int indexToOpen;
// Close all first, we'll open back any item that needs to be open.
+ final boolean wasOpen = mInterfaceState.isOpen(mWordlistId);
mInterfaceState.closeAll();
- if (mInterfaceState.isOpen(mWordlistId)) {
+ if (wasOpen) {
// This button being shown. Take note that we don't want to open any button in the
// loop below.
indexToOpen = -1;
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 8d4beeced..a0ac47535 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -370,7 +370,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
// When user hits the space or the enter key, just cancel the while-typing timer.
final int typedCode = typedKey.mCode;
if (typedCode == Constants.CODE_SPACE || typedCode == Constants.CODE_ENTER) {
- startWhileTypingFadeinAnimation(keyboardView);
+ if (isTyping) {
+ startWhileTypingFadeinAnimation(keyboardView);
+ }
return;
}
@@ -614,8 +616,18 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
@ExternallyReferenced
public void setAltCodeKeyWhileTypingAnimAlpha(final int alpha) {
+ if (mAltCodeKeyWhileTypingAnimAlpha == alpha) {
+ return;
+ }
+ // Update the visual of alt-code-key-while-typing.
mAltCodeKeyWhileTypingAnimAlpha = alpha;
- updateAltCodeKeyWhileTyping();
+ final Keyboard keyboard = getKeyboard();
+ if (keyboard == null) {
+ return;
+ }
+ for (final Key key : keyboard.mAltCodeKeysWhileTyping) {
+ invalidateKey(key);
+ }
}
public void setKeyboardActionListener(final KeyboardActionListener listener) {
@@ -1282,16 +1294,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
invalidateKey(shortcutKey);
}
- private void updateAltCodeKeyWhileTyping() {
- final Keyboard keyboard = getKeyboard();
- if (keyboard == null) {
- return;
- }
- for (final Key key : keyboard.mAltCodeKeysWhileTyping) {
- invalidateKey(key);
- }
- }
-
public void startDisplayLanguageOnSpacebar(final boolean subtypeChanged,
final boolean needsToDisplayLanguage, final boolean hasMultipleEnabledIMEsOrSubtypes) {
mNeedsToDisplayLanguage = needsToDisplayLanguage;
diff --git a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java
index 29ee63d4e..651fea6ab 100644
--- a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java
+++ b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java
@@ -190,6 +190,14 @@ public final class SetupActivity extends Activity implements View.OnClickListene
mp.start();
}
});
+ mWelcomeVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+ @Override
+ public void onPrepared(final MediaPlayer mp) {
+ // Now VideoView has been laid-out and ready to play, remove background of it to
+ // reveal the video.
+ mWelcomeVideoView.setBackgroundResource(0);
+ }
+ });
mActionStart = findViewById(R.id.setup_start_label);
mActionStart.setOnClickListener(this);