Fix some animation janks during code start.

- Create a   summary placeholder for preferences with summary.
- Create a totally empty summary for prefernces without summary.
- For all dynamic prefs that has *no* SummaryLoader, add meta to set
their summary to empty.
- Other dynamic perfs has   as initial summary.

By doing this, all dynamic pref's height is fixed and will not change as
we update summaries, thus eliminating jank during cold start in each
page.

Also removed DashboardAlias for notification preference and default apps as a side fix.

Change-Id: Iec98b7ffef4e920bf573b2244ad04124c1c5d154
Fix: 36414481
Test: make RunSettingsRoboTests
This commit is contained in:
Fan Zhang
2017-03-20 17:32:32 -07:00
parent 748649b006
commit 320d60f0ad
6 changed files with 79 additions and 46 deletions

View File

@@ -28,6 +28,7 @@ import android.text.TextUtils;
import android.util.Log;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
import com.android.settings.overlay.FeatureFactory;
@@ -124,7 +125,11 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
} else {
pref.setKey(getDashboardKeyForTile(tile));
}
pref.setSummary(tile.summary);
if (tile.summary != null) {
pref.setSummary(tile.summary);
} else {
pref.setSummary(R.string.summary_placeholder);
}
if (tile.icon != null) {
pref.setIcon(tile.icon.loadDrawable(activity));
}