TP-40390 | Alfred masking issue (#7782)
This commit is contained in:
@@ -30,8 +30,6 @@ import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_PackageNameFactory.packageName
|
||||
import com.google.android.play.core.install.model.AppUpdateType
|
||||
import com.google.gson.JsonParser
|
||||
@@ -660,6 +658,7 @@ class HomeFragment : PaymentBaseFragment(), WidgetCallback, PlayStoreActionListe
|
||||
?.contains(Constants.SENSITIVE_VIEW) == true
|
||||
|
||||
if (isSensitive) {
|
||||
activity?.window?.decorView?.rootView?.tag = Constants.SENSITIVE_VIEW
|
||||
composeView.tag = Constants.SENSITIVE_VIEW
|
||||
}
|
||||
composeView.setProperties(
|
||||
|
||||
@@ -56,19 +56,27 @@ suspend fun captureScreen(
|
||||
return null
|
||||
}
|
||||
if (canvas != null && bmp != null) {
|
||||
if (isMaskingEnabled(screenName)) {
|
||||
if (isMaskingEnabled(screenName) || (v.tag == SENSITIVE_VIEW_TAG)) {
|
||||
val maskedViewsList = findViewWithTagRecursive(v, SENSITIVE_VIEW_TAG, mutableListOf())
|
||||
withContext(Dispatchers.Main) {
|
||||
try {
|
||||
if (maskedViewsList.isEmpty()) {
|
||||
v.draw(canvas)
|
||||
} else {
|
||||
val alphaList = mutableListOf<Pair<View, Float>>()
|
||||
|
||||
for (maskedView in maskedViewsList) {
|
||||
val savedAlpha = maskedView.alpha
|
||||
alphaList.add(Pair(maskedView, maskedView.alpha))
|
||||
maskedView.alpha = 0.0f
|
||||
v.draw(canvas)
|
||||
maskedView.alpha = savedAlpha
|
||||
}
|
||||
|
||||
v.draw(canvas)
|
||||
|
||||
for (alphaView in alphaList) {
|
||||
val view = alphaView.first
|
||||
view.alpha = alphaView.second
|
||||
}
|
||||
alphaList.clear()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.log()
|
||||
|
||||
Reference in New Issue
Block a user