How to create a custom listview like iPhone in Android - iphone

I was designing a custom listview in Android following the online tutorial Android Series: Custom ListView items and adapters and I created a custom list view like this:
This is simple and fine. Now I was surfing the web and found this fantastic listview for iPhone:
How can I create something like this? How has he given a box like interface for each row separating them from background and each other?

You could try removing the list dividers (android:divider="#null" or android:dividerHeight="0px") and using a custom drawable as the background for each row (either a 9patch or ShapeDrawable, possibly arranged in a StateList so they can have pressed/selected states). Then just also put a margin on the row layout, and your spacing should be taken care of (alternatively, you could use a transparent image as the list's divider with an appropriate height). But be careful about simply aping an iOS style because it looks nice; think about the typical Android user and what they take as interface cues. If you made your Android list look exactly like that screenshot below, I think many Android users wouldn't even realize they could click on those rows, or that they're part of a scrollable list.

The listview and each item in the listview can have separate backgrounds. So all you need to do is make some PNG files that look like the background of the items and the list itself.
You can set the backgrounds in XML using the android:src.
Or at runtime using:
setImageDrawable(getResources().getDrawable(R.drawable."picture name"))

Related

Flutter: How to do responsiveness for "real" mobile/web applications?

I saw many articles and videos on how to do responsive design in flutter.
But they all have in common, that they show a standard web page with menu, pictures, text.
What I call "real" in the title, means a full interactive application, so with displaying tables of data, providing input fields and other input elements, showing charts, ... - so all the interaction of a "real" application, not just a web site.
Simple example: If I have a large data table on a desktop screen, it has to be different on a mobile screen to show data in a way, the user can read it and use it sensibly.
So, how do I make the app responsive for all screen sizes without having to implement something twice or have case distinctions all over the place?
Refractor codes into widgets. (very important to reduce boiler plates)
Create an idea on how the webpage will look like based on 12 grid system
In build method check for screen size and return layout based on the screen size.
Please note
The widgets should be responsive by itself based on the size available. For example a chart widget. It should build a chart within the space provided by its parent.
There may be instances where in desktop some elements are in a row and the same element will be in a column in mobile. So you can also write sections like banner section (define web and phone layout), about us section etc so its easier to manage
Use wrap widget to automatically bring widgets down based on screen size
Use BoxConstrains and max width to control a Containers max width
For tables you can use packages like responsive tables

How to show the iOS lookup modal in Flutter for selected text?

In most iOS apps, selected text has a "lookup" option. Flutter interactive selection only shows "cut, copy and paste". I couldn't find an option for "lookup".
Is there a way to show the "lookup" option?
If not, assuming I create my own selection controls, is there a way to manually show the modal?
For reference, here's what I mean by "lookup" option:
and here's what I mean by the "lookup" modal:
You cann't. Flutter overrides all the UI of the native system, drawing its own. Think in Flutter in the same way you think in a videogame. Flutter takes an OpenGL Canvas and draws all stuff by itself from scratch.
As you don't use any elements from native, you neither don't have the native contextual menus. That is why you get that different options.
Now, the kind of good news. You can modify the Flutter one to configure the options. You need to use the SelectableText widget from Flutter. Take a look also at the selectionControls property. You can create your own toolbar from there.

Android UI home screen design

I am up to create a section on my Android Home screen similar to this one,
but cannot really figuring out where to start. I mean is this a ListView I should go with? or are these simple images that are placed as different objects surrounded by straight lines? In either case, how to put these things together, is a question that I am wondering..
You can either use:
a GridLayout (for API < 14, there is a support library available somewhere on GitHub)
a vertical LinearLayout containing two horizontal LinearLayouts
a single RelativeLayout
For the buttons, use TextView or Button with a top drawable.
Please note that the dashboard pattern is now discouraged (link 1, link 2) (you should present useful information to the user on first screen such as there latest trips, friend's news, ...).
Instead of that, you could put your buttons in a sliding menu (jfeinstein has a nice implementation on github which can be integrated within an hour)

Standard way of handling a user customizable view on iPhone?

This is a two part question.
Our iPhone application has a screen which needs to be customizable by users. It is a simple screen with 4-5 customizable slots. Users will be able to pick from list of wiglets/controls they would like to see in the view. They should be able to re-order the widgets and add/remove as they see fit.
Below is a UI mockup showing how a widget screen like this would work. The user would press and hold anywhere on the screen, and it would go into edit mode, similar to how deleting an app works. They then have the opportunity to remove an app from the dashboard and add new ones using a tray at the bottom.
Is this an appropriate way of handing this type of view on iPhone, if not where would be a good starting point? Any links or views/controls to look at would be appreciated.
Certainly, everything described here could be implemented from scratch using UIView as a base, but are there existing views available from Apple that could help me here?
UI Mockup
1 - Existing widget
2 - Empty spot available for widget
3 - Available widgets
I'd make each widget a customized UIView subclass, and just add them to the main view as subviews. As far as specific classes, you could use a customized UITableView (with custom UITableViewCells) for the widget drop area. The widget selection area you could easily implement with a custom UIView and four positioned UIViews. You could also consider AQGridView.
There aren't any standardized view classes that Apple provides for this.

What UI elements (objects) are used in livingsocial iPhone app?

I am new to iPhone development. I am using Titanium for developing but I guess that hardly concerns my question.
What UI elements where used to develop the certain pages of livingsocial? There are hardly 5-6 windows in the whole app.
a) For eg: if you see the main page(daily deals,escapes,purchases,settings) - did they use a window with a black background image & then added tableview to it for the four options? each tableviewrow has different images. Is that how it could be done?
Also if you notice the four options are scrollable but the heading livingsocial stays static & looks different from the native UI. How was that done?
b) If you look at sign in page (in settings) - they have two textfields & a sign in button inside a window. For the last element (Don't have an account?), is that again a tableview inside a scrollableview?
It would be great if someone can give a general outline as to how they developed their app & what UI objects we used.
edit: please find the screen shots :
a)http://dl.dropbox.com/u/9556373/IMG_0616.PNG b)http://dl.dropbox.com/u/9556373/IMG_0620.PNG
a) For eg: if you see the main page(daily deals,escapes,purchases,settings) - did they use a window with a black background image & then added tableview to it for the four options? each tableviewrow has different images. Is that how it could be done?
Also if you notice the four options are scrollable but the heading livingsocial stays static & looks different from the native UI. How was that done?
That app uses a custom made UINavigationController (for the static bar at the top, that can accommodate the title of the view and different buttons depending on the view currently showing, namely a back button for returning to the main view) and UITableView with custom made cells.
b) If you look at sign in page (in settings) - they have two textfields & a sign in button inside a window. For the last element (Don't have an account?), is that again a tableview inside a scrollableview?
No, I think that's a UIButton, that just happens to look like an isolated cell. Also, that view doesn't look like its scrollable.
I'm not familiarized with Titanium, so I can't give you any directions there. But keep in mind that using custom controls usually takes more effort than simply using apple's own default.
In answer to your first question:
I'd use a tableview for that, with custom made cells to create that look. If it is not a main window on your tab you'll have to remove the 'back' button, otherwise it'll be fine.
In answer to your second question
The first 2 are textfields. The rest are all buttons (and the text above facebook button is a label).
If you're using titanium you could take a look at the kitchensink example.
Hope this helps!
Tjellekes