For #11860 - Conditionally show add to collection button on Home screen
parent
7b20bb9976
commit
77ed670558
|
@ -46,6 +46,7 @@ import com.google.android.material.appbar.AppBarLayout
|
|||
import com.google.android.material.snackbar.Snackbar
|
||||
import kotlinx.android.synthetic.main.fragment_home.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.*
|
||||
import kotlinx.android.synthetic.main.no_collections_message.view.*
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.Dispatchers.Main
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
|
@ -231,6 +232,11 @@ class HomeFragment : Fragment() {
|
|||
}
|
||||
|
||||
view.tab_button.setCountWithAnimation(tabCount)
|
||||
view.add_tabs_to_collections_button?.visibility = if (tabCount > 0) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
return view
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
android:id="@+id/add_tabs_to_collections_button"
|
||||
style="@style/PositiveButton"
|
||||
app:icon="@drawable/ic_tab_collection"
|
||||
android:visibility="gone"
|
||||
android:text="@string/tabs_menu_save_to_collection1"
|
||||
android:layout_marginTop="8dp"/>
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in New Issue