mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +08:00
Fixed: Fixed extra keys not showing properly on Android 5
Related issue #739
This commit is contained in:
@@ -60,7 +60,7 @@ import com.termux.shared.theme.ThemeUtils;
|
||||
* in {@link ExtraKeysView#ExtraKeysView(Context, AttributeSet)} by calling the respective functions.
|
||||
* If you extend {@link ExtraKeysView}, you can also set them in the constructor, but do call super().
|
||||
*
|
||||
* After this you will have to make a call to {@link ExtraKeysView#reload(ExtraKeysInfo) and pass
|
||||
* After this you will have to make a call to {@link ExtraKeysView#reload(ExtraKeysInfo, float) and pass
|
||||
* it the {@link ExtraKeysInfo} to load and display the extra keys. Read its class javadocs for more
|
||||
* info on how to create it.
|
||||
*
|
||||
@@ -379,9 +379,11 @@ public final class ExtraKeysView extends GridLayout {
|
||||
* Reload this instance of {@link ExtraKeysView} with the info passed in {@code extraKeysInfo}.
|
||||
*
|
||||
* @param extraKeysInfo The {@link ExtraKeysInfo} that defines the necessary info for the extra keys.
|
||||
* @param heightPx The height in pixels of the parent surrounding the {@link ExtraKeysView}. It must
|
||||
* be a single child.
|
||||
*/
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
public void reload(ExtraKeysInfo extraKeysInfo) {
|
||||
public void reload(ExtraKeysInfo extraKeysInfo, float heightPx) {
|
||||
if (extraKeysInfo == null)
|
||||
return;
|
||||
|
||||
@@ -469,7 +471,11 @@ public final class ExtraKeysView extends GridLayout {
|
||||
|
||||
LayoutParams param = new GridLayout.LayoutParams();
|
||||
param.width = 0;
|
||||
param.height = 0;
|
||||
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
|
||||
param.height = (int)(heightPx + 0.5);
|
||||
} else {
|
||||
param.height = 0;
|
||||
}
|
||||
param.setMargins(0, 0, 0, 0);
|
||||
param.columnSpec = GridLayout.spec(col, GridLayout.FILL, 1.f);
|
||||
param.rowSpec = GridLayout.spec(row, GridLayout.FILL, 1.f);
|
||||
|
Reference in New Issue
Block a user