Like the image. I am trying to make something like this. When i click my sidemenu that consists of textviews that represents numbers. I want to be able to show what number the user are holding his finger on. So in this case. I was holding my finger over the number 14 and 14:00 is showing on the left side of it.
So does anyone have a good approach for me to deal with this issue.
It seems you want to use a fastscroll like feature. Try to take a look at the example code here. Then you have to customize it to your needs.
Or you can also try a different approach using a PopupMenu on the list element click.
A third approach could be using a PopupWindow, and showing it using showAsDropDown() method, passing the anchor view (in your case the list element clicked)
Related
I am trying to buid an user interface to allow to present information to a user.
The information would be grouped in windows related to the category that might look kind of like this:
Crude drawing of the window
It should have a place to put a title, a button I can set to different options and an inner layout to display the information.
Is there a similar object I can use in android or how would I go about building one?
EDIT:
The final result for a phone should be something like Drawing of a phone
EDIT2: Since i feel like I wasnt clear enough in my question I changed the title. I know how to place a list of elements on the screen, what I wonder is how to make those elements be framed by a rectangle with rounded corners that has a field for the title and a customizable button
Look at ReyclerView for displaying a list of items.
Look at CardView for displaying each "window" item.
Look at the documentation for how to make a layout.
Another day, another bug...
I have three AutoCompleteTextFields with the filter overrided to get completion from my REST service, but my big problem is that the suggestions popups of those text are clickthrough... so when I've already completed one of them, any click on the suggestion popup of another will trigger the underlying ACTF, which is already filled and so show it's own popup, making impossible to select the item from the other ACTF suggestion popup.
The two screenshots here show the situation, the ACTF are the textfield hinted "Partenaire", "Contact..." and the already autocompleted one under.
On the second screenshot, I've tried to select the item over the third ACTF, and so the four first results are from the third ACTF, and the four last are from the "Partenaire" ACTF.
Is there a way to override something like onShow() for the popup and it's hiding equivalent, so I could disable the other ACTF when I type in one of them ?
I think it's a good way to solve the problem, but I am open to any other idea :)
I've forget to mention it, but the problem occur on Android and on the simulator, but iOS has not such problem.
Check that your UI has scrolling set correctly, only one container in the hierarchy can be scrollable on the Y axis. By default the Form's content pane should be scrollable on Y (unless it's a border layout).
Hi I am developing an application that needs to display list of items. Clicking (or Tapping) on an item should display a description text of the item right below the item. I am talking about something like a vertical accordion.
I want them dynamically created (created in code rather than the XML). That part was completed with ease. I inflated multiple SlidingDrawer in a LinearLayout to accomplish it.
But the problem is only one SlidingDrawer is displayed in the activity. This was accomplished by giving fixed heights to SlidingDrawer. This approach will not hold as I mentioned above that the list of items is dynamically generated and also the area in the activity where the description of the item must come remains blank.
I am now looking for alternative views for accomplishing this. As I am a beginner in Android Development I cant find any that will work in android versions 2.3 and later.
You can always take a look at the SlidingMenu. The project can be found on GitHub. I guess you need to modify the behaviour a bit.
I am trying to recreate an Apple app in Android. The Apple app includes a dual spinner (see image below). You can select a letter on the left hand side, and it finds the first item that starts with that letter on the right hand side (or rather, the last item of the previous letter, so the user is more likely to choose something and not just accept the first item).
Is there any way of achieving something similar in Android? I'm thinking of trying to use a dialog with a couple of ListViews, but I'm not sure if I'm barking up the wrong tree there?
For the record, I was able to achieve the result I wanted using a custom dialog containing 2 ListViews side by side (with another View acting as a divider between them).
I'm working on implementing a UI for an Android application, and I wanted to ask if there is already something in the native widgets to accomplish most of what I'm trying to do.
The application that I'm working on performs 15 different tasks that can be divided into 3 different groups. (5 tasks per group) I have 18 icon images (3 for the groups and 15 for the individual tasks) and I want to be able to panel these icons (starting with the groups) like this:
I want the next icon visible below and above (if further down than the first icon) and swipe to go to the next icon
Once an icon is clicked, the panels slide to the side, exposing the next layer (the specific 5 tasks for the selected group) with the selected group still visible on the side:
From there, the user can tell at a glance what group they are in, what the current, next and previous selectable tasks are, and that by swiping right, they can get back to the group selection.
What types of widgets would I need to look into in order to accomplish something like this? Are there already pre-built lists to do these activities?
Thanks for any guidance!
You can get close with a LinearLayout of ImageView widgets and a ScrollView (vertical) or HorizontalScrollView. However, it will not give you the desired "centered image with bits of the previous/next images" effect -- it will be wherever the user positions it.
You can get close with a Gallery. However, it will not give you the vertical orientation, and it will always give you a fixed set of full options to the sides, not the partial images that you seek.
If it's gotta be the way you describe it, you'll have to roll it yourself. Gestures and animations should give you the desired effect.
Have you taken a look at ViewFlipper? http://developer.android.com/reference/android/widget/ViewFlipper.html This will give the side by side effect but you will have to make custom views for each group to populate it with the proper icons.
I'd use a ListActivity for the first 3 top level items. This won't give you the auto centering effect that you'll probably want, but you should be able to look at the Gallery source code, which can be found here, and make some modifications to the ListActivity so that it autocenters.
For the next items, I'd add an onClick and a GestureListener so you can navigate to another activity with another list view. Since you know where you came from (add some data to your Intent) you can set the color rectangle on the left so that it appears that you have just swiped the whole view left.
If you need to customize the animation, you can call this:
overridePendingTransition(R.anim.slide_left_entry, R.anim.slide_left_exit);
To make the yellow icon look good as it animates to the left, I'd change the list bounds (on the first activity) to have no margins, and change the yellow icon to have square right edges - This will make the small yellow rectangle on the next activity appear to be part of the first activity.
It should be relatively easy to mock this up to see if it's going to work properly for you.
Good luck!
EDIT: Ok, so I've made a basic project that does most of what you want.
here is the link to the eclipse project file. I was going to put the source up here, but there's a bit much to display.
What you still have to do:
Tweak animation
Configure the layer lists to display the correct colors
Add information to the top level intent for the sub-activity to be able to configure itself.
Quite a few other small things.
I think I've got the main stuff done. I've also added the gesture listener I talked about, although re-reading your question, you actually didn't ask for that. Since it's cool, I left it in.
Good Luck once again!!
Have you thought of launching Activities with different view configurations? You can switch from one activity to another with a gesture and you can Animate the views. What your UI looks like to me is a bunch of screens with affordances that show the other screens. So one Activity per screen maybe the same in different configurations or something like that.