1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Improve some layouts.

This commit is contained in:
Danny Baumann 2013-02-12 10:04:52 +01:00
parent 20d229c91b
commit 099da1913b
3 changed files with 50 additions and 73 deletions

View File

@ -3,68 +3,61 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/active_icons" android:id="@+id/active_icons"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:gravity="center_vertical"
android:paddingTop="2dip"
android:paddingBottom="0dip"
android:paddingLeft="6dip" android:paddingLeft="6dip"
android:paddingRight="6dip" android:paddingRight="6dip"
android:layout_alignParentRight="true" android:clickable="true">
android:clickable="true" >
<LinearLayout <LinearLayout
android:id="@+id/flagged_message_count_wrapper" android:id="@+id/flagged_message_count_wrapper"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingTop="6dip" android:clickable="true"
android:paddingBottom="4dip"
android:paddingLeft="10dip" android:paddingLeft="10dip"
android:paddingRight="10dip" android:paddingRight="10dip">
>
<View <View
android:id="@+id/flagged_message_count_icon" android:id="@+id/flagged_message_count_icon"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp" />
/>
<TextView <TextView
android:id="@+id/flagged_message_count" android:id="@+id/flagged_message_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:singleLine="true"
android:singleLine="true" android:ellipsize="end"
android:ellipsize="end" android:textAppearance="?android:attr/textAppearanceLarge" />
android:textAppearance="?android:attr/textAppearanceLarge"
/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/new_message_count_wrapper" android:id="@+id/new_message_count_wrapper"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@id/flagged_message_count_wrapper" android:layout_toRightOf="@id/flagged_message_count_wrapper"
android:clickable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingTop="6dip" android:clickable="true"
android:paddingBottom="4dip"
android:paddingLeft="10dip" android:paddingLeft="10dip"
android:paddingRight="10dip" android:paddingRight="10dip">
>
<View <View
android:id="@+id/new_message_count_icon" android:id="@+id/new_message_count_icon"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"/>
/>
<TextView <TextView
android:id="@+id/new_message_count" android:id="@+id/new_message_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"/>
/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

View File

@ -2,44 +2,29 @@
<LinearLayout <LinearLayout
android:id="@+id/accounts_item_layout" android:id="@+id/accounts_item_layout"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight" android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingRight="6dip"
android:paddingBottom="2dip"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:gravity="center_vertical" android:gravity="center_vertical">
android:background="#ccc" >
<View <View
android:id="@+id/chip" android:id="@+id/chip"
android:layout_width="32dip" android:layout_width="32dip"
android:layout_height="32dip" android:layout_height="32dip"
android:layout_marginLeft="8dip" android:layout_marginLeft="8dip"
android:layout_marginRight="6dip" android:layout_marginRight="6dip" />
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:background="@android:color/transparent" />
<ImageButton
<LinearLayout android:id="@+id/folders"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="6dip" > android:focusable="false"
android:layout_marginRight="3dip"
android:background="?attr/iconFolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/folders"
android:gravity="center_vertical"
android:focusable="false"
android:layout_marginRight="3dip"
android:background="?attr/iconFolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -50,7 +35,7 @@
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
@ -59,7 +44,7 @@
<TextView <TextView
android:id="@+id/email" android:id="@+id/email"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
@ -67,6 +52,7 @@
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout> </LinearLayout>
</LinearLayout>
<include layout="@layout/accounts_folders_icons" /> <include layout="@layout/accounts_folders_icons" />
</LinearLayout> </LinearLayout>

View File

@ -1713,8 +1713,6 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
holder.flaggedMessageCountWrapper.setOnClickListener(createFlaggedSearch(account)); holder.flaggedMessageCountWrapper.setOnClickListener(createFlaggedSearch(account));
holder.newMessageCountWrapper.setOnClickListener(createUnreadSearch(account)); holder.newMessageCountWrapper.setOnClickListener(createUnreadSearch(account));
view.getBackground().setAlpha(stats.available ? 0 : 127);
holder.activeIcons.setOnClickListener(new OnClickListener() { holder.activeIcons.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
Toast toast = Toast.makeText(getApplication(), getString(R.string.tap_hint), Toast.LENGTH_SHORT); Toast toast = Toast.makeText(getApplication(), getString(R.string.tap_hint), Toast.LENGTH_SHORT);