I´m writing an application for Android in which I have a character that I must dress with multiple items, such as clothes, hairs, hats, earrings, etc. and on one side of the screen I need to have a container with many items inside that are available for use.
My problem is that I haven´t found any object that lets me do this simple task in android, I need it to be scrollable, and resizeable so I can place it on the right of the screen, the objects i need to add are Imageviews.
I accomplished this on iPhone with a UIScrollView but it seems that it't not that simple with Android.
Thank you.
you will use a ScrollView too, but you need embed a container of your images, like a Layout or Webview inside your ScrollView.
Related
I am trying to achive this:
First I tried by putting all my recyclerviews (with WRAP_CONTENT) inside a nestedscrollview. That worked, but the performance was awful. Then I tried to set a height for my recyclerviews, that was a lot better (especially the first gridlayout and the horizontal linearlayout loaded very fast), but still had the problem with the dynamic "category" part.
Now I am trying to put all my recyclerviews inside a single recyclerview with different viewtypes. Since that is a pretty big deal (I need to refactor a lot of code because I have diveded every area from the screenshot inside a single fragment and now I need to put all that code inside an adapter) I wanted to ask if I can actually expect any gain from this, because in the end its again a "nestedscrollview" (made by myself, but...). Or if there is some other "best practice" way to achive this layout.
Thank you
Edit:
As expected this didnt do the trick neither. When just the two first recyclerviews are added as viewtype it scrolls and loads smoothly. But as as soon as I try to add the category items (below the category), I notice a lag and especially when selecting multiple categories and scrolling fast up, there is noticable lag. I guess I will have to change my layout and move the category selection part inside a separate view, just need to come up with a user friendly solution. But its acutally quite dissapointing that, in my opinion such trivial task, laying out multiple tables, is such a pain in the ass on android.
I didn't manage to get it working with standard android stuff.
Now I am using epoxy from airbnb ,and I have converted all my views from nestedscrollview to the epoxy recyclerview. Its a great library, and airbnb use it too for all their views.
Nevertheless it's sad that the android dev team doesn't address this problem and provide a solution besides the info "don't nest multiple scrollviews(recyclerviews) that scroll into the same direction".
You can use Recyclerview in recyclerview.
https://irpdevelop.wordpress.com/2016/02/10/horizontal-recyclerview-inside-a-vertical-recyclerview/
And make sure to use multiple view types.
I'm trying to make a dashboard like app to display real time data to a user in a vehicle with a layout similar to the included screenshot. I've tried googling for a direction to follow to try and mimic google's responsive grid columns design principle. However, I can't find any examples of that principle in practice on android. How would I go about implementing this type of design in android? Would you use Grid Layouts?
Ideally I'd like to be able to have a Grid Layout that has cells that are consistent in size that allow me to span a Card View across columns and rows but I don't know of a way to do this using a Grid layout. Any ideas?
Screenshot: https://gyazo.com/912c3414d9e8d46a1fa4eade54d620e6
Take a look at GridLayout. It will allow you to define a grid and to span columns/rows. I was also going to mention GridView, but I don't think that it allows spanning of cells.
Another possibility is FleboxLayout if you need more flexibility. TableLayout also permits spanning.
You can also build a grid layout directly with ConstraintLayout using the "GuideLine" object.
Those are four layouts that I would consider.
Suppose I have a list of data to be displayed. I know how to display it using a ListView And it is very simple and easy to do it that way. But I am looking for an alternative way to achieve the same. I don't expect to have more than 20 items in the data set I am planning for.
I was thinking of a number of squares that the user can swipe to see the next one etc, similar to some widgets on home screen.
I came across android.widget.StackView, any advice available for this?
You can try StackView (http://developer.android.com/reference/android/widget/StackView.html).
This is how the Gallery and Youtube widgets are rendered.
ListView is the best option for listing lots of data. It has very efficient loading property. But if you do not want it any specific reason, you have to use ScrollView and in ScrollView, you have to place a LinearLayout and in that LinearLayout, you have to place multiple LinearLayout(for each items of data).
Maybe you can use a ViewPager (available also for lower versions of SDK through compatibility pack).
http://developer.android.com/training/implementing-navigation/lateral.html - see also the project example top right of the page : EffectiveNavigation.zip
You can use a GridView, if you want to show multiple items on a page in a different fashion than in ListView.
You can also use ViewPager (from android 3.0, or with the support library) with your custom views.
I am newbie to android so this might be one of the dumbest question you face.
I am developing UI in Eclipse through drag-drop.I have added many elements in one screen now
the window where you drag-drop UI elements is not growing/scrolling beyond a capacity.
So I am not able to see newly added elements.
Please check image for more details..
You can observe elements after Storage Position are not visible.
How to check other elements or cant we add elements beyond a certain number/size ?
~Ajinkya.
You can add as many elements as you want. I can see a bunch of LinerLayouts for each of your items, but each linear layout is one row and has a horizontal orientation, correct? I'm not sure what you have as your overlying view, but make sure that all of those items are inside of a LinearLayout with vertical orientation. You can wrap that in a <ScrollView> to add a scrollbar to it. Here is a Scrollview example
Side note: Also, the drag and drop is nice to look at, but I've always had a better experience directly editing the xml, even if I started creating the layout with the GUI. It's easier to tell what is going on with each element and make changes. It's best to check the way everything looks in the emulator too, sometimes it can look different than in the GUI editor, especially if items are put into your interface programmatically.
I have a pair of adjacent views in an Android application. I'd like to give the user the ability to drag a widget to change the relative size of the two views within a larger container. If SlidingDrawer let the user pin the drawer wherever they wanted, that'd likely get me what I want.
My Google 'fu is failing me. I can't find a single example of this anywhere.
Thanks!
I ended up putting together a bit of code to create a custom LinearLayout subclass to do what I wanted.
The code is at https://github.com/k9mail/splitview