Commit Graph

218 Commits

Author SHA1 Message Date
Deepanshu Gupta
10bb1371dc Add preferences rendering.
NO_SQ: Depends on updating layoutlib-api-prebuilt.jar
Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
2014-12-23 12:04:30 -08:00
Fabrice Di Meglio
b22be6fcf2 Fix bug #17521147 Settings activity looks terrible on Volantis
- update layouts for PreferenceActivity and its headers
in two panes mode (per UX request)
- add theming where it was missing

Change-Id: I0c478c1a66b6de7e122b7ee73da24f3dd5a7bc28
2014-09-26 13:38:12 -07:00
Alan Viverette
996a63859f Fix accessibility events emitted from TwoStatePreference
Removes redundant and conflicting events emitted from check and switch
preferences. Sends VIEW_CLICKED accessibility events from AdapterView
rows after calling their on click listeners, which ensures data is
consistent.

BUG: 16961152
Change-Id: I4b57bceec6830d775c2da57226b8ee482242caf7
2014-09-02 16:35:45 -07:00
Fabrice Di Meglio
b1a50f2dff Fix bug #16957601 Stability: ISE in Settings: Observer com.android.settings.
SettingsPreferenceFragment$1@273c8fdb was not registered

- add onUnbindPreferences() call to match onBindPreferences()
- this new method is @hide so it does not impact the APIs

Change-Id: Iee0ab8a4ecc2046f89fb96cc52af150e835f658c
2014-08-14 18:00:11 +00:00
John Spurlock
351346092a Volume: Show safe media warning in settings.
If the safe media warning is enabled, make sure
we display it from the new inline slider preference in
Settings (without showing the volume dialog itself).

Also:
 - Update the warning dialog to the new sysui theme.
 - Separate the warning sentences with an additional line.
 - Fix the auto-dismiss timeout.
 - Add a system property to additionally enable the safe
   media warning for testing
 - Add more information to audio service dumpsys.

Bug:15434662
Change-Id: I95fec12c9049bbfdb7ebdf246160e4b12c0c5be3
2014-07-25 11:27:51 -04:00
Alan Viverette
4d065a04ce Remove old listener when rebinding SwitchPreference
Also fixes switch animation during scrolling, unnecessary call to
requestLayout() on drawable invalidate, and potential NPE.

BUG: 16225972
BUG: 4312303
Change-Id: I015d1f03206dd2c812592b0abfa4214a3de73d3f
2014-07-11 23:03:52 +00:00
Fabrice Di Meglio
f9499b36e6 Add PreferenceFragment styling
- add the capability to specify a specific layout for PreferenceFragment

Change-Id: I2fa36b8fa8110e6cbc8006e1d000dc90ae6a5f0b
2014-07-07 20:08:27 +00:00
Fabrice Di Meglio
5f9f6c3936 Fix PreferenceGroupAdapter highlight code path
- do not change the Preference View background. Instead wrap
the Preference View into a FrameLayout with the highlighting
Drawable as the background
- test the View type to force the Preference View creation and
not rely on the convert View when highlighting
- define a new View type for the highlighting
- increment getViewTypeCount() returned value (for the new type)

Change-Id: Ie5f19311e11545aba848fd637ec61e43071d8dcf
2014-06-23 18:47:26 -07:00
Brian Attwell
02bc31e7b3 setSelectedHeader() when switching to fragment
Without this change, passing a EXTRA_SHOW_FRAGMENT value
for a two panel preferences activity will cause the correct
fragment to be shown. However, it will not cause the
correct header to be highlighted.

Bug: 15675746
Bug: 5045558
Change-Id: I18d8e15dd104e8f39ae1ccbb11ab17fd1bf7462e
2014-06-17 04:43:10 +00:00
Fabrice Di Meglio
19ae4ca5a7 Fix SeekBarPreference Theming
- make the layout a Theme attribute and use it
- make a specific Material version of the layout for matching
what we have in the Settings App

See bug: #15414236 Define a framework theme for system settings

and #15384992 Setting Dashboard - padding updates

