Update async layout inflater to fix AppCompat views.

This commit is contained in:
Clark
2023-03-23 14:40:48 -04:00
committed by Cody Henthorne
parent d6a9ed1a8d
commit 98438ff8e4
4 changed files with 22 additions and 1 deletions

View File

@@ -476,6 +476,8 @@ dependencies {
implementation libs.androidx.biometric implementation libs.androidx.biometric
implementation libs.androidx.sharetarget implementation libs.androidx.sharetarget
implementation libs.androidx.profileinstaller implementation libs.androidx.profileinstaller
implementation libs.androidx.asynclayoutinflater
implementation libs.androidx.asynclayoutinflater.appcompat
implementation (libs.firebase.messaging) { implementation (libs.firebase.messaging) {
exclude group: 'com.google.firebase', module: 'firebase-core' exclude group: 'com.google.firebase', module: 'firebase-core'

View File

@@ -10,6 +10,7 @@ import androidx.annotation.LayoutRes;
import androidx.annotation.MainThread; import androidx.annotation.MainThread;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.asynclayoutinflater.appcompat.AsyncAppCompatFactory;
import androidx.asynclayoutinflater.view.AsyncLayoutInflater; import androidx.asynclayoutinflater.view.AsyncLayoutInflater;
import org.signal.core.util.ThreadUtil; import org.signal.core.util.ThreadUtil;
@@ -116,7 +117,7 @@ public class CachedInflater {
layoutDirection = currentLayoutDirection; layoutDirection = currentLayoutDirection;
} }
AsyncLayoutInflater inflater = new AsyncLayoutInflater(context); AsyncLayoutInflater inflater = new AsyncLayoutInflater(context, new AsyncAppCompatFactory());
int existingCount = Util.getOrDefault(cache, layoutRes, Collections.emptyList()).size(); int existingCount = Util.getOrDefault(cache, layoutRes, Collections.emptyList()).size();
int inflateCount = Math.max(limit - existingCount, 0); int inflateCount = Math.max(limit - existingCount, 0);

View File

@@ -74,6 +74,8 @@ dependencyResolutionManagement {
alias('androidx-sqlite').to('androidx.sqlite:sqlite:2.1.0') alias('androidx-sqlite').to('androidx.sqlite:sqlite:2.1.0')
alias('androidx-core-role').to('androidx.core:core-role:1.0.0') alias('androidx-core-role').to('androidx.core:core-role:1.0.0')
alias('androidx-profileinstaller').to('androidx.profileinstaller:profileinstaller:1.2.2') alias('androidx-profileinstaller').to('androidx.profileinstaller:profileinstaller:1.2.2')
alias('androidx-asynclayoutinflater').to('androidx.asynclayoutinflater:asynclayoutinflater:1.1.0-alpha01')
alias('androidx-asynclayoutinflater-appcompat').to('androidx.asynclayoutinflater:asynclayoutinflater-appcompat:1.1.0-alpha01')
// Material // Material
alias('material-material').to('com.google.android.material:material:1.8.0') alias('material-material').to('com.google.android.material:material:1.8.0')

View File

@@ -159,6 +159,22 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="f7eab60c57addd94bb06275832fe7600611beaaae1a1ec597c231956faf96c8b" origin="Generated by Gradle"/> <sha256 value="f7eab60c57addd94bb06275832fe7600611beaaae1a1ec597c231956faf96c8b" origin="Generated by Gradle"/>
</artifact> </artifact>
</component> </component>
<component group="androidx.asynclayoutinflater" name="asynclayoutinflater" version="1.1.0-alpha01">
<artifact name="asynclayoutinflater-1.1.0-alpha01.aar">
<sha256 value="d9f2c72c6b38e1ddfff2c2782746a257f05d0668e1bdee632d74b86c4b339dba" origin="Generated by Gradle"/>
</artifact>
<artifact name="asynclayoutinflater-1.1.0-alpha01.module">
<sha256 value="0e0a1ba3cd8188e80b1d5d841a10274f167f77c514ac824d88e83d24ff14e653" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.asynclayoutinflater" name="asynclayoutinflater-appcompat" version="1.1.0-alpha01">
<artifact name="asynclayoutinflater-appcompat-1.1.0-alpha01.aar">
<sha256 value="6d52477d638aae7118d51f01206fe47d96a3a5ae26064764ad955513da945187" origin="Generated by Gradle"/>
</artifact>
<artifact name="asynclayoutinflater-appcompat-1.1.0-alpha01.module">
<sha256 value="1cc9d0b777a5bd29f9759fe30618d04e94187bf8b3078fd67558a61b5dc05aa5" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.autofill" name="autofill" version="1.0.0"> <component group="androidx.autofill" name="autofill" version="1.0.0">
<artifact name="autofill-1.0.0.aar"> <artifact name="autofill-1.0.0.aar">
<sha256 value="c9468f56e05006ea151a426c54957cd0799b8b83a579d2846dd22061f33e5ecd" origin="Generated by Gradle"/> <sha256 value="c9468f56e05006ea151a426c54957cd0799b8b83a579d2846dd22061f33e5ecd" origin="Generated by Gradle"/>