diff --git a/clients/android/NewsBlur/AndroidManifest.xml b/clients/android/NewsBlur/AndroidManifest.xml
index 846bc0c75..90be916c8 100644
--- a/clients/android/NewsBlur/AndroidManifest.xml
+++ b/clients/android/NewsBlur/AndroidManifest.xml
@@ -47,18 +47,6 @@
android:name=".activity.RegisterProgress"
android:noHistory="true"
android:label="@string/get_started" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/clients/android/NewsBlur/res/layout/activity_register_progress.xml b/clients/android/NewsBlur/res/layout/activity_register_progress.xml
index 771b3b91c..d6c413340 100644
--- a/clients/android/NewsBlur/res/layout/activity_register_progress.xml
+++ b/clients/android/NewsBlur/res/layout/activity_register_progress.xml
@@ -1,18 +1,23 @@
-
+ android:orientation="vertical"
+ android:paddingHorizontal="32dp"
+ android:paddingVertical="64dp">
-
+
+
@@ -22,43 +27,13 @@
android:layout_height="40dp"
android:layout_marginRight="10dp"
android:indeterminate="true"
- app:indicatorSize="32dp"/>
+ app:indicatorSize="32dp" />
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/clients/android/NewsBlur/res/layout/activity_webcontainer.xml b/clients/android/NewsBlur/res/layout/activity_webcontainer.xml
deleted file mode 100644
index 7d847026d..000000000
--- a/clients/android/NewsBlur/res/layout/activity_webcontainer.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/clients/android/NewsBlur/res/layout/fragment_addsocial.xml b/clients/android/NewsBlur/res/layout/fragment_addsocial.xml
deleted file mode 100644
index 1febe9958..000000000
--- a/clients/android/NewsBlur/res/layout/fragment_addsocial.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/clients/android/NewsBlur/res/values/strings.xml b/clients/android/NewsBlur/res/values/strings.xml
index 99daea771..23d89a8dc 100644
--- a/clients/android/NewsBlur/res/values/strings.xml
+++ b/clients/android/NewsBlur/res/values/strings.xml
@@ -254,13 +254,6 @@
Register
There was problem registering for NewsBlur.
Let\'s get started
- Add your friends
- Connect with your friends to easily follow the stories that matter to them
- Twitter
- Facebook
- Auto-follow friends
- Add Twitter friends
- Add Facebook friends
I need to log in!
I need to register
%d public comments
diff --git a/clients/android/NewsBlur/src/com/newsblur/activity/AddFacebook.java b/clients/android/NewsBlur/src/com/newsblur/activity/AddFacebook.java
deleted file mode 100644
index e020c5ec4..000000000
--- a/clients/android/NewsBlur/src/com/newsblur/activity/AddFacebook.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.newsblur.activity;
-
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import com.newsblur.R;
-import com.newsblur.network.APIConstants;
-import com.newsblur.util.UIUtils;
-
-public class AddFacebook extends NbActivity {
-
- public static final int FACEBOOK_AUTHED = 0x21;
- private WebView webview;
-
- @Override
- protected void onCreate(Bundle bundle) {
- super.onCreate(bundle);
- setContentView(R.layout.activity_webcontainer);
-
- UIUtils.setupToolbar(this, R.drawable.logo, getString(R.string.add_facebook), true);
-
- webview = (WebView) findViewById(R.id.webcontainer);
- webview.getSettings().setJavaScriptEnabled(true);
-
- webview.setWebViewClient(new WebViewClient() {
- // this was deprecated in API 24 but the replacement only added in the same release.
- // the suppression can be removed when we move past 24
- @SuppressWarnings("deprecation")
- public boolean shouldOverrideUrlLoading(WebView view, String url){
- if (TextUtils.equals(url, APIConstants.buildUrl("/"))) {
- AddFacebook.this.setResult(FACEBOOK_AUTHED);
- AddFacebook.this.finish();
- return true;
- }
- view.loadUrl(url);
- return false;
- }
- });
-
- webview.loadUrl(APIConstants.buildUrl(APIConstants.PATH_CONNECT_FACEBOOK));
- }
-
-}
diff --git a/clients/android/NewsBlur/src/com/newsblur/activity/AddSocial.java b/clients/android/NewsBlur/src/com/newsblur/activity/AddSocial.java
deleted file mode 100644
index 55d15b8e4..000000000
--- a/clients/android/NewsBlur/src/com/newsblur/activity/AddSocial.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.newsblur.activity;
-
-import android.content.Intent;
-import android.os.Bundle;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentTransaction;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-
-import com.newsblur.R;
-import com.newsblur.fragment.AddSocialFragment;
-import com.newsblur.util.UIUtils;
-
-import dagger.hilt.android.AndroidEntryPoint;
-
-@AndroidEntryPoint
-public class AddSocial extends NbActivity {
-
- private FragmentManager fragmentManager;
- private String currentTag = "addSocialFragment";
- private AddSocialFragment addSocialFragment;
-
- @Override
- protected void onCreate(Bundle bundle) {
- super.onCreate(bundle);
- setContentView(R.layout.activity_addsocial);
-
- UIUtils.setupToolbar(this, R.drawable.logo, getString(R.string.add_friends), false);
-
- fragmentManager = getSupportFragmentManager();
-
- if (fragmentManager.findFragmentByTag(currentTag) == null) {
- FragmentTransaction transaction = fragmentManager.beginTransaction();
- addSocialFragment = new AddSocialFragment();
- transaction.add(R.id.addsocial_container, addSocialFragment, currentTag);
- transaction.commit();
- }
-
- Button nextStep = (Button) findViewById(R.id.login_addsocial_nextstep);
- nextStep.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- Intent i = new Intent(AddSocial.this, Main.class);
- i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(i);
- }
- });
-
- }
-
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
- super.onActivityResult(requestCode, resultCode, intent);
- switch (resultCode) {
- case AddTwitter.TWITTER_AUTHED:
- addSocialFragment.setTwitterAuthed();
- case AddFacebook.FACEBOOK_AUTHED:
- addSocialFragment.setFacebookAuthed();
- }
- }
-}
diff --git a/clients/android/NewsBlur/src/com/newsblur/activity/AddTwitter.java b/clients/android/NewsBlur/src/com/newsblur/activity/AddTwitter.java
deleted file mode 100644
index 5a22c425d..000000000
--- a/clients/android/NewsBlur/src/com/newsblur/activity/AddTwitter.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.newsblur.activity;
-
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import com.newsblur.R;
-import com.newsblur.network.APIConstants;
-import com.newsblur.util.UIUtils;
-
-public class AddTwitter extends NbActivity {
-
- public static final int TWITTER_AUTHED = 0x20;
- private WebView webview;
-
- @Override
- protected void onCreate(Bundle bundle) {
- super.onCreate(bundle);
- setContentView(R.layout.activity_webcontainer);
-
- UIUtils.setupToolbar(this, R.drawable.logo, getString(R.string.add_twitter), true);
-
- webview = (WebView) findViewById(R.id.webcontainer);
- webview.getSettings().setJavaScriptEnabled(true);
-
- webview.setWebViewClient(new WebViewClient() {
- // this was deprecated in API 24 but the replacement only added in the same release.
- // the suppression can be removed when we move past 24
- @SuppressWarnings("deprecation")
- public boolean shouldOverrideUrlLoading(WebView view, String url){
- if (TextUtils.equals(url, APIConstants.buildUrl("/"))) {
- AddTwitter.this.setResult(TWITTER_AUTHED);
- AddTwitter.this.finish();
- return true;
- }
- view.loadUrl(url);
- return false;
- }
- });
-
- webview.loadUrl(APIConstants.buildUrl(APIConstants.PATH_CONNECT_TWITTER));
- }
-
-}
diff --git a/clients/android/NewsBlur/src/com/newsblur/activity/RegisterProgress.kt b/clients/android/NewsBlur/src/com/newsblur/activity/RegisterProgress.kt
index 4ea6360f8..6b94c1a13 100644
--- a/clients/android/NewsBlur/src/com/newsblur/activity/RegisterProgress.kt
+++ b/clients/android/NewsBlur/src/com/newsblur/activity/RegisterProgress.kt
@@ -9,6 +9,7 @@ import androidx.lifecycle.lifecycleScope
import com.newsblur.R
import com.newsblur.databinding.ActivityRegisterProgressBinding
import com.newsblur.network.APIManager
+import com.newsblur.network.domain.RegisterResponse
import com.newsblur.util.PrefsUtils
import com.newsblur.util.executeAsyncTask
import dagger.hilt.android.AndroidEntryPoint
@@ -44,24 +45,22 @@ class RegisterProgress : FragmentActivity() {
apiManager.signup(username, password, email)
},
onPostExecute = {
- if (it.authenticated) {
- binding.viewSwitcher.showNext()
- } else {
- var errorMessage = it.errorMessage
- if (errorMessage == null) {
- errorMessage = resources.getString(R.string.register_message_error)
- }
- Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show()
- startActivity(Intent(this, Login::class.java))
- }
+ if (it.authenticated) showAuth()
+ else showError(it)
}
)
-
- binding.buttonNext.setOnClickListener { next() }
}
- private operator fun next() {
- val i = Intent(this, AddSocial::class.java)
- startActivity(i)
+ private fun showAuth() {
+ startActivity(Intent(this, Main::class.java).apply {
+ flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
+ })
+ }
+
+ private fun showError(response: RegisterResponse) {
+ val errorMessage = response.errorMessage
+ ?: resources.getString(R.string.register_message_error)
+ Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show()
+ startActivity(Intent(this, Login::class.java))
}
}
\ No newline at end of file
diff --git a/clients/android/NewsBlur/src/com/newsblur/fragment/AddSocialFragment.kt b/clients/android/NewsBlur/src/com/newsblur/fragment/AddSocialFragment.kt
deleted file mode 100644
index 48b39ac30..000000000
--- a/clients/android/NewsBlur/src/com/newsblur/fragment/AddSocialFragment.kt
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.newsblur.fragment
-
-import android.content.Intent
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.lifecycleScope
-import com.newsblur.R
-import com.newsblur.activity.AddFacebook
-import com.newsblur.activity.AddTwitter
-import com.newsblur.databinding.FragmentAddsocialBinding
-import com.newsblur.network.APIManager
-import com.newsblur.util.executeAsyncTask
-import dagger.hilt.android.AndroidEntryPoint
-import javax.inject.Inject
-
-@AndroidEntryPoint
-class AddSocialFragment : Fragment() {
-
- @Inject
- lateinit var apiManager: APIManager
-
- private lateinit var binding: FragmentAddsocialBinding
-
- private var twitterAuthed = false
- private var facebookAuthed = false
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- retainInstance = true
- }
-
- fun setTwitterAuthed() {
- twitterAuthed = true
- authCheck()
- }
-
- fun setFacebookAuthed() {
- facebookAuthed = true
- authCheck()
- }
-
- override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
- val view = inflater.inflate(R.layout.fragment_addsocial, null)
- binding = FragmentAddsocialBinding.bind(view)
- binding.addsocialTwitter.setOnClickListener {
- val i = Intent(activity, AddTwitter::class.java)
- startActivityForResult(i, 0)
- }
- binding.addsocialFacebook.setOnClickListener {
- val i = Intent(activity, AddFacebook::class.java)
- startActivityForResult(i, 0)
- }
- authCheck()
- binding.addsocialAutofollowCheckbox.setOnCheckedChangeListener { _, checked ->
- lifecycleScope.executeAsyncTask(
- doInBackground = {
- apiManager.setAutoFollow(checked)
- }
- )
- }
- return view
- }
-
- private fun authCheck() {
- if (twitterAuthed) {
- binding.addsocialTwitterText.text = "Added Twitter friends!"
- binding.addsocialTwitter.isEnabled = false
- }
- if (facebookAuthed) {
- binding.addsocialFacebookText.text = "Added Facebook friends!"
- binding.addsocialFacebook.isEnabled = false
- }
- }
-}
\ No newline at end of file
diff --git a/clients/android/NewsBlur/src/com/newsblur/network/APIConstants.java b/clients/android/NewsBlur/src/com/newsblur/network/APIConstants.java
index af64e29c3..8a5d6b926 100644
--- a/clients/android/NewsBlur/src/com/newsblur/network/APIConstants.java
+++ b/clients/android/NewsBlur/src/com/newsblur/network/APIConstants.java
@@ -35,7 +35,6 @@ public class APIConstants {
public static final String PATH_MY_PROFILE = "/social/load_user_profile";
public static final String PATH_FOLLOW = "/social/follow";
public static final String PATH_UNFOLLOW = "/social/unfollow";
- public static final String PATH_AUTOFOLLOW_PREF = "/profile/set_preference";
public static final String PATH_USER_ACTIVITIES = "/social/activities";
public static final String PATH_USER_INTERACTIONS = "/social/interactions";
public static final String PATH_RIVER_STORIES = "/reader/river_stories";
@@ -72,8 +71,6 @@ public class APIConstants {
public static final String PATH_READ_STORIES = "/reader/read_stories";
public static final String PATH_MOVE_FEED_TO_FOLDERS = "/reader/move_feed_to_folders";
public static final String PATH_SAVE_FEED_CHOOSER = "/reader/save_feed_chooser";
- public static final String PATH_CONNECT_FACEBOOK = "/oauth/facebook_connect/";
- public static final String PATH_CONNECT_TWITTER = "/oauth/twitter_connect/";
public static final String PATH_SET_NOTIFICATIONS = "/notifications/feed/";
public static final String PATH_INSTA_FETCH = "/rss_feeds/exception_retry";
public static final String PATH_RENAME_FEED = "/reader/rename_feed";
diff --git a/clients/android/NewsBlur/src/com/newsblur/network/APIManager.java b/clients/android/NewsBlur/src/com/newsblur/network/APIManager.java
index a803d502a..2f851d78b 100644
--- a/clients/android/NewsBlur/src/com/newsblur/network/APIManager.java
+++ b/clients/android/NewsBlur/src/com/newsblur/network/APIManager.java
@@ -106,13 +106,6 @@ public class APIManager {
return true;
}
- public boolean setAutoFollow(boolean autofollow) {
- ContentValues values = new ContentValues();
- values.put("autofollow_friends", autofollow ? "true" : "false");
- final APIResponse response = post(buildUrl(APIConstants.PATH_AUTOFOLLOW_PREF), values);
- return (!response.isError());
- }
-
public NewsBlurResponse markFeedsAsRead(FeedSet fs, Long includeOlder, Long includeNewer) {
ValueMultimap values = new ValueMultimap();