Merge pull request #14 from SimpleMobileTools/master

update
This commit is contained in:
solokot 2018-01-16 15:00:11 +03:00 committed by GitHub
commit 90e6fea4e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 81 additions and 22 deletions

View File

@ -157,6 +157,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
menu.apply {
findItem(R.id.hide_folder).isVisible = !isFolderHidden && !mShowAll
findItem(R.id.unhide_folder).isVisible = isFolderHidden && !mShowAll
findItem(R.id.exclude_folder).isVisible = !mShowAll
findItem(R.id.folder_view).isVisible = mShowAll
findItem(R.id.open_camera).isVisible = mShowAll
@ -262,7 +263,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
}
private fun setupAdapter() {
if (isDirEmpty()) {
if (!mShowAll && isDirEmpty()) {
return
}

View File

@ -57,6 +57,7 @@ class SettingsActivity : SimpleActivity() {
setupShowMediaCount()
setupKeepLastModified()
setupShowInfoBubble()
setupOneFingerZoom()
setupShowExtendedDetails()
setupManageExtendedDetails()
updateTextColors(settings_holder)
@ -272,27 +273,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupScreenRotation() {
settings_screen_rotation.text = getScreenRotationText()
settings_screen_rotation_holder.setOnClickListener {
val items = arrayListOf(
RadioItem(ROTATE_BY_SYSTEM_SETTING, res.getString(R.string.screen_rotation_system_setting)),
RadioItem(ROTATE_BY_DEVICE_ROTATION, res.getString(R.string.screen_rotation_device_rotation)),
RadioItem(ROTATE_BY_ASPECT_RATIO, res.getString(R.string.screen_rotation_aspect_ratio)))
RadioGroupDialog(this@SettingsActivity, items, config.screenRotation) {
config.screenRotation = it as Int
settings_screen_rotation.text = getScreenRotationText()
}
private fun setupOneFingerZoom() {
settings_one_finger_zoom.isChecked = config.oneFingerZoom
settings_one_finger_zoom_holder.setOnClickListener {
settings_one_finger_zoom.toggle()
config.oneFingerZoom = settings_one_finger_zoom.isChecked
}
}
private fun getScreenRotationText() = getString(when (config.screenRotation) {
ROTATE_BY_SYSTEM_SETTING -> R.string.screen_rotation_system_setting
ROTATE_BY_DEVICE_ROTATION -> R.string.screen_rotation_device_rotation
else -> R.string.screen_rotation_aspect_ratio
})
private fun setupShowExtendedDetails() {
settings_show_extended_details.isChecked = config.showExtendedDetails
settings_show_extended_details_holder.setOnClickListener {
@ -312,4 +300,25 @@ class SettingsActivity : SimpleActivity() {
}
}
}
private fun setupScreenRotation() {
settings_screen_rotation.text = getScreenRotationText()
settings_screen_rotation_holder.setOnClickListener {
val items = arrayListOf(
RadioItem(ROTATE_BY_SYSTEM_SETTING, res.getString(R.string.screen_rotation_system_setting)),
RadioItem(ROTATE_BY_DEVICE_ROTATION, res.getString(R.string.screen_rotation_device_rotation)),
RadioItem(ROTATE_BY_ASPECT_RATIO, res.getString(R.string.screen_rotation_aspect_ratio)))
RadioGroupDialog(this@SettingsActivity, items, config.screenRotation) {
config.screenRotation = it as Int
settings_screen_rotation.text = getScreenRotationText()
}
}
}
private fun getScreenRotationText() = getString(when (config.screenRotation) {
ROTATE_BY_SYSTEM_SETTING -> R.string.screen_rotation_system_setting
ROTATE_BY_DEVICE_ROTATION -> R.string.screen_rotation_device_rotation
else -> R.string.screen_rotation_aspect_ratio
})
}

View File

@ -246,7 +246,7 @@ class PhotoFragment : ViewPagerFragment() {
view.subsampling_view.apply {
maxScale = 10f
beVisible()
isQuickScaleEnabled = false
isQuickScaleEnabled = context.config.oneFingerZoom
setImage(ImageSource.uri(medium.path))
orientation = if (orient == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(orient)
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {

View File

@ -168,6 +168,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getInt(getDirectoryColumnsField(), getDefaultDirectoryColumnCount())
set(dirColumnCnt) = prefs.edit().putInt(getDirectoryColumnsField(), dirColumnCnt).apply()
var oneFingerZoom: Boolean
get() = prefs.getBoolean(ONE_FINGER_ZOOM, false)
set(oneFingerZoom) = prefs.edit().putBoolean(ONE_FINGER_ZOOM, oneFingerZoom).apply()
private fun getDirectoryColumnsField(): String {
val isPortrait = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
return if (isPortrait) {

View File

@ -43,6 +43,7 @@ val VIEW_TYPE_FILES = "view_type_files"
val SHOW_EXTENDED_DETAILS = "show_extended_details"
val EXTENDED_DETAILS = "extended_details"
val LAST_FILE_CLEANUP = "last_file_cleanup"
val ONE_FINGER_ZOOM = "one_finger_zoom"
// slideshow
val SLIDESHOW_INTERVAL = "slideshow_interval"

View File

@ -447,6 +447,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_one_finger_zoom_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_one_finger_zoom"
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/one_finger_zoom"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_extended_details_holder"
android:layout_width="match_parent"
@ -464,7 +484,6 @@
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/show_extended_details"/>
</RelativeLayout>
<RelativeLayout

View File

@ -135,6 +135,7 @@
<string name="replace_share_with_rotate">استبدال خيار المشاركة مع خيار تدوير في القائمة ملء الشاشة</string>
<string name="show_extended_details">عرض تفاصيل موسعة على وسائط ملء الشاشة</string>
<string name="manage_extended_details">إدارة المجلدات المستبعدة</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Reemplaçar Compartir per Girar al menú de pantalla complerta</string>
<string name="show_extended_details">Mostrar detalls estesos sobre mitjans a pantalla complerta</string>
<string name="manage_extended_details">Gestioneu els detalls ampliats</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Teilen/Drehen im Vollbild-Menü vertauschen</string>
<string name="show_extended_details">Eigenschaften anzeigen im Vollbild</string>
<string name="manage_extended_details">Eigenschaften auswählen</string>
<string name="one_finger_zoom">Erlaube Ein-Finger-Zoom im Vollbild</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Reemplazar Compartir con Girar en el menú de pantalla completa</string>
<string name="show_extended_details">Mostrar detalles extendidos sobre medios en pantalla completa</string>
<string name="manage_extended_details">Administrar detalles ampliados</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Korvaa jakaminen kääntämisellä koko näytön tilassa</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Remplacer Partager par Pivoter si menu en plein écran</string>
<string name="show_extended_details">Afficher les détails supplémentaires par dessus le média en plein écran</string>
<string name="manage_extended_details">Gérer les détails supplémentaires</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Substituír Compartir con Rotar no menú de pantalla completa</string>
<string name="show_extended_details">Mostrar información pormenorizada sobre medios a pantalla completa</string>
<string name="manage_extended_details">Xestionar información polo miúdo</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Zamjeni Dijeli s Rotiraj pri pregledu datoteka</string>
<string name="show_extended_details">Prikaži detaljne informacije pri pregledu datoteka</string>
<string name="manage_extended_details">Upravljaj detaljnim informacijama</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Sostituisci Condividi con Ruota a schermo intero</string>
<string name="show_extended_details">Mostra informazioni estese su media a schermo intero</string>
<string name="manage_extended_details">Gestisci le informazioni estese</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">フルスクリーンメニューの「共有」を「回転」に置き換える</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">전체화면 메뉴의 공유 아이콘을 회전 아이콘으로 변경</string>
<string name="show_extended_details">전체화면 모드에서 세부정보 표시</string>
<string name="manage_extended_details">확장된 세부정보 관리</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Erstatt Del med Roter i meny ved mediavisning</string>
<string name="show_extended_details">Vis flere detaljer i mediavisningen</string>
<string name="manage_extended_details">Velg detaljer</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Menu-item Draaien vastzetten in volledige weergave (in plaats van Delen)</string>
<string name="show_extended_details">Uitgebreide informatie tonen in volledige weergave</string>
<string name="manage_extended_details">Uitgebreide informatie</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Zamień funkcję udostępniania na obracanie w menu pełnoekranowym</string>
<string name="show_extended_details">Dodatkowe szczegóły przy podglądzie pełnoekranowym</string>
<string name="manage_extended_details">Zarządzaj dodatkowymi szczegółami</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Substituir botão "Compartilhar" por "Rotação de tela" quando em tela cheia</string>
<string name="show_extended_details">Exibir detalhes extendidos quando em tela cheia</string>
<string name="manage_extended_details">Gerenciar detalhes extendidos</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Substituir a opção Partilhar pela opção Rodar se em ecrã completo</string>
<string name="show_extended_details">Mostrar detalhes se em ecrã completo</string>
<string name="manage_extended_details">Gerir detalhes exibidos</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Заменить \"Поделиться\" на \"Повернуть\" в меню полноэкранного режима</string>
<string name="show_extended_details">Показывать детали файла</string>
<string name="manage_extended_details">Выбрать детали файла</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Nahradiť Zdieľanie s Otočením v celoobrazovkovom menu</string>
<string name="show_extended_details">Zobraziť rozšírené vlastnosti ponad celoobrazovkové médiá</string>
<string name="manage_extended_details">Spravovať rozšírené vlastnosti</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Ersätt Dela med Rotera i helskärmsmenyn</string>
<string name="show_extended_details">Visa utökad information över media i helskärmsläge</string>
<string name="manage_extended_details">Hantera utökad information</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -7,7 +7,7 @@
<string name="hidden">(隐藏)</string>
<string name="pin_folder">锁定目录</string>
<string name="unpin_folder">解除锁定目录</string>
<string name="pin_to_the_top">Pin to the top</string>
<string name="pin_to_the_top">锁定到顶部</string>
<string name="show_all">文件视图</string>
<string name="all_folders">所有目录</string>
<string name="folder_view">目录视图</string>
@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">替换全屏时菜单栏的“分享”为“旋转”</string>
<string name="show_extended_details">全屏浏览媒体时显示详细信息</string>
<string name="manage_extended_details">要显示的详细信息项目</string>
<string name="one_finger_zoom">单指缩放</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">將全螢幕選單的分享取代為旋轉</string>
<string name="show_extended_details">全螢幕時顯示詳細資訊</string>
<string name="manage_extended_details">管理詳細資訊</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

View File

@ -131,6 +131,7 @@
<string name="replace_share_with_rotate">Replace Share with Rotate at fullscreen menu</string>
<string name="show_extended_details">Show extended details over fullscreen media</string>
<string name="manage_extended_details">Manage extended details</string>
<string name="one_finger_zoom">Allow one finger zoom at fullscreen media</string>
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
<!-- Short description has to have less than 80 chars -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 KiB

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 242 KiB