diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-21 10:52:16 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-21 10:54:08 +0200 |
commit | 09f1ff4f59a89b10d5475b7296351c1dd0f09633 (patch) | |
tree | 06f588467e52874f2f6137b3de5a98b306b30089 /android/sdremote | |
parent | 95b26a37eec7800a337f4522c9235f6e6306de32 (diff) |
Restyle and refactor clockbar to work with 2.3.
Change-Id: I2101fd1ef41ac71f81875ba845250ce875a242b5
Diffstat (limited to 'android/sdremote')
4 files changed, 106 insertions, 108 deletions
diff --git a/android/sdremote/res/layout/presentation_clockbar.xml b/android/sdremote/res/layout/presentation_clockbar.xml index 1e2e097e5a26..4d5d028f8904 100644 --- a/android/sdremote/res/layout/presentation_clockbar.xml +++ b/android/sdremote/res/layout/presentation_clockbar.xml @@ -1,36 +1,96 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/clockbar" + android:id="@+id/clockbars_container" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="#EE313131" - android:orientation="horizontal" > + android:orientation="vertical" > - <ToggleButton - android:id="@+id/clockbar_toggle_clockmode" - android:layout_width="0dp" + <LinearLayout + android:id="@+id/clockbar" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@drawable/clockbar_clock" - android:textOff="" - android:textOn="" /> - - <ToggleButton - android:id="@+id/clockbar_toggle_stopwatchmode" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@drawable/clockbar_stopwatch" - android:textOff="" - android:textOn="" /> - - <ToggleButton - android:id="@+id/clockbar_toggle_countdownmode" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@drawable/clockbar_countdown" - android:textOff="" - android:textOn="" /> + android:background="#EE313131" + android:orientation="horizontal" > + + <ToggleButton + android:id="@+id/clockbar_toggle_clockmode" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@drawable/clockbar_clock" + android:textOff="" + android:textOn="" /> + + <ToggleButton + android:id="@+id/clockbar_toggle_stopwatchmode" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@drawable/clockbar_stopwatch" + android:textOff="" + android:textOn="" /> + + <ToggleButton + android:id="@+id/clockbar_toggle_countdownmode" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@drawable/clockbar_countdown" + android:textOff="" + android:textOn="" /> + </LinearLayout> + + <LinearLayout + android:id="@+id/clockbar_stopwatchbar" + android:layout_width="match_parent" + android:layout_height="48dp" + android:background="#DD4D4D4D" + android:orientation="horizontal" > + + <Button + android:id="@+id/clockbar_stopwatch_run" + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="#00000000" + android:text="@string/clock_timer_start" + android:textColor="#FFFFFF" /> + + <Button + android:id="@+id/clockbar_stopwatch_reset" + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="#00000000" + android:text="@string/clock_timer_reset" + android:textColor="#FFFFFF" /> + </LinearLayout> + + <LinearLayout + android:id="@+id/clockbar_countdownbar" + android:layout_width="match_parent" + android:layout_height="48dp" + android:background="#DD4D4D4D" + android:orientation="horizontal" > + + <EditText + android:id="@+id/clockbar_countdown_time" + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1" + android:ems="10" + android:inputType="time" + android:text="03:00" > + </EditText> + + <Button + android:id="@+id/clockbar_countdown_button" + android:layout_width="0dip" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="#00000000" + android:text="@string/clock_timer_start" + android:textColor="#FFFFFF" /> + </LinearLayout> </LinearLayout>
\ No newline at end of file diff --git a/android/sdremote/res/layout/presentation_clockbar_countdownbar.xml b/android/sdremote/res/layout/presentation_clockbar_countdownbar.xml deleted file mode 100644 index cc753418d2c2..000000000000 --- a/android/sdremote/res/layout/presentation_clockbar_countdownbar.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?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:text="03:00" - 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="@string/clock_timer_start" - android:textColor="#FFFFFF" - android:background="#00000000" /> - -</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 deleted file mode 100644 index 5459bec6ebdc..000000000000 --- a/android/sdremote/res/layout/presentation_clockbar_stopwatchbar.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?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:background="#00000000" - android:text="@string/clock_timer_start" - android:textColor="#FFFFFF" /> - - <Button - android:id="@+id/clockbar_stopwatch_reset" - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight="1" - android:background="#00000000" - android:text="@string/clock_timer_reset" - android:textColor="#FFFFFF" /> - -</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 ac15028390b3..73325bc9607c 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java @@ -28,7 +28,6 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.FrameLayout; -import android.widget.FrameLayout.LayoutParams; import android.widget.TextView; import android.widget.ToggleButton; @@ -258,8 +257,6 @@ public class PresentationActivity extends SherlockFragmentActivity { mClockBar_countdownButton.setOnClickListener(this); // Stopwatch bar - aInflater.inflate(R.layout.presentation_clockbar_stopwatchbar, - mOuterLayout); mStopwatchBar = mOuterLayout .findViewById(R.id.clockbar_stopwatchbar); @@ -271,8 +268,6 @@ public class PresentationActivity extends SherlockFragmentActivity { mStopwatchButtonReset.setOnClickListener(this); // Countdown bar - aInflater.inflate(R.layout.presentation_clockbar_countdownbar, - mOuterLayout); mCountdownBar = mOuterLayout .findViewById(R.id.clockbar_countdownbar); @@ -294,22 +289,22 @@ public class PresentationActivity extends SherlockFragmentActivity { } mClockBar_clockButton.setChecked(!mTimerOn); - FrameLayout.LayoutParams aParams = (LayoutParams) mCountdownBar - .getLayoutParams(); - aParams.topMargin = mClockBar.getBottom(); - // aParams.height = mClockBar.getHeight(); - // aParams.bottomMargin = aParams.topMargin + aParams.height; - // aParams.leftMargin = 100; - mCountdownBar.setLayoutParams(aParams); - mCountdownBar.setPadding(0, mClockBar.getBottom(), 0, 0); - mStopwatchBar.setPadding(0, mClockBar.getBottom(), 0, 0); - // mCountdownBar.requestLayout(); - // mOuterLayout.requestLayout(); - // mOuterLayout.invalidate(); - // aParams = (LayoutParams) mStopwatchBar.getLayoutParams(); - // aParams.topMargin = mClockBar.getHeight(); - // mOuterLayout.invalidate(); - // mStopwatchBar.setY(mClockBar.getHeight()); + // FrameLayout.LayoutParams aParams = (LayoutParams) mCountdownBar + // .getLayoutParams(); + // aParams.topMargin = mClockBar.getBottom(); + // // aParams.height = mClockBar.getHeight(); + // // aParams.bottomMargin = aParams.topMargin + aParams.height; + // // aParams.leftMargin = 100; + // mCountdownBar.setLayoutParams(aParams); + // mCountdownBar.setPadding(0, mClockBar.getBottom(), 0, 0); + // mStopwatchBar.setPadding(0, mClockBar.getBottom(), 0, 0); + // // mCountdownBar.requestLayout(); + // // mOuterLayout.requestLayout(); + // // mOuterLayout.invalidate(); + // // aParams = (LayoutParams) mStopwatchBar.getLayoutParams(); + // // aParams.topMargin = mClockBar.getHeight(); + // // mOuterLayout.invalidate(); + // // mStopwatchBar.setY(mClockBar.getHeight()); boolean aIsCountdown = mCommunicationService.getSlideShow() .getTimer().isCountdown(); @@ -317,7 +312,7 @@ public class PresentationActivity extends SherlockFragmentActivity { boolean aStopwatchMode = mTimerOn && !aIsCountdown; mClockBar_stopwatchButton.setChecked(aStopwatchMode); mStopwatchBar.setVisibility(aStopwatchMode ? View.VISIBLE - : View.INVISIBLE); + : View.GONE); mStopwatchBar.bringToFront(); if (aStopwatchMode) { Timer aTimer = mCommunicationService.getSlideShow().getTimer(); @@ -334,7 +329,7 @@ public class PresentationActivity extends SherlockFragmentActivity { boolean aCountdownMode = mTimerOn && aIsCountdown; mClockBar_countdownButton.setChecked(mTimerOn && aIsCountdown); mCountdownBar.setVisibility(mTimerOn && aIsCountdown ? View.VISIBLE - : View.INVISIBLE); + : View.GONE); mCountdownBar.bringToFront(); if (aCountdownMode) { Timer aTimer = mCommunicationService.getSlideShow().getTimer(); |