ConstraintLayout chain context menu no longer visible in Android Studio - android

Using Android Studio 3.4 Canary 9 and 10
ConstraintLayout 2.0.0.alpha3
I am having an issue with constraint layout in the bleeding edge build of Android Studio 3.4 canary 9. Basically, when you click on a view in constraint layout, say on a chain element, you should be able to see small icons appear that allow you to perform certain actions on the views.
As you can see, under each view are 3 buttons that allow you to change the chain settings. However, this is what I get in my layout editor on 3.4.C09 when clicking on an element in a chain:
Did they get disabled or moved elsewhere? Is this a bug? I have looked everywhere in the IDE without any luck, tried zooming in / zooming out, changing the theme, invalidating caches/restart, clean rebuild etc.
Thank you for any help provided!

UPDATE
Now you should see Circle Chain mode option in right-click menu in Android Studio 3.6.
According to the official response, this function has been removed in AS3.4.
But there seems to be no alternative. I have reported this problem to Goole and you can track here.
For now, you can add app:layout_constraintHorizontal_chainStyle attr in xml manually. And after that Cycle chain mode options will appeare in the right-click menu.

It is now available in attributes under layout_constraints. ( AS 3.5 )

Related

Layout Validation in Android Studio

How do I get the Layout Validation window in Android Studio? It's usually listed under View > Tool windows. Is there a solution that helps you see your layouts displayed on different screen sizes in realtime without actually running an emulator or actual device?
As per Android Studio version 4.1.3, it's still there in
View -> Tool Windows -> Layout Validation
If you can't see it,
go to settings
search for Layout Validation
Click on KeyMap
Double click on Layout Validation
Add keyboard shortcut
As of Arctic Fox 2020.3.1, it seems to appear only if you are in the XML layout editor. It doesn't appear to work (yet) for Jetpack Compose previews.
In order that the Layout Validation window appears, you have to open some of your views (activity, fragment,...) xml layout. Then, the window should automatically appear in the upper right corner of the IDE window. See here:
https://developer.android.com/studio/debug/layout-inspector#layout-validation
If it doesn't appear, then it should be listed under View > Tool Windows

Android Studio 2.2 Designer (Gridlayout) not working properly

After the update to 2.2 the designer seems to gone crazy.
I using API 24 with Build Tools Version 24.0.3.
Into the designer if i have a parent GridLayout or the v7:
I can't drag the first subview inside. The only solution i found is that to drag it into the Component Tree.
If i add two subviews, i can't arrange them by dragging inside the designer, before the 2.2 version of android studio the columns and the rows was , now it shows this error and stops to respond:
java.lang.NullPointerException
at com.android.tools.idea.uibuilder.handlers.grid.GridDragHandler.commit(GridDragHandler.java:56)
at com.android.tools.idea.uibuilder.surface.DragDropInteraction$1.run(DragDropInteraction.java:191)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction$2.run(WriteCommandAction.java:108)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:103)
at com.intellij.openapi.command.WriteCommandAction.access$000(WriteCommandAction.java:34)
at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:85)
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:723)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:82)
at com.android.tools.idea.uibuilder.surface.DragDropInteraction.moveTo(DragDropInteraction.java:203)
at com.android.tools.idea.uibuilder.surface.DragDropInteraction.end(DragDropInteraction.java:123)
...
Sometimes into the designer if i click one subview of the GridLayout it goes at the bottom of the superview, in xml preview too!!!
Now the designer doesn't allow me to copy components between 2 different layouts ( i have to copy it from xml ).
If a property of a view is selected into the right panel ( for example : text for a TextView ) and i press delete, it deletes the components instead of resetting the property ( i have to delete the line from xml ).
It should be the stable version, but in my opinion, it's not usable like before, now i have to manually modify the xml more then before.
I already tried to clear all like: Described here and then reinstall it. But it's the same.
It's something that i am missing?

ListView tools:listitem not working in android studio 2.2 stable channel

Steps to Reproduce:
Open Layout editor
Add a ListItem
Specify tools:listitem property with a valid row_layout
What should happen:
It should use the layout from tools:listitem to render list items.
Actual result:
Nothing changes, it still shows the default list with generic views
Bug Report
I could see this bug was already filed on Jul 5, 2016 Bug Report Link
Are there any work around available to render list?
One thing to notice: it's tools:listitem not tools:listItem which is somewhat confusing. Took me some time to figure that out, since Android Studio currently doesn't provide autocompletion for that.
You must define an id i.e. android:id="#+id/list_view" to your list
Another reason why tools:listItem doesn't work is when you're using the AndroidX's RecyclerView when using an older Android Studio. Update to 3.2 or higher and it will work.
This is fixed in Android Studio 2.3 beta 1
File -> Invalidate Caches and Restart
fixed the issue for me

Drag/Drop feature in Android studio not working

