New style for filters page to show list pictures and restructure custom filters.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 174 B |
|
Before Width: | Height: | Size: 162 B |
|
After Width: | Height: | Size: 819 B |
|
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,12 @@
|
||||
<!-- See the file "LICENSE" for the full license governing this code. -->
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid
|
||||
android:color="#ff282828" />
|
||||
<corners
|
||||
android:bottomRightRadius="4dp"
|
||||
android:bottomLeftRadius="4dp"
|
||||
android:topLeftRadius="4dp"
|
||||
android:topRightRadius="4dp" />
|
||||
</shape>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 293 B |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 726 B |
|
Before Width: | Height: | Size: 738 B |
|
Before Width: | Height: | Size: 717 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
@ -1,51 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- See the file "LICENSE" for the full license governing this code. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="58dip"
|
||||
android:background="@android:drawable/list_selector_background"
|
||||
android:paddingTop="4dip"
|
||||
android:paddingBottom="4dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:paddingTop="5dip"
|
||||
android:paddingBottom="5dip"
|
||||
android:paddingLeft="7dip"
|
||||
android:paddingRight="6dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- expander icon -->
|
||||
<ImageView android:id="@+id/expander"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="5dip"
|
||||
android:paddingRight="5dip"
|
||||
android:layout_width="22dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="11dip"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!-- filter icon -->
|
||||
<ImageView android:id="@+id/icon"
|
||||
android:layout_width="32dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="5dip"
|
||||
android:paddingRight="5dip"
|
||||
android:layout_width="25dip"
|
||||
android:layout_height="48dip"
|
||||
android:layout_toRightOf="@id/expander"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginLeft="12dip"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!-- filter url image icon -->
|
||||
<greendroid.widget.AsyncImageView android:id="@+id/url_image"
|
||||
android:layout_width="30dip"
|
||||
android:layout_height="48dip"
|
||||
android:layout_toRightOf="@id/expander"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!-- filter name -->
|
||||
<TextView android:id="@+id/name"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="100"
|
||||
android:paddingLeft="5dip"
|
||||
android:gravity="center_vertical"/>
|
||||
android:layout_marginLeft="55dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:paddingRight="30dp"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
<!-- size -->
|
||||
<TextView android:id="@+id/size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/filter_count"
|
||||
android:layout_marginRight="5dip"
|
||||
android:layout_marginTop="15dip"
|
||||
android:paddingLeft="7dip"
|
||||
android:paddingRight="7dip"
|
||||
android:textColor="#ffffff"
|
||||
android:gravity="center" />
|
||||
|
||||
<!-- selected -->
|
||||
<ImageView android:id="@+id/selected"
|
||||
android:layout_width="24dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toLeftOf="@id/size"
|
||||
android:paddingLeft="5dip"
|
||||
android:paddingRight="5dip"
|
||||
android:src="@drawable/filter_selected_icon"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!-- activity text -->
|
||||
<TextView android:id="@+id/activity"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="55dp"
|
||||
android:layout_marginTop="29dp"
|
||||
android:paddingRight="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.api;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* A <code>FilterCategoryWithNewButton</code> has a button for new filter creation
|
||||
*
|
||||
* @author Tim Su <tim@todoroo.com>
|
||||
*
|
||||
*/
|
||||
public class FilterCategoryWithNewButton extends FilterCategory {
|
||||
|
||||
/**
|
||||
* Intent to launch
|
||||
*/
|
||||
public PendingIntent intent;
|
||||
|
||||
/**
|
||||
* Label for new button
|
||||
*/
|
||||
public String label;
|
||||
|
||||
/**
|
||||
* Constructor for creating a new FilterCategory
|
||||
* @param listingTitle
|
||||
* Title of this item as displayed on the lists page, e.g. Inbox
|
||||
* @param children
|
||||
* filters belonging to this category
|
||||
*/
|
||||
public FilterCategoryWithNewButton(String listingTitle, Filter[] children) {
|
||||
this.listingTitle = listingTitle;
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for creating a new FilterCategory
|
||||
*
|
||||
* @param plugin
|
||||
* {@link Addon} identifier that encompasses object
|
||||
*/
|
||||
protected FilterCategoryWithNewButton() {
|
||||
//
|
||||
}
|
||||
|
||||
// --- parcelable
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeParcelable(intent, 0);
|
||||
dest.writeString(label);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parcelable creator
|
||||
*/
|
||||
@SuppressWarnings("hiding")
|
||||
public static final Parcelable.Creator<FilterCategoryWithNewButton> CREATOR = new Parcelable.Creator<FilterCategoryWithNewButton>() {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public FilterCategoryWithNewButton createFromParcel(Parcel source) {
|
||||
FilterCategoryWithNewButton item = new FilterCategoryWithNewButton();
|
||||
item.readFromParcel(source);
|
||||
|
||||
Parcelable[] parcelableChildren = source.readParcelableArray(
|
||||
FilterCategoryWithNewButton.class.getClassLoader());
|
||||
item.children = new Filter[parcelableChildren.length];
|
||||
for(int i = 0; i < item.children.length; i++) {
|
||||
if(parcelableChildren[i] instanceof FilterListItem)
|
||||
item.children[i] = (Filter) parcelableChildren[i];
|
||||
else
|
||||
item.children[i] = null;
|
||||
}
|
||||
|
||||
item.intent = source.readParcelable(PendingIntent.class.getClassLoader());
|
||||
item.label = source.readString();
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public FilterCategoryWithNewButton[] newArray(int size) {
|
||||
return new FilterCategoryWithNewButton[size];
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.todoroo.astrid.api;
|
||||
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.todoroo.andlib.sql.QueryTemplate;
|
||||
|
||||
public class FilterWithUpdate extends FilterWithCustomIntent {
|
||||
|
||||
/**
|
||||
* Update image URL
|
||||
*/
|
||||
public String imageUrl = null;
|
||||
|
||||
/**
|
||||
* Update message text
|
||||
*/
|
||||
public String updateText = null;
|
||||
|
||||
protected FilterWithUpdate() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FilterWithUpdate(String listingTitle, String title,
|
||||
QueryTemplate sqlQuery, ContentValues valuesForNewTasks) {
|
||||
super(listingTitle, title, sqlQuery, valuesForNewTasks);
|
||||
}
|
||||
|
||||
public FilterWithUpdate(String listingTitle, String title,
|
||||
String sqlQuery, ContentValues valuesForNewTasks) {
|
||||
super(listingTitle, title, sqlQuery, valuesForNewTasks);
|
||||
}
|
||||
|
||||
// --- parcelable
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeString(imageUrl);
|
||||
dest.writeString(updateText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromParcel(Parcel source) {
|
||||
super.readFromParcel(source);
|
||||
imageUrl = source.readString();
|
||||
updateText = source.readString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parcelable Creator Object
|
||||
*/
|
||||
@SuppressWarnings("hiding")
|
||||
public static final Parcelable.Creator<FilterWithUpdate> CREATOR = new Parcelable.Creator<FilterWithUpdate>() {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public FilterWithUpdate createFromParcel(Parcel source) {
|
||||
FilterWithUpdate item = new FilterWithUpdate();
|
||||
item.readFromParcel(source);
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public FilterWithUpdate[] newArray(int size) {
|
||||
return new FilterWithUpdate[size];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||