Implement share action
This commit is contained in:
@@ -32,10 +32,11 @@ class LawnchairOverviewActionsView @JvmOverloads constructor(
|
||||
|
||||
container = ViewCompat.requireViewById(this, R.id.action_buttons)
|
||||
clearAllAction = ViewCompat.requireViewById(this, R.id.action_clear_all)
|
||||
shareAction = ViewCompat.requireViewById(this, R.id.action_share)
|
||||
lensAction = ViewCompat.requireViewById(this, R.id.action_lens)
|
||||
screenshotAction = ViewCompat.requireViewById(this, R.id.action_screenshot)
|
||||
shareAction = ViewCompat.requireViewById(this, R.id.action_share)
|
||||
|
||||
|
||||
shareAction.setOnClickListener { mCallbacks?.onShare() }
|
||||
lensAction.setOnClickListener { mCallbacks?.onLens() }
|
||||
|
||||
prefs.recentsActionClearAll.subscribeChanges(this, ::updateVisibilities)
|
||||
|
||||
@@ -44,6 +44,14 @@ class TaskOverlayFactoryImpl(@Suppress("UNUSED_PARAMETER") context: Context) : T
|
||||
task
|
||||
), OverlayUICallbacks {
|
||||
|
||||
override fun onShare() {
|
||||
if (mIsAllowedByPolicy) {
|
||||
endLiveTileMode { mImageApi.startShareActivity(null) }
|
||||
} else {
|
||||
showBlockedByPolicyMessage()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLens() {
|
||||
if (mIsAllowedByPolicy) {
|
||||
endLiveTileMode { mImageApi.startLensActivity() }
|
||||
@@ -55,6 +63,7 @@ class TaskOverlayFactoryImpl(@Suppress("UNUSED_PARAMETER") context: Context) : T
|
||||
}
|
||||
|
||||
interface OverlayUICallbacks : TaskOverlayFactory.OverlayUICallbacks {
|
||||
fun onShare()
|
||||
fun onLens()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user