Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b2e778a authored by Mill Chen's avatar Mill Chen
Browse files

Make collapsing toolbar load font synchronously

Since collapsing toolbar might load the font asynchronously, it caused
that some settings pages are seeing a flicker on its title. This change
is using TextAppearanceConfig.setShouldLoadFontSynchronously(true)
method to have title font load synchronously, which would remove the
flicker problem.

Bug: 182232144
Test: visual verified
1) Settings > Notifications > Notification history
2) See if there's a flicker on title

Change-Id: I80f5c5862ea6408bfb372d61a11122fb0240e45d
parent e68fa4af
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.widget.Toolbar;
import androidx.annotation.Nullable;

import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.resources.TextAppearanceConfig;

/**
 * A base Activity that has a collapsing toolbar layout is used for the activities intending to
@@ -39,7 +40,8 @@ public class CollapsingToolbarBaseActivity extends SettingsTransitionActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Force loading font synchronously for collapsing toolbar layout
        TextAppearanceConfig.setShouldLoadFontSynchronously(true);
        super.setContentView(R.layout.collapsing_toolbar_base_layout);
        mCollapsingToolbarLayout = findViewById(R.id.collapsing_toolbar);