Choose other background.

Discussion in 'Help & Support' started by Vinicius, Apr 21, 2013.

  1. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    The Mentalist!
  2. nforce777 New Guy

    Member Since:
    Jan 1, 2015
    Message Count:
    5
    Likes Received:
    1
    Trophy Points:
    0
    I would like to say : Thank you Very much! Couldn't have done it without you.
  3. nforce777 New Guy

    Member Since:
    Jan 1, 2015
    Message Count:
    5
    Likes Received:
    1
    Trophy Points:
    0
    you have to add the following :

    in res-xml-lwp_settings.xml :



    <ListPreference
    android:defaultValue="@string/background"
    android:entries="@array/backgroundNames"
    android:entryValues="@array/backgroundValues" //values are for instance background1, background2,... (you can name them as you like)
    android:key="background_settings"
    android:summary="Change the background"
    android:title="Choose Background" />



    in res-values-strings.xml :

    <string name="background">background1</string>

    <string-array name="backgroundNames">
    <item>background1</item>
    <item>background2</item>
    <item>background3</item> //add more if you like
    </string-array>

    <string-array name="backgroundValues">
    <item>background1</item>
    <item>background2</item>
    <item>background3</item> //add more if you like
    </string-array>



    In src-SBLiveWallpaper.java implement the changes like James wrote. Visit his link and look into src-SBLiveWallpaper.java

    If you have trouble i can upload my java file (created in LWC 2.6).

    Hope this helpes.
  4. Shyner Keeps coming back

    Member Since:
    Sep 2, 2012
    Message Count:
    18
    Likes Received:
    7
    Trophy Points:
    10
    Ha! May have it figured. Was missing the tiniest piece of code I must have skimmed right passed. App is crashing so I'll probably have to restart from the default sblivewallpaper.java. I'll try to report back tomorrow with my hopeful success! ☺
    EDIT: Mission success! Many thanks for the effort to share this very important feature. All of the "scaleFactor" commands were giving me an issue afterword but I was able to use one of the recommended fixes by eclipse to solve that and presto, success at long last! Now to better support landscape mode... it's a little hoaky, but landscape now supported! Item rotation speed, more screen sizes and better icons too. Now looking to offer some control over font size and color to the end user but it's proving to be a pain. ;-)

    Attached Files:

Share This Page