Android Studio 3.2.1, XML bad indent format - android

After updating to Android Studio 3.2.1 the XML files format is very annoying and bad, how can we fix it? Can we change it from somewhere in settings to previews type?

On Android Studio 3, Go to :
Preferences > Editor > Code style > XML then on Scheme switch to Default instead of Project.
You can then use those shortcuts to indent your code:
Windows:
Ctrl + Alt + L
macOS:
Option + Command + L

You can edit your code styles under File > Settings > Editor > Code Style > XML
If you want to preview a specific file, just paste that file's contents into the preview window.

Open File > Settings > Editor > Code Style > XML
Now in layout file make sure you have selected wrap attributes as Wrap always.
Screenshot

Related

Android studio doesn't recognize UTF-8 encoding

The problem is that when I use UTF-8 characters like ā, ē, š Android Studio translates them to some different symbols.
This is Log.d() that I'm passing:
Log.d("Test", "ššāā");
The result that I get is
D/Test: ЕЎЕЎДЃДЃ
And that is not only for Logcat. It passes same thing everywhere I try to use these characters.
Check your gradle file for any encodings like
compileOptions.encoding = 'windows-1251'
Can you try this:
File -> Other Settings -> Default Settings, then search for "File Encodings", change Project Encoding to UTF-8
Make sure all the below are set to UTF-8:
Global Encoding (Settings > Editor > File Encodings)
Project Encoding (Settings > Editor > File Encodings)
Default encoding for properties files (Settings > Editor > File Encodings)
The actual file encoding at the bottom right in Android Studio

Shortcut to create new line in Android Studio editor

What is the shortcut to create a new line in Android Studio editor (like ctrl+enter in Visual Studio Code)?
I believe its Shift + Enter
If you want to change it ::
Go to File > Settings > Select Keymap > Select Editor Options > Start
a New Line
Shift + Enter
List of android studio keyboard shortcuts:
Android keyboard shortcuts

how to change terminal font size on Android Studio?

I want to change the Terminal font size. But I have no idea to do it.
Who can solve it?
in window : File - > Settings - > Editor - > Color scheme -> Console Font
File > Settings (Ctrl + Alt + S) > Editor > Color Scheme > Console Font
Thanks for everyone, I have solve it. I also do this steps some days ago, but it is not effective immediately. I try to do it once again just now and then restart AndroidStudio , Everything is OK. Thanks!
In Android Studio 3.0 File > Settings > Editor > Color & Fonts > Console Font....then click Apply and Ok
If you are android studio version above 3.0 :
File > Settings > Editor(expand it) > Color scheme(Expand it) > Console Font > Tick checkbox of Use console font instead of default > Enter size of font you want use > click Apply > Click Ok

Autocompletion not showing in Android Studio with dual screens

I just switched from Eclipse to Android Studio (IntelliJ).
I can't figure out how the autocompletion works! I tried Control + Space, Control + Shift + Space but i have no relevant suggestion. Not in the Java files, not in the layout files.
Is there another shortcut? Do I need to enable some option beforehand?
Preferences > Keymap > Code > Completion > Basic/SmartType:
It was actually a display problem. I'm using two screens, and the suggestions only appear when the IDE is on the main one.
The (imperfect) solution is to define the display where I'm using the IDE as the main one.
Just remove all the folder "AndroidStudioPreview";
On Windows:
Go to your User Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users\[your username] (ex. C:\Users\JohnDoe\)
In this folder there should be a folder called .AndroidStudioPreview
On Mac OS X
Remove these files:
~/Library/Application Support/AndroidStudioPreview
~/Library/Caches/AndroidStudioPreview
~/Library/Logs/AndroidStudioPreview
~/Library/Preferences/AndroidStudioPreview
You can get your Autocompletion suggestions back in Android Studio by doing: File>Invalidate Coches/Restart...>Invalidate and Restart

Issue Displaying Japanese Characters in Eclipse

My ecliplse IDE is displaying junk characters instead of the correct japanese characters...
Tried many strategies , my encoding is set to UTF-8...but still no outcome.
Screenshots for references are attached..
Any help will be accepted...
Thanks in advance.
Open this file in your Workspace directory: <your_workspace_dir>\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.ide.prefs
Append this line to that file: IDE_ENCODINGS_PREFERENCE=EUC-JP'Shift_JIS'
Restart Eclipse
Open Setting: Window > Preferences > General > Workspace > Text File
Encoding. In Other: select "EUC-JP" in dropdown.
Ok -> re-open that file;
The xml file might be saved as SJIS(MS932).
Maybe this page can help you:
http://internetmarketingcoding.com/how-to-convert-japanese-shift-jis-text-to-utf-8
Open the eclipse.ini config file in the eclipse home folder
Add the new parameter -Dfile.encoding=SJIS
Close and Open the eclipse.

Categories

Resources