Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I list all string resource files in folder tree?

I create a project with free and pro edition based productFlavors, and use different string resource file for different edition, the folders construction is cc.png.

If I change Build Variant in panel, the values in Android tab display two strings.xml(2), one is located main folder, another is located free or pro folder, you can see aa.png and bb.png.

I hope that all string resource files can be displayed together, it will display three string.xml(3), first is located main folder, sencond is located free folder, third is located pro folder. How can I do that ? Thanks!

CC.Png

enter image description here

AA.png

enter image description here

BB.png

enter image description here

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "info.dodata.messagecleanup"
        minSdkVersion 9
        targetSdkVersion 22
        versionCode 7
        versionName "1.07"
        archivesBaseName = "MessageCleanup-V" + versionName
    }


    productFlavors {
        free {
            applicationId "info.dodata.messagecleanup"
            buildConfigField "String", "AppName", "\"Message Cleanup\""
        }


        pro {
            applicationId "info.dodata.messagecleanup.pro"
            buildConfigField "String", "AppName", "\"Message Cleanup Pro\""
        }
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.gms:play-services:7.3.0'
}
like image 575
HelloCW Avatar asked Aug 04 '15 01:08

HelloCW


2 Answers

Unfortunately the Android project pane view does not support this behavior. The Android view was specifically designed to show the state of your project for a given build variant, not across all variants.

As you have already discovered, the easiest way to see your resources in all available configurations is to use the "project" view instead of the "Android" view.

You are also free to file a feature request on the Android issue tracker for the option to show the resources available across all variants.

like image 161
Bryan Herbst Avatar answered Sep 19 '22 22:09

Bryan Herbst


You can define custom scopes within IntelliJ / Android Studio, that display specific folders/files:

enter image description here

You can then select that custom scope from the scope drop-down selector:

enter image description here

That said, I think the more efficient way of navigating between the string files is to hit the "Search Everywhere" hotkey, type "strings.xml", and select the one you want:

enter image description here

like image 40
eski Avatar answered Sep 19 '22 22:09

eski