Problem: I'm trying to make a sliding view similar to the first example on this examples page but instead of one slider I want two or more sliders. Is that possible to do in one scene with ConstraintsLayout 2.0.2 or do I need to make multiple scenes with a single slider in each?
I have looked at multiple examples on multiple sites but I can't find anything that shows two items being animated independently of each other. The closest thing I have found is the example on the link provided labeled Multi-State which is located at the bottom of the list.
No. MotionLayout has a single value "progress" which moves from 0 to 1.
You can have 2 motionlayouts in another layout and each is a slider.
Related
I'm trying to make 3 evenly split Expandable menu.
I've been working this for over a week. but it seems impossible to create it.
The layout effect I want to make is like this.
let's say 300dp is my device height.
and there are 3headers(50dp each) and 3 expandable layouts.
it will be a static accordion menu so, scrollbar is not necessary.
if the user click one of the items.
it should be expanded as 200dp.(300dp - 50dp*2)
And the other 2 expandable items should shrink into 0dp.
expand/collapse has animations, and animations should have a specific value according to the Android Animator class. But if I want to animate two layouts simultaneously it causes the calculation problem.
I tried 2 Github libs so far.
https://github.com/cachapa/ExpandableLayout
https://github.com/florent37/ExpansionPanel
But, the both have sample problems. Please refer to my representations.
representation video1 : https://youtu.be/yJ7ZIQWG3no
representation video2 : https://youtu.be/xQ8HoWWdPOU
representation video3 : https://youtu.be/kO4cfYp36Co
Also, I posted this question as an issue here : https://github.com/cachapa/ExpandableLayout/issues/78
You can see the layout file here but one of the contributors said, it's not the problem of the library. but about animation or size calculation.
What I've tried so far:
LinearLayout as a root layout and each headers have android:layout_weight="1" attrs.
Constraitlayout and each headers have app:layout_constraintHeight_percent="0.33".
I ended up finding an alternative UI library called stepper.
- https://github.com/fython/MaterialStepperView
I am developing my first Android game whose main screen is composed of a 4x4 array of views, each view contains an image and a text. When we touch on a view and swipe it to the position of a neighbor view, the two views are swapped, just like Candy Crush. I've been searching for a couple of days but I haven't found any appropriate solution. I concern about the following problems:
Should I use GridView or simply an array of views for such swapping?
What kinds of event should I process for this requirement?
How can I add animation so that two exchanged elements seem to have a real moving effect.
Any help would be much appreciated!
This Link should point you in the right direction. Note this will also work with GridViews. You just have to add your desired rules for filtering which items may/may not be swapped with eachother.
You usually traverse a list by scrolling through the views that are placed one after another. What I'm trying to achieve is similar, but the views would be stacked on top of each other. The views will also cover the whole screen. So when you scroll, the top view slides away (or uses some other transition animation), but the bottom one is not moving underneath. You can imagine that the views are like the papers in a top spiral-bound notebook.
So my question is - does something similar already exist? I haven't been able to found anything so I might need to make a custom implementation. Oh and the views will each contain an image and there might be quite a few of them, so it will need to handle that (I was thinking of using Android Universal Image Loader). Thanks.
Sounds like you want to use Depth page transformer, via http://developer.android.com/training/animation/screen-slide.html#pagetransformer
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´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.