Commit Graph

82 Commits

Author SHA1 Message Date
Sunny Goyal d804398755 Using SharedPrefenrece.apply instead of commit to prevent disk IO on main thread
Bug: 25903149
Change-Id: Ib1ee3fd27cca14f147f704aec768a330c4f03b33
2015-12-17 22:24:51 -08:00
Tony Wickham f2bd93c7e0 Handle errors gracefully in WallpaperCropActivity.
(cherry picked from commit c984cde008)
Now instead of crashing, it says "Couldn't load image."

Bug: 25326319
Bug: 25656670
Change-Id: I71471f4b26f7c23dee40b60772ddd798f67b409e
2015-11-18 11:31:26 -08:00
Tony Wickham 4530aca912 Set parallax offset to be 0.5f for default wallpapers.
This ensures they are centered as they were without any offset.

Bug: 25347076
Change-Id: Id773cd89463d47b350e60878c00e1112e0244414
2015-10-30 09:52:22 -07:00
Tony Wickham eb804b6aac Hide the "Set Wallpaper" action bar when clicked.
This already happens everywhere except for the case where an external
app such as Photos started the wallpaper picker. So not only is this
more consistent, it also prevents crashes and other potential issues
caused by clicking "Set Wallpaper" too many times.

Bug: 25026717

Change-Id: I63c6a0ce68656e6e68094e88074a836d8c1034f9
2015-10-21 21:01:54 +00:00
Tony Wickham 14a43ce3e6 Inform users when "Set wallpaper" fails.
Bug: 23716897
Change-Id: I06cd63d9ee869235c6a4c3140e574bf4c710454e
2015-09-25 14:18:20 -07:00
Tony Wickham 724c3c638a Merge "Show a spinner while wallpaper is being cropped." into ub-launcher3-burnaby-polish 2015-09-23 00:39:36 +00:00
Tony Wickham 625e4fe596 Show a spinner while wallpaper is being cropped.
Bug: 23599411

Change-Id: I6c5f75554fd59b7caa3a61f1b11b4a2a6aa21e7c
2015-09-22 17:33:20 -07:00
Tony Wickham ff9133f112 Adjust cropped bitmap bounds to correctly fit in original bitmap bounds.
Bug: 22631531

Change-Id: Ia0c1bccf4b8af3a8b335b865974c5d08f9836689
2015-09-23 00:13:56 +00:00
Tony Wickham 3e776a87dc Wallpaper preview parallax matches the actual wallpaper's.
Cherry picking the following changes from ub-launcher3-master:
Change-Id: I41c5bbbfdabfeb4e20d77e9b5804842a03211edf
Change-Id: I69afa3f8cc59c77e9c4c25e29e8db8c4beb87462
Change-Id: I82b7ba506d51ee4b3812af5fbdf95d3303b37aef
Change-Id: Id7c2b5483c5535d59be2f8a459ce7788e3c8318a

Bug: 23568800
Change-Id: I343169b9fdc5ceaab3d4b39044627d78b7267868
2015-09-10 11:56:54 -07:00
Tony Wickham b894aa1f67 Fix typos caused by gerrit's inline editor.
Change-Id: Ie142f5c6b418ac775cc167787f8e372d5354b91a
(cherry picked from commit 1ea392f0bc)
2015-09-04 22:34:09 +00:00
Tony Wickham aebd9fde89 Reuse existing temporary wallpaper tiles when selecting same photo.
Previously, if you selected a photo to set as the wallpaper multiple times, it
kept adding temporary wallpaper tiles that were all identical. Now it reuses the
same tile, updating the thumbnail and wallpaper if the Uri happens to point to a
new image (such as if a photo is renamed).

Change-Id: Ib05c9db4e1fd17226b503174f25add3368158b11
(cherry picked from commit f970ee5cdc)
2015-09-04 22:07:38 +00:00
Sunny Goyal 9fc953b94d Version code cleanup
> Renaming Lmp to Lollipop
  > Lollipop_MR1 instead of directly using 22
  > Using M APIs directly instead of reflection

Change-Id: I10a307f46e3be15b3299f549a2fd7e0e215a6a1b
2015-08-17 13:26:01 -07:00
Sunny Goyal 79a640ec35 Ensure that crop view is loaded before applying a wallpaper
Bug: 22293299
Change-Id: I64d5268cc263bbb6595a0b28bdd5ec73d540da41
2015-08-12 15:28:33 -07:00
Sunny Goyal b33e09a93c Preventing user from selecting any new time, when a tile is already being applied
Bug: 22293299
Change-Id: I6b9bf2b777d33ca23f291c7872ce1f338d41e516
2015-08-10 11:54:14 -07:00
Adam Cohen 209a859ded Fix issue where scroll container shadow didn't fade out
Change-Id: I3b0104dea04009819db0375c381b8ff445b76baa
2015-08-03 19:06:50 -07:00
Sunny Goyal 320a27b539 Removing junit.framework.Assert from wallpaper picker code
Bug: 22124692
Change-Id: Ifd41727a2ce4af660818b4f0cd6b95110ffdeec4
2015-06-26 14:10:44 -07:00
Adam Cohen b15d43837c Avoid crashing if we don't have the READ_EXTERNAL_STORAGE permission
issue 22019397

Change-Id: I7d556494569afaeac0ecdd641a089b78663b5563
2015-06-23 17:50:27 -07:00
Rahul Chaturvedi e863fed140 Read rotation setting correctly from the wallpaper picker.
If reading the rotation setting without the multi-process flag, the
WallpaperPickerActivity usually picks up a cached value. Specifying the
multi-process flag during the read fixes this and the wallpaper picker
always has the correct rotation setting.

Change-Id: Ic3639f8cd694674e92c8940b753c6bc30486076d
2015-06-15 14:09:42 -04:00
Mady Mellor 19b1bad239 Merge "Stylus support: creating and setting listeners for stylus button press" into ub-launcher3-burnaby 2015-06-03 16:26:35 +00:00
Mady Mellor ef044dd380 Stylus support: creating and setting listeners for stylus button press
This updates almost(*) all locations that use a long press listener to
also set a custom touch listener that recognizes the stylus button press
action.

The stylus button press action is: when a stylus touches a view while the
primary stylus button is pressed which may occur on a DOWN or MOVE event.

*The location this is *not* enabled for is: Longpress to enter "overview"
mode -- this isn't really a selection or drag n drop action; it is also
easy to accidentally do this while using the stylus gesture to drag n drop
items which is not an ideal interaction. Also not set for the "cling" that
demonstrates this.

Bug: 20430722
Change-Id: I9343f143261a7b4fada9afca28b8a11a60dbecca
2015-06-02 15:35:07 -07:00
Rahul Chaturvedi 7fc77cad3d Add the Allow Rotation setting to Launcher3.
This CL adds a Settings activity along with the code needed to provide
a "Allow Rotation" setting to all phones and tablets. This setting is
set to false for phones and true for tablets. On changing the setting
from unlocked to locked, the launcher (and the Settings activity)
will get locked to the orientation the user was in when he disabled
"Allow Rotation". This is consistent with how the natural rotation
feature of Android works.

Change-Id: I8a1c59d1fa0bb9262530cad96e0a9bdbab0d9344
2015-06-01 16:50:50 -04:00
Sunny Goyal 8abbd29ca3 Enabling setWallpaper button only if the image was loaded successfully
Bug: 20187333
Change-Id: I1b738a06499d20facbc4bccb1e6247086a45b686
2015-05-21 16:14:08 -07:00
Sunny Goyal e49c105de5 Verify that an image can be rendered on a GL Surface before using it
Bug: 20138883
Change-Id: I8de70eb971f31c2a4c07a7903e097a1586402282
2015-05-18 16:42:22 -07:00
Sunny Goyal 7066003b20 Various lint error fixes.
> Fixing some RTL errors by specifying both marginStart and marginLeft
> Moving all layout direction checks to Utilities
> Explicitely adding @TargetApi before every method

Change-Id: Ibe9c52b93b5a6adeadb27ace2b312770fd732ea0
2015-05-14 12:28:07 -07:00
Sunny Goyal bbc140b545 Merge "Revert "Revert "Disable setWallpaper button until the wallpaper is loaded" Will submit again after the drop" Actual fix" into ub-launcher3-burnaby 2015-04-15 23:53:43 +00:00
Sunny Goyal 89a6ec2af2 Revert "Revert "Disable setWallpaper button until the wallpaper is loaded" Will submit again after the drop"
Actual fix

This reverts commit b4b01efa43.

Change-Id: I65cc75e0f1a95f69be607bb5b11d7f4627ff25c1
2015-04-15 23:40:57 +00:00
Sunny Goyal b3c5fac5dc Merge "Revert "Disable setWallpaper button until the wallpaper is loaded" Will submit again after the drop" into ub-launcher3-burnaby 2015-04-15 23:39:51 +00:00
Sunny Goyal b4b01efa43 Revert "Disable setWallpaper button until the wallpaper is loaded"
Will submit again after the drop

This reverts commit 65776c4359.

Change-Id: I5f85d0c70f3f5faf85d9ba16e82d4714b694a193
2015-04-15 23:38:17 +00:00
Sunny Goyal 8fbb771537 Merge "Disable setWallpaper button until the wallpaper is loaded" into ub-launcher3-burnaby 2015-04-15 22:26:32 +00:00
Sunny Goyal 65776c4359 Disable setWallpaper button until the wallpaper is loaded
Bug: 20187333
Change-Id: Id7a42616560e15eddedad5846ef927a3be52ed1c
2015-04-15 14:17:46 -07:00
Neil Fuller ba41458f5c Remove usage of FloatMath
Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I2effc3f498fb13e66de9a905b9a40ac5688a5850
2015-04-15 09:10:18 +01:00
Sunny Goyal 7f06ae5c8b Removing Pools.java as it is present in support lib
Change-Id: I0f1346223aa289889dbefedd47bff093e9c2c05d
2015-04-08 11:08:27 -07:00
Sunny Goyal 1d0b093a6e Adding BaseActivity which can be overriden for custom behavior
Change-Id: I6707aa99f5d33dceede226a6367e24482f5157f6
2015-03-21 11:11:03 -07:00
Sunny Goyal 6a1e95a3df Removing all dependencies of launcher code on wallpaper-picker
> WallpaperPicker can still depend on launcher code, but not the
other way round.

