Skip to content

Commit

Permalink
fixing the news page
Browse files Browse the repository at this point in the history
  • Loading branch information
Turupawn committed May 23, 2016
1 parent 79088de commit 27df503
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 206 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ proguard/
.idea/libraries

.DS_Store

.idea
*.iml
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

23 changes: 0 additions & 23 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/encodings.xml

This file was deleted.

19 changes: 0 additions & 19 deletions .idea/gradle.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/scopes/scope_settings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/vcs.xml

This file was deleted.

19 changes: 0 additions & 19 deletions ItchDroid-AS.iml

This file was deleted.

97 changes: 0 additions & 97 deletions app/app.iml

This file was deleted.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "io.itch"
Expand Down
20 changes: 15 additions & 5 deletions app/src/main/java/io/itch/activities/NewsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
import io.itch.R;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;
import android.webkit.WebViewClient;

@SuppressLint("SetJavaScriptEnabled")
public class NewsActivity extends BaseActivity {

ProgressBar progressBar;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_news);
WebView webview = (WebView) findViewById(R.id.webViewNews);
progressBar = (ProgressBar) findViewById(R.id.progressBarWeb);

webview.getSettings().setJavaScriptEnabled(true);
final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBarWeb);

webview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
progressBar.setProgress(progress);
Expand All @@ -40,9 +46,14 @@ public void onProgressChanged(WebView view, int progress) {
"} catch (e) { " +
"}" +
"})();");
if (progress >= 100) {
progressBar.setVisibility(View.GONE);
}
}
});

webview.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String url) {
webView.loadUrl(url);
return true;
}
});

Expand All @@ -53,5 +64,4 @@ public void onProgressChanged(WebView view, int progress) {
protected String getScreenPath() {
return "News";
}

}

0 comments on commit 27df503

Please sign in to comment.