pixel-almost-perfect: mailbox list

Bug 3137965

Change-Id: Ic5aa3327ddbd456024e1938b74c7da0452b682f5
This commit is contained in:
Makoto Onuki 2010-11-24 13:35:56 -08:00
parent 2e1c3eaaf1
commit 9d6d5b3091
5 changed files with 86 additions and 8 deletions

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Wrap list_content in a frame layout to apply the top margin. -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="16dip"
>
<include layout="@android:layout/list_content" />
</FrameLayout>

View File

@ -15,12 +15,14 @@
-->
<!-- extends RelativeLayout -->
<!-- STOPSHIP text color pixelperfect. -->
<com.android.email.activity.MailboxListItem
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingRight="8dip"
android:layout_height="48dip"
android:background="?android:attr/activatedBackgroundIndicator"
android:paddingLeft="@dimen/mailbox_list_padding_left"
android:paddingRight="@dimen/mailbox_list_padding_right"
>
<ImageView
android:id="@+id/folder_icon"
@ -28,19 +30,18 @@
android:layout_height="32dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="2dip"
android:layout_marginRight="8dip"
/>
<TextView
android:id="@+id/message_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="12dip"
android:layout_centerVertical="true"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"
android:textSize="14dip"
android:textColor="#888"
/>
<TextView
android:id="@+id/mailbox_name"
@ -51,10 +52,11 @@
android:layout_centerVertical="true"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorPrimary"
android:textSize="18dip"
android:textColor="#000"
/>
<!-- Color chips are shown only for account rows on combined view. -->
<!-- STOPSHIP dimensions not pixelperfect. -->
<View
android:id="@+id/color_chip"
android:layout_width="32dip"

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- landscape -->
<resources>
<dimen name="mailbox_list_padding_left">8dip</dimen>
<dimen name="mailbox_list_padding_right">32dip</dimen>
</resources>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- portrait -->
<resources>
<dimen name="mailbox_list_padding_left">16dip</dimen>
<dimen name="mailbox_list_padding_right">32dip</dimen>
</resources>

View File

@ -18,6 +18,7 @@ package com.android.email.activity;
import com.android.email.Controller;
import com.android.email.Email;
import com.android.email.R;
import com.android.email.RefreshManager;
import com.android.email.Utility;
import com.android.email.provider.EmailProvider;
@ -35,8 +36,10 @@ import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.DragEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnDragListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
@ -160,6 +163,12 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList
}
}
@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.mailbox_list_fragment, container, false);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
if (Email.DEBUG_LIFECYCLE && Email.DEBUG) {