Loading packages/CaptivePortalLogin/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ <activity android:name="com.android.captiveportallogin.CaptivePortalLoginActivity" android:label="@string/action_bar_label" android:theme="@android:style/Theme.Holo" > android:theme="@style/AppTheme" > <intent-filter> <action android:name="android.intent.action.ACTION_SEND"/> <category android:name="android.intent.category.DEFAULT"/> Loading packages/CaptivePortalLogin/res/layout/activity_captive_portal_login.xml +10 −3 Original line number Diff line number Diff line Loading @@ -5,9 +5,16 @@ android:layout_height="match_parent" tools:context="com.android.captiveportallogin.CaptivePortalLoginActivity" tools:ignore="MergeRootFrame"> <RelativeLayout <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" > android:layout_height="match_parent" android:orientation="vertical" > <ProgressBar android:id="@+id/progress_bar" android:layout_width="match_parent" android:layout_height="wrap_content" style="?android:attr/progressBarStyleHorizontal" /> <WebView android:id="@+id/webview" Loading @@ -16,5 +23,5 @@ android:layout_alignParentBottom="false" android:layout_alignParentRight="false" /> </RelativeLayout> </LinearLayout> </FrameLayout> packages/CaptivePortalLogin/res/values/styles.xml +3 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Light"> <style name="AppBaseTheme" parent="@android:style/Theme.Material.Settings"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to Loading @@ -15,6 +15,8 @@ <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <!-- Setting's theme's accent color makes ProgressBar useless, reset back. --> <item name="android:colorAccent">@*android:color/material_light_blue_A200</item> </style> </resources> packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java +5 −2 Original line number Diff line number Diff line Loading @@ -26,11 +26,13 @@ import android.provider.Settings; import android.provider.Settings.Global; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; import java.io.IOException; import java.net.HttpURLConnection; Loading Loading @@ -66,7 +68,6 @@ public class CaptivePortalLoginActivity extends Activity { done(true); } requestWindowFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.activity_captive_portal_login); getActionBar().setDisplayShowHomeEnabled(false); Loading Loading @@ -164,7 +165,9 @@ public class CaptivePortalLoginActivity extends Activity { private class MyWebChromeClient extends WebChromeClient { @Override public void onProgressChanged(WebView view, int newProgress) { setProgress(newProgress*100); ProgressBar myProgressBar = (ProgressBar) findViewById(R.id.progress_bar); myProgressBar.setProgress(newProgress); myProgressBar.setVisibility(newProgress == 100 ? View.GONE : View.VISIBLE); } } } Loading
packages/CaptivePortalLogin/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ <activity android:name="com.android.captiveportallogin.CaptivePortalLoginActivity" android:label="@string/action_bar_label" android:theme="@android:style/Theme.Holo" > android:theme="@style/AppTheme" > <intent-filter> <action android:name="android.intent.action.ACTION_SEND"/> <category android:name="android.intent.category.DEFAULT"/> Loading
packages/CaptivePortalLogin/res/layout/activity_captive_portal_login.xml +10 −3 Original line number Diff line number Diff line Loading @@ -5,9 +5,16 @@ android:layout_height="match_parent" tools:context="com.android.captiveportallogin.CaptivePortalLoginActivity" tools:ignore="MergeRootFrame"> <RelativeLayout <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" > android:layout_height="match_parent" android:orientation="vertical" > <ProgressBar android:id="@+id/progress_bar" android:layout_width="match_parent" android:layout_height="wrap_content" style="?android:attr/progressBarStyleHorizontal" /> <WebView android:id="@+id/webview" Loading @@ -16,5 +23,5 @@ android:layout_alignParentBottom="false" android:layout_alignParentRight="false" /> </RelativeLayout> </LinearLayout> </FrameLayout>
packages/CaptivePortalLogin/res/values/styles.xml +3 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Light"> <style name="AppBaseTheme" parent="@android:style/Theme.Material.Settings"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to Loading @@ -15,6 +15,8 @@ <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <!-- Setting's theme's accent color makes ProgressBar useless, reset back. --> <item name="android:colorAccent">@*android:color/material_light_blue_A200</item> </style> </resources>
packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java +5 −2 Original line number Diff line number Diff line Loading @@ -26,11 +26,13 @@ import android.provider.Settings; import android.provider.Settings.Global; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; import java.io.IOException; import java.net.HttpURLConnection; Loading Loading @@ -66,7 +68,6 @@ public class CaptivePortalLoginActivity extends Activity { done(true); } requestWindowFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.activity_captive_portal_login); getActionBar().setDisplayShowHomeEnabled(false); Loading Loading @@ -164,7 +165,9 @@ public class CaptivePortalLoginActivity extends Activity { private class MyWebChromeClient extends WebChromeClient { @Override public void onProgressChanged(WebView view, int newProgress) { setProgress(newProgress*100); ProgressBar myProgressBar = (ProgressBar) findViewById(R.id.progress_bar); myProgressBar.setProgress(newProgress); myProgressBar.setVisibility(newProgress == 100 ? View.GONE : View.VISIBLE); } } }