This plugin adds a hideable native toolbar. The toolbar is displayed using a double tap gesture. The last button in the toolbar on Android displays items that do not fit or are less commonly used.
To learn more about icons have a look at Icons on Android, iOS Toolbar and Navigation Bar Buttons, iOS Content Views and Apache Cordova Icons and Splash Screens.
For additional details on the Toolbar plugin see C:\SAP\MobileSDK3\KapselSDK\docs\api\sap.Toolbar.html or Using the Toolbar Plugin.
This plugin is intended to be used with the SAP Fiori Client. The plugin is needed in the SAP Fiori Client as the Fiori Apps that run within it are online apps that normally run in a browser that has back and reload buttons which are not present in a regular cordova app.
The following steps will demonstrate how to modify the sample used in the logon plugin section to have the buttons such as read, lock, unlock, register and unregister be moved to the toolbar.
cordova plugin add kapsel-plugin-toolbar --searchpath %KAPSEL_HOME%/plugins
or
cordova plugin add kapsel-plugin-toolbar --searchpath $KAPSEL_HOME/plugins
For Android you need to modify the activity theme in the AndroidManifest.xml to be android:theme="@android:style/Theme.Holo".
The minSdkVersion must also be changed to at least 11.
To make the change, modify the file C:\Kapsel_Projects\LogonDemo\platforms\android\AndroidManifest.xml and change<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="LogonDemo" android:theme="@android:style/Theme.Black.NoTitleBar">
to<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="LogonDemo" android:theme="@android:style/Theme.Holo">
and<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
to<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19" />
function addToolbarMenuItems(screenID) {
sap.Toolbar.clear();
if (screenID == "LoadingDiv") {
//Do not add any toolbar items.
}
else if (screenID == "LockedDiv") {
sap.Toolbar.addItem({"label" : "UnLock", "icon" : "ic_action_not_secure", "showAsAction" : sap.Toolbar.SHOW_AS_ACTION_ALWAYS }, function() {unlock();});
}
else if (screenID == "MainDiv") {
sap.Toolbar.addItem({"label" : "Read", "icon" : "ic_action_refresh", "showAsAction" : sap.Toolbar.SHOW_AS_ACTION_ALWAYS | sap.Toolbar.SHOW_AS_ACTION_WITH_TEXT }, function() {clearTable();read();});
if (applicationContext == null) {
sap.Toolbar.addItem({"label" : "Register", "icon" : "ic_action_add_person", "showAsAction" : sap.Toolbar.SHOW_AS_ACTION_ALWAYS }, function() {register();});
}
else {
sap.Toolbar.addItem({"label" : "UnRegister", "icon" : "no_icon", "showAsAction" : sap.Toolbar.SHOW_AS_ACTION_WITH_TEXT }, function() {unRegister();});
}
sap.Toolbar.addItem({"label" : "Lock", "icon" : "ic_action_secure", "showAsAction" : sap.Toolbar.SHOW_AS_ACTION_ALWAYS }, function() {lock();});
}
}
Add the below line to the showScreen method.addToolbarMenuItems(screenIDToShow);
Add the below line to the end of the method logonUnregisterSuccessCallback(result).showScreen("MainDiv");
Action Bar Icons\holo_dark\01_core_refresh
Action Bar Icons\holo_dark\06_social_add_person
Action Bar Icons\holo_dark\10_device_access_secure
Action Bar Icons\holo_dark\10_device_access_not_secure
Copy the child folders into C:\Kapsel_Projects\LogonDemo\platforms\android\res.~/SAP/MobileSDK3/KapselSDK/plugins/fioriclient/ios/SMPToolbar.xcassets/smp_reload.imageset
cordova run android
or
cordova run ios
Note that after adding icons a clean may be needed to ensure the new icons are added.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
25 | |
21 | |
12 | |
9 | |
8 | |
8 | |
8 | |
8 | |
8 |