-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
adya1904
committed
Mar 27, 2020
1 parent
3d4ee17
commit 0f1a5db
Showing
21 changed files
with
426 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package india.coronavirus.fight; | ||
|
||
import android.graphics.Bitmap; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.webkit.WebSettings; | ||
import android.webkit.WebView; | ||
import android.webkit.WebViewClient; | ||
import android.widget.ProgressBar; | ||
|
||
import androidx.annotation.Nullable; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
public class HeatMap extends AppCompatActivity { | ||
private ProgressBar progressBar; | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.fragment_web); | ||
|
||
WebView webView = findViewById(R.id.web); | ||
progressBar = findViewById(R.id.progress_bar); | ||
webView.getSettings().setJavaScriptEnabled(true); | ||
webView.getSettings().setPluginState(WebSettings.PluginState.ON); | ||
webView.setWebViewClient(new webViewClient()); | ||
webView.loadUrl("http://ac41bf31.ngrok.io/india"); | ||
} | ||
|
||
public class webViewClient extends WebViewClient { | ||
@Override | ||
public void onPageStarted(WebView view, String url, Bitmap favicon) { | ||
// TODO Auto-generated method stub | ||
super.onPageStarted(view, url, favicon); | ||
} | ||
|
||
@Override | ||
public boolean shouldOverrideUrlLoading(WebView view, String url) { | ||
// TODO Auto-generated method stub | ||
progressBar.setVisibility(View.VISIBLE); | ||
view.loadUrl(url); | ||
return true; | ||
|
||
} | ||
|
||
@Override | ||
public void onPageFinished(WebView view, String url) { | ||
// TODO Auto-generated method stub | ||
super.onPageFinished(view, url); | ||
progressBar.setVisibility(View.GONE); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
app/src/main/java/india/coronavirus/fight/ui/heatmap/HeatMapFrgament.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package india.coronavirus.fight.ui.heatmap; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.webkit.WebSettings; | ||
import android.webkit.WebView; | ||
import android.webkit.WebViewClient; | ||
import android.widget.ProgressBar; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.fragment.app.Fragment; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
import india.coronavirus.fight.R; | ||
|
||
public class HeatMapFrgament extends Fragment { | ||
|
||
@BindView(R.id.progress_bar) | ||
ProgressBar progressBar; | ||
@BindView(R.id.web) | ||
WebView webView; | ||
|
||
@SuppressLint("SetJavaScriptEnabled") | ||
public View onCreateView(@NonNull LayoutInflater inflater, | ||
ViewGroup container, Bundle savedInstanceState) { | ||
|
||
View root = inflater.inflate(R.layout.fragment_web, container, false); | ||
ButterKnife.bind(this, root); | ||
progressBar.setVisibility(View.VISIBLE); | ||
|
||
webView.getSettings().setJavaScriptEnabled(true); | ||
webView.getSettings().setPluginState(WebSettings.PluginState.ON); | ||
webView.loadUrl("http://ac41bf31.ngrok.io/india"); | ||
webView.setWebViewClient(new WebViewClient()); | ||
return root; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.