Basic clock control bar done.

Change-Id: I Ifd2e56b97f5b53ce29101d9eee7953b7700fb749
This commit is contained in:
Andrzej J.R. Hunt
2012-07-25 18:30:43 +02:00
committed by Michael Meeks
parent 499f589711
commit 2e999e9604
2 changed files with 37 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
<?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="wrap_content"
android:orientation="horizontal"
android:background="#BB000000">
<ToggleButton
android:id="@+id/clockbar_toggle_clockmode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="ToggleButton" />
<ToggleButton
android:id="@+id/clockbar_toggle_stopwatchmode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@drawable/actionbar_toggle" />
<ToggleButton
android:id="@+id/clockbar_toggle_countdownmode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@drawable/actionbar_toggle" />
</LinearLayout>

View File

@@ -16,6 +16,7 @@ import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
@@ -135,7 +136,7 @@ public class PresentationActivity extends Activity {
mTimeLabel = (ToggleButton) aBar.getCustomView().findViewById(
R.id.actionbar_time);
mThumbnailButton.setOnClickListener(this);
mTimeLabel.setOnClickListener(this);
// Listen for fragment changes
getFragmentManager().addOnBackStackChangedListener(this);
@@ -184,7 +185,11 @@ public class PresentationActivity extends Activity {
getFragmentManager().popBackStack();
}
} else if (aSource == mTimeLabel) {
System.out.println("added");
LayoutInflater aInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = aInflater.inflate(R.layout.presentation_clockbar,
mLayout);
// mLayout.addView(v);
}
}