[fenix] For https://github.com/mozilla-mobile/fenix/issues/11112 - Adds save tabs to collection button to the no collections message
parent
1059f33dca
commit
2f786409d5
@ -0,0 +1,26 @@
|
|||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
package org.mozilla.fenix.home.sessioncontrol.viewholders
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import kotlinx.android.synthetic.main.no_collections_message.view.*
|
||||||
|
import org.mozilla.fenix.R
|
||||||
|
import org.mozilla.fenix.ext.ViewHolder
|
||||||
|
import org.mozilla.fenix.home.sessioncontrol.CollectionInteractor
|
||||||
|
|
||||||
|
open class NoCollectionsMessageViewHolder(
|
||||||
|
view: View,
|
||||||
|
interactor: CollectionInteractor
|
||||||
|
) : ViewHolder(view) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
view.add_tabs_to_collections_button.setOnClickListener {
|
||||||
|
interactor.onAddTabsToCollectionTapped()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
companion object {
|
||||||
|
const val LAYOUT_ID = R.layout.no_collections_message
|
||||||
|
}
|
||||||
|
}
|
@ -1,28 +0,0 @@
|
|||||||
/* 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/. */
|
|
||||||
|
|
||||||
package org.mozilla.fenix.home.sessioncontrol.viewholders
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import androidx.annotation.StringRes
|
|
||||||
import kotlinx.android.synthetic.main.no_content_message.*
|
|
||||||
import org.mozilla.fenix.R
|
|
||||||
import org.mozilla.fenix.ext.ViewHolder
|
|
||||||
|
|
||||||
open class NoContentMessageViewHolder(view: View) : ViewHolder(view) {
|
|
||||||
|
|
||||||
fun bind(
|
|
||||||
@StringRes header: Int,
|
|
||||||
@StringRes description: Int
|
|
||||||
) {
|
|
||||||
with(itemView.context) {
|
|
||||||
no_content_header.text = getString(header)
|
|
||||||
no_content_description.text = getString(description)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
const val LAYOUT_ID = R.layout.no_content_message
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-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"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/no_collections_wrapper"
|
||||||
|
android:background="@drawable/empty_session_control_background"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/no_collections_header"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/no_collections_header1"
|
||||||
|
tools:drawableEnd="@drawable/ic_tab_collection"
|
||||||
|
android:textAppearance="@style/HeaderTextStyle"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:fontFamily="@font/metropolis_semibold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/no_collections_description"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="@string/no_collections_description1"
|
||||||
|
android:textColor="?primaryText"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
app:fontFamily="@font/metropolis_medium" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/add_tabs_to_collections_button"
|
||||||
|
style="@style/PositiveButton"
|
||||||
|
app:icon="@drawable/ic_tab_collection"
|
||||||
|
android:text="@string/tabs_menu_save_to_collection1"
|
||||||
|
android:layout_marginTop="8dp"/>
|
||||||
|
</LinearLayout>
|
@ -1,38 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-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"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/no_content_wrapper"
|
|
||||||
android:background="@drawable/empty_session_control_background"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/no_content_header"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@tools:sample/lorem"
|
|
||||||
tools:drawableEnd="@drawable/ic_tab_collection"
|
|
||||||
android:textAppearance="@style/HeaderTextStyle"
|
|
||||||
android:textSize="16sp"
|
|
||||||
app:fontFamily="@font/metropolis_semibold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/no_content_description"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
tools:text="@tools:sample/lorem"
|
|
||||||
android:textColor="?primaryText"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
app:fontFamily="@font/metropolis_medium" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -1,44 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-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"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/no_content_wrapper"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:background="@drawable/empty_session_control_background"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="8dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/no_content_header"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:textAppearance="@style/HeaderTextStyle"
|
|
||||||
android:textSize="16sp"
|
|
||||||
tools:text="@tools:sample/lorem" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/no_content_description"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?primaryText"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="normal"
|
|
||||||
tools:text="@tools:sample/lorem" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/add_new_tab_button"
|
|
||||||
style="@style/NeutralButton"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:icon="@drawable/ic_new"
|
|
||||||
tools:text="@string/home_screen_shortcut_open_new_tab_2"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
</LinearLayout>
|
|
Loading…
Reference in New Issue