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; return false;
} }
// schedule next notification
ReminderService.getInstance().scheduleAlarm(task);
// you're done - don't sound, do delete // you're done - don't sound, do delete
if(task.isCompleted() || task.isDeleted()) if(task.isCompleted() || task.isDeleted())
return false; return false;

@ -7,14 +7,38 @@
<!-- =================================================== tab: installed == --> <!-- =================================================== tab: installed == -->
<FrameLayout android:id="@+id/tab_installed"
android:layout_width="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" <ListView android:id="@+id/installed"
android:paddingRight="8dip" android:paddingRight="8dip"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" /> android:layout_height="fill_parent" />
</FrameLayout>
<!-- =================================================== tab: available == --> <!-- =================================================== tab: available == -->
<FrameLayout android:id="@+id/tab_available"
android:layout_width="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" <ListView android:id="@+id/available"
android:paddingRight="8dip" android:paddingRight="8dip"
android:orientation="vertical" android:orientation="vertical"
@ -22,3 +46,5 @@
android:layout_height="fill_parent" /> android:layout_height="fill_parent" />
</FrameLayout> </FrameLayout>
</FrameLayout>

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

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

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

@ -7,9 +7,9 @@ import android.app.TabActivity;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TabHost; import android.widget.TabHost;
import android.widget.TextView;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired; 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)). tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.AOA_tab_installed)).
setIndicator(r.getString(R.string.AOA_tab_installed), setIndicator(r.getString(R.string.AOA_tab_installed),
r.getDrawable(R.drawable.tab_addons)).setContent( 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)). tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.AOA_tab_available)).
setIndicator(r.getString(R.string.AOA_tab_available), setIndicator(r.getString(R.string.AOA_tab_available),
r.getDrawable(R.drawable.tab_add)).setContent( r.getDrawable(R.drawable.tab_add)).setContent(
R.id.available)); R.id.tab_available));
setTitle(R.string.AOA_title); 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)) if(installed.size() == 0 || getIntent().getBooleanExtra(TOKEN_START_WITH_AVAILABLE, false))
getTabHost().setCurrentTab(1); 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); ListView installedList = (ListView) findViewById(R.id.installed);
installedList.setEmptyView(noAddons);
installedList.setAdapter(new AddOnAdapter(this, true, installed)); 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); ListView availableList = (ListView) findViewById(R.id.available);
availableList.setEmptyView(noAddons);
availableList.setAdapter(new AddOnAdapter(this, false, available)); 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 // show add-on help if necessary
if(addonsAddons.getChildCount() == 0) { if(addonsAddons.getChildCount() == 0) {
((View)addonsAddons.getParent()).setVisibility(View.GONE);
findViewById(R.id.addons_empty).setVisibility(View.VISIBLE); findViewById(R.id.addons_empty).setVisibility(View.VISIBLE);
((Button)findViewById(R.id.addons_button)).setOnClickListener(new View.OnClickListener() { ((Button)findViewById(R.id.addons_button)).setOnClickListener(new View.OnClickListener() {
@Override @Override

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

@ -178,7 +178,7 @@ public class AddOnService {
((BitmapDrawable)r.getDrawable(R.drawable.icon_pp)).getBitmap()); ((BitmapDrawable)r.getDrawable(R.drawable.icon_pp)).getBitmap());
list[1] = new AddOn(false, true, "Astrid Locale Plugin", null, 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", LOCALE_PACKAGE, "http://www.weloveastrid.com/store",
((BitmapDrawable)r.getDrawable(R.drawable.icon_pp)).getBitmap()); ((BitmapDrawable)r.getDrawable(R.drawable.icon_pp)).getBitmap());

Loading…
Cancel
Save