File: message_banner_view.xml

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (145 lines) | stat: -rw-r--r-- 7,037 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2020 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<org.chromium.components.messages.MessageBannerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_gravity="center_horizontal"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content">

    <org.chromium.components.browser_ui.widget.BoundedLinearLayout
        android:id="@+id/message_banner"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_centerHorizontal="true"
        android:minHeight="@dimen/message_banner_main_content_height"
        android:layout_gravity="center_horizontal"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:elevation="@dimen/message_banner_elevation"
        app:maxWidthPortrait="@dimen/message_max_width"
        app:maxWidthLandscape="@dimen/message_max_width"
        android:background="@drawable/message_bg_tinted"
        android:layout_marginTop="@dimen/message_shadow_top_margin"
        android:layout_marginBottom="@dimen/message_shadow_bottom_margin"
        android:layout_marginStart="@dimen/message_shadow_lateral_margin"
        android:layout_marginEnd="@dimen/message_shadow_lateral_margin" >

        <ImageView
            android:id="@+id/message_icon"
            app:tint="@macro/default_icon_color_accent1"
            android:layout_marginHorizontal="@dimen/message_icon_margin"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/message_icon_size"
            android:scaleType="fitCenter"
            android:adjustViewBounds="true"
            android:importantForAccessibility="no" />

        <LinearLayout
            android:id="@+id/message_main_content"
            android:animateLayoutChanges="true"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:layout_gravity="center_vertical"
            android:orientation="vertical"
            android:layout_height="wrap_content"
            android:paddingTop="@dimen/message_banner_vertical_padding"
            android:paddingBottom="@dimen/message_banner_vertical_padding">

            <TextView
                android:id="@+id/message_title"
                style="@style/TextAppearance.TextLarge.Primary"
                android:textDirection="locale"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
            <org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables
                android:id="@+id/message_description"
                style="@style/TextAppearance.TextSmall.Secondary"
                android:visibility="gone"
                android:breakStrategy="simple"
                android:textDirection="locale"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:drawablePadding="@dimen/message_description_icon_padding"
                app:drawableWidth="@dimen/message_description_icon_size"
                app:drawableHeight="@dimen/message_description_icon_size"/>
        </LinearLayout>

        <!--  Content description is set programmatically according to secondary button icon. -->
        <org.chromium.ui.listmenu.ListMenuButton
            android:id="@+id/message_secondary_button"
            app:tint="@macro/default_icon_color_secondary"
            app:menuVerticalOverlapAnchor="false"
            android:visibility="gone"
            android:contentDescription="@null"
            android:accessibilityTraversalAfter="@id/message_primary_button"
            android:background="?actionBarItemBackground"
            android:layout_width="@dimen/min_touch_target_size"
            android:layout_height="@dimen/min_touch_target_size" />

        <ImageView
            android:id="@+id/message_divider"
            android:layout_marginTop="@dimen/message_divider_margin"
            android:layout_marginBottom="@dimen/message_divider_margin"
            android:background="@drawable/divider_line_bg"
            android:visibility="gone"
            android:importantForAccessibility="no"
            android:layout_width="1dp"
            android:layout_height="24dp" />

        <!-- TODO(crbug.com/415025020): Maybe migrate to MoreProgressButton -->
        <FrameLayout
            android:minWidth="@dimen/button_min_width"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <org.chromium.ui.widget.ButtonCompat
                style="@style/TextButton"
                android:id="@+id/message_primary_button"
                app:verticalInset="0dp"
                app:rippleCornerRadiusTopStart="0dp"
                app:rippleCornerRadiusBottomStart="0dp"
                app:rippleCornerRadiusBottomEnd="@dimen/message_banner_radius"
                app:rippleCornerRadiusTopEnd="@dimen/message_banner_radius"
                android:maxWidth="@dimen/message_primary_button_max_width"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:visibility="gone" />

            <com.google.android.material.progressindicator.CircularProgressIndicator
                android:id="@+id/message_primary_progress_indicator"
                android:layout_width="@dimen/message_progress_indicator_size"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:indeterminate="true"
                android:visibility="gone"/>
        </FrameLayout>
    </org.chromium.components.browser_ui.widget.BoundedLinearLayout>

    <org.chromium.ui.widget.ChromeImageButton
        android:id="@+id/message_close_button"
        android:clickable="true"
        android:gravity="center"
        android:src="@drawable/btn_close"
        android:scaleType="fitCenter"
        android:contentDescription="@string/close"
        android:visibility="gone"
        android:translationX="@dimen/message_close_button_translation"
        android:elevation="@dimen/message_banner_elevation"
        android:layout_alignEnd="@id/message_banner"
        android:layout_alignParentTop="true"
        android:layout_marginTop="@dimen/message_close_button_top_margin"
        android:background="@drawable/message_close_button_bg"
        android:layout_width="@dimen/message_close_button_size"
        android:layout_height="@dimen/message_close_button_size"
        android:padding="@dimen/message_close_button_padding"
        app:tint="@color/default_icon_color_tint_list"
        />

</org.chromium.components.messages.MessageBannerView>