I have a UI design which should contain a text data and this can be dynamic so i need a scroll view after the TextView is over i need a list view, Now this list view onItemClick of a cell should expand and contract to show details, Any sample project or code from where i can achieve this UI design, Please help me with this one.
It is strongly not recommended to have Nested Views that scroll.
What you can do is have a TextView followed by the ListView. You can use expandable listView for your expansion requirement. All the examples are present in APIDemos shipped with Android SDK.
Try some of the stuff and get back for more help here.
Related
I have this activity, with a list of tokens/options in it. As of right now, i have a button that, using intents, opens a new activity based on the item selected (basically: a text to modify the settings and add extra info).
Now, i would like to make the first activity to show, in the below half of the screen,a preview of the new activity, but with fewer/diferent options and less information.
I know how to do that using fragments, but i don't know how to approach the creation of the new activity.
Is there a way to merge them both, to pass the first fragment to the second activity, or do i need to completely code (and thus, modify) "twice"?
Is there a better aproach that lets me do that easily?
If considered you are inflating options in recycler view in the activity, add a frame layout in the same as a container for a fragment to preview the new activity. Set the visibility to gone for the frame layout and when an option is selected set the fragment and display it. For a nice animation use android:animateLayoutChanges="true"
in the options activity xml at the root view. Hope I helped happy coding :)
I've set up the tab and basic navigation, But having problem how to create such list view in android, with 2 or more rows and have two columns as in picture below adjusted side by side(have imageview & button below each image) & another list view below that one, which is basic and simple. I'm totally new to android ui xml, please guide me, or point me to any good learning resource about this on web.
Use dashboard in your application.Just Google it about Dashboard.You will get tutorial.This is an sample dashboard view.
I'm programming an android app with a list displaying images and some additional information like title, place, etc...
I'm new to the android ecosystem and wondering what are the best practices to implement a list element which normally displays the mentioned information and turns into input fields on a press on the listelement.
Do I have to draw the display elements (e.g. TextField) and the edit element on top of each other and set visible for either display or input? How to handle this generally? Or do I replace the layout responsible for the list element altogether?
I know that for the simple case of a text there is a simple solution for making the EditText field look like an uneditable TextField. I'm, however, looking for a general answer covering broader cases than just a TextField.
Thanks!
you can make the elements of the listview a view flipper having two views.one you textview and other and edittext.
<ViewFlipper
...
<TextView
... />
<EditText
... />
/ViewFlipper>
Then in the onItemClickListener of the list items you can call flipper.showNext();
So, flipper works like, it shows only the first view defined in it and on the subsequent call of showNext() it displays the next view defined in it.
So if you have 2 elements in it, it will behave as the coin with two sides.
So in your situation there are a few ways you can achieve this.
First way is to build a layout which contains TextView and EditText and in first initialization your edit text won't be visible. And in your OnItemClick you have to hide your textview and show editext with value of your current data and option to edit.
The second way which I think is more user friendly is that you can show an AlertDialog after OnItemClick with custom layout where you can change the values and update the listview after user press Yes or do nothing is he selects No.
It depends on you which way you will do that, but I think the second option is the better one.
this is not a technical question, but one for advice regarding the best practices in designing an Android tablet UI.
I've got my concept of an Android Phone app pinned down.
The first activity (master view) launched contains a tab bar with three fragments from which the user can launch detail view activities of different sorts.
Both the master-view activity and the detail-view activities have actions in their action bars. Different detail views have different action items.
My question is: How should I organize and display the action items on a tablet, where an activity combines both views side by side?
The problem is the unified action bar for both the master-view fragment and whatever kind of detail fragment is shown. I do not think it is a good idea to start messing with the contents of the action bar whenever a different kind of detail view is opened.
The Android Design Guide does not tell you much on that front. There is a sample of a Contacts app in the "Multi-pane Layouts" section, but it does not actually deal with the problem. It evades it, by putting the single relevant action as an icon inside the detail view fragment.
Any advice with regards to best practices and references are appreciated.
I would suggest leaving your master details icons in the action bar, whilst putting your details view icons in another view/area within the details fragment.
My reasoning would be that icons in the action bar affect / are associated with the whole app / view on screen. Whilst your details icons only affect the details view and therefor should not be in the action menu when showing multiple fragments.
I guess you will have to see how the designs look..
I am not a fan of the action bar icons being changed from within the same activity (even if it contains multiple fragments), however when you load a new activity (like in your phone design) then I say yeah throw them in the action bar.
If I understand your question correctly, which I think is basically a question of how multiple Fragments (i.e. when on a multi-pane layout such as on a tablet) should contribute to the single ActionBar, it's quite straightforward and it is actually briefly discussed in the documentation here. Essentially, you can have the multiple Fragments all contributing their own menu items / action items to the single action bar, via some simple API calls.
I need to create a Custom view in android which will have dynamic text like price, address etc. and also an ImageView inside it as shown in the image below. I tried to find google some tutorial for custom view but didn't find something satisfactory to do all these things. I also need to use onClick event on this view. Please guys, some code would be of great help. I'm a novice to android. I read google tutorial to create custom view but couldn't implement this.
https://lh4.ggpht.com/HmwmRTx3g9ddkHbgvZXpZOB3Am-O9OQARQ2qpxJ16zTDZbG57CmvgxUC75sGFzC3cqrH
Thanks for attention.
This is called Custom Overlay for MapView.
You can check example and implement as per your requirement - Android MapView Balloons
You can use FrameLayouts. It is very simple to use. FrameLayout can add several views on top of each other. It creates a stack of the views. Just add whatever views you want to inside FrameLayout and use the property setVisibility() to control when to show which view.