Refactor add network page

WifiDialog.java can be launched as "full screen mode"
in some use cases. However the way it's done is that
it uses theme to fake the full screen appearance.
It just feels hacky to use a dialog for full screen UI.
So, we created an "AddNetworkFragment" to make this
page can look like a normal fragment.

Also, clean up some useless code about "full screen mode"
of WifiDialog.

Change-Id: Iedd04c6a8e403cbceb872313314e1cba0d514246
Fixes: 111875856
Test: robo test, manual test
This commit is contained in:
tmfang
2018-08-10 00:25:47 +08:00
parent a439fec1c8
commit db00a3177a
9 changed files with 402 additions and 53 deletions

View File

@@ -4,7 +4,6 @@ import static com.google.common.truth.Truth.assertThat;
import android.content.Context;
import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
import com.android.settings.wifi.WifiDialog.WifiDialogListener;
@@ -32,14 +31,6 @@ public class WifiDialogTest {
MockitoAnnotations.initMocks(this);
}
@Test
public void createFullscreen_setsFullscreenTheme() {
WifiDialog fullscreen = WifiDialog.createFullscreen(mContext, mListener, mockAccessPoint,
WifiConfigUiBase.MODE_CONNECT);
assertThat(fullscreen.getContext().getThemeResId())
.isEqualTo(R.style.Theme_Settings_WifiDialogFullScreen);
}
@Test
public void createModal_usesDefaultTheme() {
WifiDialog modal = WifiDialog