Added emtpy add-on activity, made links to it and made it pretty

pull/14/head
Tim Su 15 years ago
parent 11461b8700
commit 2735c80979

@ -90,7 +90,8 @@
</activity> </activity>
<!-- Activity that creates or edits tasks --> <!-- Activity that creates or edits tasks -->
<activity android:name="com.todoroo.astrid.activity.TaskEditActivity" <activity android:name="com.todoroo.astrid.activity.TaskEditActivity"
android:windowSoftInputMode="stateHidden"> android:windowSoftInputMode="stateHidden"
android:theme="@style/Theme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -101,6 +102,10 @@
<data android:mimeType="vnd.android.cursor.item/task" /> <data android:mimeType="vnd.android.cursor.item/task" />
</intent-filter> </intent-filter>
</activity> </activity>
<!-- Activity that selects and installs add-ons -->
<activity android:name="com.todoroo.astrid.activity.AddOnActivity"
android:windowSoftInputMode="stateHidden"
android:theme="@style/Theme" />
<!-- Activity for preferences --> <!-- Activity for preferences -->
<activity android:name="com.todoroo.astrid.activity.EditPreferences" /> <activity android:name="com.todoroo.astrid.activity.EditPreferences" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_gradient">
<!-- =================================================== tab: installed == -->
<ScrollView android:id="@+id/installed_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/installed_container"
android:paddingRight="8dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</LinearLayout>
</ScrollView>
<!-- =================================================== tab: available == -->
<ScrollView android:id="@+id/availble_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/available_container"
android:paddingRight="8dip"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</LinearLayout>
</ScrollView>
</FrameLayout>

@ -250,13 +250,15 @@
<!-- add-ons --> <!-- add-ons -->
<LinearLayout android:id="@+id/tab_addons_addons" <LinearLayout android:id="@+id/tab_addons_addons"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="fill_parent"
android:layout_weight="100"
android:orientation="vertical" /> android:orientation="vertical" />
<!-- separator --> <!-- separator -->
<View <View
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="1dip" android:layout_height="1dip"
android:layout_weight="1"
android:padding="5dip" android:padding="5dip"
android:background="@android:drawable/divider_horizontal_dark" /> android:background="@android:drawable/divider_horizontal_dark" />
@ -264,6 +266,7 @@
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:layout_weight="1"
android:gravity="bottom" android:gravity="bottom"
android:paddingTop="5dip" android:paddingTop="5dip"
android:baselineAligned="false"> android:baselineAligned="false">

@ -131,11 +131,6 @@
version in the Android market! Please do that before continuing, or wait a version in the Android market! Please do that before continuing, or wait a
few seconds.</string> few seconds.</string>
<!-- Dialog for Astrid Power Pack -->
<string name="DLG_power_pack">Support Astrid and get more productive with
the Astrid Power Pack backup, widgets, no ads, and calendar integration.
Power up today!</string>
<!-- Button for going to Market --> <!-- Button for going to Market -->
<string name="DLG_to_market">Go To Market</string> <string name="DLG_to_market">Go To Market</string>
@ -353,6 +348,12 @@ to the plugin creator for fastest service.
<item>Specific Day</item> <item>Specific Day</item>
</string-array> </string-array>
<!-- Add Ons tab when no add-ons found -->
<string name="TEA_no_addons">No Add-ons Found!</string>
<!-- Add Ons button -->
<string name="TEA_addons_button">Get Some Add-ons</string>
<!-- ============================================= IntroductionActivity == --> <!-- ============================================= IntroductionActivity == -->
<!-- Introduction Window title --> <!-- Introduction Window title -->
@ -433,9 +434,23 @@ to the plugin creator for fastest service.
<!-- ==================================================== AddOnActivity == --> <!-- ==================================================== AddOnActivity == -->
<!-- Add Ons: author for internal authors --> <!-- Add Ons Activity Title -->
<string name="AOA_title">Astrid: Add Ons</string>
<!-- Add-on Activity: author for internal authors -->
<string name="AOA_internal_author">Astrid Team</string> <string name="AOA_internal_author">Astrid Team</string>
<!-- Add-on Activity: installed add-ons tab -->
<string name="AOA_tab_installed">Installed</string>
<!-- Add-on Activity - available add-ons tab -->
<string name="AOA_tab_available">Available</string>
<!-- Dialog for Astrid Power Pack -->
<string name="AOA_power_pack">Support Astrid and get more productive with
the Astrid Power Pack backup, widgets, no ads, and calendar integration.
Power up today!</string>
<!-- ========================================== SynchronizationProvider == --> <!-- ========================================== SynchronizationProvider == -->
<!-- Sync Notification: message when sync service active --> <!-- Sync Notification: message when sync service active -->

