Commit Graph

66 Commits

Author SHA1 Message Date
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
Adam Cohen 4ae96ce92d Add ability for Partner customization apk to override certain DeviceProfile params
-> Workspace row / col counts
-> All apps row / col counts
-> Workspace icon size

issue 17208277

Change-Id: I25cfafede4da783083593b9bfeff4e5ba7751d36
2014-09-04 15:12:55 +00:00
Sunny Goyal 0af0d8422b Saving the system wallpaper thumbnail prefixed by the SDK_INT
so that it is recreated after a system update.

issue: 15670065

Change-Id: I237ef1d99676d5a0ac6ff7b4a80a7a72905ef1ed
2014-08-13 12:16:59 -07:00
Sunny Goyal 0fe505bf82 Autoinstalls loading xml
> Launcher checkes for an apk in the system image with a broadcast
receiver for action:
com.android.launcher3.action.LAUNCHER_CUSTOMIZATION
> Default layout is parsed from that apk, which can also contain
icons and string resources used in the layout config

Change-Id: I44fc9e7c3134f525f7b5db29f4e8bb56e17ce445
2014-08-12 14:13:18 -07:00
Adam Cohen f24c61295d Add partner customization option to force first run flow
Change-Id: Id50587cbb95e375b3847597f12bd8566c70dd7bc
(cherry picked from commit 923e1de9f0d7672dd18947ecde2b0da8c5768b7a)
2014-08-08 04:31:24 +00:00
Adam Cohen 8dc6e1bfa2 Fix SecurityException when exiting wallpaper picker early
issue 16155967

Change-Id: Iba1add737089b73e6e5bbfb143dce4204fa9dc7c
2014-07-24 10:48:20 -07:00
Sunny Goyal 0c625eeec2 Merge "Adding options in the partner apk to disable the default wallpaper and provide a folder containing additional wallpapers" into ub-now-master 2014-07-23 18:44:51 +00:00
Sunny Goyal e9bacd9c2b Fixing memory leak in WallpaperCropActivity
issue 15516788

Change-Id: I6feb4cb72052bc7f19e9c30957bff7dcccd5bc9d
2014-07-22 09:39:01 -07:00
Sunny Goyal cdc4dbd878 Adding options in the partner apk to disable the default wallpaper and
provide a folder containing additional wallpapers

issue: 16045459

Change-Id: Id411121ff552d0d270258a5b371d1fd756bd7884
2014-07-16 16:19:23 -07:00
Adam Cohen 56c2acc3df Add method to check if there is a partner folder
Change-Id: I6154c731edfeb2a4fc0aed94f74a556059b5d103
2014-06-12 18:04:10 -07:00
Adam Cohen c8d31ff228 Add null check for empty MediaStore cursor
issue 15397853

Change-Id: I1c28262e181a4f32e1f7a58813121db72746d6a8
2014-06-12 12:37:55 -07:00
Adam Skory 5fbdd06489 Squash unreachable catch
The compiler warning distracts me often.

Change-Id: I0192314f4ac9d8e3acb40dd10a39de297affcdac
2014-06-04 18:13:49 +01:00
Adam Cohen 9b8f51fcc8 Adding ability for partners to specify a default layout
Change-Id: Ib071faa4b41d13961c3a33b865b40a644631c08a
2014-06-02 11:06:47 -07:00
Adam Cohen ea90f83e24 Check before suggesting default wallpaper dimensions
issue 14470153

Change-Id: Id00e9cb4bd2b769818ed61de65be8c1c0119e07d
2014-05-21 17:13:40 -07:00
Sameer Padala e697a9a042 Move Partner.java into the Wallpaper directory.
WallpaperPicker depends on this and have this class in Launcher3 would cause a
circular dependency in google3

Change-Id: Ia582bcb988a4f6375904660546b1bc1744d25238
2014-05-02 15:06:35 -07:00
Jeff Sharkey 5aeef58131 Add support for partner customization.
Traditionally Launcher workspace customization is offered through
overlays at build time, but we don't have access to partner-specific
customization at build time.  To solve this, this adds a new
"partner-folder" tag which points at an XML resource provided by
an external package.

The external package XML can't depend on the binary XML attributes
defined by Launcher3, so we switch to using manual string-based
attribute lookups.  Partners can also provide extra wallpapers.

When a folder only results in a single item, promote that item into
the folder location instead of deleting completely.

Bug: 13340779
Change-Id: Ide558288bef4113565f288b700d8245055c0fee9
2014-04-22 12:28:51 -07:00
Selim Cinek 314425602a Fixed crash when setting wallpaper with built in rotation
If an image had a built-in rotation, a crash could occur,
when setting it. An example was a panorama image which had
a rotation of 90 degrees.

Change-Id: Iede8226dac3a40f08d39a69162eb388e6aba97ec
Bug: 13507421
2014-03-27 20:35:19 +01:00