todoroo / astrid

Astrid: Android's #1 Task Management Application
http://www.astrid.com
GNU General Public License v3.0
1.08k stars 689 forks source link

Aj taskswidget manual order and SQLMaid #202

Closed StingerAJ closed 12 years ago

StingerAJ commented 12 years ago

This version supports showing subtasks with maual ordering in free TasksWidget. I found a bug with starting the initially selected fragment and not the currently needed when pressing the widget (e.g. TagViewFragment for alphabetically ordered tasks when the widget was created for a SubTasksViewFragment for manually ordered). This will be tackled in another commit.

The 2nd commit is to use SQLBride to connect a JDBC-capable DB-tool to run SQL-queries against a live database on-device (as described here: http://www.peculiarcat.com/?p=151). I needed this to actually figure out why the SQL-query for subtasks wasn't restricting access to the current list.

To get this working, you have to install SQLBride on your development-device prior to the deployment of this Astrid-version.

The SQLBride-App is supported from Android 2.3 upwards and can be installed from here: https://play.google.com/store/apps/details?id=com.peculiarcat.sqlbride

A rooted device is not necessary due to use of SQLMaid-integration (rooted access to arbitrary databases is disabled in current playstore despite the description, hence this commit).

You might need to start SQLBride once and then Astrid once. If you have connection-problems try the USB-cable method (it is supposed to be faster) and restart adb-server (fixed it for me).

As for DB-tools, I use SQuirreL and it is working fine.

StingerAJ commented 12 years ago

@sbosley actually, I already talked with @jonparis about these questions in the Flowdock. See this Astrid-task for details. In short: indentation (try 1.25 checkboxes) should only be in powerpack widgets, but manual ordering should be common for all widgets.

About the Fragment-bug, since you build the list-intent every time in TasksWidget.buildUpdate anyway, you could determine if manual order mode is set by looking at the sort-flag, and set the Intent-target in buildUpdate accordingly?

What do you think about the commit for SQLMaid/SQLBride-integration? Did you have time/the need to try it out? Feel free to cherry-pick the commit as it was only for better testing and thus not directly related to the widget-stuff.

sbosley commented 12 years ago

@StingerAJ cool I hadn't looked closely at that task, thanks for pointing me to it. Indentation only on ppack makes sense to me. I think your solution for the fragment bug sounds good too--down the road I might try a solution for determining the right fragment at creation time that would apply to the whole app, but that would be a bit of a refactor and I don't think there's any real need to go there just yet. Your solution sounds like it would be clean and quick to implement.

I haven't gotten a chance to test the SQL stuff yet. Tim suggested that we not merge it to the main branch since we already have other means of gaining access to the sql database that don't require installing any extra components (i.e. the ability to copy the databases to the sd card and then access them from the console) but I'll probably still play around with them in a branch of my own.

sbosley commented 12 years ago

Cherry-picked the widget code on another branch and merged after fixing the fragment class bug. Thanks Arne!