-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings: Network setup UI changes for SUW
Change-Id: Ic8e97b78f19e59fe108c7c3304dfe7e7f49020a9 Signed-off-by: Mohammad Hasan Keramat J <[email protected]>
- Loading branch information
1 parent
da2bb47
commit 22870ce
Showing
4 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2021 The LineageOS Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
|
||
<path | ||
android:fillColor="?android:attr/colorPrimary" | ||
android:pathData="M12,2A8,8 0 0,0 4,10C4,14.03 7,17.42 11,17.93V19H10A1,1 0 0,0 9,20H2V22H9A1,1 0 0,0 10,23H14A1,1 0 0,0 15,22H22V20H15A1,1 0 0,0 14,19H13V17.93C17,17.43 20,14.03 20,10A8,8 0 0,0 12,2M12,4C12,4 12.74,5.28 13.26,7H10.74C11.26,5.28 12,4 12,4M9.77,4.43C9.5,4.93 9.09,5.84 8.74,7H6.81C7.5,5.84 8.5,4.93 9.77,4.43M14.23,4.44C15.5,4.94 16.5,5.84 17.19,7H15.26C14.91,5.84 14.5,4.93 14.23,4.44M6.09,9H8.32C8.28,9.33 8.25,9.66 8.25,10C8.25,10.34 8.28,10.67 8.32,11H6.09C6.03,10.67 6,10.34 6,10C6,9.66 6.03,9.33 6.09,9M10.32,9H13.68C13.72,9.33 13.75,9.66 13.75,10C13.75,10.34 13.72,10.67 13.68,11H10.32C10.28,10.67 10.25,10.34 10.25,10C10.25,9.66 10.28,9.33 10.32,9M15.68,9H17.91C17.97,9.33 18,9.66 18,10C18,10.34 17.97,10.67 17.91,11H15.68C15.72,10.67 15.75,10.34 15.75,10C15.75,9.66 15.72,9.33 15.68,9M6.81,13H8.74C9.09,14.16 9.5,15.07 9.77,15.56C8.5,15.06 7.5,14.16 6.81,13M10.74,13H13.26C12.74,14.72 12,16 12,16C12,16 11.26,14.72 10.74,13M15.26,13H17.19C16.5,14.16 15.5,15.07 14.23,15.57C14.5,15.07 14.91,14.16 15.26,13Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/com/android/settings/network/NetworkSetupActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (C) 2012 The Android Open Source Project | ||
* Copyright (C) 2021 The LineageOS Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.android.settings.network; | ||
|
||
import android.content.Intent; | ||
import android.content.res.Resources; | ||
|
||
import androidx.preference.PreferenceFragmentCompat; | ||
|
||
import com.android.settings.ButtonBarHandler; | ||
import com.android.settings.network.NetworkProviderSettings; | ||
import com.android.settings.R; | ||
import com.android.settings.SettingsActivity; | ||
import com.android.settings.SetupWizardUtils; | ||
import com.android.settings.wifi.p2p.WifiP2pSettings; | ||
import com.android.settings.wifi.savedaccesspoints2.SavedAccessPointsWifiSettings2; | ||
|
||
public class NetworkSetupActivity extends SettingsActivity implements ButtonBarHandler { | ||
|
||
@Override | ||
public Intent getIntent() { | ||
Intent modIntent = new Intent(super.getIntent()); | ||
if (!modIntent.hasExtra(EXTRA_SHOW_FRAGMENT)) { | ||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, getNetworkProviderSettingsClass().getName()); | ||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, | ||
R.string.provider_internet_settings); | ||
} | ||
return modIntent; | ||
} | ||
|
||
@Override | ||
protected boolean isValidFragment(String fragmentName) { | ||
final boolean isSavedAccessPointsWifiSettings = | ||
SavedAccessPointsWifiSettings2.class.getName().equals(fragmentName); | ||
|
||
if (NetworkProviderSettings.class.getName().equals(fragmentName) | ||
|| WifiP2pSettings.class.getName().equals(fragmentName) | ||
|| isSavedAccessPointsWifiSettings) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
/* package */ Class<? extends PreferenceFragmentCompat> getNetworkProviderSettingsClass() { | ||
return NetworkProviderSettings.class; | ||
} | ||
|
||
@Override | ||
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { | ||
final int new_resid = SetupWizardUtils.getTheme(this, getIntent()); | ||
super.onApplyThemeResource(theme, new_resid, first); | ||
} | ||
} |