1
0
Fork 0

For #11860 - Conditionally show add to collection button on Home screen

master
David Walsh 2020-06-24 12:59:06 -05:00 committed by Emily Kager
parent 7b20bb9976
commit 77ed670558
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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>