Good night, I want to put a gif that appears until the page in webview is loaded completely ... the gif already has, I put a compile and I got the github code, my problem is that I am not able to run the gif before the web view. My plan is as follows, I want the gif to load until the webview page is 100% complete.
But I can not, does anyone help me?
code:
private WebView web;
private ImageView gif;
private String [] permissoesNecessarias = new String[]{
Manifest.permission.SEND_SMS,
Manifest.permission.INTERNET
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_mega_sena);
PermissionAction.validaPermissoes(1, this, permissoesNecessarias);
web = (WebView) findViewById(R.id.web_resultados);
gif = (ImageView) findViewById(R.id.imageView4);
web.setWebChromeClient(new WebChromeClient(){
public void onProgressChanged(WebView view, int progress){
if(progress == 100){
web.getSettings().setJavaScriptEnabled(true);
web.loadUrl("http://loterias.caixa.gov.br/wps/portal/loterias/landing/megasena#resultados");
Glide.with(getApplicationContext()).load(R.drawable.gif_loading).asGif().into(gif);
}else{
}
}
});
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Detail: After the webview uploaded, the gif appears next ...