diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 47d8c4d00aa..590f4b3b367 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -320,6 +320,8 @@ android:theme="@android:style/Theme.NoTitleBar"> + + diff --git a/res/layout/running_services_item.xml b/res/layout/running_services_item.xml index 6748a1a1a04..2728c76f433 100644 --- a/res/layout/running_services_item.xml +++ b/res/layout/running_services_item.xml @@ -50,30 +50,21 @@ android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" > - - + + android:textAppearance="?android:attr/textAppearanceMedium" + android:textStyle="bold" + android:singleLine="true" + android:ellipsize="marquee" + android:layout_marginBottom="2dip" /> + diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 82f7d5e4e44..bb786c2bed6 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -48,6 +48,34 @@ yyyy-MM-dd + + + Off + Some + All + Slow + + + + + No window animations are shown + Some window animations are shown + All window animations are shown + Slower window animations are shown + + + + + + 00 + + 01 + + 11 + + 22 + + 15 seconds diff --git a/res/values/strings.xml b/res/values/strings.xml index a73f9105a0e..9043dba1197 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1421,6 +1421,10 @@ found in the list of installed applications. Stop Cancel + + Started by application + + %1$s: select to manage diff --git a/res/xml/sound_and_display_settings.xml b/res/xml/sound_and_display_settings.xml index 639204a8aa5..1d5e66a2f58 100644 --- a/res/xml/sound_and_display_settings.xml +++ b/res/xml/sound_and_display_settings.xml @@ -110,11 +110,12 @@ android:summaryOn="@string/accelerometer_summary_on" android:summaryOff="@string/accelerometer_summary_off"/> - + it = mActiveItems.values().iterator(); + while (it.hasNext()) { + ActiveItem ai = it.next(); + if (ai.mRootView.getWindowToken() == null) { + // Clean out any dead views, just in case. + it.remove(); + continue; + } ai.updateTime(RunningServices.this); } removeMessages(MSG_UPDATE_TIMES); @@ -496,14 +530,28 @@ public class RunningServices extends ListActivity protected void onListItemClick(ListView l, View v, int position, long id) { BaseItem bi = (BaseItem)l.getAdapter().getItem(position); if (!bi.mIsProcess) { - mCurSelected = bi; - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.confirm_stop_service); - builder.setMessage(R.string.confirm_stop_service_msg); - builder.setPositiveButton(R.string.confirm_stop_stop, this); - builder.setNegativeButton(R.string.confirm_stop_cancel, null); - builder.setCancelable(true); - mCurDialog = builder.show(); + ServiceItem si = (ServiceItem)bi; + if (si.mRunningService.clientLabel != 0) { + mCurSelected = null; + PendingIntent pi = mAm.getRunningServiceControlPanel( + si.mRunningService.service); + if (pi != null) { + try { + pi.send(); + } catch (PendingIntent.CanceledException e) { + // whatever. + } + } + } else { + mCurSelected = bi; + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.confirm_stop_service); + builder.setMessage(R.string.confirm_stop_service_msg); + builder.setPositiveButton(R.string.confirm_stop_stop, this); + builder.setNegativeButton(R.string.confirm_stop_cancel, null); + builder.setCancelable(true); + mCurDialog = builder.show(); + } } else { mCurSelected = null; } diff --git a/src/com/android/settings/SoundAndDisplaySettings.java b/src/com/android/settings/SoundAndDisplaySettings.java index 4417f240c33..5f4f3581d0b 100644 --- a/src/com/android/settings/SoundAndDisplaySettings.java +++ b/src/com/android/settings/SoundAndDisplaySettings.java @@ -73,7 +73,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private CheckBoxPreference mVibrate; private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; - private CheckBoxPreference mAnimations; + private ListPreference mAnimations; private CheckBoxPreference mAccelerometer; private float[] mAnimationScales; @@ -118,8 +118,8 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mSoundEffects.setPersistent(false); mSoundEffects.setChecked(Settings.System.getInt(resolver, Settings.System.SOUND_EFFECTS_ENABLED, 0) != 0); - mAnimations = (CheckBoxPreference) findPreference(KEY_ANIMATIONS); - mAnimations.setPersistent(false); + mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS); + mAnimations.setOnPreferenceChangeListener(this); mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); mAccelerometer.setPersistent(false); @@ -187,29 +187,49 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements R.string.silent_mode_incl_alarm_summary : R.string.silent_mode_summary); - boolean animations = true; + int animations = 0; try { mAnimationScales = mWindowManager.getAnimationScales(); } catch (RemoteException e) { } if (mAnimationScales != null) { - // We will leave the window animations alone (always set), - // and only use this to change the transition animations. - for (int i=1; i= 1) { + animations = ((int)(mAnimationScales[0]+.5f)) % 10; + } + if (mAnimationScales.length >= 2) { + animations += (((int)(mAnimationScales[1]+.5f)) & 0x7) * 10; } } - if (animations != mAnimations.isChecked() || force) { - mAnimations.setChecked(animations); + int idx = 0; + int best = 0; + CharSequence[] aents = mAnimations.getEntryValues(); + for (int i=0; i best) { + best = val; + idx = i; + } } + mAnimations.setValueIndex(idx); + updateAnimationsSummary(mAnimations.getValue()); mAccelerometer.setChecked(Settings.System.getInt( getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0) != 0); } + private void updateAnimationsSummary(Object value) { + CharSequence[] summaries = getResources().getTextArray(R.array.animations_summaries); + CharSequence[] values = mAnimations.getEntryValues(); + for (int i=0; i 0) { - // Window animations are always on. - mAnimationScales[0] = 1; - } - for (int i=1; i= 1) { + mAnimationScales[0] = value%10; + } + if (mAnimationScales.length >= 2) { + mAnimationScales[1] = (value/10)%10; + } + try { + mWindowManager.setAnimationScales(mAnimationScales); + } catch (RemoteException e) { + } + updateAnimationsSummary(objValue); + } catch (NumberFormatException e) { + Log.e(TAG, "could not persist animation setting", e); + } + + } if (KEY_SCREEN_TIMEOUT.equals(preference.getKey())) { int value = Integer.parseInt((String) objValue); try {