diff options
| author | 2014-09-10 11:14:07 +0000 | |
|---|---|---|
| committer | 2014-09-10 11:14:08 +0000 | |
| commit | b907affce2ca0451637770710b5bedc8162f69cf (patch) | |
| tree | 1538f7f64b3b99b3a7f94b5b5f5dfedc7a2b5b7b | |
| parent | c90f95c79ddd930c3fba13352f15ce7666eca402 (diff) | |
| parent | aca4b25f479065088a798eff3b87ec46325632e3 (diff) | |
Merge "Notification: Use ViewStub for ProgressBar" into lmp-dev
| -rw-r--r-- | core/java/android/app/Notification.java | 2 | ||||
| -rw-r--r-- | core/res/res/layout/notification_template_part_line2.xml | 4 | ||||
| -rw-r--r-- | core/res/res/layout/notification_template_progressbar.xml | 23 |
3 files changed, 26 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 2476c4b6841f..b93d17c3a26b 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -2739,9 +2739,9 @@ public class Notification implements Parcelable } else { contentView.setViewVisibility(R.id.text2, View.GONE); if (hasProgress && (mProgressMax != 0 || mProgressIndeterminate)) { + contentView.setViewVisibility(R.id.progress, View.VISIBLE); contentView.setProgressBar( R.id.progress, mProgressMax, mProgress, mProgressIndeterminate); - contentView.setViewVisibility(R.id.progress, View.VISIBLE); showLine2 = true; } else { contentView.setViewVisibility(R.id.progress, View.GONE); diff --git a/core/res/res/layout/notification_template_part_line2.xml b/core/res/res/layout/notification_template_part_line2.xml index 7e99c5ea4050..aeef3ab2ad33 100644 --- a/core/res/res/layout/notification_template_part_line2.xml +++ b/core/res/res/layout/notification_template_part_line2.xml @@ -45,13 +45,13 @@ android:visibility="gone" /> </LinearLayout> - <ProgressBar + <ViewStub android:id="@android:id/progress" + android:layout="@layout/notification_template_progressbar" android:layout_width="match_parent" android:layout_height="15dp" android:layout_marginEnd="8dp" android:visibility="gone" android:layout_weight="0" - style="@style/Widget.Material.Light.ProgressBar.Horizontal" /> </merge> diff --git a/core/res/res/layout/notification_template_progressbar.xml b/core/res/res/layout/notification_template_progressbar.xml new file mode 100644 index 000000000000..61480b8664cb --- /dev/null +++ b/core/res/res/layout/notification_template_progressbar.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ 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. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/progress" + android:layout_width="match_parent" + android:layout_height="match_parent" + style="@style/Widget.Material.Light.ProgressBar.Horizontal" + /> |