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

Commit f61f47a3 authored by Jiaming Cheng's avatar Jiaming Cheng Committed by Android (Google) Code Review
Browse files

Merge "[QSDetailedView] Apply details view UI style after view binding." into main

parents cdee030b 6fa6b49f
Loading
Loading
Loading
Loading
+15 −16
Original line number Diff line number Diff line
@@ -191,12 +191,21 @@ public class InternetAdapter extends RecyclerView.Adapter<InternetAdapter.Intern
            mWifiTitleText = view.requireViewById(R.id.wifi_title);
            mWifiSummaryText = view.requireViewById(R.id.wifi_summary);
            mWifiEndIcon = view.requireViewById(R.id.wifi_end_icon);

            if (!isInDetailsView){
                return;
        }

        void onBind(@NonNull WifiEntry wifiEntry) {
            mWifiIcon.setImageDrawable(getWifiDrawable(wifiEntry));
            setWifiNetworkLayout(wifiEntry.getTitle(),
                    Html.fromHtml(wifiEntry.getSummary(false), Html.FROM_HTML_MODE_LEGACY));

            final int connectedState = wifiEntry.getConnectedState();
            final int security = wifiEntry.getSecurity();
            updateEndIcon(connectedState, security);

            mWifiListLayout.setEnabled(shouldEnabled(wifiEntry));

            // Set the UI styles for details view only.
            if (mIsInDetailsView) {
                mWifiTitleText.setTextAppearance(R.style.TextAppearance_TileDetailsEntryTitle);
                mWifiSummaryText.setTextAppearance(R.style.TextAppearance_TileDetailsEntrySubTitle);
                if (mWifiIcon.getDrawable() != null) {
@@ -209,16 +218,6 @@ public class InternetAdapter extends RecyclerView.Adapter<InternetAdapter.Intern
                }
            }

        void onBind(@NonNull WifiEntry wifiEntry) {
            mWifiIcon.setImageDrawable(getWifiDrawable(wifiEntry));
            setWifiNetworkLayout(wifiEntry.getTitle(),
                    Html.fromHtml(wifiEntry.getSummary(false), Html.FROM_HTML_MODE_LEGACY));

            final int connectedState = wifiEntry.getConnectedState();
            final int security = wifiEntry.getSecurity();
            updateEndIcon(connectedState, security);

            mWifiListLayout.setEnabled(shouldEnabled(wifiEntry));
            if (connectedState != WifiEntry.CONNECTED_STATE_DISCONNECTED) {
                mWifiListLayout.setOnClickListener(
                        v -> mInternetDetailsContentController.launchWifiDetailsSetting(