##WHAT IS ANDROID SHORTCUTS?
The shorctus have a features of Android 7.1 Nougat, and available only for the launcher that implement, in this library, you can implement in your launcher shortcuts starting from API 14! Whit new communication all developers will only implement shortcuts layout (this library), then it's up to developer to implement their own shortcuts, like Google!!! I have also implemented Force Touch and YOU CAN USE ON CUSTOM LAUNCHER WITH SHORTCUTS!!
##DONATIONS
This project needs you! If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated (and I love food, coffee and beer). Thank you!
PayPal
-
Donate $5: Thank's for creating this project, here's a coffee (or some beer) for you!
-
Donate $10: Wow, I am stunned. Let me take you to the movies!ù
-
Donate $15: I really appreciate your work, let's grab some lunch!
-
Donate $25: That's some awesome stuff you did right there, dinner is on me!
-
Donate $50: I really really want to support this project, great job!
-
Donate $100: You are the man! This project saved me hours (if not days) of struggle and hard work, simply awesome!
-
Donate $2799: Go buddy, buy Macbook Pro for yourself!
Of course, you can also choose what you want to donate, all donations are awesome!! Follow this link Donate!!
#v1.2.0 Preview##v1.1.0 Preview
##v1.0.0 Preview Click Here
##v0.2.0 Preview Click Here
##APP EXAMPLE
####Android Shortcuts is on Google Play!!!
####Or scan QR Code
##USAGE
Add this to build.gradle
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
Than add this dependencies
compile 'com.github.michelelacorte:AndroidAppShortcuts:1.2.0'
##DOCUMENTATION
Coming soon with Force Touch implementation
##SYSTEM REQUIREMENT
Android API 14+
##STATUS
##CHANGELOG
v1.3.0 (Coming Soon!)
- Fixed numbers of shortcuts at 5
- Fixed layout issue with numbers of shortcuts >= 2 :
- 1440x2560 (Portrait).
- 1080x1920 (Portrait).
- 720x1280 (Portrait).
v1.2.0
- Update class
ShortcutsCreation
layout bug fixed, now support device screen resolution:- 1440x2560 (Portrait).
- 1080x1920 (Portrait).
- 720x1280 (Portrait).
- Fixed layout with no toolbar padding.
- Fixed shortcuts constructor with
Bitmap
(remote shortcuts). - Fixed
mShortcutsOptions
click listener, now auto-convert resource into bitmap and create launcher shortcuts with icon. - Added class
StyleOption
, contains static int for menù option layout. - Added 1 style right menù of shortcuts (see int optionLayoutStyle or StyleOption class).
- Code style improvement by codacy.
- Fixed crash on Example App when click outside of GridView.
- Fixed crash when
OnShortcutsOptionClickListener
isn't defined (local shortcuts mode).
v1.1.0
- Deprecate AIDL communication, not suited to the needs, replaced with simple file data.
- Improved Example App, new version 1.1.
- Improved Shortcuts view, fixed bug.
- Added class
RemoteShortcuts
- Method
static void saveRemoteShortcuts(Activity activity, String packageName, ArrayList<Shortcuts> listOfShortcuts)
for save shortcuts and make accessible on library. - Method
static ArrayList<Shortcuts> getRemoteShortcuts(Activity activity, String packageName)
to get shortcuts from library. - Method
static void checkPermission(Activity activity)
for check WRITE_EXTERNAL_STORAGE permission on Android M and above. - Method
static void requestPermission(Activity activity)
for request permission to user.
- Method
- Update class
Shortcuts
- Added constructor
Shortcuts(Bitmap shortcutsImage, String shortcutsText)
- Added constructor
Shortcuts(int shortcutsImage, String shortcutsText, String targetClass, String targetPackage)
only for remote use. - Added constructor
Shortcuts(Bitmap shortcutsImage, String shortcutsText, String targetClass, String targetPackage)
only for remote use. - Added constructor
Shortcuts(int shortcutsImage, String shortcutsText, View.OnClickListener onShortcutsClickListener, View.OnClickListener onShortcutsOptionClickListener)
- Added getter
View.OnClickListener getOnShortcutsOptionClickListener()
- Added getter
Bitmap getShortcutsImageBitmap()
- Added getter
String getTargetPackage()
- Added getter
String getTargetClass()
- Added constructor
- Update class
Utils
- Added method
static void createShortcutsOnLauncher(Activity activity, Bitmap shortcutsImage, String shortcutsText, String className, String packageName)
for create shortcuts when user click on right menù (option menù)
- Added method
v1.0.0
- Improved Example App, soon relased on Google Play
Added classShortcutsService
that create remote connection and use AIDL to communicate with launcher, soon all developers will only implement shortcuts layout, then it's up to developer to implement their own shortcuts, like google!!!- Improved animation, almost equal to the Pixels Launcher.
- Added 2 style right menù of shortcuts (see int optionLayoutStyle)
- Added click shadow on shortcuts.
Added AIDL interfaceIRemoteShortcutClickListener
Methodvoid onShortcutsClickListener()
when user click on shortcutsMethodvoid onShortcutsOptionClickListener()
when user click on right menù
Added AIDL interfaceIRemoteShortcutService
Methodvoid addShortcutsWithRemoteClickListener(int shortcutsImage, String shortcutsText, IRemoteShortcutClickListener onShortcutsClickListener)
Methodvoid addShortcuts(int shortcutsImage, String shortcutsText)
MethodList<Shortcuts> getShortcuts()
Added AIDL interfaceShortcuts
provide parcelable ShortcutsAdded classRemoteServiceConnection
Public constructorRemoteServiceConnection(Activity activity, List<Shortcuts> shortcuts)
Public constructorRemoteServiceConnection(Activity activity, Shortcuts... shortcuts)
Public methodboolean connectServiceAndVerifyConnection(RemoteServiceConnection serviceConnection)
to bind service and return boolean to check if is connected.Public methodvoid connectService(RemoteServiceConnection serviceConnection)
to bind service.Public methodIRemoteShortcutService getService()
to retreive service.
Added classShortcutsService
to create service- Update class
Shortcuts
Added constructorShortcuts(int shortcutsImage, String shortcutsText, final IRemoteShortcutClickListener onIRemoteShortcutsClickListener)
- Added method
int getShortcutsImage()
- Added method
String getShortcutsText()
Added methodIRemoteShortcutClickListener getOnIRemoteShortcutsClickListener()
- Added method
View.OnClickListener getOnShortcutsClickListener()
Update class toParcelable
for AIDL communication.
- Update class
ShortcutsCreation
- Added private method
void createShortcutsBasedOnGridSize(int currentXPosition, int currentYPosition, int rowHeight, GridSize gridSize, List<Shortcuts> shortcuts)
- Update method
void createShortcutsBasedOnGridSize(int currentXPosition, int currentYPosition, int rowHeight, GridSize gridSize, int optionLayoutStyle, List<Shortcuts> shortcuts)
- Update method
void createShortcutsBasedOnGridSize(int currentXPosition, int currentYPosition, int rowHeight, GridSize gridSize, int optionLayoutStyle, final Shortcuts... shortcuts)
- Improved method
getPositionInGrid()
- Added private method
v0.2.0
- Improved Animation enter/exit on Shortcuts (See Preview)
- Update
ShortcutsCreation
class, now support all grid size!! (Tested major grid size Column x Row: 4x5, 4x4, 5x5, 5x4) - Added class
Utils
- Public method
GridSize getGridSize(AdapterView gridView)
- Public method
int getToolbarHeight(Activity activity)
moved fromShortcutsCreation
- Public method
- Added class
GridSize
- Public constructor
GridSize(int nColumn, int nRow)
- Public method
int getRowCount()
- Public method
int getColumnCount()
- Public constructor
- Update
ShortcutsCreation
, added paramint rowHeight
to constructor - Update
ShortcutsCreation
class- Added constructor
ShortcutsCreation(Activity activity, ViewGroup masterLayout, GridView gridView)
- Added private method boolean
isClickOnItem(int currentXPosition, int currentYPosition, GridSize gridSize)
- Added constructor
- Deleted
ResizeAnimation
class - Bug fix and code improvement
v0.1.0
- Support API 14+ (API 25 Compatible)
- Added params
ShorcutsCreation
class for initializegridView
andparentLayout
- Public constructor
ShortcutsCreation(Activity activity, ViewGroup masterLayout, AdapterView gridView)
- Public method to create shortctus
void createShortcuts(int currentXPosition, int currentYPosition, Shortcuts... shortcuts)
- Public method to clear layout
void clearAllLayout()
- Private method
int getToolbarHeight(Context context)
- Private method
void getScreenDimension()
- Private method
int getPositionInGrid(int currentXPosition, int currentYPosition, AdapterView gridView)
- Public constructor
- Added
Shortcuts
class for create your custom shortcuts!!- Public constructor with params
Shortcuts(int shortcutsImage, String shortcutsText, View.OnClickListener onShortcutsClickListener)
- Public constructor with params
Shortcuts(int shortcutsImage, String shortcutsText)
- Public method
void init(View layout)
do not use this, it's just to initialize shortcuts inShortcutsCreation
class
- Public constructor with params
- Added
ResizeAnimation
class to make transition- Public constructor
ResizeAnimation(View v, float fromWidth, float fromHeight, float toWidth, float toHeight)
- Protected method
applyTransformation(float interpolatedTime, Transformation t)
- Public constructor
##CREDITS
Author: Michele Lacorte (micky1995g@gmail.com)
Follow my Google+
##CONTRIBUTING
If you want to contribute to the project fork it and open Pull Request, or contact me by e-mail.
Each proposal will be accepted!
##LICENSE
Copyright 2016 Michele Lacorte
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.