From 29f17b97f4cb80706e19ab3728a94391947848bd Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Mon, 19 Oct 2009 15:51:50 -0400 Subject: Incorporate UX feedback into Live Wallpaper picker. - "Configure..." button is hidden when unavailable - Reorder buttons: Set on left, Configure on right - Change "Configure..." to "Settings..." for consistency with rest of system Also fixes http://b/issue?id=2167421 by setting wallpaper offsets to (0.5, 0) when attaching a new wallpaper. --- .../wallpaper/livepicker/LiveWallpaperPickActivity.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/com/android/wallpaper') diff --git a/src/com/android/wallpaper/livepicker/LiveWallpaperPickActivity.java b/src/com/android/wallpaper/livepicker/LiveWallpaperPickActivity.java index 0cd60bb..c2db020 100644 --- a/src/com/android/wallpaper/livepicker/LiveWallpaperPickActivity.java +++ b/src/com/android/wallpaper/livepicker/LiveWallpaperPickActivity.java @@ -293,7 +293,7 @@ public class LiveWallpaperPickActivity extends Activity implements button.setOnClickListener(this); mConfigureButton = (Button)findViewById(R.id.configure); - mConfigureButton.setEnabled(false); + mConfigureButton.setVisibility(View.GONE); mConfigureButton.setOnClickListener(this); // Set default return data @@ -340,8 +340,11 @@ public class LiveWallpaperPickActivity extends Activity implements public void onItemSelected(AdapterView parent, View v, int position, long id) { mSelectedIntent = mWallpaperIntents.get(position); mSelectedInfo = mWallpaperInfos.get(position); - mConfigureButton.setEnabled(mSelectedInfo != null - && mSelectedInfo.getSettingsActivity() != null); + mConfigureButton.setVisibility( + (mSelectedInfo != null && + mSelectedInfo.getSettingsActivity() != null) + ? View.VISIBLE + : View.GONE); findViewById(R.id.set).setEnabled(true); WallpaperConnection conn = new WallpaperConnection(mSelectedIntent); @@ -359,6 +362,8 @@ public class LiveWallpaperPickActivity extends Activity implements try { mWallpaperManager.getIWallpaperManager().setWallpaperComponent( mSelectedIntent.getComponent()); + mWallpaperManager.setWallpaperOffsets( + v.getRootView().getWindowToken(), 0.5f, 0.0f); this.setResult(RESULT_OK); } catch (RemoteException e) { // do nothing -- cgit v1.2.3