Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue 104 #132

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ASNECore/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply from: '../maven_push.gradle'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}

Expand Down
3 changes: 3 additions & 0 deletions facebook/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apply plugin: 'com.android.library'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
3 changes: 3 additions & 0 deletions googleplus/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply from: '../maven_push.gradle'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
*******************************************************************************/
package com.github.gorbin.asne.googleplus;

import android.content.Context;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;

import com.github.gorbin.asne.core.AccessToken;
import com.github.gorbin.asne.core.SocialNetwork;
import com.github.gorbin.asne.core.SocialNetworkException;
Expand All @@ -45,9 +44,8 @@
import com.github.gorbin.asne.core.listener.OnRequestSocialPersonsCompleteListener;
import com.github.gorbin.asne.core.persons.SocialPerson;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.UserRecoverableAuthException;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.Scopes;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
Expand All @@ -56,7 +54,6 @@
import com.google.android.gms.plus.PlusShare;
import com.google.android.gms.plus.model.people.Person;
import com.google.android.gms.plus.model.people.PersonBuffer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -68,7 +65,7 @@
* @author Anton Krasov
* @author Evgeny Gorbin ([email protected])
*/
public class GooglePlusSocialNetwork extends SocialNetwork implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
public class GooglePlusSocialNetwork extends SocialNetwork implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {

/*** Social network ID in asne modules, should be unique*/
public static final int ID = 3;
Expand Down Expand Up @@ -637,14 +634,6 @@ public void onConnectionSuspended(int i) {
mConnectRequested = false;
}

/**
* Called when the client is disconnected.
*/
@Override
public void onDisconnected() {
mConnectRequested = false;
}

/**
* Called when there was an error connecting the client to the service.
* @param connectionResult A ConnectionResult that can be used for resolving the error, and deciding what sort of error occurred.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.github.gorbin.asne.googleplus;

import com.google.android.gms.plus.model.moments.ItemScope;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -67,65 +65,4 @@ public class MomentUtil {
ACTIONS[i] = "http://schemas.google.com/" + ACTIONS[i];
}
}

/**
* Generates the "result" JSON object for select moments.
*
* @param momentType The type of the moment.
*/
public static ItemScope getResultFor(String momentType) {
if (momentType.equals("CommentActivity")) {
return getCommentActivityResult();
}
if (momentType.equals("ReserveActivity")) {
return getReserveActivityResult();
}
if (momentType.equals("ReviewActivity")) {
return getReviewActivityResult();
}
return null;
}

/**
* Generates the "result" JSON object for CommentActivity moment.
*/
private static ItemScope getCommentActivityResult() {
return new ItemScope.Builder()
.setType("http://schema.org/Comment")
.setUrl("https://developers.google.com/+/plugins/snippet/examples/blog-entry#comment-1")
.setName("This is amazing!")
.setText("I can't wait to use it on my site!")
.build();
}

/**
* Generates the "result" JSON object for ReserveActivity moment.
*/
private static ItemScope getReserveActivityResult() {
return new ItemScope.Builder()
.setType("http://schemas.google.com/Reservation")
.setStartDate("2012-06-28T19:00:00-08:00")
.setAttendeeCount(3)
.build();
}

/**
* Generates the "result" JSON object for ReviewActivity moment.
*/
private static ItemScope getReviewActivityResult() {
ItemScope rating = new ItemScope.Builder()
.setType("http://schema.org/Rating")
.setRatingValue("100")
.setBestRating("100")
.setWorstRating("0")
.build();

return new ItemScope.Builder()
.setType("http://schema.org/Review")
.setName("A Humble Review of Widget")
.setUrl("https://developers.google.com/+/plugins/snippet/examples/review")
.setText("It is amazingly effective")
.setReviewRating(rating)
.build();
}
}
3 changes: 3 additions & 0 deletions instagram/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply from: '../maven_push.gradle'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
3 changes: 3 additions & 0 deletions linkedin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply from: '../maven_push.gradle'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
3 changes: 3 additions & 0 deletions odnoklassniki/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply from: '../maven_push.gradle'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
3 changes: 3 additions & 0 deletions twitter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply from: '../maven_push.gradle'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.TextUtils;

import com.github.gorbin.asne.core.AccessToken;
import com.github.gorbin.asne.core.OAuthActivity;
import com.github.gorbin.asne.core.OAuthSocialNetwork;
Expand All @@ -44,13 +43,12 @@
import com.github.gorbin.asne.core.listener.OnRequestSocialPersonCompleteListener;
import com.github.gorbin.asne.core.listener.OnRequestSocialPersonsCompleteListener;
import com.github.gorbin.asne.core.persons.SocialPerson;

import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import twitter4j.PagableResponseList;
import twitter4j.Relationship;
import twitter4j.StatusUpdate;
Expand Down Expand Up @@ -508,9 +506,11 @@ protected Bundle doInBackground(Bundle... params) {
@Override
protected void onPostExecute(Bundle result) {
if (!handleRequestResult(result, REQUEST_LOGIN)) return;
if (mSocialNetworkManager == null) return;

if (result.containsKey(RESULT_OAUTH_LOGIN)) {
Intent intent = new Intent(mSocialNetworkManager.getActivity(), OAuthActivity.class)
WeakReference<Context> contextReference = new WeakReference<Context>(mSocialNetworkManager.getActivity());
if (result.containsKey(RESULT_OAUTH_LOGIN) && contextReference.get() != null) {
Intent intent = new Intent(contextReference.get(), OAuthActivity.class)
.putExtra(OAuthActivity.PARAM_CALLBACK, mRedirectURL)
.putExtra(OAuthActivity.PARAM_URL_TO_LOAD, result.getString(RESULT_OAUTH_LOGIN));

Expand Down
2 changes: 2 additions & 0 deletions vk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.claudiabrito'

android {
compileSdkVersion 23
Expand Down