Android Studio: Code Folding turned off but not applying to imports - android-studio

I have turned off Code Folding using the procedure described here.
However, my imports are still folded away, hidden by an Ellipsis, as shown here:
I really don't see the point of having code hidden away so that extra key presses or mouse clicks are required to see it.
How can I make Android Studio just show me everything?

Launch Android Studio
Configure > Settings > Editor > General > Code Folding
Uncheck "Imports"

Related

How do I see both Resharper's and Visual Studio's refactoring suggestions?

In Resharper for Visual Studio, often I want to use a refactoring suggestion and I'm not sure whether it is part of Resharper or VS. Sometimes I have to push Ctrl+. to open Resharper's refactorings and then hit escape and then push Alt+Enter to open VS's wrench or light bulb.
Is there a way to combine these into one menu or otherwise see both, of course without losing the VS refactorings?
ReSharper used to be able to merge VS actions into the Alt+Enter menu, but right now as of 2022.3 this functionality is broken (see RSRP-486822).
I suggest you disable "Hide Visual Studio Quick Action icons in the left editor margin" setting in R# options. This was you will be able to see VS actions using Ctrl+., and R# actions using Alt+Enter.

How to enable soft wraps in android studio?

I need help in configuring Android Studio so that the code that I write does not go beyond the window and I don't have to scroll horizontally to see it? (The code should go to the next line while still in continuation)
This is what I mean to say ...
I have seen a question similar to this on the site but the wrapping and braces setting were not present for Flutter (there was no option for flutter) or Dart (there's nothing there except for dartfmt).
"File>Settings>Editor>General" tab and under soft wrap section check softwrap option and click on apply
if you want arrow indicators then uncheck the option "show soft wrap indicators for current line only" then click on apply.

How to disable code inspection errors in README.md file in Android Studio

In my GitHub README.md file, which is in the root of my Android project, I have code snippets like the following ones:
```xml
android:windowSoftInputMode="stateHidden"
```
```java
MongolToast.makeText(getApplicationContext(), "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠤᠤ︖", MongolToast.LENGTH_LONG).show();
```
However, in Android Studio these code snippets give errors
I don't want to be warned of supposed code errors in the README file. How do I disable all errors here?
Notes:
I know how to suppress inspections normally in code with #SuppressLint or going into settings and unchecking the lint inspection. I don't want these errors to be suppressed in other areas of my project, though.
Somewhat similar question (without an answer): Android Studio - disable errors highlighting for excluded files
After doing some further research I come to conclusion that these errors are not from Android Studio itself but there are plugins for markdown format like Markdown Navigator and Markdown Support if any of them is installed and enabled then you will see above errors in README.md file.
I think this spell check is built in feature of these plugins and can not be controlled from Android Studio.
One option what I think is to disable these plugins and you are good to go.
You can disable these plugins from (Android Studio 3.1.4 MacOS) Preferences > Plugins (or File > Settings > Plugins in Linux) by unchecking them and restart (don't forget it) your Android Studio:
First you need to create a scope (Settings->Scope)
and add the files you want to keep out of scope for the Lints you wanna suppress.
Then go to Settings->Inspections, chose the inspection you wanna remove,
and then on the right choose from the drop down your scope to define the wanted behavior.
In this case, my scope is called AVOID_LINTS, and won't show any typo warnings.
EDIT
In the first step, when you create the scope, you need to add your README to the new scope.
EDIT2
Where to find the scopes:
You may search for the files you want to add, select and click include.
Remove code type annotation, change from:
```xml
android:windowSoftInputMode="stateHidden"
```
```java
MongolToast.makeText(getApplicationContext(), "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠤᠤ︖", MongolToast.LENGTH_LONG).show();
```
change to:
```
android:windowSoftInputMode="stateHidden"
```
```
MongolToast.makeText(getApplicationContext(), "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠤᠤ︖", MongolToast.LENGTH_LONG).show();
```
Newer versions of Android Studio starting with 2022.2.1 Flamingo (at least from Beta 1) have an option to toggle "Show problems in code fences" under Preferences > Languages & Frameworks > Markdown.
Note that this toggles all problem types at the same time (typos, warnings and errors).

Android Studio Resetting Changes to Default Code Style

I'm here today because I'm having an issue with Android Studio. I don't know if it existed on previous versions (I don't remember this being an issue, so I doubt it was a problem on a previous version), but currently I am using the Android Studio V2.1 Stable release.
My issue is that if I launch Android Studio (I happen to be on Windows, 64-bit Android Studio) and at the Start Screen/Page, I click Configure>Settings>Editor>Code Styles, and change the default parameters on any of the languages (XML, Java, HTML, etc.), the Default profile is copied to a new profile (Default(1)) and the new settings get applied to each profile.
If I Apply these changes and exit Android Studio, and launch back up and follow the same method...the settings have completely gone back to what they were before I changed them, with the exception of the Default(1) copy profile. But from my experience, Android Studio doesn't build new projects based on this Default(1) copy profile, it builds them on the Default profile. Which means all of my adjustments to using indents and not spaces, keeping indents on empty lines, etc. all do not get carried through to the actual project files, leaving me to have to go back into the settings with the project loaded up and change all of these parameters again. That's just asinine. Please tell me I'm missing something here and that there's a simpler way of achieving the ability to keep a code style template that I can use on all of my projects!
Perhaps it would be better to report or consult on this using the Android Studio feedback site. If that's the better option, I'm willing to do that too.
Thanks everyone!
What I do in that case is
Go to Preferences
Code Style
Select scheme you want
Click Settings cog
Click copy to project
Some OKs and then it works.
After selecting the code style that i want, opened the gradle.properties file in root folder of the project and deleted the following line
kotlin.code.style=official
deleting the above line, prevents the code style resetting to default.
Go to Preferences
Code Style
Set Scheme to Default [IDE]
Click restore defaults
The simplest way I found to reset the default settings is as follows:
In Android Studio, click on File.
Settings (Ctrl + Alt + S)
Under Editor in settings
Select Code Style
Next to Scheme: select the three dots to access the scheme options ()
Select Restore Defaults
A Confirmation Dialog Box will be displayed to confirm if you want to revert back to
the default settings.

Where is the warnings screen option in Android Studio?

I want to see warnings of my code in Android Studio, But i am unable to find the option to display warnings view. In case of eclipse we can see the warnings in the "Problems" view.
Can anyone suggest me, how to view warnings in android studio?
If, on the toolbar, you click Analyze -> Inspect Code; then in the window that pops up select how much of your project you want to inspect (I usually do Whole Project, but you might want to select a specific module), then click okay.
Android Studio will work for a bit, then the inspection window will pop up from the bottom with a list of results, subdivided by inspection.
Build -> Make Project (Ctrl + F9) gives what we can get equivalent of Eclipse's “Problems” view on Android Studio
you can use F2 to next problems, see more here: Navigating to Next/Previous Error
GO to View-->Tool Windows-->Messages to view the warnings
Even i searched all the settings in Android Studio, but couldn't find a separate window for it.
The warnings are actually visible to the right end of a particular line as a small yellow marker and clicking on that show the warnings in the status bar below. The colors of them can be editted in the inspection options.
Hope this helps you.
The closest thing Android Studio/IntelliJ has to the Problems view in Eclipse is to use the Problems section of the Project tool window. With that open, navigate down to any classes that appear there and open them in the editor. Once in the editor, you can use F2 to jump between errors in the open file.
Unfortunately, IntelliJ's Problems tool window shows classes with errors nested by folder/package, so you have to expand several levels and it takes up a lot of screen real estate to see even one error. It also doesn't list the errors individually, forcing you to first open the problematic file and then use F2 to navigate to each one. I also had the problem that errors in files that weren't open, didn't show up there.
[opening warning screen in android studio
Click the warning icon as marked in the image.
Warning screen will open.
][click to see image] here

Resources