Skip to content

Commit

Permalink
styling the rip page, starting the bomb automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
gnorsilva committed Nov 20, 2011
1 parent 94d6ad2 commit ef67e15
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
Binary file added res/drawable-hdpi/tombstone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions res/layout/bomb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:onClick="starCountdown"
>
android:orientation="vertical" >

<TextView
android:id="@+id/bomb_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="00:10"
android:textSize="20sp"
android:textColor="#ff0000" />
android:textColor="#ff0000"
android:textSize="20sp" />

<ImageView
android:layout_width="match_parent"
Expand Down
19 changes: 10 additions & 9 deletions res/layout/rip.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<?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:orientation="vertical" >
android:layout_height="fill_parent"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/tombstones"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitCenter"
android:layout_weight="1" />
android:layout_weight="3"
android:src="@drawable/tombstone" />

<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2" />
android:layout_centerInParent="true"
android:layout_weight="1"
android:layout_width="300dp"
android:layout_height="200dp" />

</LinearLayout>
9 changes: 1 addition & 8 deletions src/com/novoda/aqvsira/Bomb.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.TextView;

public class Bomb extends Activity {

private BombTimer bombTimer;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bomb);
TextView timerView = (TextView) findViewById(R.id.bomb_timer);
bombTimer = new BombTimer(timerView, this, getIntent().getStringExtra("id"));
}

public void starCountdown(View v) {
bombTimer.start();
new BombTimer(timerView, this, getIntent().getStringExtra("id")).start();
}

private static class BombTimer extends CountDownTimer {
Expand Down

0 comments on commit ef67e15

Please sign in to comment.