Change-Id: I93a07f985c3955c638a68a5fad9c09b184a879b9
2015-03-20 18:16:58 -07:00
Adam Cohen 091440a9cb Reducing method count by eliminating synthetic accessors
Elimates 304 methods based on dex analysis

The java compiler generates sythetic accessor methods for all private
fields, methods and contructors accessed from inner classes. By marking them
package-private and @Thunk instead, sythentic accessor methods are no
longer needeed. These annotated elements should be treated as private.

Change-Id: Id0dc2c92733474250d8ff12fa793d3a8adeb1f26
2015-03-20 11:15:54 -07:00
Sunny Goyal 9c83a0da6d Cleaning up some resources in WallpaperPickerActivity
Change-Id: I4923403c0c094d0ae0b00e3a08a13099c3addb10
2015-02-26 19:33:38 +00:00
Sunny Goyal 9f9d0a59c4 Picking a bitmap to reuse where least pixels are wasted
Change-Id: I4217bc68a5caa2d1526e4ebb101dbaf0348066d3
2015-02-25 11:53:26 -08:00
Sunny Goyal 65b929d6f2 Reducing memory usage of wallpaper picker
> Loading preview bitmap only once, instead of loading it twice at BitmapRegionTileSource and BitmapSource
> Maintaing a weak-set of reusable bitmaps and reusing them for decoding bitmaps
> Loading images on a HandlerThread (instead of AsyncTask) and removing any non-started task before submitting a new task
> Loading inbuild images (from resources) on HandlerThread instead of UIThread
> Freeing up unbound GL textures before binding a new texture.

Bug: 18382606
Change-Id: Ic4ca630dd113ded65d2853eb0d291c9e5823637e
(cherry picked from commit 283c2261bd)
2015-02-24 23:18:25 +00:00
Sunny Goyal f3e4f548fd Merge "Moving some files and methods around" into ub-launcher3-master 2015-02-20 01:54:31 +00:00
Sunny Goyal 9026271410 Merge "Fixing logic to determine if wallpaper change." into ub-launcher3-master 2015-02-20 01:50:47 +00:00
Sunny Goyal 35746d6029 Merge "Removing unused BlockingGLTextureView" into ub-launcher3-master 2015-02-12 22:26:48 +00:00
Sunny Goyal 06a4d3f1af Moving some files and methods around
> Removing android.util package
> Moving static methods and classes out of WallpaperCropActivity
> Removing some unused utility methods

Change-Id: I252a0655ddce195189b6b3f0bf92970e5808c9d7
2015-02-12 12:25:56 -08:00
Sunny Goyal c7eef37512 Removing unused BlockingGLTextureView
Change-Id: Iac5aec1193e53dd554f61d07201bac06178914f5
2015-02-12 10:13:09 -08:00
Sunny Goyal fddef4634c Fixing logic to determine if wallpaper change.
> Current logic to determine if livewallpaper changed returns true all the time
> Use returnCode passed by the calling activity.

Change-Id: Ida800a90451b1f7d368234e1a7e10938dcf2f6f7
2015-02-12 10:01:15 -08:00
Sunny Goyal 6f553b975f Fixing last image thumb, being loaded twice
Change-Id: I241e472a3f0869b82066163514fb2c29c0f18a8f
2015-02-12 09:58:04 -08:00
Sunny Goyal 5736ed319d Merge "Removing usage of reflection." into ub-launcher3-master 2015-01-21 01:13:27 +00:00
Sunny Goyal d009101232 Removing usage of reflection.
> Updated launcher.java with the new APIs
> Removed unused method in BitmapUtils

Change-Id: I24804d2cd7d9fc45040532e8324672f5ea6fc110
2015-01-20 15:56:23 -08:00
Sunny Goyal c46bfef5df Removing support library dependency
> Removed FolderAutoScrollHelper as folders are currently not scrollable

Change-Id: I261f43a665b742697e3224e1e9852ccc526badcd
2015-01-20 11:49:12 -08:00
Helena Josol 28db280b7a Add more Launcher files to delete on Clear Launcher Data
Bug: 12753154
Change-Id: I00679bdc6eff70a1398122aaa955c08eabd556b1
2014-10-16 17:35:50 +01:00
Helena Josol 4fbbb3e3e0 Create a central list of files the Launcher writes to the app directory
Replace hardcoded Launcher filenames with the defined constants.

Bug: 12753154
Change-Id: I072f202d9388a703b9e6851bde64ea7fafe4b10a
2014-10-06 17:08:10 +01:00