Home How to automatically use different set of application icons based on chosen buildType?
Reply: 1

How to automatically use different set of application icons based on chosen buildType?

Waterfr Villa
1#
Waterfr Villa Published in 2017-11-15 01:14:27Z

Iam trying to automatically switch between two sets of app icons based on the buildTypes i defined here at build.gradle:

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

    }
}

I have already looked at this post, however my files structure is different and the offered solution does not work for my case. How to provide different Android app icons for different gradle buildTypes?

Here is my files structure where there are two sets of icons stored at res-debug and res-release. How can I automatically switch between the two?

\app\src\main:
├───assets
├───java
│   └───com
│       └───myproj
│           └───videoplayer
│               ├───dialog
│               ├───dto
│               ├───entity
│               └───utils
├───res-debug
│   ├───layout
│   ├───mipmap-hdpi
│   ├───mipmap-mdpi
│   ├───mipmap-xhdpi
│   ├───mipmap-xxhdpi
│   ├───mipmap-xxxhdpi
│   └───values
└───res-release
    ├───layout
    ├───mipmap-hdpi
    ├───mipmap-mdpi
    ├───mipmap-xhdpi
    ├───mipmap-xxhdpi
    ├───mipmap-xxxhdpi
    └───values
Northern Poet
2#
Northern Poet Reply to 2017-11-15 02:03:43Z

The correct folder structure should be:

└─src                            
    ├─debug                      
    │  └─res                     
    │      ├─layout              
    │      ├─mipmap-*         
    │      └─values              
    ├─main                       
    │  ├─java                    
    │  │  └─com.any.package                    
    │  └─res                     
    │      ├─drawable            
    │      ├─layout              
    │      ├─mipmap-mdpi         
    │      ├─mipmap-xhdpi        
    │      ├─mipmap-xxhdpi       
    │      ├─mipmap-xxxhdpi      
    │      └─values              
    └─release
       └─res                     
           ├─layout              
           ├─mipmap-*         
           └─values              
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.361681 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO