Visual Studio Code – Can “OPEN EDITORS” panel be sorted?

Update 2020-12-16 With release v1.52.0 being shipped you can sort open editors. From the release notes: There is a new setting explorer.openEditors.sortOrder to control the sort order in the OPEN EDITORS list. The values are: editorOrder – Editors are listed in the same order as editor tabs are shown (default). alphabetical – Editors are listed … Read more

creating a DialogPreference from XML

Here is an example of how to use the dialog preference (subclassing as you mentioned). package dk.myapp.views; import android.content.Context; import android.preference.DialogPreference; import android.util.AttributeSet; /** * The OptionDialogPreference will display a dialog, and will persist the * <code>true</code> when pressing the positive button and <code>false</code> * otherwise. It will persist to the android:key specified in xml-preference. … Read more

How to open Visual Studio Code’s ‘settings.json’ file?

To open the User settings: Open the command palette (either with F1 or Ctrl+Shift+P) Type “open settings” You are presented with a few optionsĀ¹, choose Open User Settings (JSON) This image was taken in the VS Code online editor Which, from the manual and depending on platform, is one of: Windows %APPDATA%\Code\User\settings.jsonĀ² macOS $HOME/Library/Application\ Support/Code/User/settings.json … Read more

Dynamic ListPreference in android

Every XML element in Android can be created programmatically as the element name is also a Java class. Hence you can create a ListPreference in code: CharSequence[] entries = { “One”, “Two”, “Three” }; CharSequence[] entryValues = { “1”, “2”, “3” }; ListPreference lp = new ListPreference(this); lp.setEntries(entries); lp.setEntryValues(entryValues); You could alternatively create it in … Read more

Android shared preferences not saving

From the documentation: Create a new Editor for these preferences, through which you can make modifications to the data in the preferences and atomically commit those changes back to the SharedPreferences object. Since that’s a new Editor instance, your code should be more like this: preferences = getApplicationContext().getSharedPreferences(PREFERENCES_NAME, 0); SharedPreferences.Editor editor = preferences.edit(); editor.putString(SETTINGS_BACKGROUND_IMAGE, “okok”); … Read more

How to set the Default Value of a ListPreference

You don’t need to programmatically handle the default value of ListPreferences. You can do this in xml setting file. Below is an example <string-array name=”opts”> <item>red</item> <item>green</item> <item>blue</item> </string-array> <string-array name=”opts_values”> <item>1</item> <item>2</item> <item>3</item> </string-array> … <ListPreference android:title=”Colour select” android:summary=”Select your favourite” android:key=”colour” android:entries=”@array/opts” android:entryValues=”@array/opts_values” android:defaultValue=”2″ /> here I selected 2 as a default value. … Read more

How to prevent Sublime Text 2 from opening that last open file / project when starting up

I think the behavior you want can be enabled by changing the hot_exit and remember_open_files settings. If you check out the “Global Settings – Default” preferences, there are some comments there describing these settings. If you want to change them, you should override them in the “Global Settings – User” file to preserve your changes … Read more

How to change the integrated terminal in Visual Studio code

To change the integrated terminal on Windows, you just need to change the terminal.integrated.shell.windows line: Open VS User Settings (Preferences > User Settings). This will open two side-by-side documents. Add a new “terminal.integrated.shell.windows”: “C:\\Bin\\Cmder\\Cmder.exe” setting to the User Settings document on the right if it’s not already there. This is so you aren’t editing the … Read more

Android: How to remove margin/padding in Preference Screen

Updating this for androidx. After a lot of experimentation, I resolved this issue by adding this to each preference that had the excess indentation: app:iconSpaceReserved=”false” Of course, you’ll also need to add this to the PreferenceScreen declaration itself at the top of your xml: xmlns:app=”http://schemas.android.com/apk/res-auto” Follow Up For Custom Preferences I noticed that in the … Read more