Change-Id: I69c90523fab112fecf26d89de8fc35dd62430c06
2014-06-16 15:58:25 -07:00
John Spurlock
0dbf1a6be2 Settings: Keep SeekBarVolumizer in sync with audio stream.
Use AudioManager.VOLUME_CHANGED_ACTION instead of relying
on obsolete settings.

Bug:15343543
Change-Id: Ia95237bb455268314ec985affe92b0cec6b52e29
2014-06-01 13:01:23 -04:00
John Spurlock
95caba1270 frameworks/base: Performance tweaks for SeekBarVolumizer.
Move ringtone init to the worker thread.  Allow the volumizer
instance to be reused by making the seekbar settable.

Bug:15091992
Change-Id: Ib616ae0fbb9a45c63391f8335e48ec2754dbdcd5
2014-05-27 13:10:38 -04:00
John Spurlock
74a2e06d83 VolumeZen: frameworks changes to support Settings.
- Pull SeekBarVolumizer out into a separately reusable class.
- Make register/unregisterOnActivityStopListener avail to system code.
- Add new setting for displaying suppressed notifications in zen mode.

Change-Id: Ic30aa575ae07650cee62c8c1d83b6bc69395cf0d
2014-05-18 12:26:21 -04:00
Alan Viverette
fcb48b3ab9 Ensure volume preference has correct defStyleAttr
BUG: 14635756
Change-Id: Id78da5df3d355a4dda9bd1b80b14df54803d5d03
2014-05-15 15:03:36 -07:00
Fabrice Di Meglio
8a86d734e5 Improve Preference highlighting
- add PreferenceFragment.onBindPreferences() so that we can know
when the binding as been done
- use the Preference's key as a tag for its View (so that we can
locate it latter in the View hierarchy)

Change-Id: Ifb3b30e576048b7464af63643834d278a46a8543
2014-04-17 19:42:05 -07:00
Fabrice Di Meglio
35d7b89b9f Add Preference highlighting
- use a specific drawable for highlighting a Preference
at a given position
- also add PreferenceFragment.hasListView() as hidden API

Change-Id: If69854cf6c4852d0f45e2c3a9734b1f63b352f9d
2014-04-16 16:01:13 -07:00
Alan Viverette
55565ecd46 Update list item text appearance
Adds a new attribute for secondary list item text and points
the Gingerbread and Holo themes to use TextAppearance.Small for
compatibility's sake.

Change-Id: I8e78a908b699baae6d1f5b3623fd7b5648b99b77
2014-04-09 16:52:54 -07:00
Fabrice Di Meglio
53c2cf799f Add support for saving and using the Preference's key value
- make public and hide the PreferenceGroupAdapter class
- add setActivated(int position) to be able to set the activated item
- udpate getView(int position, View convertView, ViewGroup parent) to set/unset
the activated item

Change-Id: I8a653ad6541bb6b7a043ba7c3d95e5ecad924a0d
2014-04-08 13:22:07 -07:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Alan Viverette
8eea3ea559 Add APIs for obtaining themed Drawable from Theme, Context
BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
2014-02-03 18:42:24 -08:00
Fabrice Di Meglio
ad2fcfe1b6 Make public but hide OnPreferenceTreeClickListener
- needed as the Settings app is no more a PreferenceActivity

Change-Id: I583493c4027b983efd059564a12eff0814c6bf02
2014-01-20 11:10:52 -08:00
Fabrice Di Meglio
5aaae37506 Code cleaning for PreferenceActivity
- remove non used argument

Change-Id: If57b8230aefffdd77fbba240042093ddb6975b9d
2014-01-08 15:50:34 -08:00
Alan Viverette
f878c298e1 Apply theme to PreferenceActivity headers
BUG: 11900302
Change-Id: Ibd1b08b412f6e64b44b2f3f07d297ede8fa01367
2013-12-02 18:36:00 -08:00
Svetoslav Ganov
f7d720e6b0 am 4f23b610: am b95d6f54: am c6db9c3b: Merge "Revert "PreferenceFragment showing the breadcrumb when not needed."" into klp-dev
* commit '4f23b6104e11be81f3e2ca1a1031de6ca112f50a':
  Revert "PreferenceFragment showing the breadcrumb when not needed."
