# HG changeset patch # User Vincent V. # Date 1344764292 -7200 # Node ID 3c5724d308870fa929a2c0e407a259a13da63da7 # Parent 7caab0161cf9404f200561f86bb037885ba92dfd clean + remove avatar status for now (will be replace by beem colored icon) diff -r 7caab0161cf9 -r 3c5724d30887 res/drawable/avatar_status.xml --- a/res/drawable/avatar_status.xml Mon Jul 16 15:43:55 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - diff -r 7caab0161cf9 -r 3c5724d30887 res/layout/chat.xml --- a/res/layout/chat.xml Mon Jul 16 15:43:55 2012 +0200 +++ b/res/layout/chat.xml Sun Aug 12 11:38:12 2012 +0200 @@ -7,7 +7,6 @@ android:orientation="horizontal" android:gravity="center_vertical" android:background="#222222" android:padding="4dp"> diff -r 7caab0161cf9 -r 3c5724d30887 res/values/strings.xml --- a/res/values/strings.xml Mon Jul 16 15:43:55 2012 +0200 +++ b/res/values/strings.xml Sun Aug 12 11:38:12 2012 +0200 @@ -16,6 +16,7 @@ Use Beem Service + Problem : Account %s not connected Chat diff -r 7caab0161cf9 -r 3c5724d30887 src/com/beem/project/beem/BeemApplication.java --- a/src/com/beem/project/beem/BeemApplication.java Mon Jul 16 15:43:55 2012 +0200 +++ b/src/com/beem/project/beem/BeemApplication.java Sun Aug 12 11:38:12 2012 +0200 @@ -45,8 +45,6 @@ package com.beem.project.beem; import android.app.Application; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; /** * This class contains informations that needs to be global in the application. Theses informations must be necessary @@ -108,76 +106,11 @@ public static final String MUC_PASSWORD = "muc_password"; public static final String MUC_AUTOJOIN = "muc_autojoin"; - private boolean mIsConnected; - private boolean mIsAccountConfigured; - private SharedPreferences mSettings; - private final PreferenceListener mPreferenceListener = new PreferenceListener(); - /** * Constructor. */ public BeemApplication() { - } - - @Override - public void onCreate() { - super.onCreate(); - mSettings = PreferenceManager.getDefaultSharedPreferences(this); - String login = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, ""); - String password = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, ""); - mIsAccountConfigured = !("".equals(login) || "".equals(password)); - mSettings.registerOnSharedPreferenceChangeListener(mPreferenceListener); - } - - @Override - public void onTerminate() { - super.onTerminate(); - mSettings.unregisterOnSharedPreferenceChangeListener(mPreferenceListener); - - } - - /** - * Tell if Beem is connected to a XMPP server. - * @return false if not connected. - */ - public boolean isConnected() { - return mIsConnected; + super(); } - /** - * Set the status of the connection to a XMPP server of BEEM. - * @param isConnected set for the state of the connection. - */ - public void setConnected(boolean isConnected) { - mIsConnected = isConnected; - } - - /** - * Tell if a XMPP account is configured. - * @return false if there is no account configured. - */ - public boolean isAccountConfigured() { - return mIsAccountConfigured; - } - - /** - * A listener for all the change in the preference file. It is used to maintain the global state of the application. - */ - private class PreferenceListener implements SharedPreferences.OnSharedPreferenceChangeListener { - - /** - * Constructor. - */ - public PreferenceListener() { - } - - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { - if (BeemApplication.ACCOUNT_USERNAME_KEY.equals(key) || BeemApplication.ACCOUNT_PASSWORD_KEY.equals(key)) { - String login = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, ""); - String password = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, ""); - mIsAccountConfigured = !("".equals(login) || "".equals(password)); - } - } - } } diff -r 7caab0161cf9 -r 3c5724d30887 src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Mon Jul 16 15:43:55 2012 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Sun Aug 12 11:38:12 2012 +0200 @@ -416,7 +416,7 @@ int contactStatus = 1; //TODO: set the jid instead of null then debug Drawable avatar = getAvatarStatusDrawable(null); - img.setImageDrawable(avatar); + img.setImageDrawable(mContext.getResources().getDrawable(R.drawable.beem_launcher_icon_silver)); img.setImageLevel(contactStatus); } @@ -442,7 +442,7 @@ } if (avatarDrawable == null) avatarDrawable = mContext.getResources().getDrawable(R.drawable.beem_launcher_icon_silver); - LayerDrawable ld = (LayerDrawable) mContext.getResources().getDrawable(R.drawable.avatar_status); + LayerDrawable ld = (LayerDrawable) mContext.getResources().getDrawable(R.drawable.beem_status_icon); ld.setLayerInset(1, 36, 36, 0, 0); ld.setDrawableByLayerId(R.id.avatar, avatarDrawable); return ld;