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
No related branches found
No related tags found
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 @@
<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"
<RelativeLayout
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" />
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: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"
......
......@@ -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,7 +13,7 @@
android:layout_alignParentTop="true"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceLargeInverse" />
<TextView
android:id="@+id/account_host"
......@@ -20,16 +21,20 @@
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
......@@ -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"
......
......@@ -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();
......@@ -69,7 +70,9 @@ public class AccountSelectionAdapter extends BaseAdapter {
entryView.host.setText(accounts.get(pos).getHost() + " - " + accounts.get(pos).getRegistered_state());
// 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) {
......
......@@ -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);
......
......@@ -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 };
......@@ -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());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment