package uk.co.sftrabbit.stackanswers;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import uk.co.sftrabbit.stackanswers.app.DrawerActivity;

public class AuthenticationActivity extends DrawerActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_authentication);

		setDrawerIndicatorEnabled(false);

		WebView webView = (WebView) findViewById(R.id.authentication_web_view);
		webView.setWebViewClient(new WebViewClient());

		WebSettings webSettings = webView.getSettings();
		webSettings.setJavaScriptEnabled(true);

		webView.loadUrl(
			"https://stackexchange.com/oauth/dialog?" +
			"client_id=2265&" +
			"scope=read_inbox,write_access,private_info&" +
			"redirect_uri=https://stackexchange.com/oauth/login_success"
		);
	}
}

@@ -58,16 +58,55 @@
 Bundle;%0A
+import android.webkit.WebChromeClient;%0A
 import a
@@ -196,24 +196,59 @@
 ViewClient;%0A
+import android.widget.ProgressBar;%0A
 import uk.co
@@ -540,24 +540,120 @@
 ed(false);%0A%0A
+%09%09final ProgressBar progressBar =%0A%09%09%09(ProgressBar) findViewById(R.id.authentication_progress);%0A%0A
 %09%09WebView we
@@ -762,16 +762,204 @@
 ient());
+%0A%09%09webView.setWebChromeClient(new WebChromeClient() %7B%0A%09%09%09@Override%0A%09%09%09public void onProgressChanged(WebView webview, int newProgress) %7B%0A%09%09%09%09progressBar.setProgress(newProgress);%0A%09%09%09%7D%0A%09%09%7D);
 %0A%0A%09%09WebS

Update progress bar as authentication pages load