2013-11-21 12:22:59 -08:00
Svetoslav Ganov
45dbd75290 am dbab7e17: am 4ed5f502: am 4d159661: Merge "Revert "PreferencesFragment showing the breadcrumb area in single pane mode."" into klp-dev
* commit 'dbab7e1794f91e3dc4b0617df6fb59183c7349e5':
  Revert "PreferencesFragment showing the breadcrumb area in single pane mode."
2013-11-21 12:22:55 -08:00
Svetoslav Ganov
c6db9c3b37 Merge "Revert "PreferenceFragment showing the breadcrumb when not needed."" into klp-dev 2013-11-21 20:12:13 +00:00
Svetoslav Ganov
8fc552e695 Revert "PreferenceFragment showing the breadcrumb when not needed."
This reverts commit 7db97b0a29.

Change-Id: Iefe9807fd75baf04e61ec59b508e438320c80fe3
2013-11-21 19:36:22 +00:00
Svetoslav Ganov
68e7f13e22 Revert "PreferencesFragment showing the breadcrumb area in single pane mode."
This reverts commit 2b8795a9db.

Change-Id: If8dcc7190cbe66af09945d8b23a3e1d8fd791b1d
2013-11-21 19:33:53 +00:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Svetoslav
26ae3286c3 am ebda68bf: am 52dedb89: am 512c722f: Merge "PreferencesFragment showing the breadcrumb area in single pane mode." into klp-dev
* commit 'ebda68bf844d4b5b75a01317b45ee04041e726e3':
  PreferencesFragment showing the breadcrumb area in single pane mode.
2013-11-11 20:52:34 -08:00
Jeff Brown
08432a419b am fa0d9c2f: am 02b77575: am 1cdbbb1e: Merge "Changes to support new screen cast settings screen." into klp-dev
* commit 'fa0d9c2fa8e5c2c73bd36688784f1e44eb08635b':
  Changes to support new screen cast settings screen.
2013-11-11 20:51:03 -08:00
Svetoslav
2b8795a9db PreferencesFragment showing the breadcrumb area in single pane mode.
If the PreferenceActivity is running in a single pane mode we are
not showing the headers and the breadcrumb area. However, when this
activity is restarted and has a saved state to restore we are trying
to use headers even in a single pane mode. As a result the breadcrumb
area is shown and the content is shifted to the bottom with an empty
space at the top. This change ignores the saved headers from the
saved instance state in a single pane mode. Note that in such a case
these headers are null anyway as we do not use them.

bug:11242762

Change-Id: I2828bc82762695d9c93fb4ca43933598a9b12b87
2013-11-11 18:31:54 -08:00
Jeff Brown
75af171006 Changes to support new screen cast settings screen.
Fixed the Preference ordering code to consider the case where
two preferences might have the same order.  In that case, it
falls back on the title to disambiguate.  Previous behavior was
undefined (and technically not stable).

Expose the wifi display device address.

Perform wifi display scans every 10 seconds instead of every 15
to improve reponsiveness.

Make sure to define routes for wifi displays that we are connecting
to even if they are not yet paired.  Simplified the logic for
adding and removing these routes to avoid possibly getting out
of sync and leaving stale routes behind.

Fix wifi display notification icon.

Bug: 11257292
Change-Id: I8ac15fb17d83758c0bdce80399e12723c367b83c
2013-11-10 22:51:15 -08:00
Svetoslav
2dc3477e7f am 109c0a21: am b1dac2f4: am 517220b4: Merge "PreferenceFragment showing the breadcrumb when not needed." into klp-dev
* commit '109c0a21938cbab8ae1bde594339cbdf338cb559':
  PreferenceFragment showing the breadcrumb when not needed.
2013-11-04 21:59:59 -08:00
Svetoslav
7db97b0a29 PreferenceFragment showing the breadcrumb when not needed.
The breadcrumb section is used for a single pane mode for showing
the current user location. The breadcrumb should not be shown if
its title and subtitle are empty. The code in PreferenceActivity
onCreate updates the breadcrumb with the title and subtitle in
a single page mode but does not hide it if they are empty. This
change fixes that.

