Skip to content
Browse files

Fixed outline formatting.

  • Loading branch information...
1 parent 046ff29 commit 75797a0f0031a173b9edb08e7c29341be1f832bb @hdweiss hdweiss committed Dec 9, 2012
View
1 src/com/matburt/mobileorg/Gui/Agenda/AgendaFragment.java
@@ -61,6 +61,7 @@ public void addAgenda(OrgQueryBuilder query) {
mergeAdapter.addView(titleView);
OutlineAdapter adapter = new OutlineAdapter(getActivity());
+ adapter.setLevelIndentation(false);
adapter.setState(query.getNodes(db, getActivity()));
mergeAdapter.addAdapter(adapter);
}
View
5 src/com/matburt/mobileorg/Gui/Agenda/OrgQueryBuilder.java
@@ -11,6 +11,7 @@
import com.matburt.mobileorg.OrgData.OrgContract.OrgData;
import com.matburt.mobileorg.OrgData.OrgDatabase.Tables;
import com.matburt.mobileorg.OrgData.OrgFile;
+import com.matburt.mobileorg.OrgData.OrgProviderUtils;
import com.matburt.mobileorg.util.OrgFileNotFoundException;
import com.matburt.mobileorg.util.SelectionBuilder;
@@ -55,6 +56,10 @@ public SelectionBuilder getQuery(Context context) {
getFileSelection(builder, context);
+ if (activeTodos)
+ builder.where(getSelection(OrgProviderUtils.getActiveTodos(context
+ .getContentResolver()), OrgData.TODO));
+
if(todos != null && todos.size() > 0)
builder.where(getSelection(todos, OrgData.TODO));
View
6 src/com/matburt/mobileorg/Gui/Outline/OutlineAdapter.java
@@ -23,6 +23,8 @@
private DefaultTheme theme;
+ private boolean levelIndentation = true;
+
public OutlineAdapter(Context context) {
super(context, R.layout.outline_item);
this.resolver = context.getContentResolver();
@@ -94,10 +96,14 @@ public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null)
outlineItem = new OutlineItem(getContext());
+ outlineItem.setLevelFormating(levelIndentation);
outlineItem.setup(getItem(position), this.expanded.get(position), theme, resolver);
return outlineItem;
}
+ public void setLevelIndentation(boolean enabled) {
+ this.levelIndentation = enabled;
+ }
@Override
public void clear() {
View
12 src/com/matburt/mobileorg/Gui/Outline/OutlineItem.java
@@ -29,6 +29,7 @@
private TextView titleView;
private TextView tagsView;
+ private boolean levelFormatting = true;
public OutlineItem(Context context) {
super(context);
@@ -39,6 +40,10 @@ public OutlineItem(Context context) {
tagsView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
}
+ public void setLevelFormating(boolean enabled) {
+ this.levelFormatting = enabled;
+ }
+
public void setup(OrgNode node, boolean expanded, DefaultTheme theme, ContentResolver resolver) {
setupTags(node.tags, theme);
@@ -49,11 +54,14 @@ public void setup(OrgNode node, boolean expanded, DefaultTheme theme, ContentRes
return;
}
- applyLevelFormating(theme, node.level, titleSpan);
+ if (levelFormatting)
+ applyLevelFormating(theme, node.level, titleSpan);
setupTitle(node.name, theme, titleSpan);
setupPriority(node.priority, theme, titleSpan);
setupTodo(node.todo, titleSpan, theme, resolver);
- applyLevelIndentation(node.level, titleSpan);
+
+ if (levelFormatting)
+ applyLevelIndentation(node.level, titleSpan);
if(expanded == false)
setupChildrenIndicator(node, resolver, theme, titleSpan);

0 comments on commit 75797a0

Please sign in to comment.
Something went wrong with that request. Please try again.