Use Drawer in Settings app
- get rid of PreferenceActivity as much as we can and use fragments instead - add Drawer widget - add Dashboard high level entry into the Drawer (but this is work in progress and would be done in another CL) - add bypass of fragment's Header validation when launched from the Drawer but *force* validation if external call thru an Intent Be aware that WifiPickerActivity should remain for now a PreferenceActivity. It is used by SetupWizard and should not trigger running the SettingsActivity's header building code. SetupWizard is a Home during the provisionnig process and then deactivate itself as a Home but would make the Home header to appear in the Drawer (because momentarily we would have two Home). Also, verified that: - the WiFi settings still work when called from SetupWizard - when you have multiple Launchers, the Home header will appear in the list of Headers in the Drawer Change-Id: I407a5e0fdd843ad7615d3d511c416a44e3d97c90
This commit is contained in:
@@ -28,7 +28,6 @@ import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -40,6 +39,7 @@ import android.widget.TextView;
|
||||
import java.util.List;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.applications.AppOpsState.AppOpEntry;
|
||||
|
||||
public class AppOpsCategory extends ListFragment implements
|
||||
@@ -333,8 +333,8 @@ public class AppOpsCategory extends ListFragment implements
|
||||
Bundle args = new Bundle();
|
||||
args.putString(AppOpsDetails.ARG_PACKAGE_NAME, mCurrentPkgName);
|
||||
|
||||
PreferenceActivity pa = (PreferenceActivity)getActivity();
|
||||
pa.startPreferencePanel(AppOpsDetails.class.getName(), args,
|
||||
SettingsActivity sa = (SettingsActivity) getActivity();
|
||||
sa.startPreferencePanel(AppOpsDetails.class.getName(), args,
|
||||
R.string.app_ops_settings, null, this, RESULT_APP_DETAILS);
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,6 @@ import android.content.pm.PermissionGroupInfo;
|
||||
import android.content.pm.PermissionInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -40,6 +39,7 @@ import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.Utils;
|
||||
|
||||
import java.util.List;
|
||||
@@ -161,8 +161,8 @@ public class AppOpsDetails extends Fragment {
|
||||
private void setIntentAndFinish(boolean finish, boolean appChanged) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(ManageApplications.APP_CHG, appChanged);
|
||||
PreferenceActivity pa = (PreferenceActivity)getActivity();
|
||||
pa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
|
||||
SettingsActivity sa = (SettingsActivity)getActivity();
|
||||
sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
|
||||
}
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
|
@@ -19,6 +19,7 @@ package com.android.settings.applications;
|
||||
import com.android.internal.telephony.ISms;
|
||||
import com.android.internal.telephony.SmsUsageMonitor;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.applications.ApplicationsState.AppEntry;
|
||||
|
||||
@@ -57,7 +58,6 @@ import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.Formatter;
|
||||
@@ -920,8 +920,8 @@ public class InstalledAppDetails extends Fragment
|
||||
if(localLOGV) Log.i(TAG, "appChanged="+appChanged);
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(ManageApplications.APP_CHG, appChanged);
|
||||
PreferenceActivity pa = (PreferenceActivity)getActivity();
|
||||
pa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
|
||||
SettingsActivity sa = (SettingsActivity)getActivity();
|
||||
sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
|
||||
}
|
||||
|
||||
private void refreshSizeInfo() {
|
||||
|
@@ -1,12 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2010 The Android Open Source 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.applications;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.preference.PreferenceActivity;
|
||||
import com.android.settings.SettingsActivity;
|
||||
|
||||
import com.android.settings.ChooseLockGeneric.ChooseLockGenericFragment;
|
||||
|
||||
public class InstalledAppDetailsTop extends PreferenceActivity {
|
||||
public class InstalledAppDetailsTop extends SettingsActivity {
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
@@ -21,5 +34,4 @@ public class InstalledAppDetailsTop extends PreferenceActivity {
|
||||
if (InstalledAppDetails.class.getName().equals(fragmentName)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.IPackageManager;
|
||||
@@ -44,9 +43,7 @@ import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.UserHandle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceFrameLayout;
|
||||
import android.provider.Settings;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.support.v4.view.PagerTabStrip;
|
||||
import android.support.v4.view.ViewPager;
|
||||
@@ -72,6 +69,7 @@ import android.widget.TextView;
|
||||
import com.android.internal.app.IMediaContainerService;
|
||||
import com.android.internal.content.PackageHelper;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.Settings.RunningServicesActivity;
|
||||
import com.android.settings.Settings.StorageUseActivity;
|
||||
import com.android.settings.applications.ApplicationsState.AppEntry;
|
||||
@@ -844,7 +842,7 @@ public class ManageApplications extends Fragment implements
|
||||
|| className.endsWith(".StorageUse")) {
|
||||
mSortOrder = SORT_ORDER_SIZE;
|
||||
defaultListType = LIST_TYPE_ALL;
|
||||
} else if (Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS.equals(action)) {
|
||||
} else if (android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS.equals(action)) {
|
||||
// Select the all-apps list, with the default sorting
|
||||
defaultListType = LIST_TYPE_ALL;
|
||||
}
|
||||
@@ -1026,8 +1024,8 @@ public class ManageApplications extends Fragment implements
|
||||
Bundle args = new Bundle();
|
||||
args.putString(InstalledAppDetails.ARG_PACKAGE_NAME, mCurrentPkgName);
|
||||
|
||||
PreferenceActivity pa = (PreferenceActivity)getActivity();
|
||||
pa.startPreferencePanel(InstalledAppDetails.class.getName(), args,
|
||||
SettingsActivity sa = (SettingsActivity) getActivity();
|
||||
sa.startPreferencePanel(InstalledAppDetails.class.getName(), args,
|
||||
R.string.application_info_label, null, this, INSTALLED_APP_DETAILS);
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,6 @@ import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.text.format.Formatter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -161,7 +160,6 @@ public class ProcessStatsDetail extends Fragment implements Button.OnClickListen
|
||||
}
|
||||
|
||||
private void doAction(int action) {
|
||||
PreferenceActivity pa = (PreferenceActivity)getActivity();
|
||||
switch (action) {
|
||||
case ACTION_FORCE_STOP:
|
||||
killProcesses();
|
||||
|
@@ -25,7 +25,6 @@ import android.os.ServiceManager;
|
||||
import android.os.SystemClock;
|
||||
import android.os.UserManager;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
@@ -40,6 +39,7 @@ import com.android.internal.app.IProcessStats;
|
||||
import com.android.internal.app.ProcessMap;
|
||||
import com.android.internal.app.ProcessStats;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.fuelgauge.Utils;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -192,7 +192,7 @@ public class ProcessStatsUi extends PreferenceFragment
|
||||
args.putBoolean(ProcessStatsDetail.EXTRA_USE_USS, mUseUss);
|
||||
args.putLong(ProcessStatsDetail.EXTRA_MAX_WEIGHT, mMaxWeight);
|
||||
args.putLong(ProcessStatsDetail.EXTRA_TOTAL_TIME, mTotalTime);
|
||||
((PreferenceActivity) getActivity()).startPreferencePanel(
|
||||
((SettingsActivity) getActivity()).startPreferencePanel(
|
||||
ProcessStatsDetail.class.getName(), args, R.string.details_title, null, null, 0);
|
||||
|
||||
return super.onPreferenceTreeClick(preferenceScreen, preference);
|
||||
|
@@ -28,7 +28,6 @@ import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.os.UserHandle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.AttributeSet;
|
||||
@@ -42,6 +41,7 @@ import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.AbsListView.RecyclerListener;
|
||||
import com.android.settings.SettingsActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -397,9 +397,9 @@ public class RunningProcessesView extends FrameLayout
|
||||
}
|
||||
args.putInt(RunningServiceDetails.KEY_USER_ID, mi.mUserId);
|
||||
args.putBoolean(RunningServiceDetails.KEY_BACKGROUND, mAdapter.mShowBackground);
|
||||
|
||||
PreferenceActivity pa = (PreferenceActivity)mOwner.getActivity();
|
||||
pa.startPreferencePanel(RunningServiceDetails.class.getName(), args,
|
||||
|
||||
SettingsActivity sa = (SettingsActivity) mOwner.getActivity();
|
||||
sa.startPreferencePanel(RunningServiceDetails.class.getName(), args,
|
||||
R.string.runningservicedetails_settings_title, null, null, 0);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user