bug:11242762

Change-Id: Ib1ba9e8afd9d0ab2e85d78a65ca7c18489464f6d
2013-11-01 11:57:12 -07:00
Amith Yamasani
d94c31d13a am 32a2775e: am 85f77c2b: Merge "Unmarshall PFDs properly when hand-crafting interface stubs" into klp-dev
* commit '32a2775e529d13dfd34273a3b4af5151435720b2':
  Unmarshall PFDs properly when hand-crafting interface stubs
2013-09-24 10:22:50 -07:00
Amith Yamasani
c2be0d6183 Unmarshall PFDs properly when hand-crafting interface stubs
ParcelFileDescriptors now carry an optional socket fd to communicate
close events. So, make sure that the correct creator is called when
reconstructing parceled PFDs.

Bug: 10759966
Change-Id: Ic6b9ffb8cb7af5f3a12440def595f74682231866
2013-09-23 13:35:46 -07:00
Alan Viverette
599d2a49e8 Fix default style attr in DialogPreference subclass constructors
BUG: 10751709
Change-Id: Ia7fa91e52881b46d39711d2adc43330014234a55
2013-09-16 13:48:29 -07:00
Amith Yamasani
a927fb6169 am 23d6b7b3: am 618f8cc5: Merge "Don\'t leave space for summary text if it\'s an empty string" into klp-dev
* commit '23d6b7b36096eef53f819ee5eee0aba3beecde67':
  Don't leave space for summary text if it's an empty string
2013-09-10 09:02:43 -07:00
Amith Yamasani
618f8cc5db Merge "Don't leave space for summary text if it's an empty string" into klp-dev 2013-09-10 15:59:37 +00:00
Alan Viverette
617feb99a0 Add View constructor that supplies a default style resource
Also updates the constructor of every class that extends View.

BUG: 10676369
Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
2013-09-09 18:09:13 -07:00
Amith Yamasani
b25158886b Don't leave space for summary text if it's an empty string
Bug: 10639567
Change-Id: Ifeb71ea0779a86e39fe55fb0bc6cd267dba4a92e
2013-09-09 14:50:21 -07:00
Amith Yamasani
a5001b94a0 Throw an exception if isValidFragment is not overridden for KK targets
Bug: 9901133
Change-Id: I8dfe43aa90546e351f25c94579a34bb87658bf08
2013-09-06 14:18:00 -07:00
Alan Viverette
0ccef4d003 Merge "Apply implicit parent dependency when adding to PreferenceGroup" into klp-dev 2013-09-05 23:36:18 +00:00
Alan Viverette
651b4249b9 Apply implicit parent dependency when adding to PreferenceGroup
BUG: 10493706
Change-Id: Iba741d8dd4e72bc5aef5c033e42a9ba4fb0c523b
2013-09-05 13:32:40 -07:00
Chet Haase
e8222dddaf Change build version from KEY_LIME_PIE to KITKAT
Issue #10631619 Change build version to KitKat

Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
2013-09-05 08:44:33 -07:00
Alan Viverette
d3927bd035 Merge "Allow recycling of Preferences in com.android.* packages" into klp-dev 2013-08-21 01:58:55 +00:00
Alan Viverette
791b37e0d9 Allow recycling of Preferences in com.android.* packages
Refactors hasSpecifiedLayout to canRecycleLayout for readability's
sake. All boolean references to the method have been inverted.

BUG: 10079104
Change-Id: Ie6beda9f0b837f889a6cc6a80377349e98cc4883
2013-08-20 17:34:19 -07:00
Alan Viverette
02f5680363 Add implicit parent dependency for Preferences
Also removes unused dependency change listener interface.

BUG: 10117838
Change-Id: I03f0eb37e7ba69942f7997a8b32adb38a3dee0bd
2013-08-19 16:32:56 -07:00
Amith Yamasani
cf638aceef Use more styles for preferences to allow single pane 10"
Change-Id: Ib3b1032ca45f22bca08546eb65b2c42bc1975bdf
2013-08-06 15:19:10 -07:00