Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2b1f7c7 authored by blong's avatar blong Committed by Xiaojing Zhang
Browse files

Add contact memory status function

- Add one menu to display the used and total contacts count
  for each account.

Change-Id: Ic116c6a9e1959f00ed12295086edf878fb2086ba
parent d2c6998e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -213,6 +213,11 @@
            android:label="@string/activity_title_contacts_filter"
            android:theme="@style/ContactListFilterTheme" />

        <activity
            android:name=".activities.MemoryStatusActivity"
            android:label="@string/memory_status_title"
            android:theme="@style/ContactListFilterTheme" />

        <!-- Used to select display and sync groups -->
        <activity
            android:name=".common.list.CustomContactListFilterActivity"
+72 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
    * Neither the name of The Linux Foundation, Inc. nor the names of its
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:fillViewport="true">

    <ListView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:divider="@null"
        android:layout_marginLeft="@dimen/contact_filter_left_margin"
        android:layout_marginRight="@dimen/contact_filter_right_margin"
        android:layout_marginStart="@dimen/contact_filter_left_margin"
        android:layout_marginEnd="@dimen/contact_filter_right_margin" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dip"
        android:layout_marginLeft="16dip"
        android:layout_marginRight="16dip"
        android:layout_marginStart="16dip"
        android:layout_marginEnd="16dip"
        android:background="?android:attr/dividerHorizontal" />

    <ScrollView android:id="@+id/empty"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fadingEdge="none"
        android:fillViewport="true"
        android:visibility="gone">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/calculating_status_now"
            android:textSize="20sp"
            android:textColor="?android:attr/textColorSecondary"
            android:gravity="center"/>
    </ScrollView>
</LinearLayout>
+129 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
    * Neither the name of The Linux Foundation, Inc. nor the names of its
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dip"
    android:layout_marginTop="10dip"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/list_section_divider_holo_custom"
        android:orientation="horizontal"
        android:paddingLeft="10dip"
        android:paddingRight="10dip" >

        <TextView
            android:id="@+id/account_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:ellipsize="middle"
            android:singleLine="true"
            android:textSize="12sp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_centerVertical="true"
            android:layout_marginLeft="10dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:singleLine="true"
                android:layout_gravity="center_vertical"
                android:text="@string/memory_used"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <TextView
                android:id="@+id/count_cur"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:paddingLeft="5dip"
                android:layout_gravity="center_vertical"
                android:singleLine="true"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="?android:attr/textColorSecondary" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/totally"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:orientation="vertical"
            android:visibility="gone" >
            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="?android:attr/dividerHorizontal"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="10dp"
                android:orientation="horizontal" >
                <TextView
                    android:id="@+id/totalLabel"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:layout_gravity="center_vertical"
                    android:text="@string/memory_size"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:id="@+id/count_max"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:paddingLeft="5dip"
                    android:layout_gravity="center_vertical"
                    android:singleLine="true"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="?android:attr/textColorSecondary" />
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

</LinearLayout>
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@
        android:id="@+id/menu_delete"
        android:title="@string/menu_deleteContact" />

    <item
        android:id="@+id/menu_memory_status"
        android:title="@string/menu_memory_status" />

    <item
        android:id="@+id/menu_help"
        android:title="@string/menu_help" />
+7 −0
Original line number Diff line number Diff line
@@ -255,6 +255,13 @@
    <string name="import_finish">"导入完成"</string>
    <string name="import_stop">"导入停止"</string>
    <string name="too_many_contacts_add_to_group">联系人过多,应该少于<xliff:g id="count">%d</xliff:g></string>
    <!-- add for MemoryStatusActivity -->
    <string name="menu_memory_status">"存储器状态"</string>
    <string name="memory_status_title">"存储器状态"</string>
    <string name="memory_size">"容量:"</string>
    <string name="memory_available">"可用"</string>
    <string name="memory_used">"已用:"</string>
    <string name="calculating_status_now">正在计算存储状态…</string>
    <string name="menu_export_database" msgid="2659719297530170820">"导出数据库文件"</string>
    <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"添加新联系人"</string>
    <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"查看更多"</string>
Loading