packages/apps/Taskbar
Revisión | 2b054477e816cac8f7b115192ddb2c2ac9913416 (tree) |
---|---|
Tiempo | 2019-01-18 14:53:14 |
Autor | Braden Farmer <farmerbb@gmai...> |
Commiter | Braden Farmer |
Fix jumpy search button caused by previous commit
@@ -256,6 +256,8 @@ public class StartMenuService extends Service { | ||
256 | 256 | |
257 | 257 | // Initialize views |
258 | 258 | layout = (StartMenuLayout) LayoutInflater.from(U.wrapContext(this)).inflate(layoutId, null); |
259 | + layout.setAlpha(0); | |
260 | + | |
259 | 261 | startMenu = layout.findViewById(R.id.start_menu); |
260 | 262 | |
261 | 263 | if((shouldShowSearchBox && !hasHardwareKeyboard) || Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) |
@@ -587,7 +589,9 @@ public class StartMenuService extends Service { | ||
587 | 589 | layout.setOnClickListener(ocl); |
588 | 590 | layout.setVisibility(View.VISIBLE); |
589 | 591 | |
590 | - if(Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1) | |
592 | + boolean applySoftKeyboardFix = hasHardwareKeyboard && U.isChromeOs(this); | |
593 | + | |
594 | + if(Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1 && !applySoftKeyboardFix) | |
591 | 595 | layout.setAlpha(1); |
592 | 596 | |
593 | 597 | MenuHelper.getInstance().setStartMenuOpen(true); |
@@ -617,7 +621,7 @@ public class StartMenuService extends Service { | ||
617 | 621 | |
618 | 622 | EditText editText = searchView.findViewById(R.id.search_src_text); |
619 | 623 | if(searchView.getVisibility() == View.VISIBLE) { |
620 | - if(hasHardwareKeyboard && U.isChromeOs(this)) { | |
624 | + if(applySoftKeyboardFix) { | |
621 | 625 | searchView.setIconifiedByDefault(true); |
622 | 626 | |
623 | 627 | if(editText != null) |
@@ -629,10 +633,10 @@ public class StartMenuService extends Service { | ||
629 | 633 | refreshApps(false); |
630 | 634 | |
631 | 635 | new Handler().postDelayed(() -> { |
632 | - if(Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) | |
636 | + if(Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1 || applySoftKeyboardFix) | |
633 | 637 | layout.setAlpha(1); |
634 | 638 | |
635 | - if(hasHardwareKeyboard && U.isChromeOs(this)) { | |
639 | + if(applySoftKeyboardFix) { | |
636 | 640 | searchView.setIconifiedByDefault(false); |
637 | 641 | if(editText != null) |
638 | 642 | editText.setShowSoftInputOnFocus(true); |