Blueprint android studio item to top right by default - java

I'm currently trying to make a layout in android studio however, everytime I'm adding something to my component tree it stick to the top right corner of the blueprint. I can't put seem to attach to sides my object that I want to add in my visual
THIS IS WHAT IT SHOULD LOOK LIKE
enter image description here
THIS IS WHAT I HAVE :
enter image description here

You need to Change the layout from coordinate layout to constrain layout so that use can constrain at specific position,In Case You are Using Coordinate Layout Try "gravity"to align as Your Wish,
Extra:
Always try another layout inside constrain Layout..

Related

Add Double border to Text Field In Android App

I'm new to Android development. I want to know is there any way to add two border in a text field. one inside another so that When User provide Input the Inner Border turns blue or specified color?
Hint
You can create separate drawables for each
app the outer drawable to a linear layout and inside that linear layout put edittext and apply second drawable to that edittext

How to create and interact with a custom grid like sudoku of size m*n in android

I started working on an android project which looks something like the image attached below.
I created a relative layout which should now contain two layouts. A linear which has a timer and a custom layout which should have a n*n grid layout.(say 8*10) horizontal layout.
I need to interact with grids like clicking on the grid should add an image to the grid etc. Is there a better way of implementing this rather than gridview?
Thanks
You can check GridLayout but I think GridView is better for this amount of fields.

Eclipse android widget moving

I am designing my activity screen using eclipse but whenever I move an object e.g. a button it snaps around and I find it hard to position things where i want them.
Is there some setting I can change as as soon as I add a second button it snaps the other button to another position it is so annoying!
Also if I have an image button why can't i resize this, even with a normal button if i try to make it larger it just fits to the text and wont make the button bigger or it just flicks to a random place on the activity?
thanks
Probably you're trying to place components freely in the View but you're not considering the LayoutManager behavior. If you try to position your component in a LinearLayout, for example, the components will be placed following its rules, and these components will not stay where you drop them.
Try to understand better how the layouts works on Android. But for now, the AbsoluteLayout or RelativeLayout may be what you're looking for.
About the components size, you'll need to understand better how to use layout properties for these components. See the question How to size buttons for more information.

I am using Card layout in java swing application and want to perform some nice effect on card change from one to another

In a java Swing application and if we are using Card layout for some panel than we use to show() method to show particular card.Show Method just make visible given card and disappear current card.
Is it Possible to add some effects between this card swapping?
effects like:-
List item
Left to rightte moving.
Top to Bottom.
Fade in and Fade out effect.
Zooming Effect.
Not with card layout.
You could take a look at the SlidingLayout, which is based on The Universal Tween Engine
Another approach is to design a layout manager capable of providing the required functionality. This is far more complex, but gives you an idea of what might be involved...
For example, Animations when using Gridbag Layout.

How to add an image while we drag n drop tree item?

I have a tree with number of childs and i want to drag and drop these child items on a vertical panel. Right now its working fine.The only thing i want to know is can we add an image in the place of small icon which comes at the time of dragNdrop.
You need to override the newDragProxy() method of the PickupDragController in order to provide your own proxy widget (say, an image) when the drag starts.
Do note that you also need to use setBehaviorDragProxy(true) to allow dragging proxies instead of the original widgets (i.e., the original widgets will stay in place, and you simply drag a proxy of it, that you can style as you wish).

Categories