iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello Crosslight Support,
I created a new Crosslight solution (Android only) with the project wizard in Visual Studio. As template I used the "Navigation drawer".
Next I created a "menu" folder in the "Resource" folder of the Android project. There I added a new menu xml file with my required menu definition (main menu with the three dots and a sub menu 'delete all').
Within the app I have two fragments. One for the "Simple Page" and one for the "About this app" page. What I what to achive is to apply the menu only to the "About this app" page. The other fragment should have no menu.
So I assigned the menu in the AboutFragment with an override of the MenuLayoutId. To see if the menu is working I then created a binding in the AboutBindingProvider.
After starting the app the result is somehow different as I expected.
First there is no menu on the simple page (ok). When navigating to the about page the menu shows up (ok). Clicking on the menu shows no submenu (not ok). Doing a long click on the menu shows an empty menu entry (not ok).
What am I doing wrong? I used the latest version of Crosslight (Crosslight3_0_5000_184). A sample is attached.
When I attach the menu to an activity it works as expected. But when I do a long click there is also an empty menu item shown.
Thanks,
Thomas
Hello Yudi,
Thank you for your efforts.
This helped a lot.
Any news?
Sorry for the delay in sending this.
The sample project is now being investigated by Crosslight development team. I will let you know any news I heard from the team regarding this.
Edited on February 1, 2015 9:36 PMReason: Update information about sample
I managed to show the submenu when clicking on the menu by modifying calcmenu.xml file into the following.
<?xml version="1.0" encoding="utf-8" ?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/DeleteAllButton" android:icon="@drawable/ic_action_discard" android:title="Delete all" android:showAsAction="never"/> </menu>
Please try to modify the calcmenu.xml file and let me know whether this help or not.
I just tried your proposed menu definition. Now I have a different result. There is no menu in the top right corner within the action bar. When hitting the left hardware button the menu slides in from the bottom. This is quite nice but it does not solve the initial requirement.
Will there be another fix? Because I wanted to have a menu in the top right corner with the 3 dots icon. Clicking on the 3 dots icon should open a sub menu. Please, see the initial post and the sample for detailed information.
... There is no menu in the top right corner within the action bar. When hitting the left hardware button the menu slides in from the bottom.
Could you please inform me about the Android version of your device (for example: Samsung GT-P3110 running on Android 4.1.2) and the screenshot which shows the quoted problem?
I am mainly testing on Android 4.1.2 and 4.2.2. But the Android version does not play any role.
Please, have a look at the Map sample. When you go to "Alternative Routes" you can see "Change Route" in the upper right corner. This is applies through a menu. Other views like "Simple Marker" don't have a menu in the upper right corner.
When you click on "Change Route" a selection dialog appears. What I want to achieve is that instead of the dialog there should be a sub menu poping up when I click on "Change Route". How can I do this?
To see excatly what I need, please have a look at the MyInventory sample. Do a long click on one of the items. The action bar changes and you can see a "More" menu with sub menu entries. That is what I want to achive.
Please, have a look at the original sample I attached to the first post and try to apply a menu with a sub menu.
By the way, the Map sample crashes when you have no Internet connection. That is not very good.
Thank you for the feedback about the problem in Map sample. This problem has been forwarded to Crosslight development team. It is filed under CROS-726.
I will keep you informed with any news I heard from the team regarding CROS-726.
To see exactly what I need, please have a look at the MyInventory sample. Do a long click on one of the items. The action bar changes and you can see a "More" menu with sub menu entries. That is what I want to achieve.
The "More" menu in MyInventory sample uses popup menu. I have created a backlog regarding popup menu in fragment. It is filed under CROS-729.
In the meantime, you can check about how to create popup menu and handling click events (when user select a menu item) in http://developer.android.com/guide/topics/ui/menus.html#PopupMenu.
Edited on February 22, 2015 11:05 PMReason: Propose a solution
I'd like to propose a solution for the Crosslight Android fragment menu.
The proposed solution is as follow:
Step 1: Edit Styles.xml file and add following style to override drawable id for overflow menu in Android theme as seen in the following snippet code.
<?xml version="1.0" encoding="utf-8" ?> <resources> <style name="Theme.Splash" parent="android:Theme"> <item name="android:windowBackground">@drawable/light_splash</item> <item name="android:windowNoTitle">true</item> </style> <style name="Your.Theme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionOverflowButtonStyle">@style/OverFlow</item> </style> <!-- Styles --> <style name="OverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow"> <item name="android:src">@drawable/ic_menu_moreoverflow_normal_holo_dark</item> </style> </resources>
Step 2: Use the new created theme in Android Manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="CrossFragMenu.Android" android:installLocation="preferExternal"> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" /> <application android:label="CrossFragMenu.Android" android:icon="@drawable/icon" android:theme="@style/Your.Theme"> </application> </manifest>
Step 3: Edit calcmenu.xml into the following:
Save all the changes and the result should look like this (on Samsung GT-P3110).
I enclosed the modified version of CrosFragMenu project for your reference. Please let us know whether this helps or not.
Edited on February 23, 2015 09:20 PMReason: Update information about CROS-726
I'd like to inform you that the nightly-build which fixes CROS-726 (causing map sample crashes when there is no internet connection) is now available in here.
The nightly build has been tested in my end and the reported problem is no longer persist. Please feel free to let me know if you have different result.
I just tested the reworked CrosFragMenu sample. I cleaned the solution and applied the nightly build (195).
Unfortunately, my result is different than yours. I have no menu in the top right corner. The "Delete All" only appears at the bottom when I hit the left hardware button.
For testing I used my Galaxy Tablet (Samsung SM-T310).
I created two Android emulators with following specification:
Next, deploy CrossFragMenu app into those emulators and the result is as follow:
CrossFragMenu deployed on 7" tablet with hardware button.
CrossFragMenu deployed on 7" tablet with software button (no hardware button).
In my opinion, if hardware button exist then menu will not displayed in the top right corner (it will show the menu when menu hardware button is pressed). If hardware button doesn't exist then Android will automatically display the menu in the top right corner.
I have re-modified CrossFragMenu which force use of overflow menu on devices with hardware button. This version of CrossFragMenu now has overflow menu (in the top right corner) appearing on devices with hardware button. However, there are some issues left with this version of CrossFragMenu app.
This approach requires developer to handle OnCreateOptionsMenu and OnKeyUp (manual overflow-management). Please note this version might not support binding on the menu. Please find the sample in the attachment and let me know your response.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname