Problem when changing the default colors and drawables of Android

by guna » Thu, 30 Apr 2009 12:19:27 GMT


Sponsored Links
 Hi all,

After a very long time i am posting question here... I tried to change
the default colors and drawable of android, (eg: Instead of orange
color drawable, while on focus, i want  to use my own color and in
pressing of buttons or lists, i want to show my own color, drawable
and style)... I am using the android cupcake version.... Any one tried
this or any other way? In which file i have to modify... I tried a
lot, but its not reflecting my drawable or my colors.....



Thanks,
Guna
--~--~---------~--~----~------------~-------~--~----~



Problem when changing the default colors and drawables of Android

by guna » Thu, 30 Apr 2009 20:19:13 GMT


 Hi all,

After a very long time i am posting question here... I tried to change
the default colors and drawable of android, (eg: Instead of orange
color drawable, while on focus, i want  to use my own color and in
pressing of buttons or lists, i want to show my own color, drawable
and style)... I am using the android cupcake version.... Any one tried
this or any other way? In which file i have to modify... I tried a
lot, but its not reflecting my drawable or my colors.....


Thanks,
Guna
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Problem when changing the default colors and drawables of Android

by guna » Thu, 30 Apr 2009 20:20:24 GMT


 Hi all,

After a very long time i am posting question here... I tried to change
the default colors and drawable of android, (eg: Instead of orange
color drawable, while on focus, i want  to use my own color and in
pressing of buttons or lists, i want to show my own color, drawable
and style)... I am using the android cupcake version.... Any one tried
this or any other way? In which file i have to modify... I tried a
lot, but its not reflecting my drawable or my colors.....



Thanks,
Guna
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. SystemProperties available to SDK developer?

> When I try to import android.os.SystemProperties, EC says this can not

There is no android.os.SystemProperties in the current SDK. That is a
class in the source code for use by the firmware only.


There are many possibilities:

-- SQLite
-- SharedPreferences
-- Local (private per-application) files
-- Shared (on the SD card) files
-- Network I/O to "the cloud"

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~

2. Dreaded "Stopped Unexpectedly"

I am trying to bring up a Preferences screen.  Here is the XML for the
screen.

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen 
        xmlns:android="http://schemas.android.com/apk/res/android">
        <EditTextPreference 
                android:key="weight"
                android:title="@string/weightlbltxt"
                android:defaultValue="145"
                />
        <ListPreference
            android:title="@string/genderlbltxt"
                android:entries="@array/genders"
                android:defaultValue="Male"
                />
        <ListPreference
                android:title="string/alarmlbltxt"
                android:entries="@array/alarms"
                android:defaultValue="None"
                />
        <EditTextPreference
                android:key="BAC"
                android:title="@string/baclbltxt"
                android:defaultValue="0.08"
                />
        <Button android:id="@+id/btnSetDone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:text="@string/donetxt"
                />
</PreferenceScreen>

Here is the matching Java:

package com.parisj13.trackmydrinks;

import android.content.Context;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;

public class Settings extends PreferenceActivity implements
OnClickListener {

        @Override
        protected void onCreate(Bundle savedInstanceState){
                super .onCreate(savedInstanceState);
                addPreferencesFromResource(R.layout.settings);
                //setContentView(R.layout.settings);
        }
        @Override
        public void onClick(View v) {
                finish();
        }
        
        public static int GetWeight(Context context){
                return PreferenceManager.getDefaultSharedPreferences(context)
                .getInt("weight", 145);
        }
        
        public static String GetGender(Context context){
                return  PreferenceManager.getDefaultSharedPreferences(context)
                .getString("gender", "Male");
        }
        
        public static String GetAlarm(Context context){
                return PreferenceManager.getDefaultSharedPreferences(context)
                .getString("alarm", "None");
        }
        
        public static int GetBAC(Context context){
                return PreferenceManager.getDefaultSharedPreferences(context)
                .getInt("BAC", 145);
        }
}

Manifest Entry:

        <activity android:name=".Settings"
                android:label="@string/app_name">
        </activity>

The code that launches the Settings screen:

                if(v.getId() == R.id.btnSettings){
                        i = new Intent(this, Settings.class);
                        startActivity(i);
                        return;
                }



--~--~---------~--~----~------------~-------~--~----~

3. SystemProperties available to SDK developer?

4. adding resources

5. Support for RTP on android

6. dialog is getting dismissed when I am flipping the device

7. Can SlidingDrawer stop sliding and just stay there with motionevents?