Remove Astrid.com integration

Alex Baker 13 years ago
parent d9a7d8cd81
commit 04153aa764

@ -11,7 +11,6 @@
<directory url="file://$PROJECT_DIR$/viewPagerIndicator/library/gen" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/greendroid/GreenDroid/gen" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/tests-sync/gen" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/facebook/facebook/gen" includeSubdirectories="true" />
</excludeFromCompile>
<resourceExtensions />
<wildcardResourcePatterns>

@ -8,7 +8,6 @@
<module fileurl="file://$PROJECT_DIR$/android-aac-enc/android-aac-enc.iml" filepath="$PROJECT_DIR$/android-aac-enc/android-aac-enc.iml" />
<module fileurl="file://$PROJECT_DIR$/api/api.iml" filepath="$PROJECT_DIR$/api/api.iml" />
<module fileurl="file://$PROJECT_DIR$/astrid/astrid.iml" filepath="$PROJECT_DIR$/astrid/astrid.iml" />
<module fileurl="file://$PROJECT_DIR$/facebook/facebook/facebook.iml" filepath="$PROJECT_DIR$/facebook/facebook/facebook.iml" />
<module fileurl="file://$PROJECT_DIR$/tests/tests.iml" filepath="$PROJECT_DIR$/tests/tests.iml" />
<module fileurl="file://$PROJECT_DIR$/tests-sync/tests-sync.iml" filepath="$PROJECT_DIR$/tests-sync/tests-sync.iml" />
</modules>

@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Astrid" pattern="src:*..*&amp;&amp;!src[ActionBarSherlock]:*..*&amp;&amp;!src[android-aac-enc]:*..*&amp;&amp;!src[GreenDroid]:*..*&amp;&amp;!src[ViewPagerIndicator]:*..*&amp;&amp;!src[tests]:*..*&amp;&amp;!src[tests-sync]:*..*&amp;&amp;!src[facebook]:*..*" />
<scope name="Astrid" pattern="src:*..*&amp;&amp;!src[ActionBarSherlock]:*..*&amp;&amp;!src[android-aac-enc]:*..*&amp;&amp;!src[GreenDroid]:*..*&amp;&amp;!src[ViewPagerIndicator]:*..*&amp;&amp;!src[tests]:*..*&amp;&amp;!src[tests-sync]:*..*" />
</component>

@ -105,9 +105,6 @@
android:hardwareAccelerated="false"
android:manageSpaceActivity="com.todoroo.astrid.core.OldTaskPreferences">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/fb_app_id"/>
<!-- ====================================================== Activities = -->
<!-- Activity that displays task list -->
@ -402,26 +399,6 @@
</receiver>
<!-- actfm -->
<activity
android:name="com.todoroo.astrid.actfm.ActFmLoginActivity"
android:configChanges="keyboardHidden"/>
<activity android:name="com.facebook.LoginActivity"/>
<activity
android:name="com.todoroo.astrid.actfm.ActFmPreferences"
android:theme="@android:style/Theme"
android:label="@string/actfm_APr_header">
<meta-data
android:name="category"
android:resource="@string/SyP_label"/>
<meta-data
android:name="syncAction"
android:value="true"/>
<intent-filter>
<action android:name="com.todoroo.astrid.SETTINGS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity
android:name="com.todoroo.astrid.actfm.ActFmGoogleAuthActivity"
android:theme="@style/Theme"

@ -39,7 +39,6 @@
<orderEntry type="library" exported="" name="google-http-client" level="project" />
<orderEntry type="library" exported="" name="googleloginclient-helper" level="project" />
<orderEntry type="library" exported="" name="google-api-client" level="project" />
<orderEntry type="module" module-name="facebook" />
</component>
</module>

