[Libreoffice-commits] .: android/sdremote
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 21 01:54:39 PDT 2012
android/sdremote/res/layout/presentation_clockbar.xml | 116 +++++++---
android/sdremote/res/layout/presentation_clockbar_countdownbar.xml | 29 --
android/sdremote/res/layout/presentation_clockbar_stopwatchbar.xml | 28 --
android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java | 41 +--
4 files changed, 106 insertions(+), 108 deletions(-)
New commits:
commit 09f1ff4f59a89b10d5475b7296351c1dd0f09633
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Tue Aug 21 10:52:16 2012 +0200
Restyle and refactor clockbar to work with 2.3.
Change-Id: I2101fd1ef41ac71f81875ba845250ce875a242b5
diff --git a/android/sdremote/res/layout/presentation_clockbar.xml b/android/sdremote/res/layout/presentation_clockbar.xml
index 1e2e097..4d5d028 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 cc75341..0000000
--- 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 5459bec..0000000
--- 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 ac15028..73325bc 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();
More information about the Libreoffice-commits
mailing list