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

Commit 5b219a34 authored by Yi-Ling Chuang's avatar Yi-Ling Chuang
Browse files

Disable RecyclerView animation to fix the broken UI

RecyclerView has item animation by default. In this bug, RV animation
seems to be interrupted by the page transitions(Shared Axis), and so
items could not finish sliding to its position.

Hence, disable RV animation to fix it.

Fixes: 189720797
Test: Navigate to Mobile & Wifi usage page and see the normal UI.
Change-Id: I52920715ae4b63ef78a73fcb9c76c6d20f80e012
parent 09666f9e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -39,8 +39,10 @@ import androidx.loader.content.Loader;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceCategory;
import androidx.recyclerview.widget.RecyclerView;

import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.widget.EntityHeaderController;
import com.android.settingslib.AppItem;
@@ -221,6 +223,14 @@ public class AppDataUsage extends DataUsageBaseFragment implements OnPreferenceC
        }
        LoaderManager.getInstance(this).restartLoader(LOADER_APP_USAGE_DATA, null /* args */,
                mUidDataCallbacks);

        if (Utils.isPageTransitionEnabled(mContext)) {
            final RecyclerView recyclerView = getListView();
            if (recyclerView != null) {
                recyclerView.setItemAnimator(null);
            }
        }

        updatePrefs();
    }

+9 −0
Original line number Diff line number Diff line
@@ -25,9 +25,11 @@ import android.util.Log;
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.RecyclerView;

import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settingslib.core.AbstractPreferenceController;

import java.util.ArrayList;
@@ -78,6 +80,13 @@ public class AppNotificationSettings extends NotificationSettings {
            return;
        }

        if (Utils.isPageTransitionEnabled(mContext)) {
            final RecyclerView recyclerView = getListView();
            if (recyclerView != null) {
                recyclerView.setItemAnimator(null);
            }
        }

        for (NotificationPreferenceController controller : mControllers) {
            controller.onResume(mAppRow, mChannel, mChannelGroup, null, null, mSuspendedAppsAdmin,
                    null);