mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
adding some keyboard hiding
This commit is contained in:
parent
d671c4503a
commit
45c5ac9fe8
6 changed files with 17 additions and 4 deletions
|
@ -485,6 +485,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchSearchActivity() {
|
private fun launchSearchActivity() {
|
||||||
|
hideKeyboard()
|
||||||
Intent(this, SearchActivity::class.java).apply {
|
Intent(this, SearchActivity::class.java).apply {
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
}
|
}
|
||||||
|
@ -522,6 +523,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
if (mIsThirdPartyIntent) {
|
if (mIsThirdPartyIntent) {
|
||||||
handleMediaIntent(this)
|
handleMediaIntent(this)
|
||||||
} else {
|
} else {
|
||||||
|
hideKeyboard()
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
@ -835,6 +837,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleMediaIntent(intent: Intent) {
|
private fun handleMediaIntent(intent: Intent) {
|
||||||
|
hideKeyboard()
|
||||||
intent.apply {
|
intent.apply {
|
||||||
if (mIsSetWallpaperIntent) {
|
if (mIsSetWallpaperIntent) {
|
||||||
putExtra(SET_WALLPAPER_INTENT, true)
|
putExtra(SET_WALLPAPER_INTENT, true)
|
||||||
|
|
|
@ -288,6 +288,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
|
|
||||||
private fun startSlideshow() {
|
private fun startSlideshow() {
|
||||||
if (mMedia.isNotEmpty()) {
|
if (mMedia.isNotEmpty()) {
|
||||||
|
hideKeyboard()
|
||||||
Intent(this, ViewPagerActivity::class.java).apply {
|
Intent(this, ViewPagerActivity::class.java).apply {
|
||||||
val item = mMedia.firstOrNull { it is Medium } as? Medium ?: return
|
val item = mMedia.firstOrNull { it is Medium } as? Medium ?: return
|
||||||
putExtra(SKIP_AUTHENTICATION, shouldSkipAuthentication())
|
putExtra(SKIP_AUTHENTICATION, shouldSkipAuthentication())
|
||||||
|
@ -514,6 +515,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun switchToFolderView() {
|
private fun switchToFolderView() {
|
||||||
|
hideKeyboard()
|
||||||
config.showAll = false
|
config.showAll = false
|
||||||
startActivity(Intent(this, MainActivity::class.java))
|
startActivity(Intent(this, MainActivity::class.java))
|
||||||
finish()
|
finish()
|
||||||
|
@ -770,6 +772,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun itemClicked(path: String) {
|
private fun itemClicked(path: String) {
|
||||||
|
hideKeyboard()
|
||||||
if (isSetWallpaperIntent()) {
|
if (isSetWallpaperIntent()) {
|
||||||
toast(R.string.setting_wallpaper)
|
toast(R.string.setting_wallpaper)
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
|
|
||||||
private fun checkIntent(savedInstanceState: Bundle? = null) {
|
private fun checkIntent(savedInstanceState: Bundle? = null) {
|
||||||
if (intent.data == null && intent.action == Intent.ACTION_VIEW) {
|
if (intent.data == null && intent.action == Intent.ACTION_VIEW) {
|
||||||
|
hideKeyboard()
|
||||||
startActivity(Intent(this, MainActivity::class.java))
|
startActivity(Intent(this, MainActivity::class.java))
|
||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
|
@ -198,6 +199,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
} catch (ignored: OutOfMemoryError) {
|
} catch (ignored: OutOfMemoryError) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hideKeyboard()
|
||||||
if (isPanorama) {
|
if (isPanorama) {
|
||||||
Intent(applicationContext, PanoramaVideoActivity::class.java).apply {
|
Intent(applicationContext, PanoramaVideoActivity::class.java).apply {
|
||||||
putExtra(PATH, realPath)
|
putExtra(PATH, realPath)
|
||||||
|
@ -224,6 +226,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun sendViewPagerIntent(path: String) {
|
private fun sendViewPagerIntent(path: String) {
|
||||||
|
hideKeyboard()
|
||||||
Intent(this, ViewPagerActivity::class.java).apply {
|
Intent(this, ViewPagerActivity::class.java).apply {
|
||||||
putExtra(SKIP_AUTHENTICATION, intent.getBooleanExtra(SKIP_AUTHENTICATION, false))
|
putExtra(SKIP_AUTHENTICATION, intent.getBooleanExtra(SKIP_AUTHENTICATION, false))
|
||||||
putExtra(SHOW_FAVORITES, intent.getBooleanExtra(SHOW_FAVORITES, false))
|
putExtra(SHOW_FAVORITES, intent.getBooleanExtra(SHOW_FAVORITES, false))
|
||||||
|
|
|
@ -1261,6 +1261,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun launchViewVideoIntent(path: String) {
|
override fun launchViewVideoIntent(path: String) {
|
||||||
|
hideKeyboard()
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val newUri = getFinalUriFromPath(path, BuildConfig.APPLICATION_ID) ?: return@ensureBackgroundThread
|
val newUri = getFinalUriFromPath(path, BuildConfig.APPLICATION_ID) ?: return@ensureBackgroundThread
|
||||||
val mimeType = getUriMimeType(path, newUri)
|
val mimeType = getUriMimeType(path, newUri)
|
||||||
|
|
|
@ -31,6 +31,7 @@ import com.simplemobiletools.commons.models.FAQItem
|
||||||
import com.simplemobiletools.commons.models.FileDirItem
|
import com.simplemobiletools.commons.models.FileDirItem
|
||||||
import com.simplemobiletools.gallery.pro.BuildConfig
|
import com.simplemobiletools.gallery.pro.BuildConfig
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
|
import com.simplemobiletools.gallery.pro.activities.SettingsActivity
|
||||||
import com.simplemobiletools.gallery.pro.activities.SimpleActivity
|
import com.simplemobiletools.gallery.pro.activities.SimpleActivity
|
||||||
import com.simplemobiletools.gallery.pro.dialogs.PickDirectoryDialog
|
import com.simplemobiletools.gallery.pro.dialogs.PickDirectoryDialog
|
||||||
import com.simplemobiletools.gallery.pro.helpers.RECYCLE_BIN
|
import com.simplemobiletools.gallery.pro.helpers.RECYCLE_BIN
|
||||||
|
@ -77,6 +78,11 @@ fun Activity.launchCamera() {
|
||||||
launchActivityIntent(intent)
|
launchActivityIntent(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun SimpleActivity.launchSettings() {
|
||||||
|
hideKeyboard()
|
||||||
|
startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
||||||
|
}
|
||||||
|
|
||||||
fun SimpleActivity.launchAbout() {
|
fun SimpleActivity.launchAbout() {
|
||||||
val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or
|
val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or
|
||||||
LICENSE_PICASSO or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS or LICENSE_GESTURE_VIEWS or
|
LICENSE_PICASSO or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS or LICENSE_GESTURE_VIEWS or
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simplemobiletools.gallery.pro.extensions
|
package com.simplemobiletools.gallery.pro.extensions
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.appwidget.AppWidgetManager
|
import android.appwidget.AppWidgetManager
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
@ -55,10 +56,6 @@ fun Context.getHumanizedFilename(path: String): String {
|
||||||
return humanized.substring(humanized.lastIndexOf("/") + 1)
|
return humanized.substring(humanized.lastIndexOf("/") + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.launchSettings() {
|
|
||||||
startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
|
||||||
}
|
|
||||||
|
|
||||||
val Context.config: Config get() = Config.newInstance(applicationContext)
|
val Context.config: Config get() = Config.newInstance(applicationContext)
|
||||||
|
|
||||||
val Context.widgetsDB: WidgetsDao get() = GalleryDatabase.getInstance(applicationContext).WidgetsDao()
|
val Context.widgetsDB: WidgetsDao get() = GalleryDatabase.getInstance(applicationContext).WidgetsDao()
|
||||||
|
|
Loading…
Reference in a new issue