Started move to use tag view activity always, minor tweaks

pull/14/head
Tim Su 15 years ago
parent c3b1e2e084
commit 784a37fc0b

@ -92,6 +92,8 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList
@Autowired ActFmSyncService actFmSyncService;
@Autowired ActFmPreferenceService actFmPreferenceService;
@Autowired UpdateDao updateDao;
private TabHost tabHost;
@ -140,6 +142,7 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList
View taskList = super.getListBody(parent);
tabContent.addView(taskList);
addTab(tabWidget, taskList.getId(), "tasks", tabLabels[0]);
if(actFmPreferenceService.isLoggedIn())
addTab(tabWidget, R.id.tab_updates, "updates", tabLabels[1]);
addTab(tabWidget, R.id.tab_settings, "members", tabLabels[2]);
@ -212,11 +215,14 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList
return true;
}
protected void setUpMemberPage() {
protected void setUpSettingsPage() {
tagMembers = (PeopleContainer) findViewById(R.id.members_container);
tagName = (EditText) findViewById(R.id.tag_name);
picture = (AsyncImageView) findViewById(R.id.picture);
if(actFmPreferenceService.isLoggedIn())
findViewById(R.id.listSettingsMore).setVisibility(View.VISIBLE);
picture.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
@ -338,7 +344,7 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList
}
setUpUpdateList();
setUpMemberPage();
setUpSettingsPage();
}
private void refreshUpdatesList() {

@ -32,8 +32,6 @@ import com.todoroo.andlib.sql.QueryTemplate;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.actfm.TagViewActivity;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.activity.TaskListActivity;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterCategory;
@ -60,13 +58,11 @@ public class TagFilterExposer extends BroadcastReceiver {
@Autowired TagDataService tagDataService;
@Autowired ActFmPreferenceService actFmPreferenceService;
private TagService tagService;
/** Create filter from new tag object */
@SuppressWarnings("nls")
public static FilterWithCustomIntent filterFromTag(Context context, Tag tag, Criterion criterion, boolean useTagViewActivity) {
public static FilterWithCustomIntent filterFromTag(Context context, Tag tag, Criterion criterion) {
String listTitle = tag.tag + " (" + tag.count + ")";
String title = context.getString(R.string.tag_FEx_name, tag.tag);
QueryTemplate tagTemplate = tag.queryTemplate(criterion);
@ -88,15 +84,11 @@ public class TagFilterExposer extends BroadcastReceiver {
newTagIntent(context, RenameTagActivity.class, tag),
newTagIntent(context, DeleteTagActivity.class, tag)
};
if(useTagViewActivity) {
filter.customTaskList = new ComponentName(ContextManager.getContext(), TagViewActivity.class);
Bundle extras = new Bundle();
extras.putString(TagViewActivity.EXTRA_TAG_NAME, tag.tag);
extras.putLong(TagViewActivity.EXTRA_TAG_REMOTE_ID, tag.remoteId);
filter.customExtras = extras;
} else {
filter.customTaskList = new ComponentName(ContextManager.getContext(), TaskListActivity.class);
}
return filter;
}
@ -106,7 +98,7 @@ public class TagFilterExposer extends BroadcastReceiver {
Tag tag = new Tag(tagData.getValue(TagData.NAME),
tagData.getValue(TagData.TASK_COUNT),
tagData.getValue(TagData.REMOTE_ID));
return filterFromTag(context, tag, TaskCriteria.activeAndVisible(), true);
return filterFromTag(context, tag, TaskCriteria.activeAndVisible());
}
private static Intent newTagIntent(Context context, Class<? extends Activity> activity, Tag tag) {
@ -199,8 +191,7 @@ public class TagFilterExposer extends BroadcastReceiver {
Filter[] filters = new Filter[tags.length];
Context context = ContextManager.getContext();
for(int i = 0; i < tags.length; i++)
filters[i] = filterFromTag(context, tags[i], TaskCriteria.activeAndVisible(),
actFmPreferenceService.isLoggedIn());
filters[i] = filterFromTag(context, tags[i], TaskCriteria.activeAndVisible());
return new FilterCategory(context.getString(name), filters);
}

@ -52,6 +52,7 @@ public class TagsPlugin extends BroadcastReceiver {
frame.addView(editText);
frame.setPadding(10, 0, 10, 0);
// todo make me open directly
DialogUtilities.viewDialog(activity,
activity.getString(R.string.tag_new_list),
frame, new DialogInterface.OnClickListener() {
@ -59,7 +60,7 @@ public class TagsPlugin extends BroadcastReceiver {
public void onClick(DialogInterface dialog, int which) {
Tag tag = new Tag(editText.getText().toString(), 0, 0);
FilterWithCustomIntent filter = TagFilterExposer.filterFromTag(activity,
tag, TaskCriteria.isActive(), actFmPreferenceService.isLoggedIn());
tag, TaskCriteria.isActive());
filter.start(activity);
}
}, null);

@ -81,19 +81,6 @@
</RelativeLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="@string/actfm_TVA_tag_owner_label" />
<TextView
android:id="@+id/tag_owner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:textSize="20sp"/>
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
@ -112,6 +99,41 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<!-- Footer -->
<LinearLayout
android:id="@+id/listSettingsMore"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@android:drawable/divider_horizontal_dark" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="@string/actfm_TVA_tag_owner_label" />
<TextView
android:id="@+id/tag_owner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:textSize="20sp"/>
<CheckBox
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:layout_marginLeft="5dip"
android:text="@string/actfm_TVA_silence_label" />
</LinearLayout>
</LinearLayout>
</ScrollView>

@ -46,27 +46,30 @@
<!-- Tab for showing comments & updates -->
<item>Activity</item>
<!-- Tab for showing setting -->
<item>Members</item>
<item>List Settings</item>
</string-array>
<!-- Tag View Menu: refresh -->
<string name="actfm_TVA_menu_refresh">Refresh</string>
<!-- Tag Members: tag name label -->
<!-- Tag Settings: tag name label -->
<string name="actfm_TVA_tag_label">List Name:</string>
<!-- Tag Members: tag owner label -->
<string name="actfm_TVA_tag_owner_label">List Owner:</string>
<!-- Tag Settings: tag owner label -->
<string name="actfm_TVA_tag_owner_label">List Creator:</string>
<!-- Tag Members: tag owner value when there is no owner -->
<!-- Tag Settings: tag owner value when there is no owner -->
<string name="actfm_TVA_tag_owner_none">none</string>
<!-- Tag Members: team members label -->
<string name="actfm_TVA_members_label">Team Members:</string>
<!-- Tag Settings: list collaborators label -->
<string name="actfm_TVA_members_label">Collaborators:</string>
<!-- Tag Members: tag picture -->
<!-- Tag Settings: tag picture -->
<string name="actfm_TVA_tag_picture">List Picture</string>
<!-- Tag Settings: silence notifications label -->
<string name="actfm_TVA_silence_label">Silence Notifications</string>
<!-- ============================================ edit people dialog == -->
<!-- task sharing dialog: intro -->

Loading…
Cancel
Save