Hide attachment progress bar on complete.

Also fix up styles to (mostly) match mocks and be consistent
with Gmail

Bug: 5205957
Change-Id: Iea7e9706464a8050255a7be78fca471cb7f9f6cf
This commit is contained in:
Ben Komalo 2011-09-28 15:33:20 -07:00
parent 8f56f41a07
commit fb83cef9ad
12 changed files with 129 additions and 114 deletions

View File

@ -15,6 +15,6 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="@color/text_disabled_color" />
<item android:color="@color/text_primary_color" />
<item android:state_enabled="false" android:color="@color/button_text_disabled_color" />
<item android:color="@color/button_text_color" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

View File

@ -21,15 +21,31 @@
android:layout_width="match_parent"
android:layout_height="64dip"
android:orientation="horizontal"
android:background="@drawable/attachment_bg_holo"
>
<ImageView
android:id="@+id/attachment_icon"
<FrameLayout
android:layout_width="64dip"
android:layout_height="match_parent"
android:layout_weight="0"
android:src="@drawable/ic_attachment_holo_light"
android:scaleType="fitCenter"
/>
android:layout_height="64dip"
android:orientation="vertical"
android:background="#e5e5e5"
>
<ImageView
android:id="@+id/attachment_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ic_attachment_holo_light"
android:scaleType="center"
/>
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:visibility="invisible"
/>
</FrameLayout>
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
@ -41,49 +57,31 @@
>
<RelativeLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_marginLeft="32dip"
android:layout_marginRight="16dip"
>
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="16dip"
android:layout_alignParentBottom="true"
<TextView
android:id="@+id/attachment_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginTop="2dip"
android:layout_marginBottom="6dip"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:visibility="invisible"
android:gravity="center"
android:textSize="18dip"
android:textColor="#333333"
android:singleLine="true"
android:ellipsize="middle"
/>
<TextView
android:id="@+id/attachment_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_above="@id/progress"
android:layout_marginLeft="16dip"
android:textSize="14dip"
android:layout_alignParentLeft="true"
android:layout_below="@+id/attachment_name"
android:textSize="14sp"
android:textColor="@color/text_secondary_color"
android:singleLine="true"
android:gravity="right|bottom"
/>
<TextView
android:id="@+id/attachment_name"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@id/attachment_info"
android:layout_above="@id/progress"
android:textSize="18dip"
android:textColor="@color/text_primary_color"
android:singleLine="true"
android:ellipsize="middle"
android:gravity="left|bottom"
/>
</RelativeLayout>
@ -95,7 +93,6 @@
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:showDividers="middle"
android:dividerPadding="16dip"
>
<Button
android:id="@+id/load"

View File

@ -219,7 +219,6 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/message_view_info_back_color"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="beginning|middle|end"
/>

View File

@ -23,91 +23,100 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:orientation="vertical"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="middle"
android:background="@drawable/attachment_bg_holo"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
>
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:visibility="invisible"
/>
<ImageView
android:id="@+id/attachment_icon"
android:layout_width="48dip"
android:layout_height="48dip"
android:src="@drawable/ic_attachment_holo_light"
/>
</LinearLayout>
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:orientation="vertical"
android:gravity="center_vertical"
>
<FrameLayout
android:id="@+id/attachment_container"
android:layout_width="48dip"
android:layout_height="48dip"
android:background="#e5e5e5"
>
<ImageView
android:id="@+id/attachment_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ic_attachment_holo_light"
android:scaleType="center"
/>
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:visibility="invisible"
/>
</FrameLayout>
<TextView
android:id="@+id/attachment_name"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/attachment_container"
android:layout_marginLeft="16dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondaryInverse"
android:textColor="#333333"
android:singleLine="true"
android:ellipsize="middle"
/>
<TextView
android:id="@+id/attachment_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/attachment_container"
android:layout_below="@+id/attachment_name"
android:layout_marginLeft="16dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorTertiaryInverse"
android:textColor="@color/text_secondary_color"
android:singleLine="true"
android:ellipsize="middle"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/load"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_load_action"
android:visibility="gone"
/>
<Button
android:id="@+id/cancel"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_cancel_action"
android:visibility="gone"
/>
<Button
android:id="@+id/info"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_info_action"
android:visibility="gone"
/>
<Button
android:id="@+id/save"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_save_action"
android:visibility="gone"
/>
<Button
android:id="@+id/open"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_view_action"
android:visibility="gone"
/>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:showDividers="middle"
android:dividerPadding="8dip"
>
<Button
android:id="@+id/load"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_load_action"
android:visibility="gone"
/>
<Button
android:id="@+id/cancel"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_cancel_action"
android:visibility="gone"
/>
<Button
android:id="@+id/info"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_info_action"
android:visibility="gone"
/>
<Button
android:id="@+id/save"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_save_action"
android:visibility="gone"
/>
<Button
android:id="@+id/open"
style="@style/Attachment.Button"
android:text="@string/message_view_attachment_view_action"
android:visibility="gone"
/>
</LinearLayout>
</LinearLayout>

View File

@ -162,6 +162,7 @@
<item name="android:singleLine">true</item>
<item name="android:ellipsize">end</item>
<item name="android:gravity">center</item>
<item name="android:textAllCaps">true</item>
</style>
<style name="message_list_item_normal">

View File

@ -34,6 +34,9 @@
<color name="text_ternary_color">#aaaaaa</color>
<color name="text_disabled_color">#888888</color>
<color name="button_text_color">#777777</color>
<color name="button_text_disabled_color">#cccccc</color>
<!-- TODO: properly put these text colors in the theme and use selectors -->
<color name="text_primary_color_inverse">#ffffff</color>
<color name="text_secondary_color_inverse">#eeeeee</color>

View File

@ -120,17 +120,19 @@
<style name="Attachment" />
<style name="Attachment.Button" parent="@android:style/Widget.Holo.Button">
<style name="Attachment.Button" parent="@android:style/Widget.Holo.Button.Borderless">
<item name="android:minHeight">0dip</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:paddingTop">2dip</item>
<item name="android:paddingBottom">2dip</item>
<item name="android:paddingTop">8dip</item>
<item name="android:paddingBottom">8dip</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/buttontext</item>
<item name="android:singleLine">true</item>
<item name="android:textAllCaps">true</item>
</style>
<style name="attachment_container">

View File

@ -20,7 +20,6 @@ import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;

View File

@ -1309,6 +1309,11 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O
mProgressView.setIndeterminate(false);
}
mProgressView.setProgress(progress);
// Hide on completion.
if (progress == 100) {
hideProgress();
}
}
public void showProgressIndeterminate() {