add a toggle for replacing Share with Rotate at fullscreen media

This commit is contained in:
tibbi 2017-07-09 20:34:14 +02:00
parent dfb382adeb
commit 9ea9c77294
22 changed files with 55 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class SettingsActivity : SimpleActivity() {
setupDarkBackground()
setupScrollHorizontally()
setupScreenRotation()
setupReplaceShare()
setupShowMedia()
setupHideSystemUI()
updateTextColors(settings_holder)
@ -130,6 +131,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupReplaceShare() {
settings_replace_share.isChecked = config.replaceShare
settings_replace_share_holder.setOnClickListener {
settings_replace_share.toggle()
config.replaceShare = settings_replace_share.isChecked
}
}
private fun setupScreenRotation() {
settings_screen_rotation.text = getScreenRotationText()
settings_screen_rotation_holder.setOnClickListener {

View File

@ -179,6 +179,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} else if (config.screenRotation == ROTATE_BY_SYSTEM_SETTING) {
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
}
invalidateOptionsMenu()
}
override fun onPause() {
@ -191,6 +193,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val currentMedium = getCurrentMedium() ?: return true
menu.apply {
findItem(R.id.menu_share_1).isVisible = !config.replaceShare
findItem(R.id.menu_share_2).isVisible = config.replaceShare
findItem(R.id.menu_set_as).isVisible = currentMedium.isImage()
findItem(R.id.menu_edit).isVisible = currentMedium.isImage()
findItem(R.id.menu_rotate).isVisible = currentMedium.isImage()

View File

@ -228,4 +228,8 @@ class Config(context: Context) : BaseConfig(context) {
var hideSystemUI: Boolean
get() = prefs.getBoolean(HIDE_SYSTEM_UI, false)
set(hideSystemUI) = prefs.edit().putBoolean(HIDE_SYSTEM_UI, hideSystemUI).apply()
var replaceShare: Boolean
get() = prefs.getBoolean(REPLACE_SHARE_WITH_ROTATE, false)
set(replaceShare) = prefs.edit().putBoolean(REPLACE_SHARE_WITH_ROTATE, replaceShare).apply()
}

View File

@ -32,6 +32,7 @@ val INCLUDED_FOLDERS = "included_folders"
val ALBUM_COVERS = "album_covers"
val SCROLL_HORIZONTALLY = "scroll_horizontally"
val HIDE_SYSTEM_UI = "hide_system_ui"
val REPLACE_SHARE_WITH_ROTATE = "replace_share_with_rotate"
val NOMEDIA = ".nomedia"

View File

@ -248,6 +248,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_replace_share_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_replace_share"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/replace_share_with_rotate"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_screen_rotation_holder"
android:layout_width="match_parent"

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Schwarzer Hintergrund im Vollbild</string>
<string name="scroll_thumbnails_horizontally">Kacheln horizontal scrollen</string>
<string name="hide_system_ui_at_fullscreen">Systemleisten ausblenden im Vollbild</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Utilizar siempre fondo oscuro en pantalla completa</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Sfondo scuro a schermo intero</string>
<string name="scroll_thumbnails_horizontally">Scorri miniature orizzontalmente</string>
<string name="hide_system_ui_at_fullscreen">Nascondi UI di sistema con media a schermo intero</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Fundo de tela escuro em mídia tela cheia</string>
<string name="scroll_thumbnails_horizontally">Rolar miniaturas horizontalmente</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Usar sempre um fundo escuro se em ecrã completo</string>
<string name="scroll_thumbnails_horizontally">Deslocação horizontal de miniaturas</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Tmavé pozadie pri médiách na celú obrazovku</string>
<string name="scroll_thumbnails_horizontally">Prehliadať miniatúry vodorovne</string>
<string name="hide_system_ui_at_fullscreen">Automaticky skrývať systémové lišty pri celoobrazovkových médiách</string>
<string name="replace_share_with_rotate">Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Mörk bakgrund när media visas i helskärmsläge</string>
<string name="scroll_thumbnails_horizontally">Rulla horisontellt genom miniatyrer</string>
<string name="hide_system_ui_at_fullscreen">Dölj systemanvändargränssnittet automatiskt när media visas i helskärmsläge</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">全屏时黑色背景</string>
<string name="scroll_thumbnails_horizontally">水平滚动缩略图</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -100,6 +100,7 @@
<string name="dark_background_at_fullscreen">Dark background at fullscreen media</string>
<string name="scroll_thumbnails_horizontally">Scroll thumbnails horizontally</string>
<string name="hide_system_ui_at_fullscreen">Automatically hide system UI at fullscreen media</string>
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->