@ -0,0 +1,36 @@
package com.todoroo.astrid.activity;
import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.TabHost;
import com.timsu.astrid.R;
public class AddOnActivity extends TabActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set up tab host
Resources r = getResources();
TabHost tabHost = getTabHost();
tabHost.setPadding(0, 4, 0, 0);
LayoutInflater.from(this).inflate(R.layout.addon_activity,
tabHost.getTabContentView(), true);
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_tab));
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.availble_tab));
setTitle(R.string.AOA_title);
}
}

@ -27,36 +27,41 @@ import java.util.List;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.DatePickerDialog; import android.app.DatePickerDialog;
import android.app.DatePickerDialog.OnDateSetListener;
import android.app.TabActivity; import android.app.TabActivity;
import android.app.DatePickerDialog.OnDateSetListener;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.DialogInterface.OnCancelListener;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.LayoutParams;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.DatePicker; import android.widget.DatePicker;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TabHost; import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TimePicker; import android.widget.TimePicker;
import android.widget.Toast; import android.widget.Toast;
import android.widget.ToggleButton; import android.widget.ToggleButton;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ImageView.ScaleType;
import com.flurry.android.FlurryAgent; import com.flurry.android.FlurryAgent;
import com.timsu.astrid.R; import com.timsu.astrid.R;
@ -179,15 +184,15 @@ public final class TaskEditActivity extends TabActivity {
tabHost.getTabContentView(), true); tabHost.getTabContentView(), true);
tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.TEA_tab_basic)). tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.TEA_tab_basic)).
setIndicator(r.getString(R.string.TEA_tab_basic), setIndicator(r.getString(R.string.TEA_tab_basic),
r.getDrawable(R.drawable.tea_tab_basic)).setContent( r.getDrawable(R.drawable.tab_edit)).setContent(
R.id.tab_basic)); R.id.tab_basic));
tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.TEA_tab_extra)). tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.TEA_tab_extra)).
setIndicator(r.getString(R.string.TEA_tab_extra), setIndicator(r.getString(R.string.TEA_tab_extra),
r.getDrawable(R.drawable.tea_tab_extra)).setContent( r.getDrawable(R.drawable.tab_advanced)).setContent(
R.id.tab_extra)); R.id.tab_extra));
tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.TEA_tab_addons)). tabHost.addTab(tabHost.newTabSpec(r.getString(R.string.TEA_tab_addons)).
setIndicator(r.getString(R.string.TEA_tab_addons), setIndicator(r.getString(R.string.TEA_tab_addons),
r.getDrawable(R.drawable.tea_tab_extensions)).setContent( r.getDrawable(R.drawable.tab_addons)).setContent(
R.id.tab_addons)); R.id.tab_addons));
// populate control set // populate control set
@ -213,8 +218,32 @@ public final class TaskEditActivity extends TabActivity {
if(AddonService.isPowerPack()) { if(AddonService.isPowerPack()) {
controls.add(new GCalControlSet(this, addonsAddons)); controls.add(new GCalControlSet(this, addonsAddons));
controls.add(new TimerControlSet(this, addonsAddons)); controls.add(new TimerControlSet(this, addonsAddons));
} else { }
addonsAddons.addView(AddonService.displayPowerPackHelp(this));
// show add-on help if necessary
if(addonsAddons.getChildCount() == 0) {
ImageView ppIcon = new ImageView(this);
ppIcon.setImageResource(R.drawable.icon_pp);
ppIcon.setScaleType(ScaleType.CENTER);
ppIcon.setPadding(5, 10, 5, 10);
addonsAddons.addView(ppIcon);
TextView addOnText = new TextView(this);
addOnText.setText(R.string.TEA_no_addons);
addOnText.setTextAppearance(this, R.style.TextAppearance_TLA_NoItems);
addOnText.setGravity(Gravity.CENTER);
addOnText.setPadding(5, 10, 5, 10);
addonsAddons.addView(addOnText);
Button addOnButton = new Button(this);
addOnButton.setText(R.string.TEA_addons_button);
addonsAddons.addView(addOnButton);
addOnButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(TaskEditActivity.this, AddOnActivity.class));
}
});
} }
// read data // read data

