Commit Graph

36 Commits

Author SHA1 Message Date
Fabrice Di Meglio
5035ec6944 Fix potential NPE with Preference highlighting
- there are some cases where the ListView adapter is null

Change-Id: I9dcd171f57d9ca7b8032d890f5a18c3a01fd38cf
2014-04-16 18:26:19 -07:00
Fabrice Di Meglio
906ff6fdf9 Improve Preference highlight effect
- restrict the effect to the Preference View itself

Change-Id: I3ab04433e1acecb906d0a458b31314f97b9bda03
2014-04-16 18:18:41 -07:00
Fabrice Di Meglio
6602d02f57 Improve Preference highlighting from a Search result
- fix computation of the Preference position in its PreferenceScreen
- use "highlight" (scrolling and Ripple effect) for showing the result
- "highlight" is only done once

Change-Id: I232d79d795b0983beac5a9fec3dfbe9da329c98f
2014-04-16 16:16:45 -07:00
Fabrice Di Meglio
c1457323d2 Add support for saving and using the Preference's key value
- modify the SQlite data model
- update Index code for managing the key value
- pass the key when launching a Fragment or and Activity
- implement a small animation for highlighting the Preference
from a Search result

Change-Id: I617643a4e5e3b752ece8f45ce7d5429037e479da
2014-04-08 13:08:44 -07:00
Fabrice Di Meglio
377dd62bd7 Fix bug #12993929 Screen orientation change replaces wifi password dialog with Add network dialog
- use the correct Fragment manager: it should be the child's one

Change-Id: I286b276bc6c5180b7c0e458d8562938671d493c8
2014-02-18 18:24:30 -08:00
Fabrice Di Meglio
263bcc8b73 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
2014-02-03 16:36:46 -08:00
Geoffrey Borggaard
6e1102d9fa Restriction pin changes.
Fixed bug in WirelessSettings where it was asking users for a PIN when
they weren't restricted.  Did this by refactoring the preference level
pin checking into the superclass, where it checks for the restricted mode first.
Also pin protected changes to certificates for restricted users.

Change-Id: I8310fd39f0862159668318fc1360ec6859cc00d5
2013-08-07 14:57:43 -04:00
Amith Yamasani
350938ecc6 Potential fix for a monkey-related NPE
Cache the content resolver so that async callbacks, events can
continue to get the cntent resolver when detached from the activity.
This should help with stability.

Bug: 8005271

Change-Id: Ia566bc312ce678b438004bdf4ed7537ac1604608
2013-04-09 10:25:43 -07:00
Amith Yamasani
258f7c7e1c Improve error message to figure out which fragment class is problematic.
Bug: 8057867
Change-Id: I6ad0bc8c8a6ed9bc8a1cca5debffe15c6de3a1b5
2013-02-05 10:56:55 -08:00
Amith Yamasani
aeb57edaef Pass the locale code in the help url for help pages.
Otherwise the help will always be shown in English.

Bug: 7564049
Change-Id: I94da36aa1ae5aabd118178866b7e570bb77add34
2012-12-06 14:40:51 -08:00
Amith Yamasani
c861cf8447 Improved dialog management in Settings>Users
Bug: 7266284 Delete not functional after orientation change
Bug: 7266182 Set up now not functional after orientation change

Also remove "vibrate when ringing" on tablets
Bug: 7253081

Change-Id: Ie616747f2e3292c401613eb2041b5a5a289cde20
2012-10-02 14:51:46 -07:00
Amith Yamasani
9627a8ea15 Show more settings and add restrictions/dialogs for secondary users
Bug: 7213029 crash in About>Status
Bug: 7212495 hide System updates for second user
Bug: 7212230 nickname editor should select the text
Bug: 7160487 TTS settings
Bug: 7129411 Settings needs visibility changes for secondary users

Change-Id: Ia2d1229c08b392edfa6b671fce4a382410405b14
2012-09-23 18:43:31 -07:00
Amith Yamasani
b3a593eb76 Delay calling setHasOptionsMenu() to avoid a crash in Wifi Settings
If it is called in onCreate(), it's too early for Wifi Settings,
which does its initialization in onActivityCreated().

