mirror of https://github.com/tasks/tasks
Featured lists fragment now mostly working, needs polish
parent
fb51a7334c
commit
ba80ac686c
@ -1,28 +1,39 @@
|
||||
package com.todoroo.astrid.tags.reusable;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.astrid.activity.AstridActivity;
|
||||
import com.todoroo.andlib.utility.AndroidUtilities;
|
||||
import com.todoroo.astrid.activity.FilterListFragment;
|
||||
import com.todoroo.astrid.activity.TaskListActivity;
|
||||
import com.todoroo.astrid.activity.TaskListFragment;
|
||||
import com.todoroo.astrid.api.FilterListItem;
|
||||
import com.todoroo.astrid.ui.MainMenuPopover;
|
||||
|
||||
public class FeaturedListActivity extends AstridActivity {
|
||||
public class FeaturedListActivity extends TaskListActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.featured_list_activity);
|
||||
protected Class<? extends FilterListFragment> getFilterListClass() {
|
||||
return FeaturedListFragment.class;
|
||||
}
|
||||
|
||||
|
||||
private static final int[] FORBIDDEN_MENU_ITEMS = {
|
||||
TaskListFragment.MENU_NEW_FILTER_ID,
|
||||
TaskListFragment.MENU_ADDONS_ID,
|
||||
MainMenuPopover.MAIN_MENU_ITEM_FRIENDS
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean shouldAddMenuItem(int itemId) {
|
||||
return AndroidUtilities.indexOf(FORBIDDEN_MENU_ITEMS, itemId) < 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFilterItemClicked(FilterListItem item) {
|
||||
Intent taskList = new Intent(this, TaskListActivity.class);
|
||||
taskList.putExtra(TaskListFragment.TOKEN_FILTER, item);
|
||||
startActivity(taskList);
|
||||
return true;
|
||||
public void mainMenuItemSelected(int item, Intent customIntent) {
|
||||
if (item == MainMenuPopover.MAIN_MENU_ITEM_LISTS) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
super.mainMenuItemSelected(item, customIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="43dip"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:background="?attr/asMembersHeaderBackground">
|
||||
<TextView
|
||||
android:id="@+id/clone_list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center"
|
||||
style="@style/TextAppearance"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#333333"
|
||||
android:text="@string/actfm_feat_list_clone"/>
|
||||
<ImageView
|
||||
android:id="@+id/members_edit"
|
||||
android:layout_width="43dip"
|
||||
android:layout_height="43dip"
|
||||
android:padding="5dip"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/list_settings"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/filter_assigned"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:paddingTop="3dip"
|
||||
android:paddingBottom="3dip"
|
||||
style="@style/TextAppearance"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- List body goes here -->
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in New Issue