Commit 31f481a3 authored by Francisco Cunha's avatar Francisco Cunha

P4A-1012 - Change textview to webview

parent ad6897fa
......@@ -2,18 +2,16 @@ package security.pEp.ui.about
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.text.Layout.JUSTIFICATION_MODE_INTER_WORD
import android.view.MenuItem
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.text.HtmlCompat
import com.fsck.k9.R
import com.fsck.k9.pEp.PepActivity
import com.fsck.k9.view.MessageWebView
import security.pEp.ui.toolbar.ToolBarCustomizer
import javax.inject.Inject
const val GPL_LICENSE = "https://pep-security.lu/gitlab/android/pep/-/raw/develop/LICENSE"
class LicenseActivity : PepActivity() {
......@@ -28,13 +26,8 @@ class LicenseActivity : PepActivity() {
toolbarCustomizer.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary))
initializeToolbar(true, getString(R.string.license))
findViewById<TextView>(R.id.licenseText1).text = HtmlCompat.fromHtml(getString(R.string.gpl_license_1), HtmlCompat.FROM_HTML_MODE_LEGACY)
findViewById<TextView>(R.id.licenseText2).text = HtmlCompat.fromHtml(getString(R.string.gpl_license_2), HtmlCompat.FROM_HTML_MODE_LEGACY)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
findViewById<TextView>(R.id.licenseText1).justificationMode = JUSTIFICATION_MODE_INTER_WORD
findViewById<TextView>(R.id.licenseText2).justificationMode = JUSTIFICATION_MODE_INTER_WORD
}
findViewById<MessageWebView>(R.id.license_webview).blockNetworkData(false)
findViewById<MessageWebView>(R.id.license_webview).loadUrl(GPL_LICENSE)
}
override fun inject() {
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
......@@ -8,36 +7,8 @@
<include layout="@layout/simple_toolbar_layout" />
<ScrollView
<com.fsck.k9.view.MessageWebView
android:id="@+id/license_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/licenseText1"
style="@style/LightBlackText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:textSize="12sp" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/licenseText2"
style="@style/LightBlackText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:textSize="12sp" />
</LinearLayout>
</ScrollView>
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment