Avoid element to be dragged in Draggabily - layout

I'm using Draggabilly and Packery to build a optimized draggable layout as shown in this Codepen: https://codepen.io/rafaF/pen/MWjvjqO
I have some doubts about how to use Packery/Draggabily.
The first one is how to convert en element "no-draggable", i.e., avoid to be dragged. I've achieved this by no initializing its Draggabilly instance, but I would like also to not be sorted when dragging others elements.
In the other hand, I have not been able to set a fixed height on my Packery layout in order to limit how many elements fits in a column. My idea is that if you move an element to a column that has no free space, the most bottom element should be moved to the other column. I have not found any way to do this.

There is enabled and disable switch in Draggabilly instance that you create. So just disable it if you do not need it.
The second part has to be manually solved becuase the Packery and draggabily would try to adjust in the same layout giving you best possible fit. If you want to limit the height then you have to set and run the ShiftLayout() on pakery. Ideally I would leave it to packery to determine the best layout.

Related

How to change color of dot and progress on SeekBar?

My project's Min SDK is 21. My SeekBar currently looks like this.
However, I want to change the color of the dot and the amount of progress. I have tried adjusting every attribute that takes a Resource. Either nothing happens or the dot disappears completely. Other posts have recommended adjusting attributes like thumbTint that do not exist.
It is recommended to use Material Slider instead of Seekbar. They are actually the same in function and appearence.
Here is the documentation to Sliders
Also theming sliders is very easy

FlexBox Layout Android. How to delete vertical gaps between views?

I'm generating Views inside FlexBox layout by pressing the Start button. As you can see every item on even line has random size. It works almost as it supposed to be but there is a problem, I need to get rid of vertical gaps between two vertically adjacent views. I've tried all properties of Flex Box Layout but didn't find one that can help to solve my problem. I will be happy if you help me to solve this problem.
I've solved this problem. If you have the same task you should use Relative Layout and its' flags inside your android code. It'll give you all control under the positions of Views. If it will be necessary I can expand this answer to provide more detail.

CarouFredSel: scroll not working properly with html content

So, when I have some items with html content in it, and the fx = scroll, direction = left, the first item scrolls left, the container remains empty, then quickly the second item appears.
If I use images only, one image is one scrollable item, the items follow each other smoothly, so when the first item moves left, right after the second item also comes in from the right side.
Any idea what should I set, to make the plugin work properly?
My guess is its something with the width settings of an item, but I tried several settings, no one was good.
Thank you
Maybe your item is to big for the container? or someting with position absolute/relative? Coudl you show me some of your code (and images/div sizes?)
I found the solution (in stackoverflow). I have to use float:left on the div elements I want to scroll. Now they follow nicely each other.
#subdesign,
As nicely quoted by #RunningFusion may your item be too big for the container.
Try width: "100%" instead of specifying the width in px.

jQuery dynamic layout plugin

I've tried both jQuery Masonry and Isotope plugins and can't seem to achieve the layout I desire.
Both plugins appear to calculate the "next available space" based on the height of elements on the previous row. For example:
In this example item #6 goes to the far right because the height of #4 is less than the height of #2 (where I want it to go).
The layout I would like to achieve is more similar to left-floating elements:
Are there options on the above two plugins to achieve this layout or perhaps a different plugin available?
Two possible solutions
Try out the experimental Masonry-ordered script by tasuk. It has an option to control if you want items to progress left-to-right, rather than Masonry's default next-best space.
Build your own custom layout mode for Isotope. Your layout mode would be variant of Masonry. Instead of calculating the next best space, it just progresses left-to-right through the available columns.

iOS view size and position hard-coded only?

I'm new to Macs and iOS, I got my app running on webOS, Android, and WPF/Windows. In all cases the size of, say, a 'widget' to display a bunch of text, can change depending on the dimension of the text to be displayed, as well as the position can be up against another widget. As the text size changes, the position will change so that all the widgets are crammed together nicely.
I've been searching for this capability in IOS4 in books and on-line, and it's starting to look like in iOS, you have to actually calculate the size of the text to be displayed in ViewText and then change the dimensions of ViewText, which of course then bumps other Views around to accommodate this size change. It sounds like a nightmare. Isn't there some other way to do this (like all the other GUIs can do) to size based on content, and to position relative to other Views like stacking them all together whatever size they are?
Same with ScrollView, it looks like the size of the window you actually see has to be manually specified as well, instead of, say, taking up the entire viewable window and then you can populate the ScrollView with a bunch of sub-views, some of which are below the initially viewable area? I tried this in Xcode4, but so far, haven't gotten it to work.
Similarly with creating an object with a NIB and instantiating that NIB onto an existing View, how does it determine where to position this NIB onto the existing screen?
Thanks!
Paul,
For the scrollview you need to set the bounds so it fills the screen or the area you wish it to occupy, it will then automatically generate scrollbars based on the layout within it. In the land of iOS you do have to do extensive layout work such as positioning and sizing your controls but you can also use the UIAutoResize (if I remember correctly) masks such as if they are anchored to a size, fill the area, etc. It's a little complicated to learn initially but you'll get the hang of it.
As for text you just need to use the right control, I believe what you want is a UITextView and set the options on it as needed.
When you view a XIB it's going to layout initially as you have it, again, you need to position your controls AND set their anchors (autoresize masks) so they adjust based on the screen size (phone vs. pad) and orientation: landscape vs. portrait.
HTH

Resources