replace bottom actions Properties button with Add to favorites

This commit is contained in:
tibbi 2018-06-19 23:23:18 +02:00
parent 703aa7bbd1
commit 8270aaa2f2
3 changed files with 8 additions and 12 deletions

View file

@ -136,7 +136,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
menu.apply { menu.apply {
findItem(R.id.menu_set_as).isVisible = mMedium?.isImage() == true findItem(R.id.menu_set_as).isVisible = mMedium?.isImage() == true
findItem(R.id.menu_edit).isVisible = mMedium?.isImage() == true && mUri?.scheme == "file" && !config.bottomActions findItem(R.id.menu_edit).isVisible = mMedium?.isImage() == true && mUri?.scheme == "file" && !config.bottomActions
findItem(R.id.menu_properties).isVisible = mUri?.scheme == "file" && !config.bottomActions findItem(R.id.menu_properties).isVisible = mUri?.scheme == "file"
findItem(R.id.menu_share).isVisible = !config.bottomActions findItem(R.id.menu_share).isVisible = !config.bottomActions
} }
@ -178,9 +178,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
} }
private fun initBottomActionButtons() { private fun initBottomActionButtons() {
bottom_properties.setOnClickListener { bottom_favorite.beGone()
showProperties() bottom_delete.beGone()
}
bottom_edit.setOnClickListener { bottom_edit.setOnClickListener {
openEditor(mUri!!.toString()) openEditor(mUri!!.toString())
@ -189,8 +188,6 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
bottom_share.setOnClickListener { bottom_share.setOnClickListener {
sharePath(mUri!!.toString()) sharePath(mUri!!.toString())
} }
bottom_delete.beGone()
} }
override fun fragmentClicked() { override fun fragmentClicked() {

View file

@ -276,7 +276,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val currentMedium = getCurrentMedium() ?: return true val currentMedium = getCurrentMedium() ?: return true
menu.apply { menu.apply {
findItem(R.id.menu_properties).isVisible = !config.bottomActions
findItem(R.id.menu_delete).isVisible = !config.bottomActions findItem(R.id.menu_delete).isVisible = !config.bottomActions
findItem(R.id.menu_share).isVisible = !config.bottomActions findItem(R.id.menu_share).isVisible = !config.bottomActions
findItem(R.id.menu_edit).isVisible = !config.bottomActions findItem(R.id.menu_edit).isVisible = !config.bottomActions
@ -746,8 +745,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} }
private fun initBottomActionButtons() { private fun initBottomActionButtons() {
bottom_properties.setOnClickListener { bottom_favorite.setOnClickListener {
showProperties()
} }
bottom_edit.setOnClickListener { bottom_edit.setOnClickListener {

View file

@ -10,12 +10,12 @@
android:paddingTop="@dimen/medium_margin"> android:paddingTop="@dimen/medium_margin">
<ImageView <ImageView
android:id="@+id/bottom_properties" android:id="@+id/bottom_favorite"
style="@style/MyBorderlessBackgroundStyle" style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/medium_margin" android:padding="@dimen/medium_margin"
android:src="@drawable/ic_properties" android:src="@drawable/ic_star_off"
app:layout_constraintEnd_toStartOf="@+id/bottom_edit" app:layout_constraintEnd_toStartOf="@+id/bottom_edit"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/> app:layout_constraintStart_toStartOf="parent"/>
@ -29,7 +29,7 @@
android:src="@drawable/ic_edit" android:src="@drawable/ic_edit"
app:layout_constraintEnd_toStartOf="@+id/bottom_share" app:layout_constraintEnd_toStartOf="@+id/bottom_share"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/bottom_properties"/> app:layout_constraintStart_toEndOf="@+id/bottom_favorite"/>
<ImageView <ImageView
android:id="@+id/bottom_share" android:id="@+id/bottom_share"