Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90dcf6d7 authored by Selim Cinek's avatar Selim Cinek
Browse files

Implemented the progressbar for the new templates

The padding was off in a few cases and the layout
was jumping when expanding when there were actions

Change-Id: Ia9a9ddbfd1c9a8104278a56ce6e1ef2a4ceafbe9
parent 29603462
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3000,7 +3000,6 @@ public class Notification implements Parcelable
            contentView.setImageViewResource(R.id.icon, 0);
            contentView.setTextViewText(R.id.app_name_text, null);
            contentView.setViewVisibility(R.id.chronometer, View.GONE);
            contentView.setViewVisibility(R.id.expand_button, View.GONE);
            contentView.setViewVisibility(R.id.header_sub_text, View.GONE);
            contentView.setViewVisibility(R.id.header_content_info, View.GONE);
            contentView.setViewVisibility(R.id.number_of_children, View.GONE);
@@ -3245,9 +3244,10 @@ public class Notification implements Parcelable
            }
            if (result == null) {
                result = applyStandardTemplateWithActions(getBigBaseLayoutResource());
            } else {
                hideLine1Text(result);
            }
            adaptNotificationHeaderForBigContentView(result);
            hideLine1Text(result);
            return result;
        }

+39 −52
Original line number Diff line number Diff line
@@ -14,69 +14,56 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/status_bar_latest_event_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:tag="big"
    >
    <FrameLayout
        android:id="@+id/status_bar_latest_event_content"
        android:layout_width="match_parent"
        android:layout_height="@dimen/notification_min_height"
        android:layout_gravity="top"
        android:tag="base"
        >
        <include layout="@layout/notification_template_header" />
        <LinearLayout
            android:id="@+id/notification_main_column"
            android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="top"
            android:layout_marginStart="@dimen/notification_content_margin_start"
        android:layout_marginTop="@dimen/notification_content_margin_top"
            android:layout_marginEnd="@dimen/notification_content_margin_end"
            android:layout_marginTop="@dimen/notification_content_margin_top"
            android:minHeight="@dimen/notification_min_content_height"
            android:orientation="vertical"
            >
            <include layout="@layout/notification_template_part_line1" />
        <include layout="@layout/notification_template_progress" />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="top"
            >
            <TextView android:id="@+id/big_text"
                android:textAppearance="@style/TextAppearance.Material.Notification"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:singleLine="false"
                android:visibility="gone"
                />
            <ImageView android:id="@+id/profile_badge_large_template"
                android:layout_width="@dimen/notification_badge_size"
                android:layout_height="@dimen/notification_badge_size"
                android:layout_weight="0"
                android:layout_marginStart="4dp"
                android:scaleType="fitCenter"
                android:visibility="gone"
                android:contentDescription="@string/notification_work_profile_content_description"
                />
            <include layout="@layout/notification_template_part_line3" />
        </LinearLayout>
        <include
            layout="@layout/notification_template_part_line3"
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
            android:layout_gravity="bottom"
            android:layout_marginStart="@dimen/notification_content_margin_start"
            android:layout_marginBottom="11dp"
            android:layout_marginEnd="@dimen/notification_content_margin_end">
            <include layout="@layout/notification_template_progress" />
        </FrameLayout>
        <include layout="@layout/notification_template_right_icon" />
    </FrameLayout>
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="1dp"
            android:layout_marginTop="10dp"
        android:id="@+id/action_divider"
        android:visibility="gone"
        android:background="@drawable/notification_template_divider" />
    <include
        layout="@layout/notification_material_action_list"
            android:layout_marginStart="-8dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />
</LinearLayout>
    <include layout="@layout/notification_template_right_icon" />
</FrameLayout>
+4 −1
Original line number Diff line number Diff line
@@ -34,7 +34,10 @@
        android:orientation="vertical"
        >
        <include layout="@layout/notification_template_part_line1" />
        <include layout="@layout/notification_template_progress" />
        <include layout="@layout/notification_template_progress"
            android:layout_width="match_parent"
            android:layout_height="15dp"
            android:layout_marginTop="4dp"/>

        <!-- We can't have another vertical linear layout here with weight != 0 so this forces us to
             put the badge on the first line. -->