|
2 | 2 | <!-- |
3 | 3 | Layout principal de l'activité. |
4 | 4 | Remplace la BottomNavigationView par une top-bar fixe avec : |
5 | | - • Logo "MG4Control" |
6 | | - • Indicateur firmware read-only (chip SWI133 / chip SWI68) |
| 5 | + • Logo "MG4Control", sur sa plaque |
7 | 6 | • Onglets, dans l'ordre : PROFILS, AUTOMATISATION, RACCOURCIS, STATISTIQUES, RÉGLAGES |
| 7 | + Les cinq onglets se partagent à parts égales toute la largeur laissée par le logo : ce sont |
| 8 | + les cibles tactiles les plus sollicitées de l'application, autant qu'elles soient grandes. |
8 | 9 | La zone de contenu en dessous est gérée par le NavController. |
9 | 10 | --> |
10 | 11 | <LinearLayout |
|
21 | 22 | android:layout_height="52dp" |
22 | 23 | android:orientation="horizontal" |
23 | 24 | android:gravity="center_vertical" |
24 | | - android:paddingStart="20dp" |
| 25 | + android:paddingStart="12dp" |
25 | 26 | android:paddingEnd="12dp" |
26 | 27 | android:background="@color/dash_card" |
27 | 28 | android:elevation="4dp"> |
28 | 29 |
|
29 | | - <!-- Logo image --> |
| 30 | + <!-- |
| 31 | + Logo image. Les lettres "MG" sont blanches : en thème clair la plaque sombre les fait |
| 32 | + ressortir sur la barre blanche, en thème sombre elle est transparente. Même hauteur |
| 33 | + que les onglets ; la marge verticale garde l'image à ses 36dp. |
| 34 | + --> |
30 | 35 | <ImageView |
31 | 36 | android:id="@+id/topbar_logo" |
32 | | - android:layout_width="0dp" |
33 | | - android:layout_height="36dp" |
34 | | - android:layout_weight="1" |
| 37 | + android:layout_width="wrap_content" |
| 38 | + android:layout_height="44dp" |
| 39 | + android:layout_marginEnd="8dp" |
| 40 | + android:paddingTop="4dp" |
| 41 | + android:paddingBottom="4dp" |
35 | 42 | android:src="@drawable/logo_topbar" |
36 | | - android:background="@drawable/gradient_logo_bg" |
| 43 | + android:background="@drawable/bg_logo_plate" |
37 | 44 | android:scaleType="fitStart" |
38 | 45 | android:adjustViewBounds="true" |
39 | 46 | android:contentDescription="@string/app_name" /> |
40 | 47 |
|
| 48 | + <!-- |
| 49 | + Onglets : même police qu'avant, à 16sp comme le reste de l'application. Les marges |
| 50 | + internes par défaut du bouton (6dp en haut et en bas) sont retirées pour que la plaque |
| 51 | + fasse réellement 44dp dans la barre de 52dp. Un libellé trop long pour sa part de |
| 52 | + largeur (langue, taille de texte) rétrécit au lieu d'être coupé. |
| 53 | + --> |
41 | 54 |
|
42 | 55 | <!-- Bouton PROFILS --> |
43 | 56 | <com.google.android.material.button.MaterialButton |
44 | 57 | android:id="@+id/btn_nav_profiles" |
45 | | - android:layout_width="wrap_content" |
46 | | - android:layout_height="36dp" |
| 58 | + android:layout_width="0dp" |
| 59 | + android:layout_height="44dp" |
| 60 | + android:layout_weight="1" |
| 61 | + android:insetTop="0dp" |
| 62 | + android:insetBottom="0dp" |
| 63 | + android:paddingStart="4dp" |
| 64 | + android:paddingEnd="4dp" |
| 65 | + android:maxLines="1" |
47 | 66 | android:text="@string/nav_profiles" |
48 | | - android:textSize="11sp" |
| 67 | + android:textSize="16sp" |
| 68 | + app:autoSizeTextType="uniform" |
| 69 | + app:autoSizeMinTextSize="11sp" |
| 70 | + app:autoSizeMaxTextSize="16sp" |
| 71 | + app:autoSizeStepGranularity="1sp" |
49 | 72 | android:letterSpacing="0.06" |
50 | 73 | android:textAllCaps="true" |
51 | 74 | android:textColor="@color/text_secondary" |
|
58 | 81 | <!-- Bouton AUTOMATISATION --> |
59 | 82 | <com.google.android.material.button.MaterialButton |
60 | 83 | android:id="@+id/btn_nav_automation" |
61 | | - android:layout_width="wrap_content" |
62 | | - android:layout_height="36dp" |
| 84 | + android:layout_width="0dp" |
| 85 | + android:layout_height="44dp" |
| 86 | + android:layout_weight="1" |
| 87 | + android:insetTop="0dp" |
| 88 | + android:insetBottom="0dp" |
| 89 | + android:paddingStart="4dp" |
| 90 | + android:paddingEnd="4dp" |
| 91 | + android:maxLines="1" |
63 | 92 | android:text="@string/nav_automation" |
64 | | - android:textSize="11sp" |
| 93 | + android:textSize="16sp" |
| 94 | + app:autoSizeTextType="uniform" |
| 95 | + app:autoSizeMinTextSize="11sp" |
| 96 | + app:autoSizeMaxTextSize="16sp" |
| 97 | + app:autoSizeStepGranularity="1sp" |
65 | 98 | android:letterSpacing="0.06" |
66 | 99 | android:textAllCaps="true" |
67 | 100 | android:textColor="@color/text_secondary" |
|
74 | 107 | <!-- Bouton RACCOURCIS --> |
75 | 108 | <com.google.android.material.button.MaterialButton |
76 | 109 | android:id="@+id/btn_nav_shortcuts" |
77 | | - android:layout_width="wrap_content" |
78 | | - android:layout_height="36dp" |
| 110 | + android:layout_width="0dp" |
| 111 | + android:layout_height="44dp" |
| 112 | + android:layout_weight="1" |
| 113 | + android:insetTop="0dp" |
| 114 | + android:insetBottom="0dp" |
| 115 | + android:paddingStart="4dp" |
| 116 | + android:paddingEnd="4dp" |
| 117 | + android:maxLines="1" |
79 | 118 | android:text="@string/nav_shortcuts" |
80 | | - android:textSize="11sp" |
| 119 | + android:textSize="16sp" |
| 120 | + app:autoSizeTextType="uniform" |
| 121 | + app:autoSizeMinTextSize="11sp" |
| 122 | + app:autoSizeMaxTextSize="16sp" |
| 123 | + app:autoSizeStepGranularity="1sp" |
81 | 124 | android:letterSpacing="0.06" |
82 | 125 | android:textAllCaps="true" |
83 | 126 | android:textColor="@color/text_secondary" |
|
90 | 133 | <!-- Bouton STATISTIQUES --> |
91 | 134 | <com.google.android.material.button.MaterialButton |
92 | 135 | android:id="@+id/btn_nav_stats" |
93 | | - android:layout_width="wrap_content" |
94 | | - android:layout_height="36dp" |
| 136 | + android:layout_width="0dp" |
| 137 | + android:layout_height="44dp" |
| 138 | + android:layout_weight="1" |
| 139 | + android:insetTop="0dp" |
| 140 | + android:insetBottom="0dp" |
| 141 | + android:paddingStart="4dp" |
| 142 | + android:paddingEnd="4dp" |
| 143 | + android:maxLines="1" |
95 | 144 | android:text="@string/nav_stats" |
96 | | - android:textSize="11sp" |
| 145 | + android:textSize="16sp" |
| 146 | + app:autoSizeTextType="uniform" |
| 147 | + app:autoSizeMinTextSize="11sp" |
| 148 | + app:autoSizeMaxTextSize="16sp" |
| 149 | + app:autoSizeStepGranularity="1sp" |
97 | 150 | android:letterSpacing="0.06" |
98 | 151 | android:textAllCaps="true" |
99 | 152 | android:textColor="@color/text_secondary" |
|
106 | 159 | <!-- Bouton RÉGLAGES --> |
107 | 160 | <com.google.android.material.button.MaterialButton |
108 | 161 | android:id="@+id/btn_nav_settings" |
109 | | - android:layout_width="wrap_content" |
110 | | - android:layout_height="36dp" |
| 162 | + android:layout_width="0dp" |
| 163 | + android:layout_height="44dp" |
| 164 | + android:layout_weight="1" |
| 165 | + android:insetTop="0dp" |
| 166 | + android:insetBottom="0dp" |
| 167 | + android:paddingStart="4dp" |
| 168 | + android:paddingEnd="4dp" |
| 169 | + android:maxLines="1" |
111 | 170 | android:text="@string/nav_settings" |
112 | | - android:textSize="11sp" |
| 171 | + android:textSize="16sp" |
| 172 | + app:autoSizeTextType="uniform" |
| 173 | + app:autoSizeMinTextSize="11sp" |
| 174 | + app:autoSizeMaxTextSize="16sp" |
| 175 | + app:autoSizeStepGranularity="1sp" |
113 | 176 | android:letterSpacing="0.06" |
114 | 177 | android:textAllCaps="true" |
115 | 178 | android:textColor="@color/text_secondary" |
|
0 commit comments