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

Commit 62656797 authored by Zoey Chen's avatar Zoey Chen
Browse files

[Provier Model] Remove the redundant code in the Internet Dialog

Bug: 204042506
Bug: 204041443
Bug: 204255534
Test: atest InternetDialogTest, InternetDialogControllerTest
Change-Id: I0acbe0a1495a8ba5f3df2d2393eca830679efcf7
parent 2958d2d2
Loading
Loading
Loading
Loading
+1 −12
Original line number Original line Diff line number Diff line
@@ -80,7 +80,6 @@ public class InternetDialog extends SystemUIDialog implements


    private final Handler mHandler;
    private final Handler mHandler;
    private final Executor mBackgroundExecutor;
    private final Executor mBackgroundExecutor;
    private final LinearLayoutManager mLayoutManager;


    @VisibleForTesting
    @VisibleForTesting
    protected InternetAdapter mAdapter;
    protected InternetAdapter mAdapter;
@@ -161,12 +160,6 @@ public class InternetDialog extends SystemUIDialog implements
        mCanConfigMobileData = canConfigMobileData;
        mCanConfigMobileData = canConfigMobileData;
        mCanConfigWifi = canConfigWifi;
        mCanConfigWifi = canConfigWifi;


        mLayoutManager = new LinearLayoutManager(mContext) {
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
        mUiEventLogger = uiEventLogger;
        mUiEventLogger = uiEventLogger;
        mAdapter = new InternetAdapter(mInternetDialogController);
        mAdapter = new InternetAdapter(mInternetDialogController);
        if (!aboveStatusBar) {
        if (!aboveStatusBar) {
@@ -218,7 +211,7 @@ public class InternetDialog extends SystemUIDialog implements


        setOnClickListener();
        setOnClickListener();
        mTurnWifiOnLayout.setBackground(null);
        mTurnWifiOnLayout.setBackground(null);
        mWifiRecyclerView.setLayoutManager(mLayoutManager);
        mWifiRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mWifiRecyclerView.setAdapter(mAdapter);
        mWifiRecyclerView.setAdapter(mAdapter);
    }
    }


@@ -469,10 +462,6 @@ public class InternetDialog extends SystemUIDialog implements
    }
    }


    private void setProgressBarVisible(boolean visible) {
    private void setProgressBarVisible(boolean visible) {
        if (mWifiManager.isWifiEnabled() && mAdapter.mHolderView != null
                && mAdapter.mHolderView.isAttachedToWindow()) {
            mIsProgressBarVisible = true;
        }
        mIsProgressBarVisible = visible;
        mIsProgressBarVisible = visible;
        mProgressBar.setVisibility(mIsProgressBarVisible ? View.VISIBLE : View.GONE);
        mProgressBar.setVisibility(mIsProgressBarVisible ? View.VISIBLE : View.GONE);
        mDivider.setVisibility(mIsProgressBarVisible ? View.GONE : View.VISIBLE);
        mDivider.setVisibility(mIsProgressBarVisible ? View.GONE : View.VISIBLE);