@ -1,960 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.actfm;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.os.Build;
import android.os.Bundle;
import android.text.InputType;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.text.style.ClickableSpan;
import android.text.style.UnderlineSpan;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.facebook.Request;
import com.facebook.Request.GraphUserCallback;
import com.facebook.Response;
import com.facebook.Session;
import com.facebook.SessionState;
import com.facebook.UiLifecycleHelper;
import com.facebook.model.GraphUser;
import com.facebook.widget.LoginButton;
import com.google.android.googlelogin.GoogleLoginServiceConstants;
import com.google.android.googlelogin.GoogleLoginServiceHelper;
import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.service.ExceptionService;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.sync.ActFmInvoker;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.actfm.sync.ActFmServiceException;
import com.todoroo.astrid.actfm.sync.ActFmSyncMonitor;
import com.todoroo.astrid.actfm.sync.ActFmSyncThread;
import com.todoroo.astrid.actfm.sync.messages.ConstructOutstandingTableFromMasterTable;
import com.todoroo.astrid.actfm.sync.messages.ConstructTaskOutstandingTableFromMasterTable;
import com.todoroo.astrid.actfm.sync.messages.NameMaps;
import com.todoroo.astrid.activity.Eula;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.dao.MetadataDao;
import com.todoroo.astrid.dao.MetadataDao.MetadataCriteria;
import com.todoroo.astrid.dao.RemoteModelDao;
import com.todoroo.astrid.dao.TagDataDao;
import com.todoroo.astrid.dao.TagMetadataDao;
import com.todoroo.astrid.dao.TagOutstandingDao;
import com.todoroo.astrid.dao.TaskAttachmentDao;
import com.todoroo.astrid.dao.TaskAttachmentOutstandingDao;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.dao.TaskListMetadataDao;
import com.todoroo.astrid.dao.TaskListMetadataOutstandingDao;
import com.todoroo.astrid.dao.TaskOutstandingDao;
import com.todoroo.astrid.dao.UserActivityDao;
import com.todoroo.astrid.dao.UserActivityOutstandingDao;
import com.todoroo.astrid.dao.UserDao;
import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.TagOutstanding;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.TaskListMetadata;
import com.todoroo.astrid.data.TaskListMetadataOutstanding;
import com.todoroo.astrid.data.UserActivity;
import com.todoroo.astrid.data.UserActivityOutstanding;
import com.todoroo.astrid.gtasks.auth.ModernAuthManager;
import com.todoroo.astrid.helper.UUIDHelper;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.SyncV2Service;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.subtasks.AstridOrderedListUpdater;
import com.todoroo.astrid.subtasks.AstridOrderedListUpdater.Node;
import com.todoroo.astrid.subtasks.SubtasksHelper;
import com.todoroo.astrid.subtasks.SubtasksHelper.TreeRemapHelper;
import com.todoroo.astrid.tags.TaskToTagMetadata;
import org.json.JSONObject;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
/**
* This activity allows users to sign in or log in to Astrid.com
*
* @author Tim Su <tim@astrid.com>
*/
public class ActFmLoginActivity extends SherlockFragmentActivity {
@Autowired
protected Database database;
@Autowired
protected ExceptionService exceptionService;
@Autowired
protected TaskService taskService;
@Autowired
protected ActFmPreferenceService actFmPreferenceService;
@Autowired
private TaskDao taskDao;
@Autowired
private TaskOutstandingDao taskOutstandingDao;
@Autowired
private TaskAttachmentDao taskAttachmentDao;
@Autowired
private TaskAttachmentOutstandingDao taskAttachmentOutstandingDao;
@Autowired
private TagDataDao tagDataDao;
@Autowired
private TagOutstandingDao tagOutstandingDao;
@Autowired
private UserDao userDao;
@Autowired
private UserActivityDao userActivityDao;
@Autowired
private UserActivityOutstandingDao userActivityOutstandingDao;
@Autowired
private TaskListMetadataDao taskListMetadataDao;
@Autowired
private TaskListMetadataOutstandingDao taskListMetadataOutstandingDao;
@Autowired
private MetadataDao metadataDao;
@Autowired
private TagMetadataDao tagMetadataDao;
@Autowired
protected SyncV2Service syncService;
private final ActFmInvoker actFmInvoker = new ActFmInvoker();
private Random rand;
protected TextView errors;
public static final String SHOW_TOAST = "show_toast"; //$NON-NLS-1$
// --- ui initialization
private static final int REQUEST_CODE_GOOGLE_ACCOUNTS = 1;
private static final int REQUEST_CODE_GOOGLE = 2;
static {
AstridDependencyInjector.initialize();
}
protected int getContentViewResource() {
return R.layout.actfm_login_activity;
}
protected int getTitleResource() {
return R.string.actfm_ALA_title;
}
public ActFmLoginActivity() {
DependencyInjectionService.getInstance().inject(this);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ContextManager.setContext(this);
setContentView(getContentViewResource());
if (getTitleResource() != 0) {
setTitle(getTitleResource());
}
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
rand = new Random(DateUtilities.now());
uiHelper = new UiLifecycleHelper(this, callback);
uiHelper.onCreate(savedInstanceState);
initializeUI();
getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
setResult(RESULT_CANCELED);
}
/* (non-Javadoc)
* @see android.app.Activity#onConfigurationChanged(android.content.res.Configuration)
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(getContentViewResource());
}
@Override
protected void onResume() {
super.onResume();
uiHelper.onResume();
}
@Override
protected void onPause() {
super.onPause();
uiHelper.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
uiHelper.onDestroy();
}
protected void setupTermsOfService(TextView tos) {
OnClickListener showTosListener = new OnClickListener() {
@Override
public void onClick(View v) {
Eula.showEulaBasic(ActFmLoginActivity.this);
}
};
tos.setOnClickListener(showTosListener);
String tosBase = getString(R.string.welcome_login_tos_base);
String tosLink = getString(R.string.welcome_login_tos_link);
SpannableString link = getLinkStringWithCustomInterval(tosBase, tosLink, tosBase.length() + 1, 0,
showTosListener);
tos.setText(link);
}
protected SpannableString getLinkStringWithCustomInterval(String base, String linkComponent,
int start, int endOffset, final OnClickListener listener) {
SpannableString link = new SpannableString(String.format("%s %s", //$NON-NLS-1$
base, linkComponent));
ClickableSpan linkSpan = new ClickableSpan() {
@Override
public void onClick(View widget) {
listener.onClick(widget);
}
@Override
public void updateDrawState(TextPaint ds) {
ds.setUnderlineText(true);
ds.setColor(Color.rgb(68, 68, 68));
}
};
link.setSpan(linkSpan, start, link.length() + endOffset, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return link;
}
@SuppressWarnings("nls")
protected void initializeUI() {
errors = (TextView) findViewById(R.id.error);
LoginButton loginButton = (LoginButton) findViewById(R.id.fb_login);
if (loginButton == null) {
return;
}
loginButton.setReadPermissions(Arrays.asList("email", "offline_access"));
View googleLogin = findViewById(R.id.gg_login);
if (AmazonMarketStrategy.isKindleFire()) {
googleLogin.setVisibility(View.GONE);
}
googleLogin.setOnClickListener(googleListener);
View fbLogin = findViewById(R.id.fb_login_dummy);
fbLogin.setOnClickListener(facebookListener);
TextView signUp = (TextView) findViewById(R.id.pw_signup);
signUp.setOnClickListener(signUpListener);
TextView signIn = (TextView) findViewById(R.id.pw_login);
signIn.setOnClickListener(signInListener);
setupTermsOfService((TextView) findViewById(R.id.tos));
}
// --- event handler
protected final OnClickListener googleListener = new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(ActFmLoginActivity.this,
ActFmGoogleAuthActivity.class);
startActivityForResult(intent, REQUEST_CODE_GOOGLE);
}
};
protected final OnClickListener facebookListener = new OnClickListener() {
@Override
public void onClick(View v) {
Session session = Session.getActiveSession();
if (session != null && session.isOpened()) {
facebookSuccess(session);
} else {
View fbLogin = findViewById(R.id.fb_login);
fbLogin.performClick();
}
}
};
protected final OnClickListener signUpListener = new OnClickListener() {
@Override
public void onClick(View v) {
final LinearLayout body = new LinearLayout(ActFmLoginActivity.this);
body.setOrientation(LinearLayout.VERTICAL);
body.setPadding(10, 0, 10, 0);
final EditText firstNameField = addEditField(body,
R.string.actfm_ALA_firstname_label);
firstNameField.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PERSON_NAME |
InputType.TYPE_TEXT_FLAG_CAP_WORDS);
final EditText lastNameField = addEditField(body,
R.string.actfm_ALA_lastname_label);
lastNameField.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PERSON_NAME |
InputType.TYPE_TEXT_FLAG_CAP_WORDS);
final EditText email = addEditField(body,
R.string.actfm_ALA_email_label);
email.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
getCredentials(new OnGetCredentials() {
@Override
public void getCredentials(String[] accounts) {
if (accounts != null && accounts.length > 0) {
email.setText(accounts[0]);
}
}
});
ScrollView bodyScroll = new ScrollView(ActFmLoginActivity.this);
bodyScroll.addView(body);
new AlertDialog.Builder(ActFmLoginActivity.this).setView(
bodyScroll).setIcon(R.drawable.icon_32).setTitle(
R.string.actfm_ALA_signup_title).setPositiveButton(
android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dlg, int which) {
String firstName = firstNameField.getText().toString();
String lastName = lastNameField.getText().toString();
AndroidUtilities.hideSoftInputForViews(ActFmLoginActivity.this, firstNameField, lastNameField, email);
authenticate(email.getText().toString(),
firstName, lastName, ActFmInvoker.PROVIDER_PASSWORD, generateRandomPassword());
}
}).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dlg, int which) {
AndroidUtilities.hideSoftInputForViews(ActFmLoginActivity.this, firstNameField, lastNameField, email);
}
}).show();
}
};
protected final OnClickListener signInListener = new OnClickListener() {
@Override
public void onClick(View v) {
final LinearLayout body = new LinearLayout(ActFmLoginActivity.this);
body.setOrientation(LinearLayout.VERTICAL);
body.setPadding(10, 0, 10, 0);
final EditText email = addEditField(body,
R.string.actfm_ALA_email_label);
email.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
getCredentials(new OnGetCredentials() {
@Override
public void getCredentials(String[] accounts) {
if (accounts != null && accounts.length > 0) {
email.setText(accounts[0]);
}
}
});
final EditText password = addEditField(body,
R.string.actfm_ALA_password_label);
password.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PASSWORD);
password.setTransformationMethod(new PasswordTransformationMethod());
TextView forgotPassword = new TextView(ActFmLoginActivity.this);
SpannableString text = new SpannableString(getString(R.string.actfm_ALA_forgot_password));
text.setSpan(new UnderlineSpan(), 0, text.length(), 0);
forgotPassword.setText(text);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
DisplayMetrics metrics = getResources().getDisplayMetrics();
lp.setMargins(0, (int) (8 * metrics.density), 0, (int) (8 * metrics.density));
forgotPassword.setLayoutParams(lp);
forgotPassword.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
forgotPassword(email.getText().toString());
}
});
body.addView(forgotPassword);
ScrollView bodyScroll = new ScrollView(ActFmLoginActivity.this);
bodyScroll.addView(body);
new AlertDialog.Builder(ActFmLoginActivity.this).setView(
bodyScroll).setIcon(R.drawable.icon_32).setTitle(
R.string.actfm_ALA_login_title).setPositiveButton(
android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dlg, int which) {
AndroidUtilities.hideSoftInputForViews(ActFmLoginActivity.this, email, password);
authenticate(email.getText().toString(),
"", "", ActFmInvoker.PROVIDER_PASSWORD, //$NON-NLS-1$//$NON-NLS-2$
password.getText().toString());
}
}).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dlg, int which) {
AndroidUtilities.hideSoftInputForViews(ActFmLoginActivity.this, email, password);
}
}).show();
}
};
private void forgotPassword(final String email) {
if (TextUtils.isEmpty(email)) {
DialogUtilities.okDialog(this, getString(R.string.actfm_ALA_enter_email), null);
} else {
final ProgressDialog pd = DialogUtilities.progressDialog(this, getString(R.string.DLG_please_wait));
new Thread(new Runnable() {
@Override
public void run() {
try {
actFmInvoker.invoke("user_reset_password", "email", email); //$NON-NLS-1$ //$NON-NLS-2$
DialogUtilities.okDialog(ActFmLoginActivity.this, getString(R.string.actfm_ALA_reset_sent, email), null);
} catch (IOException e) {
handleError(e);
} finally {
DialogUtilities.dismissDialog(ActFmLoginActivity.this, pd);
}
}
}).start();
}
}
private String generateRandomPassword() {
String acceptable = "abcdefghijklmnopqrstuvwxyz1234567890"; //$NON-NLS-1$
char[] chars = new char[8];
char last = 'a';
for (int i = 0; i < chars.length; i++) {
char r = acceptable.charAt(rand.nextInt(acceptable.length()));
while (!checkSimilar(last, r)) {
r = acceptable.charAt(rand.nextInt(acceptable.length()));
}
last = r;
chars[i] = r;
}
return new String(chars);
}
@SuppressWarnings("nls")
private boolean checkSimilar(char last, char check) {
String iSimilar = "ijl1!";
String oSimilar = "oO0";
String puncSimilar = ".,";
boolean match = iSimilar.indexOf(last) > 0 && iSimilar.indexOf(check) > 0
|| oSimilar.indexOf(last) > 0 && oSimilar.indexOf(check) > 0
|| puncSimilar.indexOf(last) > 0 && puncSimilar.indexOf(check) > 0;
if (match) {
return false;
}
return true;
}
private EditText addEditField(LinearLayout body, int hint) {
TextView label = new TextView(ActFmLoginActivity.this);
label.setText(hint);
body.addView(label);
EditText field = new EditText(ActFmLoginActivity.this);
field.setHint(hint);
body.addView(field);
return field;
}
// --- facebook handler
@SuppressWarnings("nls")
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if (state.isOpened()) {
Log.e("fb-login", "State opened");
facebookSuccess(session);
} else if (state.isClosed()) {
Log.e("fb-login", "State closed");
}
}
private void facebookSuccess(Session session) {
progressDialog = DialogUtilities.progressDialog(this,
getString(R.string.DLG_please_wait));
Request request = Request.newMeRequest(session, new GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
try {
String email = user.getInnerJSONObject().optString("email"); //$NON-NLS-1$
authenticate(email, user.getFirstName(), user.getLastName(), ActFmInvoker.PROVIDER_FACEBOOK, Session.getActiveSession().getAccessToken());
} catch (Exception e) {
handleError(e);
}
}
});
request.executeAsync();
}
private UiLifecycleHelper uiHelper;
private final Session.StatusCallback callback = new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
onSessionStateChange(session, state, exception);
}
};
private ProgressDialog progressDialog;
// --- utilities
@SuppressWarnings("nls")
public void authenticate(final String email, final String firstName, final String lastName, final String provider,
final String secret) {
if (progressDialog == null) {
progressDialog = DialogUtilities.progressDialog(this,
getString(R.string.DLG_please_wait));
}
new Thread() {
@Override
public void run() {
try {
final JSONObject result = actFmInvoker.authenticate(email, firstName, lastName,
provider, secret);
final String token = actFmInvoker.getToken();
if (result.optBoolean("new")) { // Report new user statistic
}
// Successful login, create outstanding entries
String lastId = ActFmPreferenceService.userId(); //Preferences.getLong(ActFmPreferenceService.PREF_USER_ID, 0);
if (!TextUtils.isEmpty(token) && !RemoteModel.isValidUuid(lastId)) {
constructOutstandingTables();
}
runOnUiThread(new Runnable() {
@Override
public void run() {
DialogUtilities.dismissDialog(ActFmLoginActivity.this, progressDialog);
progressDialog = null;
postAuthenticate(result, token);
}
});
} catch (IOException e) {
handleError(e);
} finally {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (progressDialog != null) {
DialogUtilities.dismissDialog(ActFmLoginActivity.this, progressDialog);
}
}
});
}
}
}.start();
}
private void constructOutstandingTables() {
new ConstructTaskOutstandingTableFromMasterTable(NameMaps.TABLE_ID_TASKS, taskDao, taskOutstandingDao, metadataDao, Task.CREATION_DATE).execute();
new ConstructOutstandingTableFromMasterTable<TagData, TagOutstanding>(NameMaps.TABLE_ID_TAGS, tagDataDao, tagOutstandingDao, TagData.CREATION_DATE).execute();
new ConstructOutstandingTableFromMasterTable<UserActivity, UserActivityOutstanding>(NameMaps.TABLE_ID_USER_ACTIVITY, userActivityDao, userActivityOutstandingDao, UserActivity.CREATED_AT).execute();
new ConstructOutstandingTableFromMasterTable<TaskListMetadata, TaskListMetadataOutstanding>(NameMaps.TABLE_ID_TASK_LIST_METADATA, taskListMetadataDao, taskListMetadataOutstandingDao, null).execute();
}
@SuppressWarnings("nls")
private void postAuthenticate(final JSONObject result, final String token) {
String lastLoggedInUser = ActFmPreferenceService.userId();
if (RemoteModel.isValidUuid(lastLoggedInUser)) {
String newUserId = Long.toString(result.optLong("id"));
if (!lastLoggedInUser.equals(newUserId)) {
// In this case, we need to either make all data private or clear all data
// Prompt for choice
DialogUtilities.okCancelCustomDialog(this,
getString(R.string.actfm_logged_in_different_user_title),
getString(R.string.actfm_logged_in_different_user_body),
R.string.actfm_logged_in_different_user_clear_data,
R.string.actfm_logged_in_different_user_keep_data,
android.R.drawable.ic_dialog_alert,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ActFmSyncThread.clearTablePushedAtValues();
deleteDatabase(database.getName());
finishSignIn(result, token, true);
}
},
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final ProgressDialog pd = DialogUtilities.progressDialog(ActFmLoginActivity.this, getString(R.string.actfm_logged_in_different_user_processing));
new Thread(new Runnable() {
@Override
public void run() {
rebuildAllSyncData();
runOnUiThread(new Runnable() {
@Override
public void run() {
finishSignIn(result, token, true);
}
});
pd.dismiss();
}
}).start();
}
}
);
} else {
finishSignIn(result, token, false);
}
} else {
finishSignIn(result, token, false);
}
}
private void rebuildAllSyncData() {
// Delete all tasks not assigned to self
taskService.deleteWhere(Criterion.or(Task.USER_ID.neq(0), Task.DELETION_DATE.gt(0)));
// Delete user table
userDao.deleteWhere(Criterion.all);
// Delete comments this user didn't make
userActivityDao.deleteWhere(Criterion.or(UserActivity.USER_UUID.neq(0), UserActivity.DELETED_AT.gt(0)));
// Delete attachments table
taskAttachmentDao.deleteWhere(Criterion.all);
// Delete deleted tags
tagDataDao.deleteWhere(TagData.DELETION_DATE.gt(0));
// Delete deleted metadata
metadataDao.deleteWhere(Metadata.DELETION_DATE.gt(0));
// Clear all outstanding tables
taskOutstandingDao.deleteWhere(Criterion.all);
tagOutstandingDao.deleteWhere(Criterion.all);
userActivityOutstandingDao.deleteWhere(Criterion.all);
taskListMetadataOutstandingDao.deleteWhere(Criterion.all);
taskAttachmentOutstandingDao.deleteWhere(Criterion.all);
// Make all tags private
tagMetadataDao.deleteWhere(Criterion.all);
// Generate new uuids for all tasks/tags/user activity/task list metadata and update links
generateNewUuids();
ActFmSyncThread.clearTablePushedAtValues();
constructOutstandingTables();
}
private void generateNewUuids() {
final HashMap<String, String> uuidTaskMap = new HashMap<String, String>();
HashMap<String, String> uuidTagMap = new HashMap<String, String>();
HashMap<String, String> uuidUserActivityMap = new HashMap<String, String>();
HashMap<String, String> uuidTaskListMetadataMap = new HashMap<String, String>();
mapUuids(taskDao, uuidTaskMap);
mapUuids(tagDataDao, uuidTagMap);
mapUuids(userActivityDao, uuidUserActivityMap);
mapUuids(taskListMetadataDao, uuidTaskListMetadataMap);
Task t = new Task();
TagData td = new TagData();
Metadata m = new Metadata();
UserActivity ua = new UserActivity();
TaskListMetadata tlm = new TaskListMetadata();
Set<Entry<String, String>> entries = uuidTaskMap.entrySet();
for (Entry<String, String> e : entries) {
t.clear();
m.clear();
ua.clear();
String oldUuid = e.getKey();
String newUuid = e.getValue();
t.setValue(Task.UUID, newUuid);
t.setValue(Task.PUSHED_AT, 0L);
t.setValue(Task.ATTACHMENTS_PUSHED_AT, 0L);
t.setValue(Task.USER_ACTIVITIES_PUSHED_AT, 0L);
t.setValue(Task.HISTORY_FETCH_DATE, 0L);
ua.setValue(UserActivity.TARGET_ID, newUuid);
m.setValue(TaskToTagMetadata.TASK_UUID, newUuid);
taskDao.update(Task.UUID.eq(oldUuid), t);
metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TASK_UUID.eq(oldUuid)), m);
userActivityDao.update(UserActivity.TARGET_ID.eq(oldUuid), ua);
}
entries = uuidTagMap.entrySet();
for (Entry<String, String> e : entries) {
td.clear();
ua.clear();
m.clear();
tlm.clear();
String oldUuid = e.getKey();
String newUuid = e.getValue();
td.setValue(TagData.UUID, newUuid);
td.setValue(TagData.USER_ID, Task.USER_ID_SELF);
td.setValue(TagData.PUSHED_AT, 0L);
td.setValue(TagData.TASKS_PUSHED_AT, 0L);
td.setValue(TagData.METADATA_PUSHED_AT, 0L);
td.setValue(TagData.USER_ACTIVITIES_PUSHED_AT, 0L);
ua.setValue(UserActivity.TARGET_ID, newUuid);
m.setValue(TaskToTagMetadata.TAG_UUID, newUuid);
tlm.setValue(TaskListMetadata.TAG_UUID, newUuid);
tagDataDao.update(TagData.UUID.eq(oldUuid), td);
userActivityDao.update(UserActivity.TARGET_ID.eq(oldUuid), ua);
metadataDao.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TAG_UUID.eq(oldUuid)), m);
taskListMetadataDao.update(TaskListMetadata.TAG_UUID.eq(oldUuid), tlm);
}
entries = uuidUserActivityMap.entrySet();
for (Entry<String, String> e : entries) {
ua.clear();
String oldUuid = e.getKey();
String newUuid = e.getValue();
ua.setValue(UserActivity.UUID, newUuid);
ua.setValue(UserActivity.PUSHED_AT, 0L);
userActivityDao.update(UserActivity.UUID.eq(oldUuid), ua);
}
TodorooCursor<TaskListMetadata> tlmCursor = taskListMetadataDao.query(Query.select(TaskListMetadata.ID, TaskListMetadata.UUID, TaskListMetadata.FILTER, TaskListMetadata.TAG_UUID,
TaskListMetadata.TASK_IDS, TaskListMetadata.CHILD_TAG_IDS));
try {
for (tlmCursor.moveToFirst(); !tlmCursor.isAfterLast(); tlmCursor.moveToNext()) {
tlm.clear();
tlm.readFromCursor(tlmCursor);
String filterId = tlm.getValue(TaskListMetadata.FILTER);
String tagUuid = tlm.getValue(TaskListMetadata.TAG_UUID);
// Hack to make sure outstanding entry gets created for filter or uuid
if (!TextUtils.isEmpty(filterId)) {
tlm.setValue(TaskListMetadata.FILTER, ""); //$NON-NLS-1$
tlm.setValue(TaskListMetadata.FILTER, filterId);
} else if (!RemoteModel.isUuidEmpty(tagUuid)) {
tlm.setValue(TaskListMetadata.TAG_UUID, ""); //$NON-NLS-1$
tlm.setValue(TaskListMetadata.TAG_UUID, tagUuid);
}
tlm.setValue(TaskListMetadata.UUID, uuidTaskListMetadataMap.get(tlm.getUuid()));
tlm.setValue(TaskListMetadata.PUSHED_AT, 0L);
String taskIds = tlm.getValue(TaskListMetadata.TASK_IDS);
if (!TaskListMetadata.taskIdsIsEmpty(taskIds)) {
Node root = AstridOrderedListUpdater.buildTreeModel(taskIds, null);
SubtasksHelper.remapTree(root, uuidTaskMap, new TreeRemapHelper<String>() {
@Override
public String getKeyFromOldUuid(String uuid) {
return uuid; // Old uuids are the keys
}
});
taskIds = AstridOrderedListUpdater.serializeTree(root);
tlm.setValue(TaskListMetadata.TASK_IDS, taskIds);
}
taskListMetadataDao.saveExisting(tlm);
}
} finally {
tlmCursor.close();
}
}
private <T extends RemoteModel> void mapUuids(RemoteModelDao<T> dao, HashMap<String, String> map) {
TodorooCursor<T> items = dao.query(Query.select(RemoteModel.UUID_PROPERTY));
try {
for (items.moveToFirst(); !items.isAfterLast(); items.moveToNext()) {
map.put(items.get(RemoteModel.UUID_PROPERTY), UUIDHelper.newUUID());
}
} finally {
items.close();
}
}
@SuppressWarnings("nls")
private void finishSignIn(JSONObject result, String token, boolean restart) {
actFmPreferenceService.setToken(token);
Preferences.setString(ActFmPreferenceService.PREF_USER_ID,
Long.toString(result.optLong("id")));
Preferences.setString(ActFmPreferenceService.PREF_NAME,
result.optString("name"));
Preferences.setString(ActFmPreferenceService.PREF_FIRST_NAME,
result.optString("first_name"));
Preferences.setString(ActFmPreferenceService.PREF_LAST_NAME,
result.optString("last_name"));
Preferences.setBoolean(ActFmPreferenceService.PREF_PREMIUM,
result.optBoolean("premium"));
Preferences.setString(ActFmPreferenceService.PREF_EMAIL,
result.optString("email"));
Preferences.setString(ActFmPreferenceService.PREF_PICTURE,
result.optString("picture"));
if (!result.optBoolean("new")) {
Toast.makeText(this, R.string.actfm_ALA_user_exists_sync_alert, Toast.LENGTH_LONG).show();
}
ActFmPreferenceService.reloadThisUser();
GCMIntentService.register(this);
if (restart) {
System.exit(0);
return;
} else {
setResult(RESULT_OK);
finish();
}
ActFmSyncMonitor monitor = ActFmSyncMonitor.getInstance();
synchronized (monitor) {
monitor.notifyAll();
}
}
@SuppressWarnings("nls")
private void handleError(final Throwable e) {
DialogUtilities.dismissDialog(this, progressDialog);
exceptionService.reportError("astrid-sharing-login", e); //$NON-NLS-1$
runOnUiThread(new Runnable() {
@Override
public void run() {
String message = e.getMessage();
if (e instanceof ActFmServiceException) {
ActFmServiceException ae = (ActFmServiceException) e;
JSONObject result = ae.result;
if (result != null && result.has("code")) {
String code = result.optString("code");
if ("user_exists".equals(code)) {
message = getString(R.string.actfm_ALA_error_user_exists);
} else if ("incorrect_password".equals(code)) {
message = getString(R.string.actfm_ALA_error_wrong_password);
} else if ("user_not_found".equals(code) || "missing_param".equals(code)) {
message = getString(R.string.actfm_ALA_error_user_not_found);
}
}
}
errors.setText(message);
errors.setVisibility(View.VISIBLE);
}
});
}
// --- google account manager
@SuppressWarnings("nls")
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
uiHelper.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_CANCELED) {
return;
}
if (requestCode == REQUEST_CODE_GOOGLE_ACCOUNTS && data != null && credentialsListener != null) {
String accounts[] = data.getStringArrayExtra(
GoogleLoginServiceConstants.ACCOUNTS_KEY);
credentialsListener.getCredentials(accounts);
}
// else if (requestCode == LoginButton.REQUEST_CODE_FACEBOOK) {
// if (data == null)
// return;
//
// String error = data.getStringExtra("error");
// if (error == null) {
// error = data.getStringExtra("error_type");
// }
// String token = data.getStringExtra("access_token");
// if (error != null) {
// onFBAuthFail(error);
// } else if (token == null) {
// onFBAuthFail("Something went wrong! Please try again.");
// } else {
// facebook.setAccessToken(token);
// onFBAuthSucceed();
// }
// errors.setVisibility(View.GONE);
// }
else if (requestCode == REQUEST_CODE_GOOGLE) {
if (data == null) {
return;
}
String email = data.getStringExtra(ActFmGoogleAuthActivity.RESULT_EMAIL);
String token = data.getStringExtra(ActFmGoogleAuthActivity.RESULT_TOKEN);
authenticate(email, email, "", "google", token);
}
}
public interface OnGetCredentials {
public void getCredentials(String[] accounts);
}
private OnGetCredentials credentialsListener;
public void getCredentials(OnGetCredentials onGetCredentials) {
credentialsListener = onGetCredentials;
if (Integer.parseInt(Build.VERSION.SDK) >= 7) {
credentialsListener.getCredentials(ModernAuthManager.getAccounts(this));
} else {
GoogleLoginServiceHelper.getAccount(this,
REQUEST_CODE_GOOGLE_ACCOUNTS, false);
}
}
}

@ -1,212 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.actfm;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.widget.Toast;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.actfm.sync.ActFmSyncV2Provider;
import com.todoroo.astrid.billing.BillingActivity;
import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.service.PremiumUnlockService;
import com.todoroo.astrid.sync.SyncProviderPreferences;
import com.todoroo.astrid.sync.SyncProviderUtilities;
import com.todoroo.astrid.utility.Constants;
/**
* Displays synchronization preferences and an action panel so users can
* initiate actions from the menu.
*
* @author timsu
*/
public class ActFmPreferences extends SyncProviderPreferences {
@Autowired
ActFmPreferenceService actFmPreferenceService;
@Autowired
GtasksPreferenceService gtasksPreferenceService;
@Override
public int getPreferenceResource() {
return R.xml.preferences_actfm;
}
@Override
public void startSync() {
if (!actFmPreferenceService.isLoggedIn()) {
if (gtasksPreferenceService.isLoggedIn()) {
DialogUtilities.okCancelDialog(this, getString(R.string.DLG_warning), getString(R.string.actfm_dual_sync_warning),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startLogin();
}
}, null);
} else {
startLogin();
}
} else {
setResult(RESULT_CODE_SYNCHRONIZE);
finish();
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferenceScreen screen = getPreferenceScreen();
Preference inAppBilling = findPreference(getString(R.string.actfm_inapp_billing));
if (Constants.ASTRID_LITE || Preferences.getBoolean(PremiumUnlockService.PREF_KILL_SWITCH, false)) {
screen.removePreference(inAppBilling);
} else {
inAppBilling.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
handleInAppBillingClicked();
return true;
}
});
}
findPreference(getString(R.string.actfm_account_type)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startSync();
return true;
}
});
}
private void startLogin() {
Intent intent = new Intent(this, ActFmLoginActivity.class);
startActivityForResult(intent, REQUEST_LOGIN);
}
@Override
public void logOut() {
new ActFmSyncV2Provider().signOut(this);
}
@Override
public SyncProviderUtilities getUtilities() {
return actFmPreferenceService;
}
@Override
protected void onResume() {
super.onResume();
Preference premiumUpgrade = findPreference(getString(R.string.actfm_inapp_billing));
if (premiumUpgrade != null &&
(!Constants.MARKET_STRATEGY.billingSupported() || !actFmPreferenceService.isLoggedIn() || ActFmPreferenceService.isPremiumUser())) {
getPreferenceScreen().removePreference(premiumUpgrade);
}
}
@Override
protected void onPause() {
super.onPause();
new ActFmBackgroundService().scheduleService();
}
@Override
public void updatePreferences(Preference preference, Object value) {
final Resources r = getResources();
boolean loggedIn = getUtilities().isLoggedIn();
PreferenceCategory status = (PreferenceCategory) findPreference(r.getString(R.string.sync_SPr_group_status));
if (loggedIn) {
String title = actFmPreferenceService.getLoggedInUserName();
String email = Preferences.getStringValue(ActFmPreferenceService.PREF_EMAIL);
if (!TextUtils.isEmpty(email)) {
if (!TextUtils.isEmpty(title)) {
title += "\n"; //$NON-NLS-1$
}
title += email;
}
status.setTitle(getString(R.string.actfm_status_title_logged_in, title));
} else {
status.setTitle(R.string.sync_SPr_group_status);
}
if (r.getString(R.string.actfm_https_key).equals(preference.getKey())) {
if ((Boolean) value) {
preference.setSummary(R.string.actfm_https_enabled);
} else {
preference.setSummary(R.string.actfm_https_disabled);
}
} else if (r.getString(R.string.actfm_account_type).equals(preference.getKey())) {
if (ActFmPreferenceService.isPremiumUser()) {
// Premium user
preference.setSummary(R.string.actfm_account_premium);
} else if (actFmPreferenceService.isLoggedIn()) {
// Non premium user
preference.setSummary(R.string.actfm_account_basic);
} else {
// Not logged in
preference.setEnabled(true);
preference.setTitle(R.string.account_type_title_not_logged_in);
preference.setSummary(R.string.account_type_summary_not_logged_in);
}
} else if (r.getString(R.string.sync_SPr_forget_key).equals(preference.getKey())) {
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference p) {
DialogUtilities.okCancelDialog(ActFmPreferences.this,
r.getString(R.string.sync_forget_confirm), new OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
logOut();
initializePreference(getPreferenceScreen());
}
}, null);
return true;
}
});
if (!loggedIn) {
getPreferenceScreen().removePreference(preference);
}
} else {
super.updatePreferences(preference, value);
}
}
private void handleInAppBillingClicked() {
if (ActFmPreferenceService.isPremiumUser()) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=" + Constants.PACKAGE)); //$NON-NLS-1$
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, R.string.market_unavailable, Toast.LENGTH_LONG).show();
}
} else {
Intent intent = new Intent(this, BillingActivity.class);
startActivity(intent);
}
}
}

