mirror of https://github.com/tasks/tasks
Remove unused layouts
parent
887432b599
commit
d67763c980
@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@android:drawable/list_selector_background"
|
||||
android:paddingTop="4dip"
|
||||
android:paddingBottom="4dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:paddingRight="4dip">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="5dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- icon -->
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="48dip"
|
||||
android:layout_height="48dip"
|
||||
android:gravity="center"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<!-- free -->
|
||||
<TextView
|
||||
android:id="@+id/free"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="10sp"
|
||||
android:textColor="#00ff00"
|
||||
android:text="@string/AOA_free"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="100"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="3dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- add-on name -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toRightOf="@id/icon"
|
||||
android:singleLine="true"
|
||||
style="@style/TextAppearance.TAd_ItemTitle"/>
|
||||
|
||||
<!-- description -->
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_toRightOf="@id/icon"
|
||||
android:singleLine="false"
|
||||
android:textSize="11sp"
|
||||
style="@style/TextAppearance.TAd_ItemDetails"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- buttons -->
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_market"
|
||||
android:layout_width="48dip"
|
||||
android:layout_height="48dip"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/check"
|
||||
android:layout_width="48dip"
|
||||
android:layout_height="48dip"
|
||||
android:scaleType="center"
|
||||
android:layout_gravity="center"
|
||||
android:src="@android:drawable/checkbox_on_background"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tab_installed"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
style="@style/Content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/empty"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/AOA_no_addons"
|
||||
style="@style/TextAppearance.TLA_NoItems"/>
|
||||
|
||||
<com.todoroo.astrid.ui.ErrorCatchingListView
|
||||
android:id="@+id/list"
|
||||
android:paddingRight="8dip"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@android:color/transparent"
|
||||
android:cacheColorHint="#00000000"/>
|
||||
|
||||
</FrameLayout>
|
||||
@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:astrid="http://schemas.android.com/apk/res/com.timsu.astrid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="8dip"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.todoroo.astrid.helper.AsyncImageView
|
||||
android:id="@+id/person_image"
|
||||
android:layout_width="44dip"
|
||||
android:layout_height="44dip"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="fitCenter"
|
||||
astrid:defaultSrc="@drawable/icn_default_person_image"/>
|
||||
|
||||
<CheckedTextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextAppearance.TEA_assigned"
|
||||
android:textColor="?attr/asTextColor"
|
||||
android:gravity="center_vertical"
|
||||
android:checkMark="?android:attr/listChoiceIndicatorSingle"
|
||||
android:paddingLeft="6dip"
|
||||
android:paddingRight="6dip"
|
||||
android:layout_toRightOf="@id/person_image"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#aaa"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/premium_description_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="5dip"
|
||||
android:paddingTop="10dip">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/premium_description_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dip"
|
||||
android:gravity="left"
|
||||
android:text="@string/premium_description_header"
|
||||
android:textColor="#404040"
|
||||
android:paddingLeft="20dip"
|
||||
android:textSize="20dip"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<WebView
|
||||
android:id="@+id/premium_bullets"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:textSize="20dip"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<include layout="@layout/astrid_speech_bubble"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<Button
|
||||
android:id="@+id/premium_buy_month"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="50dip"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_marginRight="8dip"
|
||||
android:layout_marginBottom="8dip"
|
||||
android:layout_marginTop="8dip"
|
||||
android:layout_weight="1"
|
||||
android:background="#707070"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:textSize="24sp"
|
||||
android:text="@string/premium_buy_month"
|
||||
android:gravity="center"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/premium_buy_year"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="50dip"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_marginRight="8dip"
|
||||
android:layout_marginBottom="8dip"
|
||||
android:layout_marginTop="8dip"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/asThemeTextColor"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/premium_buy_year"
|
||||
android:gravity="center"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/check_for_purchases"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dip"
|
||||
android:textColor="#404040"
|
||||
android:gravity="center"
|
||||
android:text="@string/premium_check_for_purchases"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2008 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.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:astrid="http://schemas.android.com/apk/res/com.timsu.astrid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.todoroo.astrid.helper.AsyncImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="31dip"
|
||||
android:layout_height="35dip"
|
||||
android:layout_margin="5dip"
|
||||
astrid:defaultSrc="@drawable/icn_default_person_image"
|
||||
android:gravity="center"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<com.todoroo.astrid.ui.ContactsAutoComplete
|
||||
android:id="@+id/text1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_weight="1"
|
||||
android:background="#00000000"
|
||||
android:hint="@string/actfm_person_hint"
|
||||
style="@style/TextAppearance"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button1"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="32dip"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="4dip"
|
||||
android:background="@drawable/btn_dismiss"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
style="@style/TEA_Separator"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dip"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dip"
|
||||
android:layout_marginBottom="5dip">
|
||||
|
||||
<com.todoroo.astrid.ui.ContactsAutoComplete
|
||||
android:id="@+id/assigned_custom"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dip"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:paddingLeft="5dip"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/asEditTextBackground"
|
||||
android:textColor="?attr/asTextColor"
|
||||
android:inputType="textEmailAddress"
|
||||
android:hint="@string/actfm_person_hint"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/assigned_clear"
|
||||
android:background="@drawable/btn_dismiss"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="32dip"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="2dip"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/edit_dlg_ok"
|
||||
android:background="@drawable/btn_add"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="32dip"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="2dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:gravity="center_vertical"/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.todoroo.astrid.ui.ErrorCatchingListView
|
||||
android:id="@+id/assigned_list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="3dip"
|
||||
android:layout_marginRight="3dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:layout_weight="100"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/no_members"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_vertical"
|
||||
style="@style/TextAppearance"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#333333"
|
||||
android:text="@string/actfm_TVA_no_members_alert"/>
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/browser"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="100">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/user_header"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dip"
|
||||
android:background="?attr/asMembersHeaderBackground">
|
||||
|
||||
<com.todoroo.astrid.helper.AsyncImageView
|
||||
android:id="@+id/user_image"
|
||||
android:layout_height="50dip"
|
||||
android:layout_width="50dip"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginRight="8dip"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_subtitle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/user_image"
|
||||
android:layout_toRightOf="@id/user_image"
|
||||
android:textColor="@android:color/black"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- List body goes here -->
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/update_message"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginBottom="30sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/update_link"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginBottom="10sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:astrid="http://schemas.android.com/apk/res/com.timsu.astrid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="100dip"
|
||||
android:background="@android:drawable/list_selector_background">
|
||||
|
||||
<!-- imageview -->
|
||||
<com.todoroo.astrid.helper.AsyncImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="70dip"
|
||||
android:layout_height="100dip"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:scaleType="fitCenter"
|
||||
astrid:defaultSrc="@drawable/ic_contact_picture_2"/>
|
||||
|
||||
<!-- title -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/image"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginTop="5dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:paddingRight="30dp"
|
||||
android:lines="2"
|
||||
android:singleLine="false"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center_vertical"
|
||||
android:text="7-feet Xx-large Rust Cozy Sac Foof Bean Bag Chair"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<!-- subtitle -->
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_toRightOf="@id/image"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:paddingRight="30dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
android:text="The Cozy Sac"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<!-- price -->
|
||||
<TextView
|
||||
android:id="@+id/price"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/subtitle"
|
||||
android:layout_toRightOf="@id/image"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:paddingRight="30dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#990000"
|
||||
android:text="$259.00"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<!-- new and used -->
|
||||
<TextView
|
||||
android:id="@+id/new_and_used"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/price"
|
||||
android:layout_toRightOf="@id/image"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:paddingRight="30dp"
|
||||
android:ellipsize="start"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
android:text="2 New & Used from $224"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<!-- arrow -->
|
||||
|
||||
<ImageView
|
||||
android:layout_width="10dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="5dip"
|
||||
android:src="@drawable/icn_arrow_right"
|
||||
android:scaleType="centerInside"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:astrid="http://schemas.android.com/apk/res/com.timsu.astrid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="100dip"
|
||||
android:background="@android:drawable/list_selector_background">
|
||||
|
||||
<!-- imageview -->
|
||||
<com.todoroo.astrid.helper.AsyncImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="100dip"
|
||||
android:layout_height="100dip"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:scaleType="fitCenter"
|
||||
astrid:defaultSrc="@drawable/ic_contact_picture_2"/>
|
||||
|
||||
<!-- title -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_toRightOf="@id/image"
|
||||
android:paddingRight="30dp"
|
||||
android:lines="3"
|
||||
android:singleLine="false"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Probiotic - Wikepedia, the free encyclopedia"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<!-- url -->
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_toRightOf="@id/image"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:paddingRight="30dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="14sp"
|
||||
android:text="en.wikipedia.org"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<!-- arrow -->
|
||||
|
||||
<ImageView
|
||||
android:layout_width="10dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="5dip"
|
||||
android:src="@drawable/icn_arrow_right"
|
||||
android:scaleType="centerInside"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -1,17 +0,0 @@
|
||||
<!-- No Tasks label -->
|
||||
<!--
|
||||
** Copyright (c) 2012 Todoroo Inc
|
||||
**
|
||||
** See the file "LICENSE" for the full license governing this code.
|
||||
-->
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/webServicesLoad"
|
||||
style="@style/TextAppearance.TLA_NoItems"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="true"
|
||||
android:drawableTop="@drawable/icon"
|
||||
android:gravity="center"
|
||||
android:text="@string/WSV_click_to_load"/>
|
||||
@ -1,156 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.astrid.data.AddOn;
|
||||
import com.todoroo.astrid.utility.Constants;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Adapter for {@link AddOn}s
|
||||
*
|
||||
* @author Tim Su <tim@todoroo.com>
|
||||
*/
|
||||
public class AddOnAdapter extends ArrayAdapter<AddOn> {
|
||||
|
||||
// --- instance variables
|
||||
|
||||
private final Activity activity;
|
||||
private final LayoutInflater inflater;
|
||||
private final boolean installed;
|
||||
|
||||
public AddOnAdapter(Activity activity, boolean installed, List<AddOn> objects) {
|
||||
super(activity, R.id.title, objects);
|
||||
this.installed = installed;
|
||||
this.activity = activity;
|
||||
inflater = (LayoutInflater) activity.getSystemService(
|
||||
Context.LAYOUT_INFLATER_SERVICE);
|
||||
}
|
||||
|
||||
// --- view construction
|
||||
|
||||
View.OnClickListener intentClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ButtonTag buttonTag = (ButtonTag) v.getTag();
|
||||
if (buttonTag != null) {
|
||||
try {
|
||||
activity.startActivity(buttonTag.intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(activity, R.string.market_unavailable, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.addon_adapter_row, parent, false);
|
||||
ViewHolder viewHolder = new ViewHolder();
|
||||
viewHolder.icon = (ImageView) convertView.findViewById(R.id.icon);
|
||||
viewHolder.free = (TextView) convertView.findViewById(R.id.free);
|
||||
viewHolder.title = (TextView) convertView.findViewById(R.id.title);
|
||||
viewHolder.description = (TextView) convertView.findViewById(R.id.description);
|
||||
viewHolder.market = (ImageButton) convertView.findViewById(R.id.button_market);
|
||||
viewHolder.installedIcon = (ImageView) convertView.findViewById(R.id.check);
|
||||
convertView.setTag(viewHolder);
|
||||
|
||||
viewHolder.market.setOnClickListener(intentClickListener);
|
||||
|
||||
}
|
||||
((ViewHolder) convertView.getTag()).item = getItem(position);
|
||||
initializeView(convertView);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
private class ViewHolder {
|
||||
public AddOn item;
|
||||
public ImageView icon;
|
||||
public TextView free;
|
||||
public TextView title;
|
||||
public TextView description;
|
||||
public ImageButton market;
|
||||
public ImageView installedIcon;
|
||||
}
|
||||
|
||||
private class ButtonTag {
|
||||
String event;
|
||||
Intent intent;
|
||||
|
||||
public ButtonTag(String message, Intent intent) {
|
||||
this.event = message;
|
||||
this.intent = intent;
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeView(View convertView) {
|
||||
ViewHolder viewHolder = (ViewHolder) convertView.getTag();
|
||||
AddOn item = viewHolder.item;
|
||||
|
||||
viewHolder.icon.setImageBitmap(item.getIcon());
|
||||
viewHolder.title.setText(item.getTitle());
|
||||
viewHolder.description.setText(item.getDescription());
|
||||
viewHolder.free.setVisibility(item.isFree() && !installed ? View.VISIBLE : View.GONE);
|
||||
|
||||
// populate buttons
|
||||
|
||||
if (installed) {
|
||||
viewHolder.market.setVisibility(View.GONE);
|
||||
viewHolder.installedIcon.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
viewHolder.market.setVisibility(View.VISIBLE);
|
||||
viewHolder.installedIcon.setVisibility(View.GONE);
|
||||
Intent marketIntent = Constants.MARKET_STRATEGY.generateMarketLink(item.getPackageName());
|
||||
if (marketIntent == null) {
|
||||
convertView.setVisibility(View.GONE);
|
||||
} else {
|
||||
convertView.setVisibility(View.VISIBLE);
|
||||
viewHolder.market.setTag(new ButtonTag("market-" + item.getPackageName(), //$NON-NLS-1$
|
||||
marketIntent));
|
||||
Drawable icon = getIntentIcon(marketIntent);
|
||||
if (icon == null) {
|
||||
viewHolder.market.setImageResource(
|
||||
android.R.drawable.stat_sys_download);
|
||||
} else {
|
||||
viewHolder.market.setImageDrawable(icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable getIntentIcon(Intent intent) {
|
||||
PackageManager pm = activity.getPackageManager();
|
||||
List<ResolveInfo> resolveInfoList = pm.queryIntentActivities(intent, 0);
|
||||
|
||||
// if options > 1, display open with...
|
||||
if (resolveInfoList.size() > 0) {
|
||||
return resolveInfoList.get(0).activityInfo.loadIcon(pm);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue