Skip to content

Commit

Permalink
Producteev: set default task edit responsible spinner not to first pe…
Browse files Browse the repository at this point in the history
…rson in list, but to yourself
  • Loading branch information
Tim Su committed Sep 17, 2010
1 parent 5ea3fcd commit 24b9111
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -13,11 +13,11 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;

import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
Expand All @@ -34,6 +34,7 @@
import com.todoroo.astrid.producteev.sync.ProducteevTask;
import com.todoroo.astrid.producteev.sync.ProducteevUser;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.utility.Preferences;

/**
* Control Set for managing task/dashboard assignments in Producteev
Expand Down Expand Up @@ -185,7 +186,8 @@ private void refreshResponsibleSpinner(ArrayList<ProducteevUser> newUsers, long
int responsibleSpinnerIndex = 0;

for (int i = 0; i < this.users.size() ; i++) {
if (this.users.get(i).getId() == responsibleId) {
if (this.users.get(i).getId() == responsibleId ||
(responsibleId == -1 && this.users.get(i).getId() == Preferences.getLong(ProducteevUtilities.PREF_USER_ID, -1))) {
responsibleSpinnerIndex = i;
break;
}
Expand Down

0 comments on commit 24b9111

Please sign in to comment.