forked from upstream-mirrors/quik
#1036 - Swipe between pictures
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
*/
|
||||
package com.moez.QKSMS.common
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.ActivityOptions
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
@@ -28,7 +26,6 @@ import android.os.Build
|
||||
import android.provider.ContactsContract
|
||||
import android.provider.Settings
|
||||
import android.provider.Telephony
|
||||
import android.view.View
|
||||
import com.moez.QKSMS.BuildConfig
|
||||
import com.moez.QKSMS.feature.backup.BackupActivity
|
||||
import com.moez.QKSMS.feature.blocked.BlockedActivity
|
||||
@@ -115,18 +112,6 @@ class Navigator @Inject constructor(
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the attachment full-screen
|
||||
* The transitionName for the view should be the id of the image being displayed
|
||||
*/
|
||||
fun showImageAnimated(from: Activity, view: View) {
|
||||
val intent = Intent(context, GalleryActivity::class.java)
|
||||
intent.putExtra("partId", view.transitionName.toLong())
|
||||
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(from, view, view.transitionName)
|
||||
from.startActivity(intent, options.toBundle())
|
||||
}
|
||||
|
||||
fun showBackup() {
|
||||
analyticsManager.track("Viewed Backup")
|
||||
startActivity(Intent(context, BackupActivity::class.java))
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
|
||||
var ViewGroup.animateLayoutChanges: Boolean
|
||||
get() = layoutTransition != null
|
||||
@@ -105,6 +106,14 @@ fun View.forwardTouches(parent: View) {
|
||||
}
|
||||
}
|
||||
|
||||
fun ViewPager.addOnPageChangeListener(listener: (Int) -> Unit) {
|
||||
addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
listener(position)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun RecyclerView.scrapViews() {
|
||||
val adapter = adapter
|
||||
val layoutManager = layoutManager
|
||||
|
||||
Reference in New Issue
Block a user