summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-07-26 11:26:32 +0200
committerMichael Meeks <michael.meeks@suse.com>2012-08-06 10:23:03 +0100
commit0eb5d4014a816e4ab8de38632d2106afeb91b131 (patch)
tree24bb2093a8ad9f0486948dd4e688fcc3f4ea4860 /android
parent847f98033c03fb6a07e64f8c9227d348a316f8ae (diff)
Added stopwatch and countdown bars.
Change-Id: I Id0bd62aa9e2f6e19a3723e70a9cc8d153457c859
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/res/layout/presentation_clockbar_countdownbar.xml26
-rw-r--r--android/sdremote/res/layout/presentation_clockbar_stopwatchbar.xml24
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java36
3 files changed, 85 insertions, 1 deletions
diff --git a/android/sdremote/res/layout/presentation_clockbar_countdownbar.xml b/android/sdremote/res/layout/presentation_clockbar_countdownbar.xml
new file mode 100644
index 000000000000..dc510cef0c8f
--- /dev/null
+++ b/android/sdremote/res/layout/presentation_clockbar_countdownbar.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/clockbar_countdownbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#DD4D4D4D"
+ android:gravity="left|top"
+ android:orientation="horizontal" >
+
+ <EditText
+ android:id="@+id/clockbar_countdown_time"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:ems="10"
+ android:inputType="time" >
+ </EditText>
+
+ <Button
+ android:id="@+id/clockbar_countdown_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="Test" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/sdremote/res/layout/presentation_clockbar_stopwatchbar.xml b/android/sdremote/res/layout/presentation_clockbar_stopwatchbar.xml
new file mode 100644
index 000000000000..49d1edd9b33c
--- /dev/null
+++ b/android/sdremote/res/layout/presentation_clockbar_stopwatchbar.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/clockbar_stopwatchbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#DD4D4D4D"
+ android:gravity="left|top"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/clockbar_stopwatch_run"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="Test" />
+
+ <Button
+ android:id="@+id/clockbar_stopwatch_reset"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="Test" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
index 10eb0283356f..11e07433d675 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
@@ -20,6 +20,8 @@ import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ToggleButton;
@@ -116,6 +118,16 @@ public class PresentationActivity extends Activity {
private ToggleButton mClockBar_stopwatchButton;
private ToggleButton mClockBar_countdownButton;
+ // ------- STOPWATCH BAR
+ private View mStopwatchBar;
+ private Button mStopwatchButtonRun;
+ private Button mStopwatchButtonReset;
+
+ // ------- COUNTDOWN BAR
+ private View mCountdownBar;
+ private EditText mCountdownEntry;
+ private Button mCountdownButton;
+
private String aTimeFormat = getResources().getString(
R.string.actionbar_timeformat);
private String aTimerFormat = getResources().getString(
@@ -156,6 +168,7 @@ public class PresentationActivity extends Activity {
}
private void setupClockBar() {
+ // ClockBar
LayoutInflater aInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
aInflater.inflate(R.layout.presentation_clockbar, mLayout);
mClockBar = mLayout.findViewById(R.id.clockbar);
@@ -171,18 +184,39 @@ public class PresentationActivity extends Activity {
mClockBar_stopwatchButton.setOnClickListener(this);
mClockBar_countdownButton.setOnClickListener(this);
+ // Stopwatch bar
+ aInflater.inflate(R.layout.presentation_clockbar_stopwatchbar,
+ mLayout);
+ mStopwatchBar = mLayout.findViewById(R.id.clockbar_stopwatchbar);
+ mStopwatchBar.setVisibility(View.INVISIBLE);
+
+ // Countdown bar
+ aInflater.inflate(R.layout.presentation_clockbar_countdownbar,
+ mLayout);
+ mCountdownBar = mLayout.findViewById(R.id.clockbar_countdownbar);
+ mCountdownBar.setVisibility(View.INVISIBLE);
+
updateClockBar();
}
private void updateClockBar() {
- // TODO: show/hide the sub bar
mClockBar_clockButton.setChecked(!mTimerOn);
+ mCountdownBar.setY(mClockBar.getHeight());
+ mStopwatchBar.setY(mClockBar.getHeight());
+
boolean aIsCountdown = mCommunicationService.getSlideShow()
.getTimer().isCountdown();
+ // Stopwatch
mClockBar_stopwatchButton.setChecked(mTimerOn && !aIsCountdown);
+ mStopwatchBar.setVisibility(mTimerOn && !aIsCountdown ? View.VISIBLE
+ : View.INVISIBLE);
+ // Countdown
mClockBar_countdownButton.setChecked(mTimerOn && aIsCountdown);
+ mCountdownBar.setVisibility(mTimerOn && aIsCountdown ? View.VISIBLE
+ : View.INVISIBLE);
+
}
private Handler timerHandler = new Handler();