diff options
-rw-r--r-- | res/layout/custom_gallery_title.xml | 54 | ||||
-rw-r--r-- | src/com/android/camera/ImageGallery.java | 15 |
2 files changed, 29 insertions, 40 deletions
diff --git a/res/layout/custom_gallery_title.xml b/res/layout/custom_gallery_title.xml index 0652678..bc1a385 100644 --- a/res/layout/custom_gallery_title.xml +++ b/res/layout/custom_gallery_title.xml @@ -4,9 +4,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,48 +14,34 @@ limitations under the License. --> -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/screen" android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical"> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/screen" + android:orientation="horizontal" + android:layout_width="fill_parent" + android:layout_height="fill_parent"> <TextView android:id="@+id/left_text" - android:gravity="center_vertical" - style="?android:attr/windowTitleStyle" - android:layout_width="wrap_content" - android:layout_height="fill_parent" android:paddingLeft="5dip" - android:layout_alignParentLeft="true" /> - - <TextView android:id="@+id/right_text" - android:gravity="center_vertical" - style="?android:attr/windowTitleStyle" - android:layout_width="wrap_content" - android:layout_height="fill_parent" android:paddingRight="5dip" - android:layout_alignParentRight="true" - android:visibility="gone" /> - - <LinearLayout android:id="@+id/loading_indicator" - android:orientation="horizontal" - android:gravity="center_vertical" - android:paddingTop="2dip" - android:layout_alignParentRight="true" - android:layout_height="wrap_content" - android:layout_width="wrap_content"> + android:gravity="center_vertical" + style="?android:attr/windowTitleStyle" + android:layout_width="wrap_content" + android:layout_height="fill_parent" + android:layout_weight="1" /> - <TextView android:id="@+id/loading_text" + <TextView android:id="@+id/loading_text" android:gravity="center_vertical" style="?android:attr/windowTitleStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:paddingLeft="5dip" android:paddingRight="5dip" - android:layout_alignParentRight="true" /> + android:layout_weight="0" /> - <ProgressBar android:id="@android:id/progress" + <ProgressBar android:id="@android:id/progress" style="?android:attr/progressBarStyleSmallTitle" android:gravity="center_vertical" android:paddingRight="5dip" android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - </LinearLayout> -</RelativeLayout> + android:layout_height="fill_parent" + android:layout_weight="0" /> +</LinearLayout> diff --git a/src/com/android/camera/ImageGallery.java b/src/com/android/camera/ImageGallery.java index ef8871e..a0050b0 100644 --- a/src/com/android/camera/ImageGallery.java +++ b/src/com/android/camera/ImageGallery.java @@ -652,7 +652,7 @@ public class ImageGallery extends Activity implements private final String mProgressTextFormatString; boolean mDidSetProgress = false; private long mLastUpdateTime; // initialized to 0 - private PowerManager.WakeLock mWakeLock; + private final PowerManager.WakeLock mWakeLock; private MyThumbCheckCallback() { Resources resources = getResources(); @@ -674,10 +674,12 @@ public class ImageGallery extends Activity implements if (!mDidSetProgress) { mHandler.post(new Runnable() { - public void run() { - View v = findViewById(R.id.loading_indicator); - v.setVisibility(View.VISIBLE); - } + public void run() { + findViewById(R.id.loading_text).setVisibility( + View.VISIBLE); + findViewById(android.R.id.progress).setVisibility( + View.VISIBLE); + } }); mDidSetProgress = true; } @@ -707,7 +709,8 @@ public class ImageGallery extends Activity implements mWakeLock.release(); mHandler.post(new Runnable() { public void run() { - findViewById(R.id.loading_indicator).setVisibility( + findViewById(R.id.loading_text).setVisibility(View.GONE); + findViewById(android.R.id.progress).setVisibility( View.GONE); } }); |