Skip to content

Commit

Permalink
Fifth Commit
Browse files Browse the repository at this point in the history
Implemented buttons airplane mode and order a pizza
Bug corrections
  • Loading branch information
thpramos committed Dec 1, 2011
1 parent f323eef commit 5d6c737
Show file tree
Hide file tree
Showing 39 changed files with 346 additions and 31 deletions.
32 changes: 22 additions & 10 deletions AndroidManifest.xml
Expand Up @@ -5,37 +5,49 @@
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.CAMERA"/>


<uses-permission android:name="android.permission.CAMERA" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity android:name=".MainActivity" android:screenOrientation="portrait">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity>
<activity
android:name=".TipsActivity"
android:screenOrientation="portrait" >
<intent-filter >
<action android:name="com.bebrite.overlay.TIPS" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:label="@string/app_name"
android:name=".GameActivity"
android:screenOrientation="portrait">
android:name=".GameActivity"
android:screenOrientation="portrait" >
<intent-filter >
<action android:name="android.intent.action.GAME" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".ResultActivity" android:screenOrientation="portrait">
<activity
android:name=".ResultActivity"
android:screenOrientation="portrait" >
<intent-filter >
<action android:name="com.bebrite.overlay.RESULT" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

</activity>
</application>

</manifest>
Binary file modified bin/CameraOverlayTry.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/GameActivity.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/MainActivity.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/R$drawable.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/R$id.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/R$layout.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/R$string.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/R$style.class
Binary file not shown.
Binary file modified bin/classes/com/bebrite/overlay/ResultActivity.class
Binary file not shown.
Binary file added bin/classes/com/bebrite/overlay/TipsActivity.class
Binary file not shown.
Binary file added bin/res/drawable-hdpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-hdpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-hdpi/steps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-ldpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-ldpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-mdpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-mdpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-xhdpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-xhdpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/resources.ap_
Binary file not shown.
28 changes: 18 additions & 10 deletions gen/com/bebrite/overlay/R.java
Expand Up @@ -25,15 +25,21 @@ public static final class drawable {
public static final int green_ball=0x7f02000b;
public static final int ic_cab=0x7f02000c;
public static final int ic_launcher=0x7f02000d;
public static final int logo=0x7f02000e;
public static final int start_bg_nobt=0x7f02000f;
public static final int start_blank_bg=0x7f020010;
public static final int start_button=0x7f020011;
public static final int start_button_bg=0x7f020012;
public static final int start_button_bg_pressed=0x7f020013;
public static final int ic_menu_airplane=0x7f02000e;
public static final int ic_menu_pizza=0x7f02000f;
public static final int logo=0x7f020010;
public static final int start_bg_nobt=0x7f020011;
public static final int start_blank_bg=0x7f020012;
public static final int start_button=0x7f020013;
public static final int start_button_bg=0x7f020014;
public static final int start_button_bg_pressed=0x7f020015;
public static final int steps=0x7f020016;
}
public static final class id {
public static final int ButPIZZA=0x7f06000f;
public static final int ButPLANE=0x7f060010;
public static final int TextView01=0x7f060006;
public static final int butCAB=0x7f060011;
public static final int buttonStart=0x7f06000a;
public static final int camerapreview=0x7f06000b;
public static final int counter=0x7f060008;
Expand All @@ -51,10 +57,12 @@ public static final class id {
}
public static final class layout {
public static final int control=0x7f030000;
public static final int line=0x7f030001;
public static final int main=0x7f030002;
public static final int main_start=0x7f030003;
public static final int result=0x7f030004;
public static final int control2=0x7f030001;
public static final int line=0x7f030002;
public static final int main=0x7f030003;
public static final int main_start=0x7f030004;
public static final int result=0x7f030005;
public static final int tips=0x7f030006;
}
public static final class string {
public static final int app_name=0x7f040001;
Expand Down
Binary file added res/drawable-hdpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/steps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-ldpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-ldpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_menu_airplane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_menu_pizza.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions res/layout-large/result.xml
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" android:gravity="center" android:background="@drawable/bg_holiday">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical" android:gravity="center" android:layout_weight="1">

<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:src="@drawable/accuracy" android:layout_marginTop="10dp"/>

<TextView
android:id="@+id/textResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xx%"
android:textSize="80sp"
android:textStyle="bold" android:textColor="#ff4e00"/>

<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" android:layout_margin="10dp" android:background="@android:drawable/alert_light_frame">

<TextView
android:id="@+id/resultText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TextView" android:textColor="#FF4e00" android:gravity="center" android:textSize="20sp"/>

</LinearLayout>

</LinearLayout>

<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical" android:layout_weight=".5" android:gravity="bottom|center">

<Button
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:drawableLeft="@android:drawable/ic_menu_rotate"
android:onClick="onClickRetry"
android:text="Try Again"
android:textColor="#555"
android:textSize="25sp"
android:textStyle="bold" />

<Button
android:id="@+id/ButPIZZA"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:drawableLeft="@drawable/ic_menu_pizza"
android:onClick="onClickPizza"
android:text="Order a Pizza"
android:textColor="#555"
android:textSize="25sp"
android:textStyle="bold" android:visibility="gone"/>

<Button
android:id="@+id/ButPLANE"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:drawableLeft="@drawable/ic_menu_airplane"
android:onClick="onClickPlane"
android:text="Airplane Mode"
android:textColor="#555"
android:textSize="25sp"
android:textStyle="bold" android:visibility="gone"/>

<Button
android:drawableLeft="@drawable/ic_cab"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Call a Cab" android:onClick="onClickCab" android:textSize="25sp" android:textStyle="bold" android:textColor="#555" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginBottom="5dp" android:id="@+id/butCAB" android:visibility="gone"/>

</LinearLayout>

</LinearLayout>
96 changes: 96 additions & 0 deletions res/layout/control2.xml
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
android:orientation="vertical" >

<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="40dp"
android:src="@drawable/bg_top" android:scaleType="fitXY"/>

<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical" android:background="#5000" android:layout_gravity="center" android:gravity="center">

<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:orientation="horizontal" android:layout_weight="1">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:shadowColor="#000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:text="TEST"
android:textColor="#FFF"
android:textSize="20sp" android:textStyle="bold" android:paddingRight="5dp"/>

<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/bell_01" android:layout_gravity="top"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:shadowColor="#000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:text="Walk in a straight line."
android:textColor="#FFF"
android:textSize="20sp"
android:textStyle="bold" android:paddingLeft="10dp"/>

</LinearLayout>

<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="0dp" android:orientation="horizontal" android:gravity="center" android:layout_weight="1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="58dp"
android:layout_weight=".75"
android:orientation="vertical" >

<TextView
android:id="@+id/counter"
style="@style/counter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="0:15" android:gravity="center|top"/>

</LinearLayout>

</LinearLayout>

</LinearLayout>

<LinearLayout
android:id="@+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" android:gravity="bottom" android:padding="10dp">

<Button
android:id="@+id/buttonStart"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Start" android:background="@drawable/game_button" android:onClick="onClickStart" android:textSize="25sp" android:textStyle="bold" android:textColor="#FFF" android:gravity="center" android:layout_margin="15dp"/>

</LinearLayout>

</LinearLayout>
Expand Down
58 changes: 58 additions & 0 deletions res/layout/tips.xml
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" android:background="@drawable/start_blank_bg">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="@android:drawable/alert_dark_frame"
android:gravity="center"
android:orientation="vertical" >

<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:src="@drawable/steps" android:layout_weight="10" android:layout_margin="10dp"/>

<TextView
android:id="@+id/TextView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shadowColor="#000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:text="1. Hold the phone still."
android:textColor="#FFF"
android:textSize="20sp" android:gravity="center"/>

<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shadowColor="#000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:text="2. Walk heel to toe for 15s"
android:textColor="#FFF"
android:textSize="20sp" android:gravity="center"/>

<Button
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="15dp"
android:background="@drawable/start_button"
android:onClick="onClickGetStarted"
android:text="Next"
android:textSize="25sp"
android:textStyle="bold" />

</LinearLayout>

</LinearLayout>
Expand Down
6 changes: 3 additions & 3 deletions src/com/bebrite/overlay/GameActivity.java
Expand Up @@ -66,7 +66,7 @@ public void onCreate(Bundle savedInstanceState) {
this.addContentView(lineView, layoutParamsControl);

// ABAIXO CRIA A VIEW CONTROL.
viewControl = controlInflater.inflate(R.layout.control, null);
viewControl = controlInflater.inflate(R.layout.control2, null);
this.addContentView(viewControl, layoutParamsControl);

gameLoopThread = new GameLoopThread(lineView,viewControl,handler);
Expand All @@ -75,8 +75,8 @@ public void onCreate(Bundle savedInstanceState) {

protected void onResume() {
super.onResume();
mSensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_UI);
mSensorManager.registerListener(this, magnetometer, SensorManager.SENSOR_DELAY_UI);
mSensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_GAME);
mSensorManager.registerListener(this, magnetometer, SensorManager.SENSOR_DELAY_GAME);

}

Expand Down
2 changes: 1 addition & 1 deletion src/com/bebrite/overlay/MainActivity.java
Expand Up @@ -23,7 +23,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

public void onClickGetStarted(View v){
startActivity(new Intent("android.intent.action.GAME"));
startActivity(new Intent("com.bebrite.overlay.TIPS"));
finish();
}

Expand Down

0 comments on commit 5d6c737

Please sign in to comment.