Clickable folder icons in account lists to get to folder lists, even if

there's an auto-open folder
This commit is contained in:
Jesse Vincent 2010-05-12 02:52:10 +00:00
parent ba021597c4
commit 093d65513a
2 changed files with 45 additions and 3 deletions

View File

@ -7,6 +7,7 @@
android:orientation="horizontal"
android:paddingRight="6dip"
android:paddingBottom="2dip"
android:descendantFocusability="blocksDescendants"
android:gravity="center_vertical" >
<View
@ -16,13 +17,31 @@
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingLeft="1dip" >
<ImageButton
android:id="@+id/folders"
android:layout_alignParentTop="true"
android:layout_gravity="top"
android:focusable="false"
android:background="@drawable/ic_show_folders"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center_vertical"
android:paddingLeft="6dip" >
android:paddingLeft="1dip" >
<TextView
android:id="@+id/description"
@ -43,7 +62,7 @@
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/active_icons"
android:layout_width="wrap_content"
@ -55,7 +74,7 @@
android:paddingRight="6dip"
android:layout_alignParentRight="true"
android:clickable="true" >
<TextView
android:id="@+id/flagged_message_count"
android:layout_width="wrap_content"
@ -73,6 +92,7 @@
android:textColor="#000000"
android:background="@drawable/btn_star_big_buttonless_on"
android:clickable="true" />
<TextView
android:id="@+id/new_message_count"
android:layout_width="wrap_content"

View File

@ -795,6 +795,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
holder.activeIcons = (RelativeLayout) view.findViewById(R.id.active_icons);
holder.chip = view.findViewById(R.id.chip);
holder.folders = (ImageButton) view.findViewById(R.id.folders);
view.setTag(holder);
}
@ -879,9 +880,29 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
holder.chip.setBackgroundColor(0x00000000);
}
holder.description.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getAccountName());
holder.email.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getAccountDescription());
if (account instanceof SearchAccount)
{
holder.folders.setVisibility(View.GONE);
}
else
{
holder.folders.setVisibility(View.VISIBLE);
holder.folders.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
FolderList.actionHandleAccount(Accounts.this, (Account)account);
}
});
}
return view;
}
@ -893,6 +914,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
public TextView flaggedMessageCount;
public RelativeLayout activeIcons;
public View chip;
public ImageButton folders;
}
}
private Flag[] combine(Flag[] set1, Flag[] set2)