Skip to content
Snippets Groups Projects
Commit dd6623b4 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

ui: adjustement on left menu

parent 5f1502e3
Branches
Tags
No related merge requests found
Showing
with 50 additions and 42 deletions
res/drawable-hdpi/ic_action_expand.png

539 B

res/drawable-hdpi/ic_action_expand_light.png

442 B

res/drawable-mdpi/ic_action_expand.png

409 B

res/drawable-mdpi/ic_action_expand_light.png

337 B

res/drawable-xhdpi/ic_action_expand.png

692 B

res/drawable-xhdpi/ic_action_expand_light.png

529 B

res/drawable-xxhdpi/ic_action_expand.png

974 B

res/drawable-xxhdpi/ic_action_expand_light.png

726 B

...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="100dp"
android:background="@color/sfl_blue_0" android:background="@color/sfl_blue_0"
android:padding="5dp" > android:padding="5dp" >
...@@ -23,30 +23,38 @@ ...@@ -23,30 +23,38 @@
android:id="@+id/user_name" android:id="@+id/user_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_alignParentRight="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_toRightOf="@+id/user_photo" android:layout_toRightOf="@+id/user_photo"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout>
<TextView <RelativeLayout
android:id="@+id/list_header_title"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="2dip" android:layout_alignLeft="@+id/user_name"
android:paddingLeft="5dip" android:layout_alignRight="@+id/user_name"
android:paddingTop="2dip" android:layout_alignParentBottom="true"
android:text="@string/frag_menu_accounts_title" android:layout_below="@+id/user_name" >
android:textColor="@color/black" />
<Spinner <Spinner
android:id="@+id/account_selection" android:id="@+id/account_selection"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> 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 <ListView
android:id="@+id/listView" android:id="@+id/listView"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/sfl_blue_0"
android:padding="4dp" > android:padding="4dp" >
<TextView <TextView
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:textAppearance="?android:attr/textAppearanceLarge" /> android:textAppearance="?android:attr/textAppearanceLargeInverse" />
<TextView <TextView
android:id="@+id/account_host" android:id="@+id/account_host"
...@@ -20,16 +21,20 @@ ...@@ -20,16 +21,20 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_below="@+id/account_alias" android:layout_below="@+id/account_alias"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmallInverse" />
<RadioButton <ImageView
android:id="@+id/account_checked" android:id="@+id/account_selected"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:background="@null"
android:clickable="false" android:clickable="false"
android:focusable="false" /> android:focusable="false"
android:src="@drawable/ic_action_accept" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/menu_title_categorie" android:id="@+id/menu_title_categorie"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingBottom="10dip" android:paddingBottom="10dip"
android:paddingLeft="15dip" android:paddingLeft="15dip"
......
...@@ -12,6 +12,7 @@ import android.view.LayoutInflater; ...@@ -12,6 +12,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.TextView; import android.widget.TextView;
...@@ -59,7 +60,7 @@ public class AccountSelectionAdapter extends BaseAdapter { ...@@ -59,7 +60,7 @@ public class AccountSelectionAdapter extends BaseAdapter {
entryView = new AccountView(); entryView = new AccountView();
entryView.alias = (TextView) rowView.findViewById(R.id.account_alias); entryView.alias = (TextView) rowView.findViewById(R.id.account_alias);
entryView.host = (TextView) rowView.findViewById(R.id.account_host); 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); rowView.setTag(entryView);
} else { } else {
entryView = (AccountView) rowView.getTag(); entryView = (AccountView) rowView.getTag();
...@@ -69,7 +70,9 @@ public class AccountSelectionAdapter extends BaseAdapter { ...@@ -69,7 +70,9 @@ public class AccountSelectionAdapter extends BaseAdapter {
entryView.host.setText(accounts.get(pos).getHost() + " - " + accounts.get(pos).getRegistered_state()); 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) { if (pos == selectedAccount) {
entryView.select.setChecked(true); entryView.select.setVisibility(View.VISIBLE);
} else {
entryView.select.setVisibility(View.GONE);
} }
return rowView; return rowView;
...@@ -81,7 +84,7 @@ public class AccountSelectionAdapter extends BaseAdapter { ...@@ -81,7 +84,7 @@ public class AccountSelectionAdapter extends BaseAdapter {
public class AccountView { public class AccountView {
public TextView alias; public TextView alias;
public TextView host; public TextView host;
public RadioButton select; public ImageView select;
} }
public void setSelectedAccount(int pos) { public void setSelectedAccount(int pos) {
......
...@@ -21,11 +21,6 @@ public class MenuAdapter extends BaseAdapter { ...@@ -21,11 +21,6 @@ public class MenuAdapter extends BaseAdapter {
headers = new ArrayAdapter<String>(context, R.layout.item_menu_header); 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) { public Object getItem(int position) {
for (Object section : this.sections.keySet()) { for (Object section : this.sections.keySet()) {
Adapter adapter = sections.get(section); Adapter adapter = sections.get(section);
......
...@@ -57,8 +57,10 @@ import android.content.Loader; ...@@ -57,8 +57,10 @@ import android.content.Loader;
import android.os.Bundle; import android.os.Bundle;
import android.os.RemoteException; import android.os.RemoteException;
import android.provider.ContactsContract.Profile; import android.provider.ContactsContract.Profile;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
...@@ -66,14 +68,12 @@ import android.widget.AdapterView.OnItemSelectedListener; ...@@ -66,14 +68,12 @@ import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, AccountsInterface { public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, AccountsInterface {
private static final String TAG = MenuFragment.class.getSimpleName(); private static final String TAG = MenuFragment.class.getSimpleName();
public static final String ARG_SECTION_NUMBER = "section_number";
MenuAdapter mAdapter; MenuAdapter mAdapter;
String[] mProjection = new String[] { Profile._ID, Profile.DISPLAY_NAME_PRIMARY, Profile.LOOKUP_KEY, Profile.PHOTO_URI }; String[] mProjection = new String[] { Profile._ID, Profile.DISPLAY_NAME_PRIMARY, Profile.LOOKUP_KEY, Profile.PHOTO_URI };
...@@ -179,9 +179,6 @@ public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, A ...@@ -179,9 +179,6 @@ public class MenuFragment extends Fragment implements LoaderCallbacks<Bundle>, A
@Override @Override
public void onItemSelected(AdapterView<?> arg0, View view, int pos, long arg3) { 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); mAccountAdapter.setSelectedAccount(pos);
try { try {
mCallbacks.getService().setAccountOrder(mAccountAdapter.getAccountOrder()); mCallbacks.getService().setAccountOrder(mAccountAdapter.getAccountOrder());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment