Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one get dimens.xml (sw600dp) into Android Studio?

I inherited the values folder structure shown below.

enter image description here

For over an hour I've Googled and looked and pulled down menus in Android Studio 1.2.2 and tried creating files and folders but nothing I have done lets me add, for instance, dimens.xml (sw720dp).

I deleted dimens.xml (sw720dp - landscape) because landscape didn't suit my needs.

What steps did whoever created the folder structure take in order to get dimens.xml (sw600dp) to appear in the structure?

What steps do I need to take to get a dimens.xml file with the sw<N>dp file naming convention? How do I get dimens.xml (sw720dp) where it belongs?

You can ignore the rest of this. I'm just showing that I've TRIED stuff, none of which works right.

Am I supposed to right-click values or dimens.xml (2)? What then?

Here's what I did and it didn't do as I need:

enter image description here enter image description here

I also tried:

enter image description here enter image description here

EDIT

I also tried copying the sw600dp file. No luck:

enter image description here

IT CAN'T BE THIS HARD.

like image 767
DSlomer64 Avatar asked Sep 20 '15 22:09

DSlomer64


1 Answers

What steps do I need to take to get a dimens.xml file with the swdp file naming convention?

First, you will probably be happier with life if you change the drop-down above your project tree from "Android" to "Project", which shows you an actual filesystem view of your project.

To add a resource directory from within Android Studio:

  1. Right-click over res/

  2. Choose New > "Android resource directory" from the context menu to bring up the New Resource Directory dialog:

Android Studio New Resource Directory

  1. Choose your resource type in the "Resource type" drop-down (in this case, values)

  2. Click on your desired qualifier (in this case, "Smallest screen width") in the "Available qualifiers" list.

  3. Click the >> button

  4. In the field that appears, fill in your numeric value (in this case, 600)

  5. Click OK to close the dialog and create the directory

To add dimens.xml to that directory, right-click over the newly-created directory and choose New > "Values resource file" from the context menu.

like image 142
CommonsWare Avatar answered Sep 20 '22 12:09

CommonsWare