diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java index 17d8690bf..71f730b82 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java @@ -167,7 +167,7 @@ public class EditPeopleControlSet extends PopupControlSet { cbFacebook = (CheckBox) getSharedWithView().findViewById(R.id.checkbox_facebook); cbTwitter = (CheckBox) getSharedWithView().findViewById(R.id.checkbox_twitter); - sharedWithContainer.addPerson(""); //$NON-NLS-1$ + sharedWithContainer.addPerson("", ""); //$NON-NLS-1$ setUpListeners(); } @@ -206,7 +206,7 @@ public class EditPeopleControlSet extends PopupControlSet { if(people != null) { for(int i = 0; i < people.length(); i++) { String person = people.getString(i); - TextView textView = sharedWithContainer.addPerson(person); + TextView textView = sharedWithContainer.addPerson(person, ""); textView.setEnabled(false); sharedPeople.add(PeopleContainer.createUserJson(textView)); } @@ -681,7 +681,7 @@ public class EditPeopleControlSet extends PopupControlSet { private void makePrivateTask() { sharedWithContainer.removeAllViews(); - sharedWithContainer.addPerson(""); //$NON-NLS-1$ + sharedWithContainer.addPerson("", ""); //$NON-NLS-1$ assignToMe(); } diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java index 1c05bba52..956924b2b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java @@ -6,7 +6,6 @@ import java.io.IOException; import org.json.JSONArray; import org.json.JSONException; -import org.json.JSONObject; import android.app.Activity; import android.content.Context; @@ -24,10 +23,10 @@ import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.view.inputmethod.InputMethodManager; -import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; +import android.widget.ToggleButton; import com.timsu.astrid.R; import com.todoroo.andlib.service.Autowired; @@ -80,7 +79,7 @@ public class TagSettingsActivity extends FragmentActivity { private AsyncImageView picture; private EditText tagName; private EditText tagDescription; - private CheckBox isSilent; + private ToggleButton isSilent; private Bitmap setBitmap; private boolean isNewTag = false; @@ -167,15 +166,14 @@ public class TagSettingsActivity extends FragmentActivity { tagName = (EditText) findViewById(R.id.tag_name); tagDescription = (EditText) findViewById(R.id.tag_description); picture = (AsyncImageView) findViewById(R.id.picture); - isSilent = (CheckBox) findViewById(R.id.tag_silenced); + isSilent = (ToggleButton) findViewById(R.id.tag_silenced); isSilent.setChecked(tagData.getFlag(TagData.FLAGS, TagData.FLAG_SILENT)); if(actFmPreferenceService.isLoggedIn()) { picture.setVisibility(View.VISIBLE); - picture.setDefaultImageResource(TagService.getDefaultImageIDForTag(tagData.getValue(TagData.NAME))); - findViewById(R.id.picture_label).setVisibility(View.VISIBLE); - findViewById(R.id.listSettingsMore).setVisibility(View.VISIBLE); + findViewById(R.id.tag_silenced_container).setVisibility(View.VISIBLE); } + picture.setDefaultImageResource(TagService.getDefaultImageIDForTag(tagData.getValue(TagData.NAME))); picture.setOnClickListener(new OnClickListener() { @Override @@ -268,7 +266,7 @@ public class TagSettingsActivity extends FragmentActivity { public void onClick(DialogInterface d, int which) { tagMembers.removeAllViews(); - tagMembers.addPerson(""); //$NON-NLS-1$ + tagMembers.addPerson("", ""); //$NON-NLS-1$ } }; DialogUtilities.okCancelCustomDialog(TagSettingsActivity.this, getString(R.string.actfm_EPA_login_button), @@ -367,21 +365,6 @@ public class TagSettingsActivity extends FragmentActivity { } picture.setUrl(tagData.getValue(TagData.PICTURE)); - TextView ownerLabel = (TextView) findViewById(R.id.tag_owner); - try { - if(tagData.getFlag(TagData.FLAGS, TagData.FLAG_EMERGENT)) { - ownerLabel.setText(String.format("<%s>", getString(R.string.actfm_TVA_tag_owner_none))); - } else if(tagData.getValue(TagData.USER_ID) == 0) { - ownerLabel.setText(Preferences.getStringValue(ActFmPreferenceService.PREF_NAME)); - } else { - JSONObject owner = new JSONObject(tagData.getValue(TagData.USER)); - ownerLabel.setText(owner.getString("name")); - } - } catch (JSONException e) { - Log.e("tag-view-activity", "json error refresh owner", e); - ownerLabel.setText(""); - } - String peopleJson = tagData.getValue(TagData.MEMBERS); updateMembers(peopleJson); @@ -401,7 +384,7 @@ public class TagSettingsActivity extends FragmentActivity { } } - tagMembers.addPerson(""); //$NON-NLS-1$ + tagMembers.addPerson("", ""); //$NON-NLS-1$ } private void uploadTagPicture(final Bitmap bitmap) { diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java index 464c30965..30ba3aef8 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java @@ -26,9 +26,9 @@ import com.todoroo.andlib.utility.Preferences; public class ActFmInvoker { /** NOTE: these values are development values & will not work on production */ - private static final String URL = "//10.0.2.2:3000/api/"; - private static final String APP_ID = "a4732a32859dbcd3e684331acd36432c"; - private static final String APP_SECRET = "e389bfc82a0d932332f9a8bd8203735f"; + private static final String URL = "//astrid.com/api/"; + private static final String APP_ID = "bf6170638298af8ed9a8c79995b1fc0f"; + private static final String APP_SECRET = "d15d25c63323bddcaa48928dccac1207"; public static final String PROVIDER_FACEBOOK = "facebook"; public static final String PROVIDER_GOOGLE= "google"; diff --git a/astrid/res/layout/contact_edit_row.xml b/astrid/res/layout/contact_edit_row.xml index 3f2e193d6..2fa069eb9 100644 --- a/astrid/res/layout/contact_edit_row.xml +++ b/astrid/res/layout/contact_edit_row.xml @@ -1,5 +1,6 @@ - - - + + - - - + android:orientation="horizontal" > + + + + + + + + + + + \ No newline at end of file diff --git a/astrid/res/layout/tag_settings_activity.xml b/astrid/res/layout/tag_settings_activity.xml index 6622ad966..4634566b2 100644 --- a/astrid/res/layout/tag_settings_activity.xml +++ b/astrid/res/layout/tag_settings_activity.xml @@ -1,221 +1,199 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + android:layout_below="@id/tag_label" + android:layout_marginTop="10dip" + android:layout_toRightOf="@id/picture" + android:padding="10dip" + android:paddingBottom="14dip" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/astrid/res/values/strings-actfm.xml b/astrid/res/values/strings-actfm.xml index 95ffd7003..714c1c523 100644 --- a/astrid/res/values/strings-actfm.xml +++ b/astrid/res/values/strings-actfm.xml @@ -80,7 +80,7 @@ Refresh - List Name: + List List Creator: @@ -89,7 +89,7 @@ none - Shared With: + Shared With List Picture @@ -101,10 +101,13 @@ List Icon: - Description: + Description + + + Settings - List description + Type a description here You need to be logged in to Astrid.com to share lists! Please log in or make this a private list. diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index 1efa92c23..20d7fb3c7 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -273,7 +273,7 @@ Help - Create Shortcut + Create Desktop Shortcut Name of shortcut: diff --git a/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java b/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java index 2c0df68a4..48ce6e69a 100644 --- a/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java +++ b/astrid/src/com/todoroo/astrid/ui/PeopleContainer.java @@ -1,5 +1,7 @@ package com.todoroo.astrid.ui; +import greendroid.widget.AsyncImageView; + import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -55,7 +57,7 @@ public class PeopleContainer extends LinearLayout { // --- methods /** Adds a tag to the tag field */ - public TextView addPerson(String person) { + public TextView addPerson(String person, String image) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); // check if already exists @@ -81,6 +83,10 @@ public class PeopleContainer extends LinearLayout { textView.setHint(R.string.actfm_person_or_tag_hint); } + final AsyncImageView imageView = (AsyncImageView)tagItem. + findViewById(R.id.icon); + imageView.setUrl(image); + textView.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { @@ -95,7 +101,7 @@ public class PeopleContainer extends LinearLayout { public void onTextChanged(CharSequence s, int start, int before, int count) { if(count > 0 && getLastTextView() == textView) { - addPerson(""); //$NON-NLS-1$ + addPerson("", ""); //$NON-NLS-1$ } if(onAddNewPerson != null) @@ -109,7 +115,7 @@ public class PeopleContainer extends LinearLayout { if(actionId != EditorInfo.IME_NULL) return false; if(getLastTextView().getText().length() != 0) { - addPerson(""); //$NON-NLS-1$ + addPerson("", ""); //$NON-NLS-1$ } return true; } @@ -222,13 +228,13 @@ public class PeopleContainer extends LinearLayout { for(int i = 0; i < people.length(); i++) { JSONObject person = people.getJSONObject(i); TextView textView = null; - + String imageURL = person.optString("picture", ""); if(person.has("id") && person.getLong("id") == ActFmPreferenceService.userId()) - textView = addPerson(Preferences.getStringValue(ActFmPreferenceService.PREF_NAME)); + textView = addPerson(Preferences.getStringValue(ActFmPreferenceService.PREF_NAME), imageURL); else if(!TextUtils.isEmpty(person.optString("name")) && !"null".equals(person.optString("name"))) - textView = addPerson(person.getString("name")); + textView = addPerson(person.getString("name"), imageURL); else if(!TextUtils.isEmpty(person.optString("email")) && !"null".equals(person.optString("email"))) - textView = addPerson(person.getString("email")); + textView = addPerson(person.getString("email"), imageURL); if(textView != null) { textView.setTag(person);