@ -20,25 +20,25 @@ import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.ContextMenu; import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.View.OnKeyListener; import android.view.View.OnKeyListener;
import android.view.Window;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.widget.AbsListView; import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast; import android.widget.Toast;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.TextView.OnEditorActionListener;
import com.flurry.android.FlurryAgent; import com.flurry.android.FlurryAgent;
import com.timsu.astrid.R; import com.timsu.astrid.R;
@ -84,7 +84,7 @@ public class TaskListActivity extends ListActivity implements OnScrollListener {
public static final int ACTIVITY_EDIT_TASK = 0; public static final int ACTIVITY_EDIT_TASK = 0;
public static final int ACTIVITY_SETTINGS = 1; public static final int ACTIVITY_SETTINGS = 1;
public static final int ACTIVITY_PLUGINS = 2; public static final int ACTIVITY_ADDONS = 2;
public static final int ACTIVITY_MENU_EXTERNAL = 3; public static final int ACTIVITY_MENU_EXTERNAL = 3;
// --- menu codes // --- menu codes
@ -187,9 +187,9 @@ public class TaskListActivity extends ListActivity implements OnScrollListener {
MenuItem item; MenuItem item;
/*item = menu.add(Menu.NONE, MENU_ADDONS_ID, Menu.NONE, item = menu.add(Menu.NONE, MENU_ADDONS_ID, Menu.NONE,
R.string.TLA_menu_addons); R.string.TLA_menu_addons);
item.setIcon(android.R.drawable.ic_menu_set_as);*/ item.setIcon(android.R.drawable.ic_menu_set_as);
item = menu.add(Menu.NONE, MENU_SETTINGS_ID, Menu.NONE, item = menu.add(Menu.NONE, MENU_SETTINGS_ID, Menu.NONE,
R.string.TLA_menu_settings); R.string.TLA_menu_settings);
@ -659,11 +659,8 @@ public class TaskListActivity extends ListActivity implements OnScrollListener {
// handle my own menus // handle my own menus
switch (item.getItemId()) { switch (item.getItemId()) {
case MENU_ADDONS_ID: case MENU_ADDONS_ID:
dialogUtilities.okDialog( intent = new Intent(this, AddOnActivity.class);
this, startActivityForResult(intent, ACTIVITY_ADDONS);
"if this were real life, I would display your " + //$NON-NLS-1$
"add-ons so you could enable/disable/rearrange them.", //$NON-NLS-1$
null);
return true; return true;
case MENU_SETTINGS_ID: case MENU_SETTINGS_ID:
intent = new Intent(this, EditPreferences.class); intent = new Intent(this, EditPreferences.class);

@ -12,12 +12,6 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.ContextManager;
@ -68,33 +62,6 @@ public class AddonService {
return isPowerPack; return isPowerPack;
} }
/** Displays power pack help */
public static LinearLayout displayPowerPackHelp(final Activity activity) {
LinearLayout layout = new LinearLayout(activity);
layout.setOrientation(LinearLayout.VERTICAL);
ImageView imageView = new ImageView(activity);
imageView.setImageResource(R.drawable.icon_pp);
layout.addView(imageView);
TextView textView = new TextView(activity);
textView.setText(R.string.DLG_power_pack);
textView.setTextSize(16);
textView.setGravity(Gravity.CENTER);
layout.addView(textView);
Button button = new Button(activity);
button.setText(R.string.DLG_to_market);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new MarketClickListener(activity, POWER_PACK_PACKAGE);
}
});
layout.addView(button);
return layout;
}
/** /**
* Takes users to the market * Takes users to the market
* *

Loading…
Cancel
Save