@ -271,14 +271,6 @@ public abstract class CommentsFragment extends SherlockListFragment {
textView.setText(activity.getString(R.string.ENA_no_comments));
} else {
textView.setText(activity.getString(R.string.UpS_no_activity_log_in));
activityContainer.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivityForResult(new Intent(getActivity(), ActFmLoginActivity.class),
TagSettingsActivity.REQUEST_ACTFM_LOGIN);
}
});
}
listView.setVisibility(View.GONE);
} else {

@ -692,26 +692,8 @@ public class EditPeopleControlSet extends PopupControlSet {
}
if (dirty && !actFmPreferenceService.isLoggedIn()) {
DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
fragment.startActivityForResult(new Intent(activity, ActFmLoginActivity.class),
loginRequestCode);
}
};
DialogInterface.OnClickListener cancelListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
makePrivateTask();
task.setValue(Task.USER_ID, Task.USER_ID_SELF);
}
};
DialogUtilities.okCancelCustomDialog(activity, activity.getString(R.string.actfm_EPA_login_button),
activity.getString(R.string.actfm_EPA_login_to_share), R.string.actfm_EPA_login_button,
R.string.actfm_EPA_dont_share_button, android.R.drawable.ic_dialog_alert,
okListener, cancelListener);
makePrivateTask();
task.setValue(Task.USER_ID, Task.USER_ID_SELF);
return false;
}

