# HG changeset patch # User Da Risk # Date 1281465376 -7200 # Node ID e85bccf2d817c52494f17b4efaaa5db02d56ca39 # Parent b2572c048dd70859d345f0ac5bb8b8eabe77e88b# Parent 310796265f158d8fa42cf22056670f6ef5288ef3 Merge diff -r b2572c048dd7 -r e85bccf2d817 res/layout/chat.xml --- a/res/layout/chat.xml Tue Aug 10 01:46:51 2010 +0200 +++ b/res/layout/chat.xml Tue Aug 10 20:36:16 2010 +0200 @@ -35,8 +35,8 @@ android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:transcriptMode="normal" android:stackFromBottom="true" + android:fadingEdge="none" android:padding="4px" android:fastScrollEnabled="true" android:smoothScrollbar="false" - android:layout_marginBottom="20sp" android:padding="4px" android:focusable="true"/> + + + +Beem +Aceptar +Limpiar +Cancelar +Autorizar +Denegar +JabberID +Contraseña +Continuar + + +Configuración manual + + +JabberID + + +Conectando... + + +Usa el servicio Beem +Servicio Beem creado +Servicio Beem suprimido + + +Chat +Llamada +Gestión de usuario + + +Beem - Añadir contacto + +Usuario +Alias +Grupo +Añadir +Contacto añadido +Error añadiendo contacto +Error en el login +Formulario incorrecto +Contacto ya existe + + +Beem - Cambiar mi estado +Mi estado +Mi mensaje personal +Abrir lista de contactos + +Añadir contacto +Proyecto Beem +Crear cuenta +Editar cuenta +Actualizando estado +Nada que cambiar + + +Editar su usuario +Editar su contraseña +Proxy +Usar un servidor proxy +Iniciar a traves de un servidor proxy +Protocolo +Escoja el tipo de servidor proxy +Editar direccion del servidor proxy +Editar puerto del servidor proxy +Opcional, permitir auto-autentificarse en el server proxy. +Opcional, permitir auto-autentificarse en el server proxy. +Avanzado +Opciones especificas del server +Modificar retraso de conexion +Marca esta casilla si deseas usar un servidor especifico para esta conexion +Editar direccion del server +Editar puerto del server +Recurso +Prioridad +Establecer recursosXMPP +Establecer prioridades +Lista de Amigos +A set of display options for your buddy list + +Ocultar grupos +Opciones de ocultar grupos +Ocultar amigos +Check this option to hide unconnected buddies + +Nombre de usuario +beem@beem-project.com +Contraseña +Servidor +Puerto +Servicio de comportamiento +Opciones de usuarios abanzados +Dirección del servidor XMPP +Comentgarios del servidor XMPP +Puerto XMPP +Establecer SSL/TTL en XMPP +Tiempo de reconexión +Puerto por defecto: 5222 +Establecer uso de servidor Proxy +Conectar mediante servidor proxy +Seleccionar tipo de servidor proxy +Servidor proxy +Puerto proxy +Puerto proxy por defecto 1080 +Nombre de usuario proxy +Contraseña de usuario proxy +Habilitar auto-ausente +Cambiar estado a ausente cuando la pantalla se apage +Mensaje ausente +El mensaje de ausente que sera mostrado +Ausente, my pantalla esta apagada +Configuracion de notificaciones +Habilitar vibracion +Habilitar vibracion en mensajes entrantes +Tono de mensaje entrante +Configurar tono de mensaje entrante + + + +Suscripcion aceptada +Error de suscripcion +Suscripcion rechazada +%s desea agregarlo a su lista de contactos. Desea autorizarlo/a ? +Autorizar contacto ? + + +Tienes un nuevo mensaje + + +BEEM: Ha sido desconectado + + +%s le agrego en su lista de contactos. +Autoriza %s para que lo contacte. + + +Beem - Actividad inicio +Beem - Configuracion +Beem - Actividad editar configuracion +Beem - Crear una cuenta + +Beem - Contactos +Beem - Actividad lista contactos +Beem - Informacion usuario + + +Crear esta cuenta +Crear y usar esta cuenta + + +Usuario +Contraseña +Inicio sesion - Error +Cerrar +Crear una cuenta +Configuracion +Acerca +Beem %s - Acerca + +Beem is an EPITECH Innovative Project. Visit us at +http://www.beem-project.com ! + +Cerrar +Configuracion +Inicio +Conectando. Espere por favor ... +Unfortunately, an error occured.\n\nError +detail:\n%s +Iniciar sesion +No se detecto conexion a internet +Configuracion de parametros en menu + + +Conectando ... +Autentificando ... +Inicio correcto +Inicio fallido + + +Crear una cuenta +Administrar mis listas de privacidad +Los cambios han sido guardados correctamente. + + + + +Preferencias generales +Configuracion de usuario (requerido) +Configuracion avanzada de usuario (opcional) +Opciones de red +Configuracion Proxy +Configuracion Proxy + + +editar_configuracion_pestaña_cuenta +Cuenta +editar_configuracion_pestaña_xmpp +XMPP +editar_configuracion_pestaña_proxy +Proxy + + + +Bienvenido a BEEM.\n\nNo ha configurado su cuenta XMPP(Jabber) todavia.\nEscoja una de las siguientes opciones: +Por favor complete con su cuenta existente +Ya tengo una cuenta y deseo usarla +Deseo crear una nueva cuenta + + +Instrucciones - Crear una cuenta +Error - Creando una cuenta +Cambiar mi configuracion +Cerrar +cuenta %s fue creada correctamente +Incorrecto JabberID +La clave no coincide +Usuario +Contraseña +Confirmar Contraseña + + +Añadir a Contacto +Cambiar Estado +Configuracion +Desconectar +Todos Contactos +Sin Grupo + + +Alias +Manten. Grupos +Reenviar Invitacion +Bloquear +Borrar +Reenviar Suscripcion +Are you sure you want to delete this contact ? + + +No +Estas Seguro de Reenviar Invitacion? + +Beem - Chat +Escribe tu Mensaje +Yo +Error +Enviar +Lista de Contactos +Cambiar chat +Chats abiertos +Cerrar Chat +No más chats activos +componiendo un mensaje +ha dejado la conversación +presta atención a la conversación +esta haciendo otra cosa + +Disponible +Disponible para chatear +No interumpir +Fuera +No Disponibles +Desconectado + +Beem - Manten. mi lista privada +No existe ninguna lista privada registrada +Crear lista privada +Crear lista privada +Titulo +Crear +Contactos +Grupos +Borrar +Borrar la lista privada \'%s\' ? + +No + +Actualizar + + + +Error Autenticando, mal usuario y contraseña. + +Error Servidor remoto +mala pregunta +prohibido +elemento no encontrado +conflicto +caracteristica no implementada +ir +jid-malformado +no-aceptable +no permitido +no autorizado +pago requerido +recibidor no disponible +redireccionar +registro requerido +servidor remoto no encontrado +Sin respuesta del servidor +Error en servidor remoto +restriccion en recurso +servicio no disponible +suscripcion requerida +condicion indefinida +condicion inesperada +tiempo de espera de solicitud + diff -r b2572c048dd7 -r e85bccf2d817 src/com/beem/project/beem/ui/Chat.java --- a/src/com/beem/project/beem/ui/Chat.java Tue Aug 10 01:46:51 2010 +0200 +++ b/src/com/beem/project/beem/ui/Chat.java Tue Aug 10 20:36:16 2010 +0200 @@ -43,19 +43,18 @@ */ package com.beem.project.beem.ui; +import java.text.DateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Date; -import java.text.DateFormat; import org.jivesoftware.smack.util.StringUtils; import android.app.Activity; -import android.app.AlertDialog; +import android.app.Dialog; import android.content.ComponentName; -import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; @@ -74,9 +73,9 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; -import android.view.ViewGroup; import android.view.View.OnClickListener; import android.view.View.OnKeyListener; +import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.EditText; @@ -91,10 +90,11 @@ import com.beem.project.beem.service.aidl.IBeemRosterListener; import com.beem.project.beem.service.aidl.IChat; import com.beem.project.beem.service.aidl.IChatManager; +import com.beem.project.beem.service.aidl.IChatManagerListener; import com.beem.project.beem.service.aidl.IMessageListener; -import com.beem.project.beem.service.aidl.IChatManagerListener; import com.beem.project.beem.service.aidl.IRoster; import com.beem.project.beem.service.aidl.IXmppFacade; +import com.beem.project.beem.ui.dialogs.builders.ChatList; import com.beem.project.beem.utils.BeemBroadcastReceiver; import com.beem.project.beem.utils.Status; @@ -272,10 +272,8 @@ try { final List openedChats = mChatManager.getOpenedChatList(); Log.d(TAG, "opened chats = " + openedChats); - if (openedChats.size() > 0) - createChatSwitcherDialog(openedChats); - else - createNoActiveChatsDialog(); + Dialog chatList = new ChatList(Chat.this, openedChats).create(); + chatList.show(); } catch (RemoteException e) { Log.e(TAG, e.getMessage()); } @@ -295,41 +293,6 @@ } /** - * Create the change chat dialog. - * @param openedChats A list containing the JID of participants of the opened chats. - */ - private void createChatSwitcherDialog(final List openedChats) { - CharSequence[] items = new CharSequence[openedChats.size()]; - - int i = 0; - for (Contact c : openedChats) { - items[i++] = c.getName(); - } - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(getString(R.string.chat_dialog_change_chat_title)); - builder.setItems(items, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int item) { - Intent chatIntent = new Intent(getApplicationContext(), com.beem.project.beem.ui.Chat.class); - chatIntent.setData((openedChats.get(item)).toUri()); - startActivity(chatIntent); - } - }); - AlertDialog chatSwitcherDialog = builder.create(); - chatSwitcherDialog.show(); - } - - /** - * Create a dialog which notify the user that there're not another one active chat. - */ - private void createNoActiveChatsDialog() { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage(getString(R.string.chat_no_more_chats)); - AlertDialog noActiveChatsDialog = builder.create(); - noActiveChatsDialog.show(); - } - - /** * Change the displayed chat. * @param contact the targeted contact of the new chat * @throws RemoteException If a Binder remote-invocation error occurred. diff -r b2572c048dd7 -r e85bccf2d817 src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Tue Aug 10 01:46:51 2010 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Tue Aug 10 20:36:16 2010 +0200 @@ -43,13 +43,12 @@ package com.beem.project.beem.ui; import java.util.ArrayList; -import java.util.LinkedList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import org.jivesoftware.smack.util.StringUtils; @@ -76,6 +75,8 @@ import android.view.ViewGroup; import android.view.ViewStub; import android.widget.AdapterView; +import android.widget.AdapterView.AdapterContextMenuInfo; +import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; @@ -83,21 +84,21 @@ import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; -import android.widget.AdapterView.AdapterContextMenuInfo; -import android.widget.AdapterView.OnItemClickListener; import com.beem.project.beem.R; import com.beem.project.beem.service.Contact; import com.beem.project.beem.service.PresenceAdapter; import com.beem.project.beem.service.aidl.IBeemRosterListener; +import com.beem.project.beem.service.aidl.IChatManager; import com.beem.project.beem.service.aidl.IRoster; import com.beem.project.beem.service.aidl.IXmppFacade; import com.beem.project.beem.ui.dialogs.builders.Alias; +import com.beem.project.beem.ui.dialogs.builders.ChatList; import com.beem.project.beem.ui.dialogs.builders.DeleteContact; import com.beem.project.beem.ui.dialogs.builders.ResendSubscription; import com.beem.project.beem.utils.BeemBroadcastReceiver; +import com.beem.project.beem.utils.SortedList; import com.beem.project.beem.utils.Status; -import com.beem.project.beem.utils.SortedList; /** * The contact list activity displays the roster of the user. @@ -130,6 +131,7 @@ private IRoster mRoster; private Contact mSelectedContact; private IXmppFacade mXmppFacade; + private IChatManager mChatManager; private SharedPreferences mSettings; private LayoutInflater mInflater; private BeemBanner mAdapterBanner; @@ -166,10 +168,20 @@ case R.id.menu_change_status: startActivity(new Intent(ContactList.this, ChangeStatus.class)); return true; + case R.id.contact_list_menu_chatlist: + List openedChats; + try { + openedChats = mChatManager.getOpenedChatList(); + Log.d(TAG, "opened chats = " + openedChats); + Dialog chatList = new ChatList(ContactList.this, openedChats).create(); + chatList.show(); + } catch (RemoteException e) { + e.printStackTrace(); + } + return true; case R.id.menu_disconnect: stopService(SERVICE_INTENT); finish(); - return true; default: return false; } @@ -235,7 +247,7 @@ break; case R.id.contact_list_context_menu_userinfo_subscription: Dialog subscription = new ResendSubscription(ContactList.this, - mXmppFacade, mSelectedContact).create(); + mXmppFacade, mSelectedContact).create(); subscription.show(); result = true; break; @@ -456,7 +468,7 @@ if (!mListGroup.contains(group)) { mListGroup.add(mListGroup.size() - 1, group); List tmplist = new SortedList( - new LinkedList(), mComparator); + new LinkedList(), mComparator); mContactOnGroup.put(group, tmplist); } mContactOnGroup.get(group).remove(contact); @@ -539,11 +551,11 @@ String noGroup = getString(R.string.contact_list_no_group); String allGroup = getString(R.string.contact_list_all_contact); final boolean add = ((!hideDisconnected || Status.statusOnline(contact.getStatus())) && // must show and - ( - (listName.equals(noGroup) && groups.isEmpty()) || // in no group - groups.contains(listName) || // or in current - listName.equals(allGroup) // or in all - )); + ( + (listName.equals(noGroup) && groups.isEmpty()) || // in no group + groups.contains(listName) || // or in current + listName.equals(allGroup) // or in all + )); mHandler.post(new Runnable() { public void run() { mListContact.remove(contact); @@ -642,7 +654,7 @@ if (curContact != null) { TextView v = (TextView) view.findViewById(R.id.contactlistpseudo); LevelListDrawable mStatusDrawable = (LevelListDrawable) getResources() - .getDrawable(R.drawable.status_icon); + .getDrawable(R.drawable.status_icon); mStatusDrawable.setLevel(curContact.getStatus()); v.setCompoundDrawablesWithIntrinsicBounds(mStatusDrawable, null, null, null); v.setText(curContact.getName()); @@ -748,7 +760,6 @@ try { mRoster = mXmppFacade.getRoster(); if (mRoster != null) { - List tmpContactList = mRoster.getContactList(); List tmpGroupList = mRoster.getGroupsNames(); Collections.sort(tmpGroupList); mListGroup.clear(); @@ -764,7 +775,8 @@ String group = getString(R.string.contact_list_all_contact); buildContactList(group); mRoster.addRosterListener(mBeemRosterListener); - Log.d(TAG, "add rester listneer"); + Log.d(TAG, "add roster listener"); + mChatManager = mXmppFacade.getChatManager(); } } catch (RemoteException e) { e.printStackTrace(); @@ -779,6 +791,7 @@ e.printStackTrace(); } mXmppFacade = null; + mChatManager = null; mRoster = null; mListContact.clear(); mListGroup.clear(); diff -r b2572c048dd7 -r e85bccf2d817 src/com/beem/project/beem/ui/dialogs/builders/ChatList.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/com/beem/project/beem/ui/dialogs/builders/ChatList.java Tue Aug 10 20:36:16 2010 +0200 @@ -0,0 +1,90 @@ +/* + BEEM is a videoconference application on the Android Platform. + + Copyright (C) 2009 by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + This file is part of BEEM. + + BEEM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + BEEM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with BEEM. If not, see . + + Please send bug reports with examples or suggestions to + contact@beem-project.com or http://dev.beem-project.com/ + + Epitech, hereby disclaims all copyright interest in the program "Beem" + written by Frederic-Charles Barthelery, + Jean-Manuel Da Silva, + Nikita Kozlov, + Philippe Lago, + Jean Baptiste Vergely, + Vincent Veronis. + + Nicolas Sadirac, November 26, 2009 + President of Epitech. + + Flavien Astraud, November 26, 2009 + Head of the EIP Laboratory. + +*/ +package com.beem.project.beem.ui.dialogs.builders; + +import java.util.List; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; + +import com.beem.project.beem.R; +import com.beem.project.beem.service.Contact; + +/** + * Create the change chat dialog. + */ +public class ChatList extends AlertDialog.Builder { + + //private static final String TAG = "Dialogs.Builders > Chat list"; + + /** + * Constructor. + * @param context context activity. + * @param openedChats A list containing the JID of participants of the opened chats. + */ + public ChatList(final Context context, final List openedChats) { + super(context); + + if (openedChats.size() > 0) { + CharSequence[] items = new CharSequence[openedChats.size()]; + + int i = 0; + for (Contact c : openedChats) { + items[i++] = c.getName(); + } + setTitle(R.string.chat_dialog_change_chat_title); + setItems(items, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int item) { + Intent chatIntent = new Intent(context, com.beem.project.beem.ui.Chat.class); + chatIntent.setData((openedChats.get(item)).toUri()); + context.startActivity(chatIntent); + } + }); + } else { + setMessage(R.string.chat_no_more_chats); + } + } +}