Minor ui tweaks to make task edit adapter third page look nicer when no plugins, add on activity have a 'no items' text

pull/14/head
Tim Su 14 years ago
parent 397f24320f
commit ca8a74d755

@ -110,6 +110,9 @@ public class Notifications extends BroadcastReceiver {
return false;
}
// schedule next notification
ReminderService.getInstance().scheduleAlarm(task);
// you're done - don't sound, do delete
if(task.isCompleted() || task.isDeleted())
return false;

@ -7,18 +7,44 @@
<!-- =================================================== tab: installed == -->
<ListView android:id="@+id/installed"
android:paddingRight="8dip"
android:orientation="vertical"
<FrameLayout android:id="@+id/tab_installed"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
android:layout_height="fill_parent">
<TextView android:id="@+id/empty_installed"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="@string/TEA_no_addons"
style="@style/TextAppearance.TLA_NoItems" />
<ListView android:id="@+id/installed"
android:paddingRight="8dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
<!-- =================================================== tab: available == -->
<ListView android:id="@+id/available"
android:paddingRight="8dip"
android:orientation="vertical"
<FrameLayout android:id="@+id/tab_available"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
android:layout_height="fill_parent">
<TextView android:id="@+id/empty_available"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="@string/TEA_no_addons"
style="@style/TextAppearance.TLA_NoItems" />
<ListView android:id="@+id/available"
android:paddingRight="8dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
</FrameLayout>

@ -12,7 +12,7 @@
<!-- icon -->
<ImageView android:id="@+id/icon"
android:layout_width="34dip"
android:layout_width="48dip"
android:layout_height="fill_parent"
android:gravity="center"
android:paddingLeft="5dip"
@ -41,7 +41,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_toRightOf="@id/icon"
android:singleLine="true"
android:singleLine="false"
style="@style/TextAppearance.TAd_ItemDetails"/>
</LinearLayout>
@ -49,18 +49,21 @@
<!-- buttons -->
<ImageButton android:id="@+id/button_web"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_width="48dip"
android:layout_height="48dip"
android:scaleType="fitCenter"
android:layout_gravity="center" />
<ImageButton android:id="@+id/button_market"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_width="48dip"
android:layout_height="48dip"
android:scaleType="fitCenter"
android:layout_gravity="center" />
<ImageView android:id="@+id/check"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_width="48dip"
android:layout_height="48dip"
android:scaleType="fitCenter"
android:layout_gravity="center"
android:src="@android:drawable/checkbox_on_background"/>

@ -94,21 +94,15 @@
android:autoText="true"
android:capitalize="sentences"
android:singleLine="false" />
<!-- separator -->
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:padding="5dip"
android:background="@android:drawable/divider_horizontal_dark" />
<!-- buttons -->
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:paddingTop="5dip"
android:layout_marginTop="10dip"
android:padding="5dip"
android:background="@drawable/edit_header"
android:baselineAligned="false">
<ImageButton
android:id="@+id/save_basic"
@ -203,20 +197,15 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:padding="5dip"
android:background="@android:drawable/divider_horizontal_dark" />
<!-- buttons -->
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:paddingTop="5dip"
android:layout_marginTop="10dip"
android:padding="5dip"
android:background="@drawable/edit_header"
android:baselineAligned="false">
<ImageButton
android:id="@+id/save_extra"
@ -259,25 +248,28 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100"
android:gravity="center"
android:visibility="gone"
android:orientation="vertical">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:padding="20dip"
android:src="@drawable/icon_pp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/TEA_no_addons"
android:padding="10dip"
android:gravity="center"
style="@style/TextAppearance.TLA_NoItems" />
<Button android:id="@+id/addons_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:text="@string/TEA_addons_button" />
</LinearLayout>
@ -286,9 +278,10 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="10dip"
android:padding="5dip"
android:orientation="horizontal"
android:background="@drawable/edit_header"
android:padding="5dip"
android:baselineAligned="false">
<ImageButton
@ -303,6 +296,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/tango_stop" />
</LinearLayout>
</LinearLayout>

@ -54,6 +54,7 @@
<ListView android:id="@android:id/list"
android:scrollbars="vertical"
android:cacheColorHint="#00000000"
android:paddingRight="8dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>

@ -7,9 +7,9 @@ import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
@ -48,11 +48,11 @@ public class AddOnActivity extends TabActivity {
tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.AOA_tab_installed)).
setIndicator(r.getString(R.string.AOA_tab_installed),
r.getDrawable(R.drawable.tab_addons)).setContent(
R.id.installed));
R.id.tab_installed));
tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.AOA_tab_available)).
setIndicator(r.getString(R.string.AOA_tab_available),
r.getDrawable(R.drawable.tab_add)).setContent(
R.id.available));
R.id.tab_available));
setTitle(R.string.AOA_title);
@ -76,17 +76,15 @@ public class AddOnActivity extends TabActivity {
if(installed.size() == 0 || getIntent().getBooleanExtra(TOKEN_START_WITH_AVAILABLE, false))
getTabHost().setCurrentTab(1);
TextView noAddons = new TextView(this);
noAddons.setText(R.string.TEA_no_addons);
noAddons.setTextAppearance(this, R.style.TextAppearance_TLA_NoItems);
ListView installedList = (ListView) findViewById(R.id.installed);
installedList.setEmptyView(noAddons);
installedList.setAdapter(new AddOnAdapter(this, true, installed));
if(installed.size() > 0)
findViewById(R.id.empty_installed).setVisibility(View.GONE);
ListView availableList = (ListView) findViewById(R.id.available);
availableList.setEmptyView(noAddons);
availableList.setAdapter(new AddOnAdapter(this, false, available));
if(available.size() > 0)
findViewById(R.id.empty_available).setVisibility(View.GONE);
}

@ -221,6 +221,7 @@ public final class TaskEditActivity extends TabActivity {
// show add-on help if necessary
if(addonsAddons.getChildCount() == 0) {
((View)addonsAddons.getParent()).setVisibility(View.GONE);
findViewById(R.id.addons_empty).setVisibility(View.VISIBLE);
((Button)findViewById(R.id.addons_button)).setOnClickListener(new View.OnClickListener() {
@Override

@ -125,10 +125,10 @@ public class AddOnAdapter extends ArrayAdapter<AddOn> {
"com.android.vending.SearchAssetListActivity"); //$NON-NLS-1$
Drawable icon = getIntentIcon(marketIntent);
if(icon == null)
viewHolder.web.setImageResource(
viewHolder.market.setImageResource(
android.R.drawable.stat_sys_download);
else
viewHolder.web.setImageDrawable(icon);
viewHolder.market.setImageDrawable(icon);
}
}

@ -178,7 +178,7 @@ public class AddOnService {
((BitmapDrawable)r.getDrawable(R.drawable.icon_pp)).getBitmap());
list[1] = new AddOn(false, true, "Astrid Locale Plugin", null,
"Allows Astrid to make use of the Locale application to send you notifications based on filter conditions",
"Allows Astrid to make use of the Locale application to send you notifications based on filter conditions. Requires Locale",
LOCALE_PACKAGE, "http://www.weloveastrid.com/store",
((BitmapDrawable)r.getDrawable(R.drawable.icon_pp)).getBitmap());

Loading…
Cancel
Save