1
0
Fork 0

Use tools:text to avoid inflating strings twice (#3619)

master
Tiger Oakes 2019-07-15 18:01:37 -04:00 committed by Colin Lee
parent fd7ff58ab8
commit 7747d5c240
13 changed files with 268 additions and 257 deletions

View File

@ -6,8 +6,8 @@ package org.mozilla.fenix.exceptions
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.functions.Consumer
@ -22,9 +22,9 @@ class ExceptionsUIView(
) :
UIView<ExceptionsState, ExceptionsAction, ExceptionsChange>(container, actionEmitter, changesObservable) {
override val view: LinearLayout = LayoutInflater.from(container.context)
override val view: RecyclerView = LayoutInflater.from(container.context)
.inflate(R.layout.component_exceptions, container, true)
.findViewById(R.id.exceptions_wrapper)
.findViewById(R.id.exceptions_list)
init {
view.exceptions_list.apply {

View File

@ -10,7 +10,8 @@
android:gravity="center_vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="@color/sync_error_background_color">
android:background="@color/sync_error_background_color"
android:baselineAligned="false">
<FrameLayout
android:id="@+id/icon_frame"
@ -30,6 +31,7 @@
android:layout_marginStart="15dp"
android:layout_marginEnd="6dp"
android:paddingStart="16dp"
android:paddingEnd="0dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:layout_weight="1">

View File

@ -2,7 +2,8 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_collection"
@ -115,4 +116,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</FrameLayout>

View File

@ -2,10 +2,12 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/bookmark_list"
@ -14,7 +16,8 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/bookmark_row" />
<TextView
android:id="@+id/bookmarks_empty_view"
@ -25,4 +28,5 @@
android:textColor="?secondaryText"
android:textSize="16sp"
android:visibility="gone" />
</FrameLayout>

View File

@ -2,14 +2,10 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/exceptions_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/exceptions_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
android:layout_height="match_parent"
tools:listitem="@layout/exception_item"/>

View File

@ -2,9 +2,10 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/history_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -35,5 +36,6 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
tools:listitem="@layout/history_list_item"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -28,7 +28,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:text="@string/phone_feature_blocked_by_android_explanation"/>
tools:text="@string/phone_feature_blocked_by_android_explanation"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/settings_button"

View File

@ -19,6 +19,7 @@
android:layout_marginBottom="@dimen/library_item_icon_margin_vertical"
android:background="@drawable/library_icon_reading_list_circle_background"
android:clickable="false"
android:importantForAccessibility="no"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -54,6 +54,7 @@
android:layout_marginEnd="16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_close"
android:contentDescription="@string/history_delete_item"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -37,7 +37,7 @@
app:layout_constraintTop_toBottomOf="@id/wordmark"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="1.0.x (Build #x 🦎 69.x-x)\nAC: 1.0.0"
tools:text="1.0.x (Build #x)\nGV: 69.x-x\nAC: 1.0.0"
android:textAlignment="center" />
<TextView

View File

@ -2,8 +2,9 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/select_bookmark_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -13,6 +14,7 @@
android:id="@+id/recylerView_bookmark_folders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/bookmark_row"/>
</LinearLayout>

View File

@ -2,9 +2,9 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/site_permissions_exceptions_item_height"
android:background="?android:attr/selectableItemBackground"
@ -27,7 +27,8 @@
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="@dimen/site_permissions_exceptions_item_text_size"
android:textColor="?primaryText"/>
android:textColor="?primaryText"
tools:text="mozilla.com" />
</LinearLayout>

View File

@ -2,7 +2,8 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_tab"
android:layout_width="match_parent"