26

I have updated android studio from 3.0.1 to 3.1,now there is no option for directly view the XML file in Android studio 3.0.1 there is option for Save Screenshot enter image description here

Now in update android studio version to 3.1,it's missing

enter image description here

is it moved to any other place?

MJM
  • 5,119
  • 5
  • 27
  • 53
  • https://developer.android.com/studio/debug/am-screenshot.html – ADM Mar 27 '18 at 04:56
  • In Logcat shotcut option is given – Amjad Khan Mar 27 '18 at 05:00
  • 1
    @JZM, after your question, I also updated my AS from 3.0 to 3.1 and lost the `Save screenshot` option :( – Vikasdeep Singh Mar 27 '18 at 05:06
  • @AmjadKhan that capture image from emulator or device,i am taking about direct screenshot from xml file – MJM Mar 27 '18 at 05:08
  • @JZM the functionality is the same they have removed form it and put it to real device – Amjad Khan Mar 27 '18 at 05:55
  • 5
    @AmjadKhan there is a substantial difference in functionality even if the result is the same. Some of us need specific screen ratio captures for screen graphics. I don't have a pixel 2 XL. Why should I have to create and start a sluggish emulator just to take a few simple screenshots? – Adifyr Mar 30 '18 at 07:30
  • It's also not there in AS 3.1.1 :(. Did they really remove it intentionally? – Vladimir Jovanović Apr 09 '18 at 19:46

3 Answers3

11

There are many changes that have been done into Layout Inspector and Layout Editor in Android Studio Version 3.1.0

Layout Inspector

  1. The Layout Inspector gained new features, including some functionality previously provided by the deprecated Hierarchy Viewer and Pixel Perfect tools:

  2. Zoom buttons and keyboard shortcuts for navigating and inspecting layouts Reference grid overlay Ability to load a reference image and use it as an overlay (useful for comparing your layout with a UI mockup) Render subtree preview to isolate a view in a complex layout

Layout Editor

  1. The Palette in the Layout Editor has received many improvements:

  2. Reorganization of categories for views and layouts.

  3. New Common category for views and layouts, which you can add to with a Favorite command.

  4. Improved search for views and layouts.

  5. New commands for opening documentation for a specific view or layout element.

  6. You can use the new Convert view command in the Component tree or design editor to convert a view or layout to another type of view or layout.

  7. You can now easily create constraints to items near the selected view using the new Create a connection buttons in the view inspector at the top of the Attributes window.

Ref: https://developer.android.com/studio/releases/index.html

But nowhere it is mentioned that this option "Save Screenshot" is deprecated/removed. So I am suspecting this is a bug.

Or if they intentionally removed it, They should have mentioned the reasons.

IMO, This option doesn't make too much sense as you have screenshot option already under Logcat window. Sure you need to run the application to get it. But you can't be sure of your design just seeing it on Editor Preview, it is always recommended to run the application on emulator or a device.

Community
  • 1
  • 1
TheLittleNaruto
  • 8,325
  • 4
  • 54
  • 73
  • thank you for reply,as you mention "But nowhere it is mentioned that this option "Save Screenshot" is deprecated/removed. So I am suspecting this is a bug. ",How can we report this bug? – MJM Apr 24 '18 at 12:22
  • 6
    ,"This option doesn't make too much sense " it has sense because while developing it's easy to view the generated design with zoom in zoomout option – MJM Apr 24 '18 at 12:23
  • can you please share any link for report a bug? – MJM Apr 24 '18 at 12:33
  • @MJM Here you go: https://issuetracker.google.com/issues/new?component=192708&template=840533 – TheLittleNaruto Apr 24 '18 at 13:53
  • 1
    it does make sense, not all views are static, running the app while the functionality is not implemented yet will not show the final result. That is why there is `tools` namespace for xml, so the preview can show those attributes. By example, if a text is always gonna be set from java is better to use `tools:text="example"` rather than using `android:text...`. The `tools` attributes doesn't compile to prod https://developer.android.com/studio/write/tool-attributes – cutiko May 18 '18 at 20:59
5

I have reported this issue over here,https://issuetracker.google.com/issues/78441481

ans reply from is

"This is WAI, we deprecated this feature."

MJM
  • 5,119
  • 5
  • 27
  • 53
-7

Follow below Process:

  • Run your app on a connected device or emulator.
    • If using a connected device, be sure you have enabled USB debugging.
    • In Android Studio, select View > Tool Windows > Logcat to open Logcat
    • Select the device and a process from the drop-down at the top of the window.
    • Click Screen Capture on the left side of the window.

img1

Source:

https://developer.android.com/studio/debug/am-screenshot.html

Federico Navarrete
  • 3,069
  • 5
  • 41
  • 76
Rohan Lodhi
  • 1,385
  • 9
  • 24
  • 1
    @Rahan Lodhi that capture image from emulator or device,i am taking about direct screenshot from xml file without running application – MJM Apr 24 '18 at 09:33