Skip to content

Commit

Permalink
1. Bug fixed on space bar preview not showing 2.Space bar Language pr…
Browse files Browse the repository at this point in the history
…eview padding tuning
  • Loading branch information
jrywu committed Jul 31, 2016
1 parent 4c93a79 commit 79e8e37
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions LimeStudio/app/build.gradle
Expand Up @@ -61,8 +61,8 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.+'
compile 'com.android.support:support-v4:24.0.+'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.android.support:multidex:1.0.1'
compile files('libs/commons-logging-1.1.1.jar')
Expand Down
Expand Up @@ -92,7 +92,7 @@ public class LIMEKeyboard extends LIMEBaseKeyboard {
// Minimum width of space key preview (proportional to keyboard width)
private static final float SPACEBAR_POPUP_MIN_RATIO = 0.4f;
// Height in space key the language name will be drawn. (proportional to space key height)
private static final float SPACEBAR_IMNAME_BASELINE = 0.5f;
private static final float SPACEBAR_IMNAME_BASELINE = 0.55f;

private static final int OPACITY_FULLY_OPAQUE = 255;

Expand Down
Expand Up @@ -338,18 +338,21 @@ public void handleMessage(Message msg) {
}
case MSG_SHOW_PREVIEW: {
if(DEBUG) Log.i(TAG, "handleMessage() MSG_SHOW_PREVIEW");
mLIMEKeyboardBaseView.startKeyPreviewFadeInAnimation();
final PointerTracker tracker = (PointerTracker) msg.obj;
if(!tracker.isSpaceKey(msg.arg1))
mLIMEKeyboardBaseView.startKeyPreviewFadeInAnimation();
mLIMEKeyboardBaseView.mPreviewText.setVisibility(VISIBLE);
break;
}
}
}

public void showPreview(long delay){
public void showPreview(long delay, int keyIndex, PointerTracker tracker){
if(DEBUG)
Log.i(TAG,"UIHandler.showPreview() delay = "+delay);
LIMEKeyboardBaseView mLIMEKeyboardBaseView = mLIMEKeyboardBaseViewWeakReference.get();
sendMessageDelayed(obtainMessage(MSG_SHOW_PREVIEW),delay);
sendMessageDelayed(obtainMessage(MSG_SHOW_PREVIEW, keyIndex, 0, tracker), delay);

}
public void popupPreview(long delay, int keyIndex, PointerTracker tracker) {
if(DEBUG)
Expand Down Expand Up @@ -1318,8 +1321,9 @@ private void showKey(final int keyIndex, PointerTracker tracker) {
}
// Record popup preview position to display mini-keyboard later at the same positon
mPopupPreviewDisplayedY = popupPreviewY;
//Jeremy '16, 7, 30 delay 5 second before show preview to avoid ghost image when moving last location to current.
mHandler.showPreview(mDelayBeforePreview);
//Jeremy '16, 7, 30 Add delay before show preview to avoid ghost image when moving last location to current.

mHandler.showPreview(mDelayBeforePreview, keyIndex, tracker);

}

Expand Down
2 changes: 1 addition & 1 deletion LimeStudio/app/src/main/res/values-large-land/dimens.xml
Expand Up @@ -37,7 +37,7 @@
<dimen name="sub_label_text_size">22dp</dimen>
<dimen name="small_label_text_size">24dp</dimen>
<dimen name="composing_text_size">21sp</dimen>

<!-- WB -->
<dimen name="wb_key_height">68dip</dimen>
</resources>
7 changes: 4 additions & 3 deletions LimeStudio/app/src/main/res/values-large/dimens.xml
Expand Up @@ -32,7 +32,6 @@
<dimen name="candidate_number_font_size">15sp</dimen>
<dimen name="candidate_vertical_padding">12sp</dimen>
<dimen name="key_preview_height">135dp</dimen>
<dimen name="spacebar_vertical_correction">4dip</dimen>
<dimen name="keyboard_bottom_padding">0.06in</dimen>
<dimen name="key_text_size">26dp</dimen>
<dimen name="label_text_size">26dp</dimen>
Expand All @@ -41,9 +40,11 @@
<dimen name="composing_text_size">22sp</dimen>
<dimen name="notice_text_size">20sp</dimen>
<dimen name="keyboard_vertical_correction">-0.05in</dimen>
<dimen name="spacebar_preview_text_size">28sp</dimen>
<dimen name="spacebar_vertical_correction">0dp</dimen>
<dimen name="spacebar_preview_text_size">26sp</dimen>
<dimen name="spacebar_preview_top_padding">20dp</dimen>
<dimen name="mini_keyboard_vertical_correction">-0.05in</dimen>
<dimen name="spacebar_preview_top_padding">14dip</dimen>

<!-- WB -->
<dimen name="wb_key_height">92dip</dimen>

Expand Down
2 changes: 1 addition & 1 deletion LimeStudio/app/src/main/res/values/dimens.xml
Expand Up @@ -35,6 +35,7 @@
<dimen name="phone_key_height">58dip</dimen>
<dimen name="key_height">46dip</dimen>
<dimen name="spacebar_vertical_correction">4dip</dimen>
<dimen name="spacebar_preview_top_padding">20dp</dimen>
<dimen name="candidate_stripe_height">30sp</dimen>
<dimen name="candidate_vertical_padding">10sp</dimen>
<dimen name="candidate_number_font_size">14sp</dimen>
Expand All @@ -53,7 +54,6 @@
<dimen name="mini_keyboard_fling_vertical_correction">-46dip</dimen>
<dimen name="mini_keyboard_slide_allowance">0.553in</dimen>
<dimen name="spacebar_preview_text_size">25sp</dimen>
<dimen name="spacebar_preview_top_padding">10dip</dimen>
<dimen name="preview_top_padding">0dip</dimen>
<dimen name="key_preview_height">110dp</dimen>
<dimen name="key_preview_text_size_large">40sp</dimen>
Expand Down

0 comments on commit 79e8e37

Please sign in to comment.