@ -352,28 +352,8 @@ public class TagSettingsActivity extends SherlockFragmentActivity {
if (newName.length() > 0 && oldName.length() == 0) {
tagDataService.save(tagData);
}
DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
startActivityForResult(new Intent(TagSettingsActivity.this, ActFmLoginActivity.class),
REQUEST_ACTFM_LOGIN);
}
};
DialogInterface.OnClickListener cancelListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
tagMembers.removeAllViews();
tagMembers.addPerson("", "", false); //$NON-NLS-1$
}
};
DialogUtilities.okCancelCustomDialog(TagSettingsActivity.this, getString(R.string.actfm_EPA_login_button),
getString(R.string.actfm_TVA_login_to_share), R.string.actfm_EPA_login_button,
R.string.actfm_EPA_dont_share_button, android.R.drawable.ic_dialog_alert,
okListener, cancelListener);
tagMembers.removeAllViews();
tagMembers.addPerson("", "", false); //$NON-NLS-1$
return;
}

@ -46,7 +46,6 @@ public class ActFmInvoker {
private static final String APP_ID = "a4732a32859dbcd3e684331acd36432c";
private static final String APP_SECRET = "e389bfc82a0d932332f9a8bd8203735f";
public static final String PROVIDER_FACEBOOK = "facebook";
public static final String PROVIDER_GOOGLE = "google";
public static final String PROVIDER_PASSWORD = "password";

@ -8,7 +8,6 @@ package com.todoroo.astrid.actfm.sync;
import android.app.Activity;
import android.content.DialogInterface;
import com.facebook.Session;
import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
@ -60,10 +59,6 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
actFmPreferenceService.clearLastSyncDate();
ActFmPreferenceService.premiumLogout();
GCMIntentService.unregister(ContextManager.getContext());
Session activeSession = Session.getActiveSession();
if (activeSession != null) {
activeSession.closeAndClearTokenInformation();
}
DialogUtilities.okCancelCustomDialog(activity,
activity.getString(R.string.actfm_logout_clear_tasks_title),

@ -13,7 +13,6 @@ import android.widget.Toast;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.core.PluginServices;
public class SyncUpgradePrompt {
@ -21,60 +20,6 @@ public class SyncUpgradePrompt {
private static final String P_SYNC_UPGRADE_PROMPT = "p_sync_upgr_prompt"; //$NON-NLS-1$
private static long lastPromptDate = -1;
public static void showSyncUpgradePrompt(final Activity activity) {
if (lastPromptDate == -1) {
lastPromptDate = Preferences.getLong(P_SYNC_UPGRADE_PROMPT, 0L);
}
Dialog d = null;
if (DateUtilities.now() - lastPromptDate > DateUtilities.ONE_WEEK * 3) {
if (!PluginServices.getActFmPreferenceService().isLoggedIn()) {
if (PluginServices.getGtasksPreferenceService().isLoggedIn()) {
// Logged into google but not astrid
d = getDialog(activity, R.string.sync_upgr_gtasks_only_title, R.string.sync_upgr_gtasks_only_body,
R.string.sync_upgr_gtasks_only_btn1, new Runnable() {
@Override
public void run() {
activity.startActivity(new Intent(activity, ActFmLoginActivity.class));
}
},
R.string.sync_upgr_gtasks_only_btn2,
null);
} else {
// Logged into neither
d = getDialog(activity, R.string.sync_upgr_neither_title, R.string.sync_upgr_neither_body,
R.string.sync_upgr_neither_btn1, new Runnable() {
@Override
public void run() {
activity.startActivity(new Intent(activity, ActFmLoginActivity.class));
}
});
}
setLastPromptDate(DateUtilities.now());
} else if (PluginServices.getGtasksPreferenceService().isLoggedIn()) {
// Logged into both
d = getDialog(activity, R.string.sync_upgr_both_title, R.string.sync_upgr_both_body,
R.string.sync_upgr_both_btn1,
null,
R.string.sync_upgr_both_btn2, new Runnable() {
@Override
public void run() {
new ActFmSyncV2Provider().signOut(activity);
Toast.makeText(activity, R.string.sync_upgr_logged_out, Toast.LENGTH_LONG).show();
}
});
setLastPromptDate(Long.MAX_VALUE);
} else {
// Logged into just astrid--don't need to show prompts anymore
setLastPromptDate(Long.MAX_VALUE);
}
}
if (d != null) {
d.show();
}
}
private static void setLastPromptDate(long date) {
lastPromptDate = date;
Preferences.setLong(P_SYNC_UPGRADE_PROMPT, lastPromptDate);

@ -21,7 +21,6 @@ import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import java.util.Date;
@ -76,14 +75,6 @@ public class BackupPreferences extends TodorooPreferenceActivity {
return false;
}
});
findPreference(getString(R.string.backup_BAc_cloud)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
initiateCloudBackup();
return false;
}
});
}
@Override
@ -149,15 +140,4 @@ public class BackupPreferences extends TodorooPreferenceActivity {
}
}
private void initiateCloudBackup() {
if (actFmPreferenceService.isLoggedIn()) {
DialogUtilities.okDialog(this, getString(R.string.DLG_information_title), 0,
getString(R.string.backup_BPr_cloud_already_logged_in), null);
} else {
Intent intent = new Intent(this, ActFmLoginActivity.class);
startActivity(intent);
}
}
}

@ -14,7 +14,6 @@ import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceScreen;
import com.facebook.Session;
import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
@ -134,10 +133,6 @@ public class OldTaskPreferences extends TodorooPreferenceActivity {
editor.commit();
deleteDatabase(database.getName());
Session activeSession = Session.getActiveSession();
if (activeSession != null) {
activeSession.closeAndClearTokenInformation();
}
AstridPreferences.setPreferenceDefaults();
GCMIntentService.unregister(OldTaskPreferences.this);

@ -41,10 +41,6 @@
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep class com.facebook.** {
*;
}
-keepclassmembers public class com.todoroo.astrid.data.* {
*;
}

@ -9,12 +9,11 @@
# Indicates whether an apk should be generated for each density.
split.density=false
android.library.reference.3=../facebook/facebook/
android.library.reference.1=../api/
android.library.reference.2=../actionbarsherlock/library
# Project target.
target=Google Inc.:Google APIs:14
apk-configurations=
android.library.reference.4=../viewPagerIndicator/library
android.library.reference.5=../greendroid/GreenDroid
android.library.reference.6=../android-aac-enc
android.library.reference.3=../viewPagerIndicator/library
android.library.reference.4=../greendroid/GreenDroid
android.library.reference.5=../android-aac-enc

@ -1,150 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="4dip"
android:paddingRight="4dip"
android:background="@drawable/astrid_com_gradient"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="@+id/logo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:paddingBottom="10dip"
android:src="@drawable/astrid_com_logo_new"
android:layout_weight="1"/>
<LinearLayout
android:id="@+id/LinearLayout1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingTop="5dip">
<com.facebook.widget.LoginButton
android:id="@+id/fb_login"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:layout_marginBottom="15dip"
android:layout_marginTop="15dip"
android:paddingLeft="70dip"
android:textSize="14sp"
android:gravity="left|center_vertical"
android:background="@drawable/fb_login_background"
android:textColor="@android:color/white"
android:text="@string/actfm_ALA_fb_login"
android:visibility="gone"/>
<Button
android:id="@+id/fb_login_dummy"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:layout_marginBottom="15dip"
android:layout_marginTop="15dip"
android:paddingLeft="70dip"
android:textSize="14sp"
android:gravity="left|center_vertical"
android:background="@drawable/fb_login_background"
android:textColor="@android:color/white"
android:text="@string/actfm_ALA_fb_login"/>
<Button
android:id="@+id/gg_login"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:paddingLeft="70dip"
android:textSize="14sp"
android:gravity="left|center_vertical"
android:background="@drawable/google_login_background"
android:textColor="@android:color/white"
android:text="@string/actfm_ALA_gg_login"/>
<TextView
android:id="@+id/tos"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:layout_above="@id/gg_login"
android:gravity="center"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:textSize="12.5sp"
android:visibility="invisible"
android:textColor="#ffffff"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="45dip"
android:orientation="horizontal">
<TextView
android:id="@+id/login_later"
android:text="@string/welcome_login_later"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:gravity="center"
android:layout_weight="1"
android:textSize="16sp"
android:textColor="@android:color/white"
android:visibility="gone"/>
<TextView
android:id="@+id/pw_login"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_weight="1"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:text="@string/welcome_sign_in"/>
<TextView
android:id="@+id/pw_signup"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_weight="1"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:text="@string/welcome_login_pw"/>
</LinearLayout>
<TextView
android:id="@+id/error"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:gravity="center"
android:textColor="#ff0000"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="gone"/>
</LinearLayout>

@ -1,133 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="4dip"
android:paddingRight="4dip"
android:background="@drawable/astrid_com_gradient"
android:orientation="vertical">
<ImageView
android:id="@+id/logo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:paddingTop="95dip"
android:scaleType="center"
android:src="@drawable/astrid_com_logo_new"/>
<TextView
android:id="@+id/error"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:gravity="center"
android:textColor="#ff0000"
android:textSize="16sp"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<com.facebook.widget.LoginButton
android:id="@+id/fb_login"
android:layout_width="300dip"
android:layout_height="45dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:layout_marginBottom="15dip"
android:paddingLeft="70dip"
android:textSize="16sp"
android:gravity="left|center_vertical"
android:background="@drawable/fb_login_background"
android:textColor="@android:color/white"
android:text="@string/actfm_ALA_fb_login"
android:visibility="gone"/>
<Button
android:id="@+id/fb_login_dummy"
android:layout_width="300dip"
android:layout_height="45dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:layout_marginBottom="15dip"
android:paddingLeft="70dip"
android:textSize="16sp"
android:gravity="left|center_vertical"
android:background="@drawable/fb_login_background"
android:textColor="@android:color/white"
android:text="@string/actfm_ALA_fb_login"/>
<Button
android:id="@+id/gg_login"
android:layout_width="300dip"
android:layout_height="45dip"
android:layout_marginLeft="15dip"
android:layout_marginRight="15dip"
android:paddingLeft="70dip"
android:textSize="16sp"
android:gravity="left|center_vertical"
android:background="@drawable/google_login_background"
android:textColor="@android:color/white"
android:text="@string/actfm_ALA_gg_login"/>
<TextView
android:id="@+id/tos"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:gravity="center"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:textSize="12.5sp"
android:visibility="invisible"
android:textColor="#ffffff"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="45dip"
android:orientation="horizontal"
android:paddingLeft="40dip"
android:paddingRight="40dip">
<TextView
android:id="@+id/login_later"
android:text="@string/welcome_login_later"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:gravity="center"
android:layout_weight="1"
android:textSize="16sp"
android:textColor="#a0ffffff"
android:visibility="gone"/>
<TextView
android:id="@+id/pw_login"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_weight="1"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:text="@string/welcome_sign_in"/>
<TextView
android:id="@+id/pw_signup"
android:layout_width="fill_parent"
android:layout_height="45dip"
android:layout_weight="1"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:text="@string/welcome_login_pw"/>
</LinearLayout>
</LinearLayout>

@ -5,8 +5,6 @@
-->
<resources>
<string name="fb_app_id">183862944961271</string>
<!-- ======================================================== REMINDERS == -->
<!-- whether reminders should appear at all -->

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<com.todoroo.astrid.ui.MultilinePreference
android:key="@string/actfm_account_type"
android:title="@string/actfm_account_type"
android:enabled="false"/>
<PreferenceScreen
android:key="@string/actfm_inapp_billing"
android:title="@string/actfm_inapp_billing"
android:summary="@string/actfm_inapp_billing_summary"/>
<PreferenceCategory
android:key="@string/sync_SPr_key_options"
android:title="@string/sync_SPr_group_options">
<com.todoroo.astrid.ui.MultilineListPreference
android:key="@string/actfm_APr_interval_key"
android:entries="@array/sync_SPr_interval_entries"
android:entryValues="@array/sync_SPr_interval_values"
android:title="@string/sync_SPr_interval_title"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/actfm_https_key"
android:title="@string/actfm_https_title"
android:defaultValue="false"/>
</PreferenceCategory>
<PreferenceCategory
android:key="@string/sync_SPr_group_status"
android:title="@string/sync_SPr_group_status">
<com.todoroo.astrid.ui.MultilinePreference
android:layout="@layout/status_preference"
android:key="@string/sync_SPr_status_key"
android:textSize="24sp"
android:gravity="center"/>
<com.todoroo.astrid.ui.MultilinePreference
android:key="@string/sync_SPr_key_last_error"
android:textSize="24sp"
android:gravity="center"/>
</PreferenceCategory>
<com.todoroo.astrid.ui.MultilinePreference
android:key="@string/sync_SPr_forget_key"
android:title="@string/sync_SPr_forget"
android:summary="@string/sync_SPr_forget_description"/>
</PreferenceScreen>

@ -34,10 +34,4 @@
android:textSize="24sp"
android:gravity="center"/>
<com.todoroo.astrid.ui.MultilinePreference
android:key="@string/backup_BAc_cloud"
android:title="@string/backup_BAc_cloud"
android:textSize="24sp"
android:gravity="center"/>
</PreferenceScreen>

@ -9,7 +9,6 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.os.Bundle;
@ -33,8 +32,6 @@ import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.actfm.ActFmPreferences;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.dao.Database;

@ -58,7 +58,6 @@ import com.todoroo.andlib.sql.Join;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.actfm.CommentsActivity;
import com.todoroo.astrid.actfm.TagViewFragment;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;

@ -35,7 +35,6 @@ import com.todoroo.andlib.service.ExceptionService;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.actfm.EditPeopleControlSet;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.activity.AstridActivity;
@ -301,24 +300,8 @@ public class QuickAddBar extends LinearLayout {
}
boolean assignedToMe = usePeopleControl ? peopleControl.willBeAssignedToMe() : true;
if (!assignedToMe && !actFmPreferenceService.isLoggedIn()) {
DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
activity.startActivity(new Intent(activity, ActFmLoginActivity.class));
}
};
DialogInterface.OnClickListener cancelListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface d, int which) {
// Reset people control
peopleControl.assignToMe();
}
};
DialogUtilities.okCancelCustomDialog(activity, activity.getString(R.string.actfm_EPA_login_button),
activity.getString(R.string.actfm_EPA_login_to_share), R.string.actfm_EPA_login_button,
R.string.actfm_EPA_dont_share_button, android.R.drawable.ic_dialog_alert,
okListener, cancelListener);
// Reset people control
peopleControl.assignToMe();
return null;
}

