mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Move a varaible in class definition
This commit is contained in:
parent
292a90855f
commit
ac2c829119
1 changed files with 1 additions and 26 deletions
|
@ -13,43 +13,18 @@ import android.webkit.WebView;
|
||||||
*/
|
*/
|
||||||
public class About extends AppCompatActivity{
|
public class About extends AppCompatActivity{
|
||||||
|
|
||||||
private WebView aboutView;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.about);
|
setContentView(R.layout.about);
|
||||||
|
|
||||||
String htmlString = null;
|
WebView aboutView = findViewById(R.id.aboutHtml);
|
||||||
|
|
||||||
aboutView = findViewById(R.id.aboutHtml);
|
|
||||||
|
|
||||||
aboutView.loadUrl("file:///android_asset/about.html");
|
aboutView.loadUrl("file:///android_asset/about.html");
|
||||||
aboutView.clearCache(true);
|
aboutView.clearCache(true);
|
||||||
aboutView.clearHistory();
|
aboutView.clearHistory();
|
||||||
aboutView.getSettings().setJavaScriptEnabled(true);
|
|
||||||
aboutView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
|
aboutView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
|
||||||
aboutView.setBackgroundColor(Color.WHITE);
|
aboutView.setBackgroundColor(Color.WHITE);
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ImageGetter implements Html.ImageGetter {
|
|
||||||
|
|
||||||
public Drawable getDrawable(String source) {
|
|
||||||
int id;
|
|
||||||
if (source.equals("ic_launcher-web.png")) {
|
|
||||||
id = R.drawable.ic_launcher;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Drawable d = getResources().getDrawable(id);
|
|
||||||
//Drawable d = ResourcesCompatApi21.getDrawable(getResources(),id, null);
|
|
||||||
Drawable d = ContextCompat.getDrawable(getApplicationContext(),id);
|
|
||||||
assert d != null;
|
|
||||||
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue