mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-08 03:24:04 +08:00
fix popup bug
This commit is contained in:
committed by
Fredrik Fornwall
parent
8c82f43dce
commit
2e53ef038e
@@ -1,7 +1,6 @@
|
|||||||
package com.termux.app;
|
package com.termux.app;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@@ -128,12 +127,12 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
int height = view.getMeasuredHeight();
|
int height = view.getMeasuredHeight();
|
||||||
Button button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);
|
Button button = new Button(getContext(), null, android.R.attr.buttonBarButtonStyle);
|
||||||
button.setText(text);
|
button.setText(text);
|
||||||
|
button.setTextColor(TEXT_COLOR);
|
||||||
|
button.setPadding(0, 0, 0, 0);
|
||||||
button.setMinHeight(0);
|
button.setMinHeight(0);
|
||||||
button.setMinWidth(0);
|
button.setMinWidth(0);
|
||||||
button.setMinimumWidth(0);
|
button.setMinimumWidth(0);
|
||||||
button.setMinimumHeight(0);
|
button.setMinimumHeight(0);
|
||||||
button.setPadding(0, 0, 0, 0);
|
|
||||||
button.setTextColor(TEXT_COLOR);
|
|
||||||
button.setWidth(width);
|
button.setWidth(width);
|
||||||
button.setHeight(height);
|
button.setHeight(height);
|
||||||
button.setBackgroundColor(BUTTON_PRESSED_COLOR);
|
button.setBackgroundColor(BUTTON_PRESSED_COLOR);
|
||||||
@@ -141,7 +140,6 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
popupWindow.setWidth(LayoutParams.WRAP_CONTENT);
|
popupWindow.setWidth(LayoutParams.WRAP_CONTENT);
|
||||||
popupWindow.setHeight(LayoutParams.WRAP_CONTENT);
|
popupWindow.setHeight(LayoutParams.WRAP_CONTENT);
|
||||||
popupWindow.setContentView(button);
|
popupWindow.setContentView(button);
|
||||||
popupWindow.setBackgroundDrawable(new ColorDrawable(0x00000000));
|
|
||||||
popupWindow.setOutsideTouchable(true);
|
popupWindow.setOutsideTouchable(true);
|
||||||
popupWindow.setFocusable(false);
|
popupWindow.setFocusable(false);
|
||||||
popupWindow.showAsDropDown(view, 0, -2 * height);
|
popupWindow.showAsDropDown(view, 0, -2 * height);
|
||||||
@@ -250,7 +248,7 @@ public final class ExtraKeysView extends GridLayout {
|
|||||||
scheduledExecutor = null;
|
scheduledExecutor = null;
|
||||||
}
|
}
|
||||||
if (longPressCount == 0) {
|
if (longPressCount == 0) {
|
||||||
if (popupWindow != null) {
|
if (popupWindow != null && "-/".contains(buttonText)) {
|
||||||
popupWindow.setContentView(null);
|
popupWindow.setContentView(null);
|
||||||
popupWindow.dismiss();
|
popupWindow.dismiss();
|
||||||
popupWindow = null;
|
popupWindow = null;
|
||||||
|
Reference in New Issue
Block a user