From 90cad963ec147313eee32bd4bb3a46922a3eea7d Mon Sep 17 00:00:00 2001 From: Chasm Solacer Date: Sun, 11 Dec 2022 22:10:00 +0100 Subject: Make the keyboard transparent (#252) * Add option for keyboard opacity (transparency). Keyboard background, keys and pressed keys can be adjusted separately. * Make the borders transparent as well * Moved setAlphas outside drawKeyFrame to top of onDraw method--- srcs/juloo.keyboard2/Config.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Config.java') diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 0ef5b67..c289436 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -1,6 +1,5 @@ package juloo.keyboard2; -import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; @@ -9,7 +8,6 @@ import android.util.DisplayMetrics; import android.util.TypedValue; import android.view.KeyEvent; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; final class Config @@ -40,6 +38,9 @@ final class Config public float keyVerticalInterval; public float keyHorizontalInterval; public int labelBrightness; // 0 - 255 + public int keyboardOpacity; // 0 - 255 + public int keyOpacity; // 0 - 255 + public int keyActivatedOpacity; // 0 - 255 public boolean preciseRepeat; public boolean double_tap_lock_shift; public float characterSize; // Ratio @@ -141,6 +142,10 @@ final class Config * horizontalIntervalScale; // Label brightness is used as the alpha channel labelBrightness = _prefs.getInt("label_brightness", 100) * 255 / 100; + // Keyboard opacity + keyboardOpacity = _prefs.getInt("keyboard_opacity", 100) * 255 / 100; + keyOpacity = _prefs.getInt("key_opacity", 100) * 255 / 100; + keyActivatedOpacity = _prefs.getInt("key_activated_opacity", 100) * 255 / 100; // Do not substract keyVerticalInterval from keyHeight because this is done // during rendered. keyHeight = dm.heightPixels * keyboardHeightPercent / 100 / 4; -- cgit v1.2.3