summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-02 22:54:46 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-02 22:54:46 -0800
commit117b33c8a0bbf5d193efee437e14637d397133ec (patch)
tree1412bba05e02c845778a82f7f8ab8e5d4e0847ab
parent7b6b27ec766158b8d5fe8e6a29ee19e6bf3ac94a (diff)
downloadImProvider-117b33c8a0bbf5d193efee437e14637d397133ec.tar.gz
auto import from //depot/cupcake/@137055
-rw-r--r--res/color/landing_page_text.xml3
-rw-r--r--res/color/landing_page_text_secondary.xml22
-rw-r--r--res/layout/account_view.xml2
-rw-r--r--res/values-fr/strings.xml4
-rw-r--r--res/values-it/strings.xml2
-rw-r--r--res/values-nb/strings.xml47
-rw-r--r--src/com/android/providers/im/ImProvider.java47
-rw-r--r--src/com/android/providers/im/ProviderListItem.java17
8 files changed, 138 insertions, 6 deletions
diff --git a/res/color/landing_page_text.xml b/res/color/landing_page_text.xml
index 3737def..6e967d9 100644
--- a/res/color/landing_page_text.xml
+++ b/res/color/landing_page_text.xml
@@ -17,5 +17,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="#ff000000"/>
<item android:state_selected="true" android:color="#ff000000"/>
- <item android:color="#ff808080"/>
+ <item android:state_pressed="true" android:color="#ff000000"/>
+ <item android:color="#ffffffff"/>
</selector>
diff --git a/res/color/landing_page_text_secondary.xml b/res/color/landing_page_text_secondary.xml
new file mode 100644
index 0000000..78cc390
--- /dev/null
+++ b/res/color/landing_page_text_secondary.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:color="#ff000000"/>
+ <item android:state_selected="true" android:color="#ff000000"/>
+ <item android:state_pressed="true" android:color="#ff000000"/>
+ <item android:color="#ffbebebe"/>
+</selector>
diff --git a/res/layout/account_view.xml b/res/layout/account_view.xml
index 9ec8c77..46bdecf 100644
--- a/res/layout/account_view.xml
+++ b/res/layout/account_view.xml
@@ -62,7 +62,7 @@
android:layout_height="wrap_content" />
<TextView android:id="@+id/conversations"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/landing_page_text"
+ android:textColor="@color/landing_page_text_secondary"
android:maxLines="1"
android:layout_weight="1"
android:paddingRight="3dip"
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index c3f2712..3da7c82 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -15,11 +15,11 @@
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="ro_perm_label">"lire les messages instantanés"</string>
+ <string name="ro_perm_label">"Lecture des messages instantanés"</string>
<string name="ro_perm_desc">"Permet aux applications de lire les données du prestataire de contenu de messagerie instantanée."</string>
<string name="wo_perm_label">"écrire des messages instantanées"</string>
<string name="wo_perm_desc">"Permet aux applications d\'écrire les données pour le prestataire de contenu de messagerie instantanée."</string>
- <string name="im_label">"Messagerie instantanée"</string>
+ <string name="im_label">"Chat"</string>
<string name="landing_page_title">"Chat : sélectionner un compte"</string>
<string name="menu_add_account">"Ajouter un compte"</string>
<string name="menu_edit_account">"Modifier un compte"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 336af3a..70065fb 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -19,7 +19,7 @@
<string name="ro_perm_desc">"Consente alle applicazioni di leggere dati del provider di contenuti IM."</string>
<string name="wo_perm_label">"scrivere messaggi immediati"</string>
<string name="wo_perm_desc">"Consente alle applicazioni di scrivere dati per il provider di contenuti IM."</string>
- <string name="im_label">"IM"</string>
+ <string name="im_label">"Chat"</string>
<string name="landing_page_title">"Chat - Seleziona un account"</string>
<string name="menu_add_account">"Aggiungi account"</string>
<string name="menu_edit_account">"Modifica account"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
new file mode 100644
index 0000000..1f22b81
--- /dev/null
+++ b/res/values-nb/strings.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- no translation found for ro_perm_label (8923213594676670163) -->
+ <skip />
+ <!-- no translation found for ro_perm_desc (6154703403388711809) -->
+ <skip />
+ <!-- no translation found for wo_perm_label (4771652386754813294) -->
+ <skip />
+ <!-- no translation found for wo_perm_desc (470416777693330370) -->
+ <skip />
+ <string name="im_label">"Nettprat"</string>
+ <!-- no translation found for landing_page_title (2177721703095999384) -->
+ <skip />
+ <!-- no translation found for menu_add_account (4184762314855405486) -->
+ <skip />
+ <!-- no translation found for menu_edit_account (6585077522972888350) -->
+ <skip />
+ <!-- no translation found for menu_remove_account (8013513817623405880) -->
+ <skip />
+ <string name="sign_in">"Logg inn"</string>
+ <string name="menu_sign_out">"Logg ut"</string>
+ <string name="menu_settings">"Innstillinger"</string>
+ <!-- no translation found for menu_sign_out_all (945106187701517280) -->
+ <skip />
+ <!-- no translation found for choose_account_title (3179220583433723296) -->
+ <skip />
+ <!-- no translation found for conversations (6809253595345281731) -->
+ <skip />
+ <string name="add_account">"Legg til <xliff:g id="ACCOUNT">%1$s</xliff:g>-konto"</string>
+ <string name="menu_view_contact_list">"Kontaktliste"</string>
+ <string name="signing_in_wait">"Logger inn…"</string>
+</resources>
diff --git a/src/com/android/providers/im/ImProvider.java b/src/com/android/providers/im/ImProvider.java
index f77a2e2..9a23cc8 100644
--- a/src/com/android/providers/im/ImProvider.java
+++ b/src/com/android/providers/im/ImProvider.java
@@ -71,9 +71,10 @@ public class ImProvider extends ContentProvider {
private static final String TABLE_OUTGOING_RMQ_MESSAGES = "outgoingRmqMessages";
private static final String TABLE_LAST_RMQ_ID = "lastrmqid";
private static final String TABLE_ACCOUNT_STATUS = "accountStatus";
+ private static final String TABLE_BRANDING_RESOURCE_MAP_CACHE = "brandingResMapCache";
private static final String DATABASE_NAME = "im.db";
- private static final int DATABASE_VERSION = 46;
+ private static final int DATABASE_VERSION = 47;
protected static final int MATCH_PROVIDERS = 1;
protected static final int MATCH_PROVIDERS_BY_ID = 2;
@@ -132,6 +133,7 @@ public class ImProvider extends ContentProvider {
protected static final int MATCH_LAST_RMQ_ID = 113;
protected static final int MATCH_ACCOUNTS_STATUS = 114;
protected static final int MATCH_ACCOUNT_STATUS = 115;
+ protected static final int MATCH_BRANDING_RESOURCE_MAP_CACHE = 120;
protected final UriMatcher mUrlMatcher = new UriMatcher(UriMatcher.NO_MATCH);
@@ -256,6 +258,13 @@ public class ImProvider extends ContentProvider {
"rmq_id INTEGER" +
");");
+ db.execSQL("create TABLE " + TABLE_BRANDING_RESOURCE_MAP_CACHE + " (" +
+ "_id INTEGER PRIMARY KEY," +
+ "provider_id INTEGER," +
+ "app_res_id INTEGER," +
+ "plugin_res_id INTEGER" +
+ ");");
+
// clean up account specific data when an account is deleted.
db.execSQL("CREATE TRIGGER account_cleanup " +
"DELETE ON " + TABLE_ACCOUNTS +
@@ -321,6 +330,28 @@ public class ImProvider extends ContentProvider {
db.endTransaction();
}
+ case 46:
+ if (newVersion <= 46) {
+ return;
+ }
+
+ db.beginTransaction();
+ try {
+ // add branding resource map cache table
+ db.execSQL("create TABLE " + TABLE_BRANDING_RESOURCE_MAP_CACHE + " (" +
+ "_id INTEGER PRIMARY KEY," +
+ "provider_id INTEGER," +
+ "app_res_id INTEGER," +
+ "plugin_res_id INTEGER" +
+ ");");
+ db.setTransactionSuccessful();
+ } catch (Throwable ex) {
+ Log.e(LOG_TAG, ex.getMessage(), ex);
+ break; // force to destroy all old data;
+ } finally {
+ db.endTransaction();
+ }
+
return;
}
@@ -339,6 +370,7 @@ public class ImProvider extends ContentProvider {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_PROVIDER_SETTINGS);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_OUTGOING_RMQ_MESSAGES);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LAST_RMQ_ID);
+ db.execSQL("DROP TABLE IF EXISTS " + TABLE_BRANDING_RESOURCE_MAP_CACHE);
}
private void createContactsTables(SQLiteDatabase db) {
@@ -739,6 +771,8 @@ public class ImProvider extends ContentProvider {
mUrlMatcher.addURI(authority, "accountStatus", MATCH_ACCOUNTS_STATUS);
mUrlMatcher.addURI(authority, "accountStatus/#", MATCH_ACCOUNT_STATUS);
+
+ mUrlMatcher.addURI(authority, "brandingResMapCache", MATCH_BRANDING_RESOURCE_MAP_CACHE);
}
@Override
@@ -1086,6 +1120,10 @@ public class ImProvider extends ContentProvider {
url.getPathSegments().get(1));
break;
+ case MATCH_BRANDING_RESOURCE_MAP_CACHE:
+ qb.setTables(TABLE_BRANDING_RESOURCE_MAP_CACHE);
+ break;
+
default:
throw new IllegalArgumentException("Unknown URL " + url);
}
@@ -1926,6 +1964,13 @@ public class ImProvider extends ContentProvider {
notifyProviderAccountContentUri = true;
break;
+ case MATCH_BRANDING_RESOURCE_MAP_CACHE:
+ rowID = db.insert(TABLE_BRANDING_RESOURCE_MAP_CACHE, null, initialValues);
+ if (rowID > 0) {
+ resultUri = Uri.parse(Im.BrandingResourceMapCache.CONTENT_URI + "/" + rowID);
+ }
+ break;
+
default:
throw new UnsupportedOperationException("Cannot insert into URL: " + url);
}
diff --git a/src/com/android/providers/im/ProviderListItem.java b/src/com/android/providers/im/ProviderListItem.java
index 69c0d0d..f2f0da8 100644
--- a/src/com/android/providers/im/ProviderListItem.java
+++ b/src/com/android/providers/im/ProviderListItem.java
@@ -26,6 +26,7 @@ import android.content.res.Resources;
import android.database.Cursor;
import android.im.BrandingResourceIDs;
import android.provider.Im;
+import android.content.res.ColorStateList;
import android.view.View;
import android.util.Log;
import com.android.providers.im.R;
@@ -49,6 +50,10 @@ public class ProviderListItem extends LinearLayout {
private int mActiveAccountUserNameColumn;
private int mAccountPresenceStatusColumn;
private int mAccountConnectionStatusColumn;
+
+ private ColorStateList mProviderNameColors;
+ private ColorStateList mLoginNameColors;
+ private ColorStateList mChatViewColors;
public ProviderListItem(Context context, LandingPage activity) {
super(context);
@@ -75,6 +80,10 @@ public class ProviderListItem extends LinearLayout {
Im.Provider.ACCOUNT_PRESENCE_STATUS);
mAccountConnectionStatusColumn = c.getColumnIndexOrThrow(
Im.Provider.ACCOUNT_CONNECTION_STATUS);
+
+ mProviderNameColors = mProviderName.getTextColors();
+ mLoginNameColors = mLoginName.getTextColors();
+ mChatViewColors = mChatView.getTextColors();
}
public void bindView(Cursor cursor) {
@@ -95,6 +104,10 @@ public class ProviderListItem extends LinearLayout {
mUnderBubble.setBackgroundDrawable(mDefaultBackground);
statusIcon.setVisibility(View.GONE);
+ providerName.setTextColor(mProviderNameColors);
+ loginName.setTextColor(mLoginNameColors);
+ chatView.setTextColor(mChatViewColors);
+
if (!cursor.isNull(mActiveAccountIdColumn)) {
mLoginName.setVisibility(View.VISIBLE);
providerName.setVisibility(View.VISIBLE);
@@ -124,6 +137,10 @@ public class ProviderListItem extends LinearLayout {
mUnderBubble.setBackgroundDrawable(mBubbleDrawable);
chatView.setVisibility(View.VISIBLE);
chatView.setText(r.getString(R.string.conversations, count));
+
+ providerName.setTextColor(0xff000000);
+ loginName.setTextColor(0xff000000);
+ chatView.setTextColor(0xff000000);
}
secondRowText = cursor.getString(mActiveAccountUserNameColumn);