I'm new to android programming The drag/ and drop feature in android studio is not working. I can't drag anything to my phone. Right now my fragment is google map view and i want to add a search bar to the view. It just doesn't drag. When I try to add it in text it says element item not allowed here?
This is my activity_maps.xml file
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:id="#+id/map" tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment">
<item android:id="#+id/search"
android:title="#string/search_title"
android:icon="#drawable/ic_search"
android:showAsAction="collapseActionView|ifRoom"
android:actionViewClass="android.widget.SearchView" />
</fragment>
the new version of android studio uses 2 xml files for each layout. One (e.g. content_main.xml) embedded in the other one (Activity_main.xml).
you should open the content_*.xml and do the design in it.
hope it helps.
In addition to Hamed's answer I also had to:
File > Invalidate Caches / Restart ...
I'm missing vim.
The drag and drop feature is not working in Android Studio.... I also wasted a lot of time searching...what fixed my problem was to select a Theme for the Activity.
The image below will make things clear.
After updating to the latest version of Android Studio (2.2) I started having this problem.
After some searching and playing around I discovered holding down alt allows my to drag and drop. I had the "hold ALT to drag and drop" option checked under Settings-> Appearance & Behavior > Appearance.
Either I had already selected this option and a fix in Android Studio 2.2 made it so the option applied to dragging and dropping with the palette panel OR this option was recently added and defaulted to checked or a problem happened while upgrading that set it to true.
I have this option set in IntelliJ and have used the android studio palette normally before and am mostly sure I used it without having to hold down alt before so I'm going with option A (and it took me an embarrassing amount of time until I tried holding down alt).
In my case, I was using ConstraintLayout in Android Studio 3.0. Fixed it by using android.support.constraint.ConstraintLayout instead.
Go to your "values" folder
and open the "styles.xml" file.
Replace "Theme.AppCompat.Light.DarkActionBar" under the parent tag with "Base.Theme.AppCompat.Light.DarkActionBar"
I faced this problem also and I simply fixed that by changing the theme to DeviceDefault.Light for the activity.
I also faced the same problem. The culprit was that in my parent
android.support.wearable.view.BoxInsetLayout
tag i was dragging the components directly but when i put
FrameLayout
inside
android.support.wearable.view.BoxInsetLayout
tag and then drag my components to
FrameLayout
it worked .
Hope it will help someone.
I know this is old but not being able to drag elements into the design just happened to me (2/18/18). Restarting Android Studio (3.01) did the trick.
I faced the same problem of not dragging elements in Android Studio 3.1.
Restarting the Android Studio, fixed the problem for me
I figured it out. Even though the design panel is visible as well as the Palette and Component Tree I ALSO need to have app/src/main/res/layout/fragment_main.xml selected over in the Project panel in order for the actual design of the layout to be enabled.
Drag 'n' Drop may not work properly, when you have a LinearLayout, in that condition, the items you drag will try to settle in a specific manner(Horizontal or Vertical), instead try to change your main layout to Relative Layout
Linear Layout --> Relative Layout
I know this is a old issue,none of these were working for me, and it so happened that it wasn't android studio that was giving this problem it was windows. I noticed I couldn't drag anything so clicking and holding any file on the desktop and pressing escape is what fixed it for me.
I resolve this problem by simply rebuild my android studio project.
I was facing the same problem,but then I found the solution .
All you have to do is select the element you want to add(eg. Button) and press "Enter".
The component will be displayed on your screen.
Or you can select the component and right click -> Add to Design
I have did everything in this post, until I've run android studio by just running and not running with "Run As Administrator"(Right Click -> More -> Run As Administrator). I've used to run android studio with "Run As Administrator" and that caused the problem to not drag and drop. Just run Android Studio without "Run As Administrator".
Or try do vice versa and actually "Run As Administrator" if you already just running it without "Run As Administrator".
File>Settings>Appearance and Behavior>Appearance>Theme -> IntelliJ Light
Change your settings to the above path. Then you can drag and drop the views on the design view.
I was also confused with the drag&drop feature. Until I figured out:
After beginning to drag you have to release the mouse button and everything works fine.
Nice feature - a bit unusual though.
I just downloaded Android Studio and ran into this problem.
After clicking random buttons for a few minutes I found out:
There's a magnet icon in the toolbar right above the design view called "Disable Autoconnection to Parent". After I clicked this I was able to move the button wherever.

Eclipse Android Graphical Layout is not giving the options on properties window

Eclipse Android Graphical Layout is not giving the options on properties window.
example: When i select any widget on my graphical layout editor to show the properties, when i click on "Text" property (value field) it shows the "..." button to select a string. When i click on the button, nothing happens and i have to fill it by myself. The same for other properties like Gravity (i have to fill it by myself instead of show me the options like "center", etc.
I've just updated to the last version available, anyway, this installation is very fresh (last weekend). I'm running on a ubuntu 11.04 also updated today. But this always happened to me, it never worked actually :( very frustrating.
I submitted this to android-developers mailing list and found that there is a bug (fortunately already fixed) on ADT for linux:
http://code.google.com/p/android/issues/detail?id=18348
the solution is:
Download the ADT r14 preview available here:
http://tools.android.com/download/adt-14-preview
many other bugs, mainly on interface design layout issues were fixed lately (and many linux-specific bugs).
On the Outline window, Right click on the relative layout (lets say) tree
choose "other properties" and then "All By Name". a window should pop up for you to enter the desired action.
the only thing that worked for me in order to relate action to button in Graphic layout on eclipse
(using windows 7 X64 Build: v22.3.0- 887826)

Categories

Resources