Skip to content

Commit

Permalink
Simple Theme by Beholder for on-screen keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
pelya committed Dec 21, 2010
1 parent a3106f9 commit b0c38f7
Show file tree
Hide file tree
Showing 6 changed files with 885 additions and 5 deletions.
2 changes: 1 addition & 1 deletion project/java/Globals.java
Expand Up @@ -54,7 +54,7 @@ class Globals {
public static boolean UseAccelerometerAsArrowKeys = false;
public static boolean UseTouchscreenKeyboard = true;
public static int TouchscreenKeyboardSize = 0;
public static int TouchscreenKeyboardTheme = 1;
public static int TouchscreenKeyboardTheme = 2;
public static int AccelerometerSensitivity = 2;
public static int AccelerometerCenterPos = 2;
public static int TrackballDampening = 0;
Expand Down
7 changes: 6 additions & 1 deletion project/java/Settings.java
Expand Up @@ -595,7 +595,8 @@ static void showScreenKeyboardThemeConfig(final MainActivity p)

final CharSequence[] items = {
p.getResources().getString(R.string.controls_screenkb_by, "Ugly Arrows", "pelya"),
p.getResources().getString(R.string.controls_screenkb_by, "Ultimate Droid", "Sean Stieber")
p.getResources().getString(R.string.controls_screenkb_by, "Ultimate Droid", "Sean Stieber"),
p.getResources().getString(R.string.controls_screenkb_by, "Simple Theme", "Beholder")
};

AlertDialog.Builder builder = new AlertDialog.Builder(p);
Expand Down Expand Up @@ -1154,6 +1155,10 @@ static void SetupTouchscreenKeyboardGraphics(Activity p)
{
nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.ultimatedroid));
}
if( Globals.TouchscreenKeyboardTheme == 2 )
{
nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.simpletheme));
}
}
}

Expand Down
Binary file added project/res/raw/simpletheme.raw
Binary file not shown.
Binary file modified project/res/raw/ultimatedroid.raw
Binary file not shown.
58 changes: 57 additions & 1 deletion project/themes/converter/convert.sh
@@ -1,5 +1,7 @@
#!/bin/sh

# Ultimate Droid by Sean Stieber

for f in ../UltimateDroid/*.png; do
newname=`echo $f | sed 's@.*/@@' | tr '[A-Z]' '[a-z]'`.raw
./converter $f ../../res/raw/$newname
Expand Down Expand Up @@ -46,6 +48,60 @@ rm ../../res/raw/ultimatedroid*.png.raw
gzip -9 < ../../res/raw/ultimatedroid.raw > ../../res/raw/ultimatedroid.raw.gz
mv -f ../../res/raw/ultimatedroid.raw.gz ../../res/raw/ultimatedroid.raw
echo "// Touchscreen theme to be included directly into the code witohut Java resources, not used yet"> ../touchscreentheme.h
echo "unsigned char * ultimateDroidTheme[] = { 00, // Dummy byte, skip it" >> ../touchscreentheme.h
echo "unsigned char * UltimateDroidTheme[] = { 00 // Dummy byte, skip it" >> ../touchscreentheme.h
cat ../../res/raw/ultimatedroid.raw | od -t x1 -v -A n | tr " " "," >> ../touchscreentheme.h
echo "};" >> ../touchscreentheme.h


# Simple Theme by Dmitry Matveev


for f in ../SimpleTheme/*.png; do
newname=simpletheme`echo $f | sed 's@.*/@@' | tr '[A-Z]' '[a-z]'`.raw
./converter $f ../../res/raw/$newname
done

rm -f ../../res/raw/simpletheme.raw

for F in \
dpad \
pad_left \
pad_right \
pad_up \
pad_down \
\
1auto_pressed \
1auto \
2auto_pressed \
2auto \
\
1 \
1pressed \
2 \
2pressed \
3 \
3pressed \
4 \
4pressed \
5 \
5pressed \
6 \
6pressed \
keyboard \
keyboard \
; do
if [ \! -e ../../res/raw/simpletheme$F.png.raw ]; then
echo Cannot find ../../res/raw/simpletheme$F.png.raw - check if all files are in place
exit 1
fi
cat ../../res/raw/simpletheme$F.png.raw >> ../../res/raw/simpletheme.raw
done

rm ../../res/raw/simpletheme*.png.raw

gzip -9 < ../../res/raw/simpletheme.raw > ../../res/raw/simpletheme.raw.gz
mv -f ../../res/raw/simpletheme.raw.gz ../../res/raw/simpletheme.raw
#echo "// Touchscreen theme to be included directly into the code witohut Java resources, not used yet"> ../touchscreentheme.h
echo "unsigned char * SimpleTheme[] = { 00 // Dummy byte, skip it" >> ../touchscreentheme.h
cat ../../res/raw/simpletheme.raw | od -t x1 -v -A n | tr " " "," >> ../touchscreentheme.h
echo "};" >> ../touchscreentheme.h

0 comments on commit b0c38f7

Please sign in to comment.