diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-07-26 10:11:22 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-08-06 10:23:03 +0100 |
commit | 43622ed14489dac4b3f80972fadf260e7297bb37 (patch) | |
tree | 222dfd9a8ee9baa6b8cafa2eb17c46898a795ca7 /android/sdremote | |
parent | 0f776a53f021e3317376428186df4efb67d2471e (diff) |
Enabled hiding of clockbar.
Change-Id: I6b40629ec87c88c367b1958f3a7ab9b7938581e2
Diffstat (limited to 'android/sdremote')
-rw-r--r-- | android/sdremote/res/layout/presentation_clockbar.xml | 1 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java | 41 |
2 files changed, 37 insertions, 5 deletions
diff --git a/android/sdremote/res/layout/presentation_clockbar.xml b/android/sdremote/res/layout/presentation_clockbar.xml index cde3c9598c1c..1e2e097e5a26 100644 --- a/android/sdremote/res/layout/presentation_clockbar.xml +++ b/android/sdremote/res/layout/presentation_clockbar.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/clockbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#EE313131" diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java index 48e667897109..0c9e56f5249d 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java @@ -110,6 +110,8 @@ public class PresentationActivity extends Activity { private ToggleButton mTimeLabel; private ToggleButton mThumbnailButton; + private View mClockBar; + private String aTimeFormat = getResources().getString( R.string.actionbar_timeformat); private String aTimerFormat = getResources().getString( @@ -185,11 +187,40 @@ 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); + if (mClockBar == null) { + LayoutInflater aInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); + mClockBar = aInflater.inflate( + R.layout.presentation_clockbar, mLayout); + mClockBar = mLayout.findViewById(R.id.clockbar); + if (!mTimerOn) { + ((ToggleButton) mClockBar + .findViewById(R.id.clockbar_toggle_clockmode)) + .setChecked(true); + } else { + boolean aIsCountdown = mCommunicationService + .getSlideShow().getTimer() + .isCountdown(); + ((ToggleButton) mClockBar + .findViewById(R.id.clockbar_toggle_stopwatchmode)) + .setChecked(!aIsCountdown); + ((ToggleButton) mClockBar + .findViewById(R.id.clockbar_toggle_countdownmode)) + .setChecked(aIsCountdown); + } + + } else { + // mClockBar.setVisibility(View.INVISIBLE); + + // ((ViewGroup) mClockBar.getParent()).removeView(mClockBar); + if (mClockBar.getVisibility() == View.VISIBLE) { + mClockBar.setVisibility(View.INVISIBLE); + } else { + mClockBar.setVisibility(View.VISIBLE); + mClockBar.bringToFront(); + } + // mLayout.removeView(mClockBar); + // mClockBar = null; + } } } |