My specific questions are:
Any sample code recommended libraries or links to useful tutorials would be greatly appreciated. Thanks in advance for your help!
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/adcdeb1c-1be3-44c0-8452-014908c0b4c7n%40googlegroups.com.
i got it. Thanks for your guidance.
Below are two my approaches I’ve been contemplating:
Approach 1: New Module (MobileUiResponsive)
Idea: Create a new module, "MobileUiResponsive," similar to how Neo extends Classic. This would involve reusing code and adjusting the CSS (for example, modifying Ya.css) to suit mobile requirements.
This method would keep the desktop and mobile code separate, which could be beneficial for the UiBinder framework.
Approach 2: Responsive Design in One File
Idea: Modify the existing file (e.g., DesignToolbar.ui.xml) and incorporate CSS media queries to handle both desktop and mobile layouts.
The First approach:
1. Identify Components for Adaptation:
Key components include like toolbar, palette, property editor, and blocks workspace. For mobile, consider touch-friendly designs, like collapsible panels or bottom sheets for palettes
2. Design Mobile Layouts:
Plan how each component looks on mobile. For instance, the toolbar might use a hamburger menu on mobile, while desktop shows all buttons horizontally. Consider examples like Scratch Jr, which places the block palette at the bottom in portrait mode to avoid obscuring the screen
3. Implement Using UiBinder:
using a single UiBinder file (DesignToolbar.ui.xml) with separate panels for desktop and mobile, toggling their visibility.
4. Use Java for Dynamic Switching:
The Java logic toggles visibility based on a 768px threshold (a common breakpoint for tablets vs. phones), using Window.getClientWidth(). The ResizeHandler ensures the UI adapts dynamically when the screen size changes (e.g., device rotation), all without page refreshes.
5. Apply CSS Media Queries:
2nd approach:
1. Create a New Module:
Create .ui.xml and respective java file for e.g: DesignToolbarMobile.java, DesignToolbarMobile.ui.xml and then change the respective css file for this.
2. Add Runtime UI Selection:
Swaps only the toolbar, not the whole page. Faster and smoother!
e.g:
Thank you so much for your guidance.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/76a45ad6-48e2-4a88-8966-c5d0ba985ac2n%40googlegroups.com.
This is the problem I faced for a GWT application. I need the best approach to solve this:
The challenge is that the current design approach requires a complete page refresh when switching between UI layouts (for example, from a desktop view to a mobile view). This process means multiple server trips, which can be slow and use extra data—especially on mobile devices.
> Currently the issue is when user change the interface from mobile layout to desktop
> it will took multiple visit to sever which will be expensive...
I am not sure I understand your issue, but the browser should cache the UI files.
And if you design your application with intelligent caching for the data, it will only
go back to the server when something new is needed.
Thank you,
Neil
--
Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com
We offer 30 year loans on single family houses!