# HG changeset patch # User Vincent Veronis # Date 1253793984 -7200 # Node ID 295cc30ae84a38af02925a69153e0fe6a0b0d6b4 # Parent da35534975cd14c79fe3ac67110c8d7b21f41ea5# Parent f2c9564a3cc7429fde769bcc9dd1edf6546cb12b Merge. diff -r f2c9564a3cc7 -r 295cc30ae84a res/layout/contactlist.xml --- a/res/layout/contactlist.xml Thu Sep 17 17:50:26 2009 +0200 +++ b/res/layout/contactlist.xml Thu Sep 24 14:06:24 2009 +0200 @@ -3,21 +3,9 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> - - - - - + diff -r f2c9564a3cc7 -r 295cc30ae84a src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl --- a/src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl Thu Sep 17 17:50:26 2009 +0200 +++ b/src/com/beem/project/beem/service/aidl/IBeemRosterListener.aidl Thu Sep 24 14:06:24 2009 +0200 @@ -7,4 +7,5 @@ void onEntriesUpdated(in List addresses); void onEntriesDeleted(in List addresses); void onPresenceChanged(in PresenceAdapter presence); + void onEntryDeleteFromGroup(in String group, in String jid); } \ No newline at end of file diff -r f2c9564a3cc7 -r 295cc30ae84a src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Thu Sep 17 17:50:26 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Thu Sep 24 14:06:24 2009 +0200 @@ -26,6 +26,7 @@ import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.Button; +import android.widget.Gallery; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -65,6 +66,15 @@ } + @Override + protected void onCreate(Bundle saveBundle) { + super.onCreate(saveBundle); + setContentView(R.layout.contactlist); + mAdapter = new BeemContactList(this); + mHandler = new Handler(); + + } + /** * Callback for menu creation. * @param menu the menu created @@ -109,21 +119,6 @@ } } - @Override - protected void onCreate(Bundle saveBundle) { - super.onCreate(saveBundle); - setContentView(R.layout.contactlist); - mAdapter = new BeemContactList(this); - Button b = (Button) findViewById(R.id.contactlist_group); - b.setOnClickListener(new OnClickGroupName()); - b = (Button) findViewById(R.id.contactlist_left); - b.setOnClickListener(new OnClickLeft()); - b = (Button) findViewById(R.id.contactlist_right); - b.setOnClickListener(new OnClickRight()); - mHandler = new Handler(); - - } - /** * Event on middle groupe name. */ @@ -155,13 +150,9 @@ @Override public void onClick(View arg0) { mPosCurGroup--; - if (mPosCurGroup < -1) + if (mPosCurGroup < 0) mPosCurGroup = mListGroup.size() - 1; - Button b = (Button) findViewById(R.id.contactlist_group); - if (mPosCurGroup == -1) - b.setText(R.string.contact_list_all_contact); - else - b.setText(mListGroup.get(mPosCurGroup)); + buildBanner(); try { buildContactList(mRoster.getContactList(), mRoster.getGroupsNames()); } catch (RemoteException e) { @@ -192,11 +183,7 @@ mPosCurGroup++; if (mPosCurGroup == mListGroup.size()) mPosCurGroup = -1; - Button b = (Button) findViewById(R.id.contactlist_group); - if (mPosCurGroup == -1) - b.setText(R.string.contact_list_all_contact); - else - b.setText(mListGroup.get(mPosCurGroup)); + buildBanner(); try { buildContactList(mRoster.getContactList(), mRoster.getGroupsNames()); } catch (RemoteException e) { @@ -207,6 +194,24 @@ } /** + * Build Banner button. + */ + protected void buildBanner() { + /* + * Button bmid = (Button) findViewById(R.id.contactlist_group); Button bleft = (Button) + * findViewById(R.id.contactlist_left); Button bright = (Button) findViewById(R.id.contactlist_right); if + * (mPosCurGroup == -1) { bleft.setText(mListGroup.get(mListGroup.size() - 1)); + * bmid.setText(R.string.contact_list_all_contact); bright.setText(mListGroup.get(mPosCurGroup + 1)); } else if + * (mPosCurGroup == 0) { bleft.setText(R.string.contact_list_all_contact); + * bmid.setText(mListGroup.get(mPosCurGroup)); bright.setText(mListGroup.get(mPosCurGroup + 1)); } else if + * (mPosCurGroup == mListGroup.size() -1 ) { bleft.setText(mListGroup.get(mPosCurGroup - 1)); + * bmid.setText(mListGroup.get(mPosCurGroup)); bmid.setText(R.string.contact_list_all_contact); } else { + * bleft.setText(mListGroup.get(mPosCurGroup - 1)); bmid.setText(mListGroup.get(mPosCurGroup)); + * bright.setText(mListGroup.get(mPosCurGroup + 1)); } + */ + } + + /** * {@inheritDoc} */ @Override @@ -290,13 +295,14 @@ } } } - sortBeemContactList(); - ListView listView = (ListView) findViewById(R.id.contactlist); listView.setOnItemClickListener(new BeemContactListOnClick()); listView.setOnItemLongClickListener(new BeemContactListOnLongClick()); listView.setAdapter(mAdapter); + Gallery g = (Gallery) findViewById(R.id.gallery); + g.setAdapter(new ImageAdapter(this)); + } /** @@ -472,6 +478,7 @@ public BeemContactList(final Context context) { mInflater = LayoutInflater.from(context); } + /** * {@inheritDoc} */ @@ -479,6 +486,7 @@ public int getCount() { return mListContact.size(); } + /** * {@inheritDoc} */ @@ -486,6 +494,7 @@ public Object getItem(int position) { return position; } + /** * {@inheritDoc} */ @@ -493,6 +502,7 @@ public long getItemId(int position) { return position; } + /** * {@inheritDoc} */ @@ -569,6 +579,56 @@ } /** + * Adapter banner list. + */ + public class ImageAdapter extends BaseAdapter { + private Context mContext; + + /** + * Constructor. + * @param c context activity. + */ + public ImageAdapter(final Context c) { + mContext = c; + } + + /** + * {@inheritDoc} + */ + @Override + public int getCount() { + return mListGroup.size(); + } + + /** + * {@inheritDoc} + */ + @Override + public Object getItem(int position) { + return position; + } + + /** + * {@inheritDoc} + */ + @Override + public long getItemId(int position) { + return position; + } + + /** + * {@inheritDoc} + */ + @Override + public View getView(int position, View convertView, ViewGroup parent) { + TextView i = new TextView(mContext); + i.setText(mListGroup.get(position)); + return i; + } + + } + + /** * The service connection used to connect to the Beem service. */ private class BeemServiceConnection implements ServiceConnection {