Merge "Notification: Use ViewStub for ProgressBar" into lmp-dev

This commit is contained in:
Christoph Studer
2014-09-10 11:14:07 +00:00
committed by Android (Google) Code Review
3 changed files with 26 additions and 3 deletions

View File

@@ -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);

View File

@@ -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>

View File

@@ -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"
/>