allow adding a Copy button to the bottom actions
This commit is contained in:
parent
2737a44646
commit
635b8b893e
6 changed files with 31 additions and 2 deletions
|
@ -240,7 +240,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
|
|
||||||
private fun initBottomActionButtons() {
|
private fun initBottomActionButtons() {
|
||||||
arrayListOf(bottom_favorite, bottom_delete, bottom_rotate, bottom_properties, bottom_change_orientation, bottom_slideshow, bottom_show_on_map,
|
arrayListOf(bottom_favorite, bottom_delete, bottom_rotate, bottom_properties, bottom_change_orientation, bottom_slideshow, bottom_show_on_map,
|
||||||
bottom_toggle_file_visibility, bottom_rename).forEach {
|
bottom_toggle_file_visibility, bottom_rename, bottom_copy).forEach {
|
||||||
it.beGone()
|
it.beGone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
findItem(R.id.menu_rename).isVisible = visibleBottomActions and BOTTOM_ACTION_RENAME == 0 && !currentMedium.getIsInRecycleBin()
|
findItem(R.id.menu_rename).isVisible = visibleBottomActions and BOTTOM_ACTION_RENAME == 0 && !currentMedium.getIsInRecycleBin()
|
||||||
findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() && visibleBottomActions and BOTTOM_ACTION_ROTATE == 0
|
findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() && visibleBottomActions and BOTTOM_ACTION_ROTATE == 0
|
||||||
findItem(R.id.menu_set_as).isVisible = visibleBottomActions and BOTTOM_ACTION_SET_AS == 0
|
findItem(R.id.menu_set_as).isVisible = visibleBottomActions and BOTTOM_ACTION_SET_AS == 0
|
||||||
|
findItem(R.id.menu_copy_to).isVisible = visibleBottomActions and BOTTOM_ACTION_COPY == 0
|
||||||
findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0
|
findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0
|
||||||
findItem(R.id.menu_hide).isVisible = !currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin()
|
findItem(R.id.menu_hide).isVisible = !currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin()
|
||||||
findItem(R.id.menu_unhide).isVisible = currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin()
|
findItem(R.id.menu_unhide).isVisible = currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin()
|
||||||
|
@ -863,6 +864,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
bottom_set_as.setOnClickListener {
|
bottom_set_as.setOnClickListener {
|
||||||
setAs(getCurrentPath())
|
setAs(getCurrentPath())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bottom_copy.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_COPY != 0)
|
||||||
|
bottom_copy.setOnClickListener {
|
||||||
|
copyMoveTo(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateBottomActionIcons(medium: Medium?) {
|
private fun updateBottomActionIcons(medium: Medium?) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ class ManageBottomActionsDialog(val activity: BaseSimpleActivity, val callback:
|
||||||
manage_bottom_actions_toggle_visibility.isChecked = actions and BOTTOM_ACTION_TOGGLE_VISIBILITY != 0
|
manage_bottom_actions_toggle_visibility.isChecked = actions and BOTTOM_ACTION_TOGGLE_VISIBILITY != 0
|
||||||
manage_bottom_actions_rename.isChecked = actions and BOTTOM_ACTION_RENAME != 0
|
manage_bottom_actions_rename.isChecked = actions and BOTTOM_ACTION_RENAME != 0
|
||||||
manage_bottom_actions_set_as.isChecked = actions and BOTTOM_ACTION_SET_AS != 0
|
manage_bottom_actions_set_as.isChecked = actions and BOTTOM_ACTION_SET_AS != 0
|
||||||
|
manage_bottom_actions_copy.isChecked = actions and BOTTOM_ACTION_COPY != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
AlertDialog.Builder(activity)
|
||||||
|
@ -63,6 +64,8 @@ class ManageBottomActionsDialog(val activity: BaseSimpleActivity, val callback:
|
||||||
result += BOTTOM_ACTION_RENAME
|
result += BOTTOM_ACTION_RENAME
|
||||||
if (manage_bottom_actions_set_as.isChecked)
|
if (manage_bottom_actions_set_as.isChecked)
|
||||||
result += BOTTOM_ACTION_SET_AS
|
result += BOTTOM_ACTION_SET_AS
|
||||||
|
if (manage_bottom_actions_copy.isChecked)
|
||||||
|
result += BOTTOM_ACTION_COPY
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.config.visibleBottomActions = result
|
activity.config.visibleBottomActions = result
|
||||||
|
|
|
@ -164,6 +164,7 @@ const val BOTTOM_ACTION_SHOW_ON_MAP = 256
|
||||||
const val BOTTOM_ACTION_TOGGLE_VISIBILITY = 512
|
const val BOTTOM_ACTION_TOGGLE_VISIBILITY = 512
|
||||||
const val BOTTOM_ACTION_RENAME = 1024
|
const val BOTTOM_ACTION_RENAME = 1024
|
||||||
const val BOTTOM_ACTION_SET_AS = 2048
|
const val BOTTOM_ACTION_SET_AS = 2048
|
||||||
|
const val BOTTOM_ACTION_COPY = 4096
|
||||||
|
|
||||||
const val DEFAULT_BOTTOM_ACTIONS = BOTTOM_ACTION_TOGGLE_FAVORITE or BOTTOM_ACTION_EDIT or BOTTOM_ACTION_SHARE or BOTTOM_ACTION_DELETE
|
const val DEFAULT_BOTTOM_ACTIONS = BOTTOM_ACTION_TOGGLE_FAVORITE or BOTTOM_ACTION_EDIT or BOTTOM_ACTION_SHARE or BOTTOM_ACTION_DELETE
|
||||||
|
|
||||||
|
|
|
@ -137,8 +137,19 @@
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:padding="@dimen/medium_margin"
|
android:padding="@dimen/medium_margin"
|
||||||
android:src="@drawable/ic_set_as"
|
android:src="@drawable/ic_set_as"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="@+id/bottom_copy"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toEndOf="@+id/bottom_rename"/>
|
app:layout_constraintStart_toEndOf="@+id/bottom_rename"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/bottom_copy"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
|
android:padding="@dimen/medium_margin"
|
||||||
|
android:src="@drawable/ic_copy"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/bottom_set_as"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
|
@ -110,5 +110,13 @@
|
||||||
android:paddingBottom="@dimen/activity_margin"
|
android:paddingBottom="@dimen/activity_margin"
|
||||||
android:text="@string/set_as"/>
|
android:text="@string/set_as"/>
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
android:id="@+id/manage_bottom_actions_copy"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/activity_margin"
|
||||||
|
android:text="@string/copy"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
Loading…
Reference in a new issue