I have simple android app mockup with home screen.
Homescreen contains 3 options: start game, settings and leaderboards.
I am not sure, what alloy components should I use for screens like settings etc.
Should I use different controllers for home, menu, settings etc? Or should they be just different Views in the same window? I can't find information about good practice for titanium app design.
you can take a look this framework: ChariTi-CB
Actually, I will prefer use one window and include all screens, and use the view for each screen, in this way, if you want to control the window style (like the orientationModes), you just can easy to control it in the app. The above framework is use this design pattern.
Well we tend to use a separate controller for each separate piece of functionality. If each controller would be displayed in a separate window then in this case I'd have 6 files:
/controllers/startgame.js
/views/startgame.xml
/styles/startgame.tss
/controllers/settings.js
/views/settings.xml
/style/settings.tss
/controllers/leaderboards.js
/views/leaderboards.xml
/style/leaderboards.tss
just use "alloy generate controller" on the CLI to generate them quickly.
Related
I want to develop a Android app with an interface like Viber. Multi pages that user can swipe between them.
How can I do this with Qt and Qt Quick?
Is StackView what I need?
I haven't used Viber on Android but on iOS (and the last time i used it over a year ago) they had a UITabBarController at the bottom which switch between several main screens. The contact screen for example displayed a UITableView wrapped in a UINavigationController so you could select a contact then view the contact's details.
So what you could do is this:
Build a TabBar QML Component and anchor it to the bottom.
Build a Tab Component that's reusable so you can just add new tabs to the TabBar with a method like addTab(Component, string) where Component is your customized reusable Tab component and string is the name of your view's QML file which can be lazy loaded with a Loader.
In your Contacts QML file (or any one that needs a "Master-Detail View") you can then create a StackView and add any required view's as components.
Take a read though this:
http://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html
Definitely also read up on how QML Loader and QML Component work as they'll be the basis for most of this. You might want to experiment with this first in a separate project before getting too deep in the real UI.
I am in a situation like i have to generate UI Controls like Button,Switcher,Progress Bar, Label text etc based on my list Items .
I am looking for a way to generate the controls in a View and add Views with generated controls in a Layout .
Can anyone give me a proper way to do that?
Why not to use Fragments?
Google docs about this here
and little tutorial here
You may want to take a look at the Metawidget source code. The Android version of Metawidget makes extensive use of generating Views and Layouts at runtime (e.g. see org.metawidget.android.widget.widgetbuilder.AndroidWidgetBuilder). You may even find Metawidget itself will suit your needs (it's designed to be embedded into projects for use-cases such as this).
What is complete replacement of iOS Tabs Replacement in Android.
I Know that Android is Android and we don't Imitate other platforms on Android. I have Studied Pure Android
But All I want to have the replacment of iOS tabs in Android with following features.
1.) Stores Navigation flow for each tab, As in iOS there is navigation controller for each tab and we can have the previous state for each tab while switching from tab to tab.
2.) Desirable but not necessary- Double click on tab button will refresh the view with the root view as per in iOS.
3.) The animation while switching from tab to tab or with in Tab does not swipe the complete Tabs(including the TAB Bar). It means only the content of each Tab should be replaceable with separate Activity or something like this.
4.) In short User Experience must be similar to iOS Tab Bar.
What I have Tried so far.
1.) Added Tabs with TabHost on bottom of screen.But I Haven't got the stack navigation for each Tab separately.
(Something like: https://github.com/AdilSoomro/Iphone-Tab-in-Android)
2.) Also I have an idea of Using Stack (Java Collection Framework.) But that will be a headache to maintain all the stack by my self.
So, Guys In short:
Do you have any ideas of any Third Party Library, that I can use in my project without much problem to achieve all the features mentioned above?
Any help would be appreciated.
Thanks.
This one is best to implement iOS like tabs in Android
Like this:
You can use the native tabs and style it to seem like iOS ones.
Use Fragments, and store/reload the "Natigation flow" at the onPause/onRestore methods in each Fragment or in the FragmentActivity when you change form one fragment to an other.
BTW, please don't do that. If you studied Pure Android, what's the point do you want to achieve? Android is Android and iOS is iOS, do not mix them please.
UPDATE: 3 September 2017
An other, and imho better, approach to do so is make use of the Bottom Navigation. Take a look to materialdocs to learn how to use it.
I have written an Android App, which uses ViewPager to swipe between different Views of my app. This works very well, but the animation isn't like I want it to be.
The current view swipes out to the right, and the new enters from left. But I want the current view to leave like a layer to the right, so that the user can see the new view, which was "under" the current view. I want the "old" view to stay at the right side, so it can return onclick.
The current Evernote App uses this behaviour. I attached a screenshot. Thanks ;-)!
http://i.stack.imgur.com/2RlT4.jpg
You can refer Sliding-Sidebar. This has Facebook like slideout effect.
Quick reference of the above library :
You can download the Android UI Patterns app. from the Google Play and see the effects you require. Its inside ActionBar & Dashboard --> gui-sliding-sidebar.
you should use the fly in app menu here below demo project will help you
https://github.com/korovyansk/android-fb-like-slideout-navigation
I would suggest you use SlidingMenu It is a very good and solid library with an active developer. It works well with ActionbarSherlock too which is great for backwards compatibility.
SlidingMenu
An Android library that allows developers to easily create slide-in menus like in the Spotify and Facebook applications.
I'm getting started with Android development, and I would like to have an interface similar to that of tweetdeck: there are several workspaces (activities) that are laid out left to right, and the user can switch between them with a horizontal gesture. The same way the Android desktops are switched.
In tweetdeck there are also dots in the titlebar, that indicate on which side and how many workspaces there are.
Is it a standard Android interface, or something custom built? How do I do something like this?
How you go about this is going to be partially dependent on the content you want to present. If there are going to be many heavyweight pages you'll want to look into doing something like a custom AdapterView. If there are only a few fixed pages such as in the stock home screen you can treat it like a scrollable view with some custom logic to handle snapping to pages.
Here's a link to the custom view that implements this in the stock Android launcher. The bits you're interested in will mostly be in onTouchEvent, onInterceptTouchEvent, and computeScroll.
https://android.googlesource.com/platform/packages/apps/Launcher2/+/master/src/com/android/launcher2/Workspace.java
Take a look at ViewFlipper: http://developer.android.com/reference/android/widget/ViewFlipper.html
In addition to studying the actual Android code (referenced in another answer), some folks have extracted and isolated the workspace (Launcher2) code into a re-usable view group. You can find the work in github here https://github.com/olibye/AndroViews