Change-Id: I3d9b49f63d342e724fd4795fbca48d08faa3c3cc
2012-04-23 18:03:52 -07:00
Amith Yamasani
b0b37ae21c Help menus for several screens.
Bug: 5144896
Change-Id: Ib2f5146f6f62f2a33261bb165c3bf1bf13b22f38
2012-04-23 15:35:36 -07:00
Gilles Debunne
6465054995 Bug 5050590: wrong title for lock screen
Change-Id: Iba170a25ac56db4140ab91f4fd583c0f676b02b0
2011-08-23 11:01:41 -07:00
Amith Yamasani
8875edede1 Fix crash after adding a word to the user dictionary.
Bug: 3407951

Make sure that the parent fragment is a SettingsPreferenceFragment. Otherwise it's not
necessary to manage the mDialogFragment.

Change-Id: I331a3507fe11a7331ff24ecf64fe8c8c3f613636
2011-01-31 12:46:57 -08:00
Hung-ying Tyan
18eb39d085 Clear mDialogFragment when it's detached
and re-associate it when it's re-created.

Before this CL, the association is gone when fragment goes through the pause-resume
cycle.

Similarly, restore onDismiss and onCancel listeners in VpnSettings.onCreateDialog(),
restore states in onCreate() instead of onActivityCreated() so that screen rotation
can be handled correctly.

Now that profiles are shared between Settings instances, always handle state change
in VpnSettings.changeState() so that state changed in one instance can be conveyed
to the other and preferences can be correctly enabled/disabled.

In additions, fix some trivial mistakes in VpnSettings.

Bug: 3396394
Change-Id: I242e1ed6c6d410b4dfefb373d8f98266fc9b46d0
2011-01-28 23:39:45 +08:00
Dianne Hackborn
300768fea5 Fix issue #3400255 Dialog fragments crash on rotation in Settings app
Change-Id: I337c1fb41e3fbedd7982418df497487481bb35d2
2011-01-27 20:39:21 -08:00
Hung-ying Tyan
adc83d8312 Fix alert dialogs in VpnSettings.
+ Don't check mDialogFragment.isVisible() in SettingsPreferenceFragment.removeDialog()
  as mDialogFragment may not be visible in parent fragment's onResume().
+ Replace mConnectDialog with mConnectDialogShowing and remove
  removeConnectDialog().
+ Dismiss alert dialogs in onPause() so that we don't need to maintain extra
  states during pause-resume cycle.

In addition, fix a NPE when startVpnTypeSelection().

Bug: 3381434
Bug: 3289365

Change-Id: Ic4aa87c7a618d95e86e45d6617f2ad7dab35f019
2011-01-26 15:50:33 +08:00
Hung-ying Tyan
0ee51e04fb Allow OnCancelListener and OnDismissListener in Settings app
for the framework-managed dialogs.

DialogFragment acts as both listeners so the application cannot set both
listeners in the embedded dialog. New hooks are added in SettingsDialogFragment
so that settings apps can do so for the framework-managed dialogs.

Bug: 3386670
Change-Id: I144e7c4ccf7f86c61f6079fa86d830c709335af1
2011-01-25 17:31:26 +08:00
Dianne Hackborn
0385cf14a1 Fix issue #3306021 NPE at android.app.AlertDialog.getDefaultDialogTheme(AlertDialog.java)
It looks like the dialog fragment was not being removed along with
the containing fragment.  The containing fragment now checks for
when it is being removed and removes its dialog fragment at that
point.

Also fix issue #3340766 NPE at
com.android.settings.applications.RunningProcessesView.startServiceDetailsActivity

We need to check if the running processes view is still attached to its
owner, since we clear owner when it is paused.

In addition, fix a bug where ManageApplications was not persisting
its "show background processes" state, and remove the icons from
its menu items to make them more understandable in the action bar.

Change-Id: I4498ef92023eb60f90758ff18d8eed7b41af79b0
2011-01-24 21:18:41 -08:00
Daisuke Miyakawa
79c5fd971e Add WifiPickerActivity for PICK_WIFI_NETWORK
- We disable left pane when PICK_WIFI_NETWORK intent is used.
- Add ButtonBarHandler interface and let SettingsPreferenceFragment
  use it instead of Settings. Note that
  PreferenceActivity#hasNextButton() and
  PreferenceActivity#getNextButton() are currently protected methods,
  while Settings' relevants are public.

Bug: 3355247
Change-Id: Ie0fae8a1dbce9c7ce37375dff8395dc09b1cc74e
2011-01-17 13:26:45 -08:00
Amith Yamasani
9e3a4700b6 Remove extra button bar.
Bug: 3058024

Change-Id: Ib3c2620869729f8916178ea0c0e899635b470a8f
2011-01-12 09:12:20 -08:00
Svetoslav Ganov
749ba65227 3244931 ANR while in settings attempting to enable Accessibility->Talkabout (IKXEVEREST-1847)
Change-Id: Ifea9324671d0e80a417f4b2fe6dbbe981f8b0679
2010-12-10 17:25:56 -08:00
Amith Yamasani
43c697854c Move Account & sync settings into Settings app.
Fragmentized some of the activities and moved buttons into the menu area.

Bug: 3148844
2010-12-01 15:14:09 -08:00
Amith Yamasani
928e78acea Fix VPN settings flow.
Bug: 3053019
2010-11-12 10:37:20 -08:00
Dianne Hackborn
59a48604b5 Start fragmentizing battery usage.
Change-Id: I0864f6738b37c3203e166bb8f7e61e8904d9980a
2010-11-11 22:32:58 -08:00
Jake Hamby
e79f990490 Implement individual Bluetooth profile connect/disconnect.
Allow individual Bluetooth profiles to be connected/disconnected from
the device's settings pane.

Bug: 3137982
Change-Id: I21512c5bf965fc523f3dc1e83d029b16b5e22440
2010-11-03 13:02:59 -07:00
Daisuke Miyakawa
25af150c98 Remove OnStateListener and FragmentStarter.
Those interfaces aren't available any more, as we make Settings
inherit PreferenceActivity.

Bug: 3034757
Change-Id: I2f778a12168e3033291d6935bcc73637e7c78c0b
2010-09-28 12:12:11 -07:00
Daisuke Miyakawa
b5647c5720 Fragmentize VpnSettings and relevant Activities.
Add startFragment() to SettingsFragmentPreference.

Change-Id: Ifab93b2e68892d5f6da559f337c94d62629780c8
2010-09-15 16:48:25 -07:00
Daisuke Miyakawa
6ebf8619d7 Fragmentize BluetoothSettings.
Add UserLeaveHintListener.java, so that the settings won't use
its implementation around Activity#onUserLeaveHint().

Also fragmentize bluetooth tethering screen.

Change-Id: Id06ae3161fbdb5854ddb7a257f464fb16ea9b089
2010-09-13 16:18:05 -07:00
Daisuke Miyakawa
f58090d522 Fragmentize UserDictionary.
Depending on I2c962726b0adc8811c18dd6df7ff7bdc93c31a07, which
implements DialogCreatable.

Change-Id: I9857e592218731bfbddc578c15180cc681fa4d20
2010-09-13 15:46:28 -07:00
Daisuke Miyakawa
21c1abcef7 Fragmentize ProxySettings.
Change-Id: I2c962726b0adc8811c18dd6df7ff7bdc93c31a07
2010-09-12 17:43:10 -07:00
Amith Yamasani
b61cf51d85 Breadcrumbs in the action bar for navigating up one level and showing current title.
Change-Id: I595e06549b888bd67c6dddd599a4cc77416c3a41
2010-09-12 11:47:26 -07:00
Daisuke Miyakawa
9c8bde576a Fragmentize WifiSettings.
- Add button bar feature toward SettingsPreferenceFragment,
  which has existed in PreferenceActivity and has been used
  (probably) only by Settings app.
- super.onActivityCreated() is not called at the beggining of
  WifiSettings#onActivityCreated(), the parent method assumes
  the child should have prepared PreferenceScreen, while
  WifiSettings cannot do until the parent Activity is ready.
- Call SetHasOptionMenu() should be called AFTER the parent
  Activity is ready. It is not documented, so it would be better
  to file another bug.
- Add exception to proguard...

Change-Id: Iebd27f0cb0abdbee9b4b1cc9b00f4bf127f7815d
2010-08-25 16:03:33 -07:00
Amith Yamasani
d79934731c Refactor settings top level activities to use fragments.
Added a base class SettingsPreferenceFragment from which the settings activities should
be derived so that they can behave like fragments. It contains some commonly called
utility methods and dialog conversion to DialogFragment.

Some of the top-level activities can be launched directly without the left pane.
Settings.java acts as a proxy activity that contains just that settings fragment without
the left pane.

There are still a lot of second and third level activities that need to be fragmentized.
This is just the first pass to test the 2-pane layout.
2010-08-18 22:59:33 -07:00