@ -1,15 +0,0 @@
Facebook welcomes contributions to our SDKs.
All contributors must sign a CLA (contributor license agreement) here:
https://developers.facebook.com/opensource/cla
To contribute on behalf of your employer, sign the company CLA
To contribute on behalf of yourself, sign the individual CLA
All contributions:
1/ MUST be be licensed using the Apache License, Version 2.0
2/ authors MAY retain copyright by adding their copyright notice to the appropriate flies
More information on the Apache License can be found here: http://www.apache.org/foundation/license-faq.html

Binary file not shown.

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ -1,61 +0,0 @@
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE FACEBOOK PRODUCT.
-----
The following software may be included in this product: Android. This software contains the following license and notice below:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

@ -1,32 +0,0 @@
Facebook SDK for Android
========================
This open-source library allows you to integrate Facebook into your Android app.
Learn more about about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at https://developers.facebook.com/android-beta
TRY IT OUT
1. Test your install; build and run the project at facebook-android-sdk-3.0.b/samples/HelloFacebookSample (To avoid test signing issues, run this on a device that does not have Facebook for Android installed, or debug the signed sample binaries provided in facebook-android-sdk-3.0.b/bin)
2. Check-out the tutorials available online at https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
3. Start coding! Visit https://developers.facebook.com/android-beta for tutorials and reference documentation.
LICENSE
Except as otherwise noted, the Facebook SDK for Android is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
DEVELOPER TERMS
- By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about peoples use of your app. Facebook will use information received in accordance with our Data Use Policy (https://www.facebook.com/about/privacy/), including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.
- You may limit your sharing of information with us by updating the Insights control in the developer tool (https://developers.facebook.com/apps/<app_id>/advanced).
- If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.
- You agree to comply with all applicable laws and regulations and also agree to our Terms (https://www.facebook.com/policies/), including our Platform Policies (https://developers.facebook.com/policy/) and Advertising Guidelines, as applicable (https://www.facebook.com/ad_guidelines.php).
By using the Facebook SDK for Android you agree to these terms.

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (C) 2010 Facebook Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook.android">
<application/>
<uses-sdk android:minSdkVersion="8" />
</manifest>

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook.sdk"
android:versionCode="1"
android:versionName="1.0">
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name="StatusActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component>
<exclude-output/>
<contentEntry url="file://$MODULE_DIR$"/>
</component>

@ -1,20 +0,0 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

@ -1,15 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-8

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SDK Unit Tests"
/>
</LinearLayout>

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="app_name">StatusActivity</string>
</resources>

@ -1,31 +0,0 @@
/**
* Copyright 2012 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.sdk;
import android.app.Activity;
import android.os.Bundle;
public class StatusActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component>
<exclude-output/>
<contentEntry url="file://$MODULE_DIR$"/>
</component>

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ActionBarSherlock" />
</component>
</module>

@ -1,20 +0,0 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

@ -1,16 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
android.library=true
# Project target.
target=android-14
android.library.reference.1=../../actionbarsherlock/library

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/com_facebook_button_check_on" />
<item android:drawable="@drawable/com_facebook_button_check_off" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true"
android:drawable="@drawable/com_facebook_loginbutton_blue_pressed" />
<item android:state_focused="true"
android:drawable="@drawable/com_facebook_loginbutton_blue_focused" />
<item android:drawable="@drawable/com_facebook_loginbutton_blue_normal" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true"
android:drawable="@drawable/com_facebook_button_grey_pressed" />
<item android:state_focused="true"
android:drawable="@drawable/com_facebook_button_grey_focused" />
<item android:drawable="@drawable/com_facebook_button_grey_normal" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/com_facebook_picker_list_selector_disabled" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/com_facebook_picker_list_selector_disabled" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/com_facebook_picker_list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/com_facebook_picker_list_selector_background_transition" />
<item android:state_focused="true" android:drawable="@drawable/com_facebook_picker_list_focused" />
<item android:drawable="@android:color/transparent" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@android:color/transparent" />
<item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/com_facebook_picker_list_selector_disabled" />
<item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/com_facebook_picker_list_selector_disabled" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/com_facebook_picker_list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/com_facebook_picker_list_selector_background_transition" />
<item android:state_focused="true" android:drawable="@drawable/com_facebook_picker_list_focused" />
</selector>

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/com_facebook_picker_list_pressed" />
<item android:drawable="@drawable/com_facebook_picker_list_longpressed" />
</transition>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#3f5b96"
android:endColor="#2d4984"
android:angle="270"/>
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF5975b0"
android:endColor="#FF47639e"
android:angle="270"/>
</shape>

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/com_facebook_picker_top_button" />
<item android:state_focused="true"
android:drawable="@drawable/com_facebook_picker_top_button" />
<item android:state_selected="true"
android:drawable="@drawable/com_facebook_picker_top_button" />
<item
android:drawable="@drawable/com_facebook_top_background" />
</selector>

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#5774B5"
android:endColor="#2C4988"
android:gradientRadius="495"
android:type="radial"/>
</shape>

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<include layout="@layout/com_facebook_picker_title_bar_stub"/>
<ListView
android:id="@+id/com_facebook_picker_list_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="@drawable/com_facebook_list_divider"
android:fastScrollEnabled="true"
android:scrollbars="vertical"
android:listSelector="@drawable/com_facebook_picker_list_selector"
android:cacheColorHint="#FFFFFF"
/>
<ProgressBar android:indeterminate="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/com_facebook_picker_activity_circle"
style="@android:style/Widget.ProgressBar"
android:layout_centerInParent="true"
android:visibility="invisible"
/>
</RelativeLayout>

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar android:indeterminate="true"
android:layout_width="wrap_content"
android:layout_height="50dip"
android:id="@+id/com_facebook_login_activity_progress_bar"
android:layout_centerInParent="true"
android:visibility="gone"
android:indeterminateOnly="true"
/>
</RelativeLayout>

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Facebook
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="50dip"
android:layout_width="fill_parent"
>
<ProgressBar android:indeterminate="true"
android:layout_width="wrap_content"
android:layout_height="50dip"
android:id="@+id/com_facebook_picker_row_activity_circle"
style="@android:style/Widget.ProgressBar.Small"
android:layout_centerInParent="true"
android:visibility="visible"
android:indeterminateOnly="true"
/>
</RelativeLayout>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save