diff --git a/res/drawable-hdpi/ic_action_expand.png b/res/drawable-hdpi/ic_action_expand.png new file mode 100644 index 0000000000000000000000000000000000000000..eacb248484f1ae6ea9cdca9e15cf0519463b5a33 Binary files /dev/null and b/res/drawable-hdpi/ic_action_expand.png differ diff --git a/res/drawable-hdpi/ic_action_expand_light.png b/res/drawable-hdpi/ic_action_expand_light.png new file mode 100644 index 0000000000000000000000000000000000000000..fd2e7ff6d51c2c95d878c77186bcbb3a8bf20aa7 Binary files /dev/null and b/res/drawable-hdpi/ic_action_expand_light.png differ diff --git a/res/drawable-mdpi/ic_action_expand.png b/res/drawable-mdpi/ic_action_expand.png new file mode 100644 index 0000000000000000000000000000000000000000..e8e646b6e69bc05d21159431fc8c5578fec63873 Binary files /dev/null and b/res/drawable-mdpi/ic_action_expand.png differ diff --git a/res/drawable-mdpi/ic_action_expand_light.png b/res/drawable-mdpi/ic_action_expand_light.png new file mode 100644 index 0000000000000000000000000000000000000000..236f4fe1e58da7d688f308203d27cb0cac99f643 Binary files /dev/null and b/res/drawable-mdpi/ic_action_expand_light.png differ diff --git a/res/drawable-xhdpi/ic_action_expand.png b/res/drawable-xhdpi/ic_action_expand.png new file mode 100644 index 0000000000000000000000000000000000000000..4772487c42b9e68a340673fa66ed0490219fe969 Binary files /dev/null and b/res/drawable-xhdpi/ic_action_expand.png differ diff --git a/res/drawable-xhdpi/ic_action_expand_light.png b/res/drawable-xhdpi/ic_action_expand_light.png new file mode 100644 index 0000000000000000000000000000000000000000..0452d8bd435298ae594346cb7d82905d58df5e48 Binary files /dev/null and b/res/drawable-xhdpi/ic_action_expand_light.png differ diff --git a/res/drawable-xxhdpi/ic_action_expand.png b/res/drawable-xxhdpi/ic_action_expand.png new file mode 100644 index 0000000000000000000000000000000000000000..22003198b45cb61d51ccb07748599367d02d9c17 Binary files /dev/null and b/res/drawable-xxhdpi/ic_action_expand.png differ diff --git a/res/drawable-xxhdpi/ic_action_expand_light.png b/res/drawable-xxhdpi/ic_action_expand_light.png new file mode 100644 index 0000000000000000000000000000000000000000..51070821baa3d0b8dd89e7d313606243be201dfb Binary files /dev/null and b/res/drawable-xxhdpi/ic_action_expand_light.png differ diff --git a/res/layout/frag_menu.xml b/res/layout/frag_menu.xml index ec4b03c8a1cfff814b1f24789910b3a12d2eb186..f70f99d28b18110b73c09326ad3a4aa647fb9816 100644 --- a/res/layout/frag_menu.xml +++ b/res/layout/frag_menu.xml @@ -8,7 +8,7 @@ <RelativeLayout android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="100dp" android:background="@color/sfl_blue_0" android:padding="5dp" > @@ -23,30 +23,38 @@ android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_centerVertical="true" + android:layout_alignParentRight="true" android:layout_marginLeft="15dp" android:layout_toRightOf="@+id/user_photo" android:singleLine="true" android:textColor="@color/white" android:textSize="20sp" android:textStyle="bold" /> - </RelativeLayout> - <TextView - android:id="@+id/list_header_title" - style="?android:attr/listSeparatorTextViewStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingBottom="2dip" - android:paddingLeft="5dip" - android:paddingTop="2dip" - android:text="@string/frag_menu_accounts_title" - android:textColor="@color/black" /> - - <Spinner - android:id="@+id/account_selection" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignLeft="@+id/user_name" + android:layout_alignRight="@+id/user_name" + android:layout_alignParentBottom="true" + android:layout_below="@+id/user_name" > + + <Spinner + android:id="@+id/account_selection" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/sfl_blue_0" /> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_centerVertical="true" + android:clickable="false" + android:focusable="false" + android:src="@drawable/ic_action_expand_light" /> + </RelativeLayout> + </RelativeLayout> <ListView android:id="@+id/listView" diff --git a/res/layout/item_account.xml b/res/layout/item_account.xml index 7554fb3a9e94a095211b97169e28393e9136efb8..3f085216b8d1dc0e6f58ce822d44c2a53997df7c 100644 --- a/res/layout/item_account.xml +++ b/res/layout/item_account.xml @@ -2,6 +2,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="@color/sfl_blue_0" android:padding="4dp" > <TextView @@ -12,24 +13,28 @@ android:layout_alignParentTop="true" android:layout_marginBottom="4dp" android:layout_marginLeft="4dp" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <TextView + android:textAppearance="?android:attr/textAppearanceLargeInverse" /> + + <TextView android:id="@+id/account_host" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/account_alias" + android:layout_marginBottom="4dp" android:layout_marginLeft="4dp" - android:textAppearance="?android:attr/textAppearanceSmall" /> + android:textAppearance="?android:attr/textAppearanceSmallInverse" /> + - <RadioButton - android:id="@+id/account_checked" + <ImageView + android:id="@+id/account_selected" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" + android:background="@null" android:clickable="false" - android:focusable="false" /> + android:focusable="false" + android:src="@drawable/ic_action_accept" /> </RelativeLayout> \ No newline at end of file diff --git a/res/layout/item_menu.xml b/res/layout/item_menu.xml index ef00c7a4ad9a2cd752cd065cb6af1031023b41b0..02e21a76b0aca0adfcb60e57a5cf72847efd0984 100644 --- a/res/layout/item_menu.xml +++ b/res/layout/item_menu.xml @@ -2,7 +2,7 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/menu_title_categorie" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="?android:attr/listPreferredItemHeight" android:gravity="center_vertical" android:paddingBottom="10dip" android:paddingLeft="15dip" diff --git a/src/org/sflphone/adapters/AccountSelectionAdapter.java b/src/org/sflphone/adapters/AccountSelectionAdapter.java index 9f90d945fb206844874d806e640416508a85ac26..a927319bca532b7b8a3d37db62a4f0523bbfc289 100644 --- a/src/org/sflphone/adapters/AccountSelectionAdapter.java +++ b/src/org/sflphone/adapters/AccountSelectionAdapter.java @@ -12,6 +12,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; +import android.widget.ImageView; import android.widget.RadioButton; import android.widget.TextView; @@ -59,7 +60,7 @@ public class AccountSelectionAdapter extends BaseAdapter { entryView = new AccountView(); entryView.alias = (TextView) rowView.findViewById(R.id.account_alias); entryView.host = (TextView) rowView.findViewById(R.id.account_host); - entryView.select = (RadioButton) rowView.findViewById(R.id.account_checked); + entryView.select = (ImageView) rowView.findViewById(R.id.account_selected); rowView.setTag(entryView); } else { entryView = (AccountView) rowView.getTag(); @@ -67,9 +68,11 @@ public class AccountSelectionAdapter extends BaseAdapter { entryView.alias.setText(accounts.get(pos).getAlias()); entryView.host.setText(accounts.get(pos).getHost() + " - " + accounts.get(pos).getRegistered_state()); - // accManager.displayAccountDetails(accounts.get(pos), entryView); +// accManager.displayAccountDetails(accounts.get(pos), entryView); if (pos == selectedAccount) { - entryView.select.setChecked(true); + entryView.select.setVisibility(View.VISIBLE); + } else { + entryView.select.setVisibility(View.GONE); } return rowView; @@ -81,7 +84,7 @@ public class AccountSelectionAdapter extends BaseAdapter { public class AccountView { public TextView alias; public TextView host; - public RadioButton select; + public ImageView select; } public void setSelectedAccount(int pos) { diff --git a/src/org/sflphone/adapters/MenuAdapter.java b/src/org/sflphone/adapters/MenuAdapter.java index 2823b0176f3f2c64d01eb40194c28f07a98f6f19..700d9e0fb028eeb0bb42eba9d872d53b1c8bc9fa 100644 --- a/src/org/sflphone/adapters/MenuAdapter.java +++ b/src/org/sflphone/adapters/MenuAdapter.java @@ -21,11 +21,6 @@ public class MenuAdapter extends BaseAdapter { headers = new ArrayAdapter<String>(context, R.layout.item_menu_header); } - public void addSection(String section, Adapter adapter) { - this.headers.add(section); - this.sections.put(section, adapter); - } - public Object getItem(int position) { for (Object section : this.sections.keySet()) { Adapter adapter = sections.get(section); diff --git a/src/org/sflphone/fragments/MenuFragment.java b/src/org/sflphone/fragments/MenuFragment.java index 9bf2cffc38467e73e1f93da5b81049ca6f8cfd98..d069d9e09f1b2f9f858777c4f2e86f2ec4da15e6 100644 --- a/src/org/sflphone/fragments/MenuFragment.java +++ b/src/org/sflphone/fragments/MenuFragment.java @@ -57,8 +57,10 @@ import android.content.Loader; import android.os.Bundle; import android.os.RemoteException; import android.provider.ContactsContract.Profile; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; +import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; @@ -66,14 +68,12 @@ import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; -import android.widget.RadioButton; import android.widget.Spinner; import android.widget.TextView; public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, AccountsInterface { private static final String TAG = MenuFragment.class.getSimpleName(); - public static final String ARG_SECTION_NUMBER = "section_number"; MenuAdapter mAdapter; String[] mProjection = new String[] { Profile._ID, Profile.DISPLAY_NAME_PRIMARY, Profile.LOOKUP_KEY, Profile.PHOTO_URI }; @@ -108,8 +108,8 @@ public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, A mCallbacks.getService().registerAllAccounts(); } catch (RemoteException e) { e.printStackTrace(); - } catch (Exception e1){ - + } catch (Exception e1) { + } getLoaderManager().initLoader(LoaderConstants.ACCOUNTS_LOADER, null, this); @@ -179,9 +179,6 @@ public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, A @Override public void onItemSelected(AdapterView<?> arg0, View view, int pos, long arg3) { - if (null != view) { - ((RadioButton) view.findViewById(R.id.account_checked)).toggle(); - } mAccountAdapter.setSelectedAccount(pos); try { mCallbacks.getService().setAccountOrder(mAccountAdapter.getAccountOrder());