Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8151495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:24:32+00:00 2026-06-06T15:24:32+00:00

I am developing an application that contains 2 themes and pictures which i use

  • 0

I am developing an application that contains 2 themes and pictures which i use as skins. I can set the theme for the whole activty in the code. My problem is that I don’t know how to correctly separate the skins when it comes to pictures. For exemple, i have two themes (Black and White) and i have a set of pictures specific for these themes. How can I separate the pictures so i can set both the theme and the images for the skin from the code ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:24:33+00:00Added an answer on June 6, 2026 at 3:24 pm

    Sorry. I misunderstood the question. I have kept the previous answer below so that the comments have a natural flow.

    In this case, what we have is a Branding.java class. This class takes in a brandname (Theme, in your case) and produces the various values and strings that would be uniques to that theme. So for example, you would name your Splash images dark_theme_splash.png and light_theme_splash.png. When loading that drawable you call Branding.getSplash() and it returns a drawable based on the current theme selected.

    public static Drawable getSplash() {
        switch(MYApplication.Theme){
        case LIGHT:
            return MYApplication.res.getDrawable(R.drawable.light_theme_splash);
        }
        return MYApplication.res.getDrawable(R.drawable.dark_theme_splash);
    }
    

    And in the branding you would have:

    public class Branding {
    
        public static final int LIGHT = 0;
        public static final int DARK = 1;
    

    Then in your app you would have an int current_theme and set it to the theme you want on the fly.

    *Below here is the old answer that answered a question that wasn’t actually asked *
    I manage an app that has eight different themes. Some dramatically different. The best solution I have found for this so far is in two parts.

    1.) Your build.xml. Since you are building different skinned apps, I imagine their .apk will be named differently. In your build.xml, take advantage of different targets. For example:

       <target name="release-themeone">
            <antcall target="-do-release" inheritAll="false">
             <param name="app.pkg" value="mapmyfitness" />
             <param name="app.pkg.name" value="com.themeone.android2" />
             <param name="launcher.icon" value="common_icon_launcher" />
             <param name=".app.name" value="DarkTheme+" /> />
           </antcall>
        </target>
    

    2.) This allows you to set different parameters for different builds. In my case, we had so many different drawables, it became cumbersome to manage them all within the various drawables folders. So in the drawable folders themselves, we put in all the common assets. Then created folders outside of the drawables that duplicated the drawable folder structure, but was contained within the theme’s name. For instance folder Themeone would contain Drawable, Drawable-hdpi etc. This allowed us to manipulate the build system in such a way that each specific target pulled only the drawables it needed.

      <copy todir="bin/${app.pkg}/res/drawable" overwrite="true">
        <fileset dir="./brands/${brand.prefix}/drawable"/>  
      </copy>
      <copy todir="bin/${app.pkg}/res/drawable-hdpi" overwrite="true">
        <fileset dir="./brands/${brand.prefix}/drawable-hdpi"/> 
      </copy>
      <copy todir="bin/${app.pkg}/res/drawable-mdpi" overwrite="true">
        <fileset dir="./brands/${brand.prefix}/drawable-mdpi"/> 
      </copy>
      <copy todir="bin/${app.pkg}/res/drawable-xhdpi" overwrite="true">
        <fileset dir="./brands/${brand.prefix}/drawable-xhdpi"/>    
      </copy>
    

    All of this is contained in a for loop in build.xml that goes through the various build targets we have.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an iOS 4 application. I have a main view that contains another
I'm developing application that can be useful only in my country(Ukraine). In Ukraine people
I am currently developing an application which contains a UITableView. The UITableView contains custom
I'm developing an application in WPF and .Net 4 which contains animations. My controls
I am developing a Qt application that can play the videos and shows some
I am developing a Java application using SWT that contains some buttons with images.
I am about 70% of the way through developing a web application which contains
I'm developing an iOS 4 application. I have a ViewController that contains another class.
I'm developing a RCP application that contains a TableViewer . This is my first
I am developing an iPhone application that contains audio and PDF files. Will Apple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.