mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-09 23:41:08 +01:00
About avec HTML (mais sans image)
This commit is contained in:
parent
2c5025985e
commit
70db533060
3 changed files with 28 additions and 10 deletions
|
@ -4,7 +4,8 @@ import android.graphics.drawable.Drawable;
|
|||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.Html;
|
||||
import android.widget.TextView;
|
||||
import android.text.Spanned;
|
||||
import android.webkit.WebView;
|
||||
|
||||
/**
|
||||
* Created by jacques on 12/06/16.
|
||||
|
@ -21,8 +22,11 @@ public class About extends AppCompatActivity{
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.about);
|
||||
|
||||
TextView htmlTextView = (TextView)findViewById(R.id.aboutHtml);
|
||||
htmlTextView.setText(Html.fromHtml(htmlText, new ImageGetter(), null));
|
||||
String htmlAsString = getString(R.string.html);
|
||||
Spanned htmlAsSpanned = Html.fromHtml(htmlAsString);
|
||||
|
||||
WebView webView = (WebView) findViewById(R.id.aboutHtml);
|
||||
webView.loadDataWithBaseURL(null, htmlAsString, "text/html", "utf-8", null);
|
||||
}
|
||||
|
||||
private class ImageGetter implements Html.ImageGetter {
|
||||
|
|
|
@ -3,13 +3,7 @@
|
|||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/aboutTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about"/>
|
||||
|
||||
<TextView
|
||||
<WebView
|
||||
android:id="@+id/aboutHtml"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
|
|
@ -128,4 +128,24 @@
|
|||
<string name="msgNotFound">Médicament introuvable dans la base de données</string>
|
||||
<string name="about">À propos</string>
|
||||
<string name="help">Aide</string>
|
||||
<string name="html">
|
||||
<![CDATA[
|
||||
<h1>À propos de PillDroid</h1>
|
||||
<h2>Gestion de stock de médicaments</h2>
|
||||
<p>This is some html. Look, here\'s an <u>underline</u>.</p>
|
||||
<p>Look, this is <em>emphasized.</em> And here\'s some <b>bold</b>.</p>
|
||||
<p>This is a UL list:
|
||||
<ul>
|
||||
<li>One</li>
|
||||
<li>Two</li>
|
||||
<li>Three</li>
|
||||
</ul>
|
||||
<p>This is an OL list:
|
||||
<ol>
|
||||
<li>One</li>
|
||||
<li>Two</li>
|
||||
<li>Three</li>
|
||||
</ol>
|
||||
]]>
|
||||
</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue