Skip to content
Merged
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
5 changes: 0 additions & 5 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ repositories {
jcenter()
maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://dl.bintray.com/optimizely/optimizely' }
maven { url "https://jitpack.io" }
}

Expand Down Expand Up @@ -78,10 +77,6 @@ dependencies {
transitive = true;
}

compile('com.optimizely:optimizely:+@aar') {
transitive = true
}

// Provided by maven central
compile ('org.wordpress:mediapicker:1.2.4') {
exclude group:'com.android.support'
Expand Down
1 change: 0 additions & 1 deletion WordPress/gradle.properties-example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ wp.oauth.redirect_uri = http://android.wordpress.org/
wp.gcm.id = wordpress
wp.db_secret = wordpress
wp.mixpanel_token = wordpress
wp.optimizely_token = wordpress
wp.simperium.app_secret = wordpress
wp.simperium.app_name = wordpress
wp.helpshift.api.key = wordpress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
import android.text.TextUtils;
import android.widget.Toast;

import com.optimizely.Optimizely;
import com.optimizely.Variable.LiveVariable;

import org.wordpress.android.R;
import org.wordpress.android.WordPress;
import org.wordpress.android.analytics.AnalyticsTracker;
Expand Down Expand Up @@ -55,8 +52,6 @@
import java.security.GeneralSecurityException;

public class ActivityLauncher {
private static LiveVariable<Boolean> isMagicLinkEnabledVariable = Optimizely.booleanForKey("isMagicLinkEnabled", false);

public static void showSitePickerForResult(Activity activity, int blogLocalTableId) {
Intent intent = new Intent(activity, SitePickerActivity.class);
intent.putExtra(SitePickerActivity.KEY_LOCAL_ID, blogLocalTableId);
Expand Down Expand Up @@ -261,7 +256,7 @@ public static void newBlogForResult(Activity activity) {
}

public static void showSignInForResult(Activity activity) {
if (isMagicLinkEnabledVariable.get() && WPActivityUtils.isEmailClientAvailable(activity)) {
if (shouldShowMagicLinksLogin(activity)) {
Intent intent = new Intent(activity, MagicLinkSignInActivity.class);
activity.startActivityForResult(intent, RequestCodes.ADD_ACCOUNT);
} else {
Expand Down Expand Up @@ -300,4 +295,10 @@ public static void addSelfHostedSiteForResult(Activity activity) {
intent.putExtra(SignInActivity.EXTRA_START_FRAGMENT, SignInActivity.ADD_SELF_HOSTED_BLOG);
activity.startActivityForResult(intent, RequestCodes.ADD_ACCOUNT);
}

public static boolean shouldShowMagicLinksLogin(Activity activity) {
boolean isMagicLinksEnabled = false;

return isMagicLinksEnabled && WPActivityUtils.isEmailClientAvailable(activity);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import android.widget.TextView;

import com.google.android.gms.auth.api.credentials.Credential;
import com.optimizely.Optimizely;
import com.optimizely.Variable.LiveVariable;
import com.wordpress.rest.RestRequest;

import org.json.JSONException;
Expand Down Expand Up @@ -76,7 +74,6 @@

public class SignInFragment extends AbstractFragment implements TextWatcher {
public static final String TAG = "sign_in_fragment_tag";
private static LiveVariable<Boolean> isNotOnWordPressComVariable = Optimizely.booleanForKey("isNotOnWordPressCom", false);
private static final String DOT_COM_BASE_URL = "https://wordpress.com";
private static final String FORGOT_PASSWORD_RELATIVE_URL = "/wp-login.php?action=lostpassword";
private static final int WPCOM_ERRONEOUS_LOGIN_THRESHOLD = 3;
Expand Down Expand Up @@ -152,7 +149,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
mCreateAccountButton = (WPTextView) rootView.findViewById(R.id.nux_create_account_button);
mCreateAccountButton.setOnClickListener(mCreateAccountListener);
mAddSelfHostedButton = (WPTextView) rootView.findViewById(R.id.nux_add_selfhosted_button);
setDotComAddSelfHostedButtonText();
mAddSelfHostedButton.setText(getString(R.string.nux_add_selfhosted_blog));
mAddSelfHostedButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -224,14 +221,6 @@ public void onResume() {
}
}

private void setDotComAddSelfHostedButtonText() {
if (isNotOnWordPressComVariable.get()) {
mAddSelfHostedButton.setText(R.string.not_on_wordpress_com);
} else {
mAddSelfHostedButton.setText(getString(R.string.nux_add_selfhosted_blog));
}
}

/**
* Hide toggle button "add self hosted / sign in with WordPress.com" and show self hosted URL
* edit box
Expand All @@ -256,7 +245,7 @@ protected void toggleSignInMode(){

protected void showDotComSignInForm(){
mUrlButtonLayout.setVisibility(View.GONE);
setDotComAddSelfHostedButtonText();
mAddSelfHostedButton.setText(getString(R.string.nux_add_selfhosted_blog));
}

protected void showSelfHostedSignInForm(){
Expand Down Expand Up @@ -538,7 +527,6 @@ public void onSuccess(final List<Map<String, Object>> userBlogList) {
}

trackAnalyticsSignIn();
Optimizely.trackEvent("Signed In");

// get reader tags so they're available as soon as the Reader is accessed - done for
// both wp.com and self-hosted (self-hosted = "logged out" reader) - note that this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
import android.view.View;
import android.widget.TextView;

import com.optimizely.Optimizely;
import com.simperium.client.Bucket;
import com.simperium.client.BucketObjectMissingException;

import org.wordpress.android.BuildConfig;
import org.wordpress.android.GCMMessageService;
import org.wordpress.android.GCMRegistrationIntentService;
import org.wordpress.android.R;
Expand Down Expand Up @@ -57,7 +55,6 @@
import org.wordpress.android.util.ProfilingUtils;
import org.wordpress.android.util.StringUtils;
import org.wordpress.android.util.ToastUtils;
import org.wordpress.android.util.WPOptimizelyEventListener;
import org.wordpress.android.widgets.WPViewPager;

import de.greenrobot.event.EventBus;
Expand Down Expand Up @@ -188,7 +185,6 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse

if (savedInstanceState == null) {
if (AccountHelper.isSignedIn()) {
startOptimizely(true);
// open note detail if activity called from a push, otherwise return to the tab
// that was showing last time
boolean openedFromPush = (getIntent() != null && getIntent().getBooleanExtra(ARG_OPENED_FROM_PUSH,
Expand All @@ -204,23 +200,11 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse
checkMagicLinkSignIn();
}
} else {
startOptimizely(false);
ActivityLauncher.showSignInForResult(this);
}
}
}

private void startOptimizely(boolean isAsync) {
if (!BuildConfig.DEBUG) {
if (isAsync) {
Optimizely.startOptimizelyAsync(BuildConfig.OPTIMIZELY_TOKEN, getApplication(), new WPOptimizelyEventListener());
} else {
Optimizely.addOptimizelyEventListener(new WPOptimizelyEventListener());
Optimizely.startOptimizelyWithAPIToken(BuildConfig.OPTIMIZELY_TOKEN, getApplication());
}
}
}

private void setTabLayoutElevation(float newElevation){
if (mTabLayout == null) return;

Expand Down

This file was deleted.