java.lang.Object | |
↳ | com.samsung.android.knox.custom.ShortcutItem |
This class defines a custom items in the home screen shortcuts.
API level 20 |
Version 2.7 |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Class constructor.
| |||||||||||
This method is a constructor for App Shortcut to be added to a screen.
| |||||||||||
This method is a constructor for App Shortcut to be added to a folder.
| |||||||||||
This method is a constructor for File Shortcut to be added to a screen.
| |||||||||||
This method is a constructor for File Shortcut to be added to a folder.
| |||||||||||
This method is a constructor for Folder Shortcut to be added to a screen.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Not implemented.
| |||||||||||
This method gets the CellX, internal member assigned in the constructor.
| |||||||||||
This method gets the CellY, internal member assigned in the constructor.
| |||||||||||
This method gets the Color, internal member assigned in the constructor.
| |||||||||||
This method gets the FolderPosition, internal member assigned in the constructor.
| |||||||||||
This method gets the Icon, internal member assigned in the constructor.
| |||||||||||
This method gets the Icon as a byte array, internal member assigned in the constructor.
| |||||||||||
This method gets the Intent, internal member assigned in the constructor.
| |||||||||||
This method gets the MoreItems, internal member assigned in the constructor.
| |||||||||||
This method gets the Name, internal member assigned in the constructor.
| |||||||||||
This method gets the Parent, internal member assigned in the constructor.
| |||||||||||
This method gets the ShortcutType, internal member assigned in the constructor.
| |||||||||||
This method returns the string representation of this class instance.
| |||||||||||
This method flatten this object in to a Parcel (out).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Class constructor.
shortcutType | Specifies type of shortcut to be added: SHORTCUT_APP_TYPE SHORTCUT_FILE_TYPE SHORTCUT_FOLDER_TYPE |
---|---|
name | Specifies name of shortcut to be added. |
intent | Specifies intent of shortcut to be added. Note: This parameter is ignored for folder shortcuts. |
parent | Specifies screen or folder in which the shortcut will be added. |
folderPos | Specifies position within folder of shortcut or USE_DEFAULT . |
x | Specifies horizontal offset of shortcut location. |
y | Specifies vertical offset of shortcut location. |
color | Specifies color of shortcut location: USE_DEFAULT FOLDER_COLOUR_1 FOLDER_COLOUR_2 FOLDER_COLOUR_3 FOLDER_COLOUR_4 FOLDER_COLOUR_5 Note: This parameter is ignored for app and file shortcuts. |
icon | Specifies icon of shortcut to be added. Note: This parameter is ignored for app and folder shortcuts. |
moreItems | Specifies if there are more shortcuts to be added ON or OFF . Note: This parameter should be set to ON whilst the shortcuts are being added and set to OFF for the final shortcut. |
int shortcutType = CustomDeviceManager.SHORTCUT_FOLDER_TYPE; // Shortcut for Folder String shortcutFolderName = "CustomFolder"; int shortcut_X = 2; int shortcut_Y = 1; int folderColor = CustomDeviceManager.FOLDER_COLOUR_1; int moreItems = CustomDeviceManager.ON; ShortcutItem folderItem = new ShortcutItem(shortcutType,shortcutFolderName, null, kcsm.getParentScreen(3), 0, shortcut_X, shortcut_Y, folderColor, null, moreItems); shortcutType = CustomDeviceManager.SHORTCUT_APP_TYPE; // Shortcut for App String shortcutAppName = "CustomApp"; int folderPos = 0; PackageManager pm = getPackageManager(); Intent shortcutIntent = pm.getLaunchIntentForpackage(getPackageName()); moreItems = CustomDeviceManager.OFF; ShortcutItem appItem = new ShortcutItem(shortcutType,shortcutAppName, shortcutIntent, shortcutFolderName, folderPos, shortcut_X, shortcut_Y, CustomDeviceManager.USE_DEFAULT, null, moreItems); |
API level 20 |
Version 2.7 |
This method is a constructor for App Shortcut to be added to a screen.
shortcutType | Specifies type of shortcut to be added: SHORTCUT_APP_TYPE |
---|---|
name | Specifies name of shortcut to be added. |
intent | Specifies intent of shortcut to be added. |
parentScreen | Specifies screen in which the shortcut will be added. |
x | Specifies horizontal offset of shortcut location. |
y | Specifies vertical offset of shortcut location. |
moreItems | Specifies if there are more shortcuts to be added ON or OFF . Note: This parameter should be set to ON whilst the shortcuts are being added and set to OFF for the final shortcut. |
shortcutType = CustomDeviceManager.SHORTCUT_APP_TYPE; // Shortcut for App String shortcutAppName = "CustomApp"; shortcut_X = 0; shortcut_Y = 0; PackageManager pm = getPackageManager(); Intent shortcutIntent = pm.getLaunchIntentForpackage(getPackageName()); moreItems = CustomDeviceManager.OFF; ShortcutItem appScreenItem = new ShortcutItem(shortcutType,shortcutAppName, shortcutIntent, kcsm.getParentScreen(3), shortcut_X, shortcut_Y, moreItems); |
API level 20 |
Version 2.7 |
This method is a constructor for App Shortcut to be added to a folder.
shortcutType | Specifies type of shortcut to be added: SHORTCUT_APP_TYPE |
---|---|
name | Specifies name of shortcut to be added. |
intent | Specifies intent of shortcut to be added. |
parentFolder | Specifies folder in which the shortcut will be added. |
folderPos | Specifies position within folder of shortcut or USE_DEFAULT . |
moreItems | Specifies if there are more shortcuts to be added ON or OFF . Note: This parameter should be set to ON whilst the shortcuts are being added and set to OFF for the final shortcut. |
shortcutType = CustomDeviceManager.SHORTCUT_APP_TYPE; // Shortcut for App String shortcutAppName = "CustomApp"; String shortcutFolderName = "CustomFolder"; int folderPosition = CustomDeviceManager.USE_DEFAULT; PackageManager pm = getPackageManager(); Intent shortcutIntent = pm.getLaunchIntentForpackage(getPackageName()); moreItems = CustomDeviceManager.OFF; ShortcutItem appFolderItem = new ShortcutItem(shortcutType,shortcutAppName, shortcutIntent, shortcutFolderName, folderPosition, moreItems); |
API level 20 |
Version 2.7 |
This method is a constructor for File Shortcut to be added to a screen.
shortcutType | Specifies type of shortcut to be added: SHORTCUT_FILE_TYPE or |
---|---|
name | Specifies name of shortcut to be added. |
intent | Specifies intent of shortcut to be added. |
parentScreen | Specifies screen in which the shortcut will be added. |
x | Specifies horizontal offset of shortcut location. |
y | Specifies vertical offset of shortcut location. |
icon | Specifies icon of shortcut to be added. |
moreItems | Specifies if there are more shortcuts to be added ON or OFF . Note: This parameter should be set to ON whilst the shortcuts are being added and set to OFF for the final shortcut. |
shortcutType = CustomDeviceManager.SHORTCUT_FILE_TYPE; // Shortcut for File String shortcutFileName = "CustomFile"; shortcut_X = 0; shortcut_Y = 0; String filePath = "/storage/emulated/0/Samsung/Music/Over the Horizon.mp3"; File f = new File(filePath); Intent shortcutIntent = new Intent(Intent.ACTION_VIEW); MimeTypeMap mime = MimeTypeMap.getSingleton(); String mimeType = mime.getMimeTypeFromExtension("mp3"); shortcutIntent.setDataAndType(Uri.fromFile(f), mimeType); BitmapDrawable icon = getResources().getDrawable("com.test.app"); moreItems = CustomDeviceManager.OFF; ShortcutItem fileScreenItem = new ShortcutItem(shortcutType,shortcutFileName, shortcutIntent, kcsm.getParentScreen(3), shortcut_X, shortcut_Y, icon, moreItems); |
API level 20 |
Version 2.7 |
This method is a constructor for File Shortcut to be added to a folder.
shortcutType | Specifies type of shortcut to be added: SHORTCUT_FILE_TYPE |
---|---|
name | Specifies name of shortcut to be added. |
intent | Specifies intent of shortcut to be added. |
parentFolder | Specifies folder in which the shortcut will be added. |
folderPos | Specifies position within folder of shortcut or USE_DEFAULT . |
icon | Specifies icon of shortcut to be added. |
moreItems | Specifies if there are more shortcuts to be added ON or OFF . Note: This parameter should be set to ON whilst the shortcuts are being added and set to OFF for the final shortcut. |
shortcutType = CustomDeviceManager.SHORTCUT_FILE_TYPE; // Shortcut for File String shortcutFileName = "CustomFile"; String shortcutFolderName = "CustomFolder"; int folderPosition = 0; String filePath = "/storage/emulated/0/Samsung/Music/Over the Horizon.mp3"; File f = new File(filePath); Intent shortcutIntent = new Intent(Intent.ACTION_VIEW); MimeTypeMap mime = MimeTypeMap.getSingleton(); String mimeType = mime.getMimeTypeFromExtension("mp3"); shortcutIntent.setDataAndType(Uri.fromFile(f), mimeType); BitmapDrawable icon = getResources().getDrawable("com.test.app"); moreItems = CustomDeviceManager.OFF; ShortcutItem fileFolderItem = new ShortcutItem(shortcutType,shortcutFileName, shortcutIntent, shortcutFolderName, folderPosition, icon, moreItems); |
API level 20 |
Version 2.7 |
This method is a constructor for Folder Shortcut to be added to a screen.
shortcutType | Specifies type of shortcut to be added: SHORTCUT_FOLDER_TYPE |
---|---|
name | Specifies name of shortcut to be added. |
parentScreen | Specifies screen in which the shortcut will be added. |
x | Specifies horizontal offset of shortcut location. |
y | Specifies vertical offset of shortcut location. |
color | Specifies color of shortcut location: USE_DEFAULT FOLDER_COLOUR_1 FOLDER_COLOUR_2 FOLDER_COLOUR_3 FOLDER_COLOUR_4 FOLDER_COLOUR_5 |
moreItems | Specifies if there are more shortcuts to be added ON or OFF . Note: This parameter should be set to ON whilst the shortcuts are being added and set to OFF for the final shortcut. |
shortcutType = CustomDeviceManager.SHORTCUT_FOLDER_TYPE; // Shortcut for Folder String shortcutFolderName = "CustomFolder"; shortcut_X = 0; shortcut_Y = 0; int folderColor = CustomDeviceManager.FOLDER_COLOUR_1; moreItems = CustomDeviceManager.OFF; ShortcutItem folderScreenItem = new ShortcutItem(shortcutType,shortcutFolderName, kcsm.getParentScreen(3), shortcut_X, shortcut_Y, folderColor, moreItems); |
API level 20 |
Version 2.7 |
Not implemented.
API level 20 |
Version 2.7 |
This method gets the CellX, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the CellY, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the Color, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the FolderPosition, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the Icon, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the Icon as a byte array, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the Intent, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the MoreItems, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the Name, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the Parent, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method gets the ShortcutType, internal member assigned in the constructor.
API level 20 |
Version 2.7 |
This method returns the string representation of this class instance.
API level 20 |
Version 2.7 |
This method flatten this object in to a Parcel (out).
out | The parcel where the data is written. |
---|---|
flags | Not used. |
API level 20 |
Version 2.7 |