abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
authorChasm Solacer2022-12-11 22:10:00 +0100
committerGitHub2022-12-11 22:10:00 +0100
commit90cad963ec147313eee32bd4bb3a46922a3eea7d (patch)
tree6b8b219bb50b1d28d28dcaddf473081f9e11df3e /srcs/juloo.keyboard2/Config.java
parentbf318729555cc6e3362716e16d60b53d466e808f (diff)
downloadunexpected-keyboard-90cad963ec147313eee32bd4bb3a46922a3eea7d.tar.gz
unexpected-keyboard-90cad963ec147313eee32bd4bb3a46922a3eea7d.zip
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
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java9
1 files changed, 7 insertions, 2 deletions
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;