Got it scaling right, finally. Sheesh.

This commit is contained in:
Neale Pickett 2012-12-08 18:21:12 -07:00
parent e8caffd1fa
commit 15787dee79
3 changed files with 48 additions and 16 deletions

View File

@ -18,14 +18,17 @@ release-install: bin/PenaltyTimer-release.apk
clean: clean:
ant clean ant clean
res/layout/main.xml: main.xml.m4
m4 $< > $@
bin/PenaltyTimer-release.apk: bin/PenaltyTimer-release-unaligned.apk bin/PenaltyTimer-release.apk: bin/PenaltyTimer-release-unaligned.apk
$(ZIPALIGN) -f 4 $< $@ $(ZIPALIGN) -f 4 $< $@
bin/PenaltyTimer-release-unaligned.apk: bin/PenaltyTimer-release-unsigned.apk bin/PenaltyTimer-release-unaligned.apk: bin/PenaltyTimer-release-unsigned.apk
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore $(KEYSTORE) -signedjar $@ $< $(ALIAS) jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore $(KEYSTORE) -signedjar $@ $< $(ALIAS)
bin/PenaltyTimer-release-unsigned.apk: src/org/woozle/penaltytimer/* res/*/* bin/PenaltyTimer-release-unsigned.apk: src/org/woozle/penaltytimer/* res/*/* res/layout/main.xml
ant release ant release
bin/PenaltyTimer-debug.apk: src/org/woozle/penaltytimer/* res/*/* bin/PenaltyTimer-debug.apk: src/org/woozle/penaltytimer/* res/*/* res/layout/main.xml
ant debug ant debug

43
main.xml.m4 Normal file
View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
define(row, `<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="horizontal"
>
<Button
android:id="@+id/$1"
android:text="★ $1"
android:textSize="24sp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="fill_parent"
/>
<Button
android:id="@+id/$2"
android:text="$2"
android:textSize="24sp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="fill_parent"
/>
</LinearLayout>')
row(jl, jr)
row(bl1, br1)
row(bl2, br2)
row(bl3, br3)
<Button
android:id="@+id/pause"
android:text="Jam End"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:onClick="pauseButton"
/>
</LinearLayout>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<Button
android:id="@+id/pause"
android:text="Jam End"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="pauseButton" />
</LinearLayout>