diff --git a/astrid/common-src/com/facebook/android/AuthListener.java b/astrid/common-src/com/facebook/android/AuthListener.java deleted file mode 100644 index c61589eca..000000000 --- a/astrid/common-src/com/facebook/android/AuthListener.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.facebook.android; - - -public interface AuthListener { - - public void onFBAuthSucceed(); - - public void onFBAuthFail(String error); - - public void onFBAuthCancel(); - -} diff --git a/astrid/common-src/com/facebook/android/LoginButton.java b/astrid/common-src/com/facebook/android/LoginButton.java deleted file mode 100644 index 41ec94e91..000000000 --- a/astrid/common-src/com/facebook/android/LoginButton.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 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. - */ - -package com.facebook.android; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.util.AttributeSet; -import android.view.View; -import android.widget.Button; - -import com.facebook.android.Facebook.DialogListener; - -public class LoginButton extends Button { - - public static final int REQUEST_CODE_FACEBOOK = 21421; - - private Facebook mFb; - private AuthListener mListener; - private String[] mPermissions; - private Activity mActivity; - - public LoginButton(Context context) { - super(context); - } - - public LoginButton(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public LoginButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - public void init(final Activity activity, final Facebook fb, AuthListener listener) { - init(activity, fb, listener, new String[] {}); - } - - public void init(final Activity activity, final Facebook fb, AuthListener listener, - final String[] permissions) { - mActivity = activity; - mFb = fb; - mPermissions = permissions; - mListener = listener; - - setOnClickListener(new ButtonOnClickListener()); - } - - private final class ButtonOnClickListener implements OnClickListener { - - public void onClick(View arg0) { - mFb.authorize(mActivity, mPermissions, REQUEST_CODE_FACEBOOK, - new LoginDialogListener()); - } - } - - private final class LoginDialogListener implements DialogListener { - public void onComplete(Bundle values) { - mListener.onFBAuthSucceed(); - } - - public void onFacebookError(FacebookError error) { - mListener.onFBAuthFail(error.getMessage()); - } - - public void onError(DialogError error) { - mListener.onFBAuthFail(error.getMessage()); - } - - public void onCancel() { - mListener.onFBAuthCancel(); - } - } - -} diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java index 9ea89d31e..0efa6913c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java @@ -5,12 +5,10 @@ */ package com.todoroo.astrid.actfm; -import java.io.FileNotFoundException; import java.io.IOException; -import java.net.MalformedURLException; +import java.util.Arrays; import java.util.Random; -import org.json.JSONException; import org.json.JSONObject; import android.app.AlertDialog; @@ -31,6 +29,7 @@ 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; @@ -41,13 +40,10 @@ import android.widget.ScrollView; import android.widget.TextView; import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.facebook.android.AsyncFacebookRunner; -import com.facebook.android.AsyncFacebookRunner.RequestListener; -import com.facebook.android.AuthListener; -import com.facebook.android.Facebook; -import com.facebook.android.FacebookError; -import com.facebook.android.LoginButton; -import com.facebook.android.Util; +import com.facebook.Session; +import com.facebook.SessionState; +import com.facebook.UiLifecycleHelper; +import com.facebook.widget.LoginButton; import com.google.android.googlelogin.GoogleLoginServiceConstants; import com.google.android.googlelogin.GoogleLoginServiceHelper; import com.timsu.astrid.GCMIntentService; @@ -97,7 +93,7 @@ import com.todoroo.astrid.service.TaskService; * @author Tim Su * */ -public class ActFmLoginActivity extends SherlockFragmentActivity implements AuthListener { +public class ActFmLoginActivity extends SherlockFragmentActivity { public static final String APP_ID = "183862944961271"; //$NON-NLS-1$ @@ -131,8 +127,8 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth private final ActFmInvoker actFmInvoker = new ActFmInvoker(); private Random rand; - private Facebook facebook; - private AsyncFacebookRunner facebookRunner; +// private Facebook facebook; +// private AsyncFacebookRunner facebookRunner; protected TextView errors; public static final String SHOW_TOAST = "show_toast"; //$NON-NLS-1$ @@ -173,6 +169,8 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth rand = new Random(DateUtilities.now()); + uiHelper = new UiLifecycleHelper(this, callback); + uiHelper.onCreate(savedInstanceState); initializeUI(); getWindow().setFormat(PixelFormat.RGBA_8888); @@ -196,15 +194,23 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth @Override protected void onResume() { super.onResume(); + uiHelper.onResume(); StatisticsService.sessionStart(this); } @Override protected void onPause() { super.onPause(); + uiHelper.onPause(); StatisticsService.sessionPause(); } + @Override + protected void onDestroy() { + super.onDestroy(); + uiHelper.onDestroy(); + } + @Override protected void onStop() { StatisticsService.sessionStop(this); @@ -254,16 +260,15 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth @SuppressWarnings("nls") protected void initializeUI() { - facebook = new Facebook(APP_ID); - facebookRunner = new AsyncFacebookRunner(facebook); +// facebook = new Facebook(APP_ID); +// facebookRunner = new AsyncFacebookRunner(facebook); errors = (TextView) findViewById(R.id.error); LoginButton loginButton = (LoginButton) findViewById(R.id.fb_login); if(loginButton == null) return; - loginButton.init(this, facebook, this, new String[] { "email", - "offline_access", "publish_stream" }); + loginButton.setReadPermissions(Arrays.asList("email", "offline_access", "publish_stream")); View googleLogin = findViewById(R.id.gg_login); if(AmazonMarketStrategy.isKindleFire()) @@ -474,75 +479,92 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth // --- facebook handler - public void onFBAuthSucceed() { - createUserAccountFB(); - } - - public void onFBAuthFail(String error) { - DialogUtilities.okDialog(this, getString(R.string.actfm_ALA_title), - android.R.drawable.ic_dialog_alert, error, null); - } - - @Override - public void onFBAuthCancel() { - // do nothing - } - - private ProgressDialog progressDialog; - - /** - * Create user account via FB - */ - public void createUserAccountFB() { - progressDialog = DialogUtilities.progressDialog(this, - getString(R.string.DLG_please_wait)); - facebookRunner.request("me", new SLARequestListener()); //$NON-NLS-1$ - } - - private class SLARequestListener implements RequestListener { - - @Override - public void onComplete(String response, Object state) { - JSONObject json; - try { - json = Util.parseJson(response); - String firstName = json.getString("first_name"); //$NON-NLS-1$ - String lastName = json.getString("last_name"); //$NON-NLS-1$ - String email = json.getString("email"); //$NON-NLS-1$ - - authenticate(email, firstName, lastName, ActFmInvoker.PROVIDER_FACEBOOK, - facebook.getAccessToken()); - StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_FB); - } catch (FacebookError e) { - handleError(e); - } catch (JSONException e) { - handleError(e); - } - } - - @Override - public void onFacebookError(FacebookError e, Object state) { - handleError(e); - } - - @Override - public void onFileNotFoundException(FileNotFoundException e, - Object state) { - handleError(e); + private void onSessionStateChange(Session session, SessionState state, Exception exception) { + if (state.isOpened()) { + Log.e("fb-login", "State opened"); + } else if (state.isClosed()) { + Log.e("fb-login", "State closed"); } + } - @Override - public void onIOException(IOException e, Object state) { - handleError(e); - } + private UiLifecycleHelper uiHelper; + private final Session.StatusCallback callback = new Session.StatusCallback() { @Override - public void onMalformedURLException(MalformedURLException e, - Object state) { - handleError(e); + public void call(Session session, SessionState state, Exception exception) { + onSessionStateChange(session, state, exception); } + }; - } +// public void onFBAuthSucceed() { +// createUserAccountFB(); +// } +// +// public void onFBAuthFail(String error) { +// DialogUtilities.okDialog(this, getString(R.string.actfm_ALA_title), +// android.R.drawable.ic_dialog_alert, error, null); +// } +// +// @Override +// public void onFBAuthCancel() { +// // do nothing +// } +// + private ProgressDialog progressDialog; +// +// /** +// * Create user account via FB +// */ +// public void createUserAccountFB() { +// progressDialog = DialogUtilities.progressDialog(this, +// getString(R.string.DLG_please_wait)); +// facebookRunner.request("me", new SLARequestListener()); //$NON-NLS-1$ +// } +// +// private class SLARequestListener implements RequestListener { +// +// @Override +// public void onComplete(String response, Object state) { +// JSONObject json; +// try { +// json = Util.parseJson(response); +// String firstName = json.getString("first_name"); //$NON-NLS-1$ +// String lastName = json.getString("last_name"); //$NON-NLS-1$ +// String email = json.getString("email"); //$NON-NLS-1$ +// +// authenticate(email, firstName, lastName, ActFmInvoker.PROVIDER_FACEBOOK, +// facebook.getAccessToken()); +// StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_FB); +// } catch (FacebookError e) { +// handleError(e); +// } catch (JSONException e) { +// handleError(e); +// } +// } +// +// @Override +// public void onFacebookError(FacebookError e, Object state) { +// handleError(e); +// } +// +// @Override +// public void onFileNotFoundException(FileNotFoundException e, +// Object state) { +// handleError(e); +// } +// +// @Override +// public void onIOException(IOException e, Object state) { +// handleError(e); +// } +// +// @Override +// public void onMalformedURLException(MalformedURLException e, +// Object state) { +// handleError(e); +// } +// +// } // --- utilities @@ -658,6 +680,8 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth @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; @@ -666,25 +690,27 @@ public class ActFmLoginActivity extends SherlockFragmentActivity implements Auth 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) { + } +// 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); diff --git a/facebook/CONTRIBUTING.mdown b/facebook/CONTRIBUTING.mdown new file mode 100644 index 000000000..ec5ea367e --- /dev/null +++ b/facebook/CONTRIBUTING.mdown @@ -0,0 +1,15 @@ +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 diff --git a/facebook/LICENSE.txt b/facebook/LICENSE.txt new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/facebook/LICENSE.txt @@ -0,0 +1,201 @@ + 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. diff --git a/facebook/NOTICE.txt b/facebook/NOTICE.txt new file mode 100644 index 000000000..d9493d5bc --- /dev/null +++ b/facebook/NOTICE.txt @@ -0,0 +1,61 @@ +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 diff --git a/facebook/README.md b/facebook/README.md deleted file mode 100644 index fcfc937a5..000000000 --- a/facebook/README.md +++ /dev/null @@ -1,24 +0,0 @@ -This open source Java library allows you to integrate Facebook into your Android application. Except as otherwise noted, the Facebook Android SDK is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) - -Getting Started -=============== - -See our [Android SDK Getting Started Guide](https://developers.facebook.com/docs/mobile/android/build/) - -Sample Applications -=============== - -This library includes three sample applications to guide you in development. - -* __simple__: A bare-bones app that demonstrates authorization, making API calls, and invoking a dialog. - -* __stream__: This slightly beefier application lets you view your news feed. - -* __Hackbook__: This includes Single Sign On implementation (SSO), sample API calls, and advanced features like Get new Permissions, Run sample FQL Query and Graph API Explorer. Check out [Hackbook for Android](https://developers.facebook.com/docs/mobile/android/hackbook/) - - -Report Issues/Bugs -=============== -[Bugs](https://developers.facebook.com/bugs) - -[Questions](http://facebook.stackoverflow.com/questions/tagged/android) diff --git a/facebook/README.mdown b/facebook/README.mdown new file mode 100644 index 000000000..7e4bb9b02 --- /dev/null +++ b/facebook/README.mdown @@ -0,0 +1,32 @@ +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 people’s 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//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. diff --git a/facebook/examples/Hackbook/default.properties b/facebook/examples/Hackbook/default.properties deleted file mode 100644 index 6805fb9fe..000000000 --- a/facebook/examples/Hackbook/default.properties +++ /dev/null @@ -1,14 +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 use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Indicates whether an apk should be generated for each density. -split.density=false -# Project target. -target=android-8 -android.library.reference.1=../../../newdialog/facebook-android-sdk/facebook diff --git a/facebook/examples/Hackbook/res/drawable/login_button.xml b/facebook/examples/Hackbook/res/drawable/login_button.xml deleted file mode 100644 index 73dc6c3ab..000000000 --- a/facebook/examples/Hackbook/res/drawable/login_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/facebook/examples/Hackbook/res/drawable/logout_button.xml b/facebook/examples/Hackbook/res/drawable/logout_button.xml deleted file mode 100644 index 58f57656b..000000000 --- a/facebook/examples/Hackbook/res/drawable/logout_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/facebook/examples/Hackbook/res/layout/connection_item.xml b/facebook/examples/Hackbook/res/layout/connection_item.xml deleted file mode 100644 index e556c0685..000000000 --- a/facebook/examples/Hackbook/res/layout/connection_item.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/facebook/examples/Hackbook/res/layout/fields_item.xml b/facebook/examples/Hackbook/res/layout/fields_item.xml deleted file mode 100644 index c072d7bd2..000000000 --- a/facebook/examples/Hackbook/res/layout/fields_item.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/facebook/examples/Hackbook/res/layout/friends_list.xml b/facebook/examples/Hackbook/res/layout/friends_list.xml deleted file mode 100644 index 82e565181..000000000 --- a/facebook/examples/Hackbook/res/layout/friends_list.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/facebook/examples/Hackbook/res/layout/main_list_item.xml b/facebook/examples/Hackbook/res/layout/main_list_item.xml deleted file mode 100644 index 2ac0fac97..000000000 --- a/facebook/examples/Hackbook/res/layout/main_list_item.xml +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/facebook/examples/Hackbook/res/layout/permission_item.xml b/facebook/examples/Hackbook/res/layout/permission_item.xml deleted file mode 100644 index 57eb43a8b..000000000 --- a/facebook/examples/Hackbook/res/layout/permission_item.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/facebook/examples/Hackbook/res/layout/places_list.xml b/facebook/examples/Hackbook/res/layout/places_list.xml deleted file mode 100644 index f63bb2884..000000000 --- a/facebook/examples/Hackbook/res/layout/places_list.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/facebook/examples/Hackbook/res/layout/splash.xml b/facebook/examples/Hackbook/res/layout/splash.xml deleted file mode 100644 index 211860639..000000000 --- a/facebook/examples/Hackbook/res/layout/splash.xml +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/facebook/examples/Hackbook/res/values/colors.xml b/facebook/examples/Hackbook/res/values/colors.xml deleted file mode 100644 index cb999e5cc..000000000 --- a/facebook/examples/Hackbook/res/values/colors.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - #ffffff - #000000 - #23cf34 - #E47833 - #4E78A0 - #0000FF - #FF909090 - \ No newline at end of file diff --git a/facebook/examples/Hackbook/src/com/facebook/android/BaseDialogListener.java b/facebook/examples/Hackbook/src/com/facebook/android/BaseDialogListener.java deleted file mode 100644 index dbd5b3360..000000000 --- a/facebook/examples/Hackbook/src/com/facebook/android/BaseDialogListener.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.facebook.android; - -import com.facebook.android.Facebook.DialogListener; - -/** - * Skeleton base class for RequestListeners, providing default error handling. - * Applications should handle these error conditions. - */ -public abstract class BaseDialogListener implements DialogListener { - - @Override - public void onFacebookError(FacebookError e) { - e.printStackTrace(); - } - - @Override - public void onError(DialogError e) { - e.printStackTrace(); - } - - @Override - public void onCancel() { - } - -} \ No newline at end of file diff --git a/facebook/examples/simple/AndroidManifest.xml b/facebook/examples/simple/AndroidManifest.xml deleted file mode 100644 index f647de1aa..000000000 --- a/facebook/examples/simple/AndroidManifest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/facebook/examples/simple/default.properties b/facebook/examples/simple/default.properties deleted file mode 100644 index 0f4dfe443..000000000 --- a/facebook/examples/simple/default.properties +++ /dev/null @@ -1,14 +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 use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Indicates whether an apk should be generated for each density. -split.density=false -android.library.reference.1=../../facebook/ -# Project target. -target=android-3 diff --git a/facebook/examples/simple/res/drawable/login.png b/facebook/examples/simple/res/drawable/login.png deleted file mode 100644 index 95c8dc156..000000000 Binary files a/facebook/examples/simple/res/drawable/login.png and /dev/null differ diff --git a/facebook/examples/simple/res/drawable/login_button.xml b/facebook/examples/simple/res/drawable/login_button.xml deleted file mode 100644 index 73dc6c3ab..000000000 --- a/facebook/examples/simple/res/drawable/login_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/facebook/examples/simple/res/drawable/login_down.png b/facebook/examples/simple/res/drawable/login_down.png deleted file mode 100644 index 10d216b3f..000000000 Binary files a/facebook/examples/simple/res/drawable/login_down.png and /dev/null differ diff --git a/facebook/examples/simple/res/drawable/logout.png b/facebook/examples/simple/res/drawable/logout.png deleted file mode 100644 index 290272aa0..000000000 Binary files a/facebook/examples/simple/res/drawable/logout.png and /dev/null differ diff --git a/facebook/examples/simple/res/drawable/logout_button.xml b/facebook/examples/simple/res/drawable/logout_button.xml deleted file mode 100644 index 58f57656b..000000000 --- a/facebook/examples/simple/res/drawable/logout_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/facebook/examples/simple/res/drawable/logout_down.png b/facebook/examples/simple/res/drawable/logout_down.png deleted file mode 100644 index 1ab14b9dc..000000000 Binary files a/facebook/examples/simple/res/drawable/logout_down.png and /dev/null differ diff --git a/facebook/examples/simple/res/layout/main.xml b/facebook/examples/simple/res/layout/main.xml deleted file mode 100644 index b73286a71..000000000 --- a/facebook/examples/simple/res/layout/main.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - ", - "
", - "" - }; - append(chunks); - } - - /** - * Renders a single post - * - * @param post - * @throws JSONException - */ - private void renderPost(JSONObject post) throws JSONException { - append("
"); - renderFrom(post); - renderTo(post); - renderMessage(post); - renderAttachment(post); - renderActionLinks(post); - renderLikes(post); - renderComments(post); - renderCommentBox(post); - append("
"); - } - - - /** - * Renders the author's name - * - * @param post - * @throws JSONException - */ - private void renderFrom(JSONObject post) throws JSONException { - JSONObject from = post.getJSONObject("from"); - String fromName = from.getString("name"); - String fromId = from.getString("id"); - renderAuthor(fromId, fromName); - } - - /** - * If it's a wall post on a friend's fall, renders - * the recipient's name preceded by a '>'. - * - * @param post - * @throws JSONException - */ - private void renderTo(JSONObject post) throws JSONException { - JSONObject to = post.optJSONObject("to"); - if (to != null) { - JSONObject toData = to.getJSONArray("data").getJSONObject(0); - String toName = toData.getString("name"); - String toId = toData.getString("id"); - append(" > "); - renderProfileLink(toId, toName); - } - } - - /** - * Renders a link to a user. - * - * @param id - * @param name - */ - private void renderProfileLink(String id, String name) { - renderLink(getProfileUrl(id), name); - } - - private String getProfileUrl(String id) { - return "http://touch.facebook.com/#/profile.php?id=" + id; - } - - /** - * Renders the author pic and name. - * - * @param id - * @param name - */ - private void renderAuthor(String id, String name) { - String[] chunks = { - "
", - "", - "
" - }; - append(chunks); - renderProfileLink(id, name); - } - - /** - * Renders the post message. - * - * @param post - */ - private void renderMessage(JSONObject post) { - String message = post.optString("message"); - String[] chunks = { - " ", message, "", - "
" - }; - append(chunks); - } - - /** - * Renders the attachment. - * - * @param post - */ - private void renderAttachment(JSONObject post) { - String name = post.optString("name"); - String link = post.optString("link"); - String picture = post.optString("picture"); - String source = post.optString("source"); // for videos - String caption = post.optString("caption"); - String description = post.optString("description"); - - String[] fields = new String[] { - name, link, picture, source, caption, description - }; - boolean hasAttachment = false; - for (String field : fields) { - if (field.length() != 0) { - hasAttachment = true; - break; - } - } - - if (!hasAttachment) { - return; - } - - append("
"); - if (name != "") { - append("
"); - if (link != null) { - renderLink(link, name); - } else { - append(name); - } - append("
"); - } - if (caption != "") { - append("
" + caption + "
"); - } - - if (picture != "") { - append("
"); - String img = ""; - if (link != "") { - renderLink(link, img); - } else { - append(img); - } - append("
"); - } - - if (description != "") { - append("
" + description + "
"); - } - append("
"); - } - - /** - * Renders an anchor tag - * - * @param href - * @param text - */ - private void renderLink(String href, String text) { - append(new String[] { - "", - text, - "" - }); - } - - /** - * Renders the posts' action links. - * - * @param post - */ - private void renderActionLinks(JSONObject post) { - HashSet actions = getActions(post); - append("
"); - append("
"); - renderTimeStamp(post); - append("
"); - String post_id = post.optString("id"); - if (actions.contains("Comment")) { - renderActionLink(post_id, "Comment", "comment"); - } - boolean canLike = actions.contains("Like"); - renderActionLink(post_id, "Like", "like", canLike); - renderActionLink(post_id, "Unlike", "unlike", !canLike); - - append("
"); - } - - /** - * Renders a single visible action link. - * - * @param post_id - * @param title - * @param func - */ - private void renderActionLink(String post_id, String title, String func) { - renderActionLink(post_id, title, func, true); - } - - /** - * Renders an action link with optional visibility. - * - * @param post_id - * @param title - * @param func - * @param visible - */ - private void renderActionLink(String post_id, String title, String func, - boolean visible) { - String extraClass = visible ? "" : "hidden"; - String[] chunks = new String[] { - "" - }; - append(chunks); - } - - /** - * Renders the post's timestamp. - * - * @param post - */ - private void renderTimeStamp(JSONObject post) { - String dateStr = post.optString("created_time"); - SimpleDateFormat formatter = getDateFormat(); - ParsePosition pos = new ParsePosition(0); - long then = formatter.parse(dateStr, pos).getTime(); - long now = new Date().getTime(); - - long seconds = (now - then)/1000; - long minutes = seconds/60; - long hours = minutes/60; - long days = hours/24; - - String friendly = null; - long num = 0; - if (days > 0) { - num = days; - friendly = days + " day"; - } else if (hours > 0) { - num = hours; - friendly = hours + " hour"; - } else if (minutes > 0) { - num = minutes; - friendly = minutes + " minute"; - } else { - num = seconds; - friendly = seconds + " second"; - } - if (num > 1) { - friendly += "s"; - } - String[] chunks = new String[] { - "
", - friendly, - " ago", - "
" - }; - append(chunks); - } - - /** - * Returns the available actions for the post. - * - * @param post - * @return - */ - private HashSet getActions(JSONObject post) { - HashSet actionsSet = new HashSet(); - JSONArray actions = post.optJSONArray("actions"); - if (actions != null) { - for (int j = 0; j < actions.length(); j++) { - JSONObject action = actions.optJSONObject(j); - String actionName = action.optString("name"); - actionsSet.add(actionName); - } - } - return actionsSet; - } - - /** - * Renders the 'x people like this' text, - * - * @param post - */ - private void renderLikes(JSONObject post) { - int numLikes = post.optInt("likes", 0); - if (numLikes > 0) { - String desc = numLikes == 1 ? - "person likes this" : - "people like this"; - String[] chunks = new String[] { - "
", - "", - "
", - "
", - new Integer(numLikes).toString(), - " ", - desc, - "
" - }; - append(chunks); - } - } - - /** - * Renders the post's comments. - * - * @param post - * @throws JSONException - */ - private void renderComments(JSONObject post) throws JSONException { - append("
"); - JSONObject comments = post.optJSONObject("comments"); - if (comments != null) { - JSONArray data = comments.optJSONArray("data"); - if (data != null) { - for (int j = 0; j < data.length(); j++) { - JSONObject comment = data.getJSONObject(j); - renderComment(comment); - } - } - } - append("
"); - } - - /** - * Renders an individual comment. - * - * @param comment - */ - private void renderComment(JSONObject comment) { - JSONObject from = comment.optJSONObject("from"); - if (from == null) { - Log.w("StreamRenderer", - "Comment missing from field: " + comment.toString()); - } else { - String authorId = from.optString("id"); - String authorName = from.optString("name"); - renderAuthor(authorId, authorName); - } - String message = comment.optString("message"); - append("
"); - String[] chunks = { - " ", - message, - "
" - }; - append(chunks); - } - - - /** - * Renders the new comment input box. - * - * @param post - */ - private void renderCommentBox(JSONObject post) { - String id = post.optString("id"); - String[] chunks = new String[] { - "
", - "", - "", - "
", - "
" - }; - append(chunks); - } - - - private void append(String str) { - sb.append(str); - } - - private void append(String[] chunks) { - for (String chunk : chunks) { - sb.append(chunk); - } - } -} \ No newline at end of file diff --git a/facebook/facebook/.project b/facebook/facebook/.project index fd0de1b6e..d0551a112 100644 --- a/facebook/facebook/.project +++ b/facebook/facebook/.project @@ -1,6 +1,6 @@ - facebook + FacebookSDK diff --git a/facebook/facebook/AndroidManifest.xml b/facebook/facebook/AndroidManifest.xml index e6940f838..daf6c8b4a 100644 --- a/facebook/facebook/AndroidManifest.xml +++ b/facebook/facebook/AndroidManifest.xml @@ -18,4 +18,5 @@ + diff --git a/facebook/facebook/TestApp/AndroidManifest.xml b/facebook/facebook/TestApp/AndroidManifest.xml new file mode 100644 index 000000000..cccc2923d --- /dev/null +++ b/facebook/facebook/TestApp/AndroidManifest.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/facebook/facebook/TestApp/SdkTestApp.eml b/facebook/facebook/TestApp/SdkTestApp.eml new file mode 100644 index 000000000..4104d1ffc --- /dev/null +++ b/facebook/facebook/TestApp/SdkTestApp.eml @@ -0,0 +1,5 @@ + + + + + diff --git a/facebook/facebook/TestApp/ant.properties b/facebook/facebook/TestApp/ant.properties new file mode 100644 index 000000000..b0971e891 --- /dev/null +++ b/facebook/facebook/TestApp/ant.properties @@ -0,0 +1,17 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked into Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + diff --git a/facebook/facebook/TestApp/build.xml b/facebook/facebook/TestApp/build.xml new file mode 100644 index 000000000..ea49a3fca --- /dev/null +++ b/facebook/facebook/TestApp/build.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/facebook/facebook/TestApp/proguard-project.txt b/facebook/facebook/TestApp/proguard-project.txt new file mode 100644 index 000000000..f2fe1559a --- /dev/null +++ b/facebook/facebook/TestApp/proguard-project.txt @@ -0,0 +1,20 @@ +# 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 *; +#} diff --git a/facebook/facebook/TestApp/project.properties b/facebook/facebook/TestApp/project.properties new file mode 100644 index 000000000..b0620672e --- /dev/null +++ b/facebook/facebook/TestApp/project.properties @@ -0,0 +1,15 @@ +# 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 + diff --git a/facebook/examples/stream/res/drawable-hdpi/icon.png b/facebook/facebook/TestApp/res/drawable-hdpi/ic_launcher.png similarity index 100% rename from facebook/examples/stream/res/drawable-hdpi/icon.png rename to facebook/facebook/TestApp/res/drawable-hdpi/ic_launcher.png diff --git a/facebook/examples/stream/res/drawable-ldpi/icon.png b/facebook/facebook/TestApp/res/drawable-ldpi/ic_launcher.png similarity index 100% rename from facebook/examples/stream/res/drawable-ldpi/icon.png rename to facebook/facebook/TestApp/res/drawable-ldpi/ic_launcher.png diff --git a/facebook/examples/simple/res/drawable/icon.png b/facebook/facebook/TestApp/res/drawable-mdpi/ic_launcher.png similarity index 100% rename from facebook/examples/simple/res/drawable/icon.png rename to facebook/facebook/TestApp/res/drawable-mdpi/ic_launcher.png diff --git a/facebook/facebook/TestApp/res/layout/main.xml b/facebook/facebook/TestApp/res/layout/main.xml new file mode 100644 index 000000000..da713e268 --- /dev/null +++ b/facebook/facebook/TestApp/res/layout/main.xml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/facebook/facebook/TestApp/res/values/strings.xml b/facebook/facebook/TestApp/res/values/strings.xml new file mode 100644 index 000000000..b2e26a0c0 --- /dev/null +++ b/facebook/facebook/TestApp/res/values/strings.xml @@ -0,0 +1,20 @@ + + + + + StatusActivity + diff --git a/facebook/facebook/TestApp/src/com/facebook/sdk/StatusActivity.java b/facebook/facebook/TestApp/src/com/facebook/sdk/StatusActivity.java new file mode 100644 index 000000000..d0930d9ad --- /dev/null +++ b/facebook/facebook/TestApp/src/com/facebook/sdk/StatusActivity.java @@ -0,0 +1,31 @@ +/** + * 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); + } +} diff --git a/facebook/facebook/android-sdk.eml b/facebook/facebook/android-sdk.eml new file mode 100644 index 000000000..4104d1ffc --- /dev/null +++ b/facebook/facebook/android-sdk.eml @@ -0,0 +1,5 @@ + + + + + diff --git a/facebook/facebook/ant.properties b/facebook/facebook/ant.properties new file mode 100644 index 000000000..b206ddecc --- /dev/null +++ b/facebook/facebook/ant.properties @@ -0,0 +1,2 @@ +jar.libs.dir=../lib +java.compilerargs=-Xlint -Werror \ No newline at end of file diff --git a/facebook/facebook/build.xml b/facebook/facebook/build.xml index f5238e48f..d85ad3e64 100644 --- a/facebook/facebook/build.xml +++ b/facebook/facebook/build.xml @@ -4,7 +4,7 @@ - + - - - + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_button_check_off.png b/facebook/facebook/res/drawable/com_facebook_button_check_off.png new file mode 100644 index 000000000..e9737df5c Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_button_check_off.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_button_check_on.png b/facebook/facebook/res/drawable/com_facebook_button_check_on.png new file mode 100644 index 000000000..d793151e6 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_button_check_on.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_button_grey_focused.9.png b/facebook/facebook/res/drawable/com_facebook_button_grey_focused.9.png new file mode 100644 index 000000000..56f603571 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_button_grey_focused.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_button_grey_normal.9.png b/facebook/facebook/res/drawable/com_facebook_button_grey_normal.9.png new file mode 100644 index 000000000..dff3b7d73 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_button_grey_normal.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_button_grey_pressed.9.png b/facebook/facebook/res/drawable/com_facebook_button_grey_pressed.9.png new file mode 100644 index 000000000..46648efcd Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_button_grey_pressed.9.png differ diff --git a/facebook/facebook/res/drawable/close.png b/facebook/facebook/res/drawable/com_facebook_close.png old mode 100644 new mode 100755 similarity index 60% rename from facebook/facebook/res/drawable/close.png rename to facebook/facebook/res/drawable/com_facebook_close.png index ed8b374b1..ad0147460 Binary files a/facebook/facebook/res/drawable/close.png and b/facebook/facebook/res/drawable/com_facebook_close.png differ diff --git a/facebook/facebook/res/drawable/facebook_icon.png b/facebook/facebook/res/drawable/com_facebook_icon.png similarity index 100% rename from facebook/facebook/res/drawable/facebook_icon.png rename to facebook/facebook/res/drawable/com_facebook_icon.png diff --git a/facebook/facebook/res/drawable/com_facebook_list_divider.9.png b/facebook/facebook/res/drawable/com_facebook_list_divider.9.png new file mode 100644 index 000000000..7d4c46c47 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_list_divider.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_list_section_header_background.9.png b/facebook/facebook/res/drawable/com_facebook_list_section_header_background.9.png new file mode 100644 index 000000000..1763c4a64 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_list_section_header_background.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_loginbutton_blue.xml b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue.xml new file mode 100644 index 000000000..8dba4d0ac --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_focused.png b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_focused.png new file mode 100644 index 000000000..218b6e5d1 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_focused.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_normal.png b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_normal.png new file mode 100644 index 000000000..121741085 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_normal.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_pressed.png b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_pressed.png new file mode 100644 index 000000000..218b6e5d1 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_loginbutton_blue_pressed.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_loginbutton_silver.xml b/facebook/facebook/res/drawable/com_facebook_loginbutton_silver.xml new file mode 100644 index 000000000..4ecb0c8c7 --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_loginbutton_silver.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_logo.png b/facebook/facebook/res/drawable/com_facebook_logo.png new file mode 100644 index 000000000..785acf9ea Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_logo.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_picker_item_background.xml b/facebook/facebook/res/drawable/com_facebook_picker_item_background.xml new file mode 100644 index 000000000..005870250 --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_picker_item_background.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_picker_list_focused.9.png b/facebook/facebook/res/drawable/com_facebook_picker_list_focused.9.png new file mode 100644 index 000000000..7c0599e3a Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_picker_list_focused.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_picker_list_longpressed.9.png b/facebook/facebook/res/drawable/com_facebook_picker_list_longpressed.9.png new file mode 100644 index 000000000..3bf8e0362 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_picker_list_longpressed.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_picker_list_pressed.9.png b/facebook/facebook/res/drawable/com_facebook_picker_list_pressed.9.png new file mode 100644 index 000000000..6e77525d2 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_picker_list_pressed.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_picker_list_selector.xml b/facebook/facebook/res/drawable/com_facebook_picker_list_selector.xml new file mode 100644 index 000000000..ce9ed5ba8 --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_picker_list_selector.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_picker_list_selector_background_transition.xml b/facebook/facebook/res/drawable/com_facebook_picker_list_selector_background_transition.xml new file mode 100644 index 000000000..0e4aa8eb8 --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_picker_list_selector_background_transition.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_picker_list_selector_disabled.9.png b/facebook/facebook/res/drawable/com_facebook_picker_list_selector_disabled.9.png new file mode 100644 index 000000000..42cb6463e Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_picker_list_selector_disabled.9.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_picker_top_button.xml b/facebook/facebook/res/drawable/com_facebook_picker_top_button.xml new file mode 100644 index 000000000..4b7a7caa9 --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_picker_top_button.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_place_default_icon.png b/facebook/facebook/res/drawable/com_facebook_place_default_icon.png new file mode 100644 index 000000000..97ec3e608 Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_place_default_icon.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_profile_default_icon.png b/facebook/facebook/res/drawable/com_facebook_profile_default_icon.png new file mode 100644 index 000000000..15864ccdb Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_profile_default_icon.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_profile_picture_blank_portrait.png b/facebook/facebook/res/drawable/com_facebook_profile_picture_blank_portrait.png new file mode 100644 index 000000000..107d7f89e Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_profile_picture_blank_portrait.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_profile_picture_blank_square.png b/facebook/facebook/res/drawable/com_facebook_profile_picture_blank_square.png new file mode 100644 index 000000000..8b4a76a0e Binary files /dev/null and b/facebook/facebook/res/drawable/com_facebook_profile_picture_blank_square.png differ diff --git a/facebook/facebook/res/drawable/com_facebook_top_background.xml b/facebook/facebook/res/drawable/com_facebook_top_background.xml new file mode 100644 index 000000000..2f598d5f2 --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_top_background.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_top_button.xml b/facebook/facebook/res/drawable/com_facebook_top_button.xml new file mode 100644 index 000000000..479e8596d --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_top_button.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/facebook/facebook/res/drawable/com_facebook_usersettingsfragment_background_gradient.xml b/facebook/facebook/res/drawable/com_facebook_usersettingsfragment_background_gradient.xml new file mode 100644 index 000000000..44c1a3c9a --- /dev/null +++ b/facebook/facebook/res/drawable/com_facebook_usersettingsfragment_background_gradient.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/facebook/facebook/res/layout/com_facebook_friendpickerfragment.xml b/facebook/facebook/res/layout/com_facebook_friendpickerfragment.xml new file mode 100644 index 000000000..76b50c1d5 --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_friendpickerfragment.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + diff --git a/facebook/facebook/res/layout/com_facebook_login_activity_layout.xml b/facebook/facebook/res/layout/com_facebook_login_activity_layout.xml new file mode 100644 index 000000000..09b28999f --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_login_activity_layout.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_activity_circle_row.xml b/facebook/facebook/res/layout/com_facebook_picker_activity_circle_row.xml new file mode 100644 index 000000000..29e8bc81b --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_activity_circle_row.xml @@ -0,0 +1,32 @@ + + + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_checkbox.xml b/facebook/facebook/res/layout/com_facebook_picker_checkbox.xml new file mode 100644 index 000000000..8adf7b3d7 --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_checkbox.xml @@ -0,0 +1,25 @@ + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_image.xml b/facebook/facebook/res/layout/com_facebook_picker_image.xml new file mode 100644 index 000000000..7793e3b3e --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_image.xml @@ -0,0 +1,24 @@ + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_list_row.xml b/facebook/facebook/res/layout/com_facebook_picker_list_row.xml new file mode 100644 index 000000000..8f439bfe0 --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_list_row.xml @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_list_section_header.xml b/facebook/facebook/res/layout/com_facebook_picker_list_section_header.xml new file mode 100644 index 000000000..cfb18beb9 --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_list_section_header.xml @@ -0,0 +1,34 @@ + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_search_box.xml b/facebook/facebook/res/layout/com_facebook_picker_search_box.xml new file mode 100644 index 000000000..786668e78 --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_search_box.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/facebook/facebook/res/layout/com_facebook_picker_title_bar.xml b/facebook/facebook/res/layout/com_facebook_picker_title_bar.xml new file mode 100644 index 000000000..bcd3141f7 --- /dev/null +++ b/facebook/facebook/res/layout/com_facebook_picker_title_bar.xml @@ -0,0 +1,63 @@ + + + + +