2016-06-12 18:46:19 +02:00
|
|
|
package net.foucry.pilldroid;
|
|
|
|
|
2016-06-19 01:47:30 +02:00
|
|
|
import android.graphics.Color;
|
2016-06-12 18:46:19 +02:00
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
|
import android.text.Html;
|
2016-06-14 23:41:05 +02:00
|
|
|
import android.webkit.WebView;
|
2016-06-12 18:46:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by jacques on 12/06/16.
|
|
|
|
*/
|
|
|
|
public class About extends AppCompatActivity{
|
|
|
|
|
2016-06-19 00:57:40 +02:00
|
|
|
private WebView aboutView;
|
2016-06-12 18:46:19 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.about);
|
|
|
|
|
2016-06-19 00:57:40 +02:00
|
|
|
String htmlString = null;
|
|
|
|
|
2016-06-19 01:47:30 +02:00
|
|
|
aboutView = (WebView) findViewById(R.id.aboutHtml);
|
2016-06-19 00:57:40 +02:00
|
|
|
|
|
|
|
aboutView.loadUrl("file:///android_asset/about.html");
|
|
|
|
aboutView.clearCache(true);
|
|
|
|
aboutView.clearHistory();
|
|
|
|
aboutView.getSettings().setJavaScriptEnabled(true);
|
2016-06-19 01:47:30 +02:00
|
|
|
aboutView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
|
|
|
|
aboutView.setBackgroundColor(Color.WHITE);
|
2016-06-19 00:57:40 +02:00
|
|
|
|
2016-06-14 23:41:05 +02:00
|
|
|
|
2016-06-12 18:46:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private class ImageGetter implements Html.ImageGetter {
|
|
|
|
|
|
|
|
public Drawable getDrawable(String source) {
|
|
|
|
int id;
|
|
|
|
if (source.equals("ic_launcher.png")) {
|
|
|
|
id = R.mipmap.ic_launcher;
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
Drawable d = getResources().getDrawable(id);
|
2016-06-19 00:57:40 +02:00
|
|
|
// Drawable d = ResourcesCompat.getDrawable(getResources(),id, null);
|
2016-06-12 18:46:19 +02:00
|
|
|
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|