Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Do not change the font. #180

Open
TikTak123 opened this issue Dec 18, 2019 · 0 comments
Open

Do not change the font. #180

TikTak123 opened this issue Dec 18, 2019 · 0 comments

Comments

@TikTak123
Copy link

I use the conductor framework in my project to replace fragment. I change the font in my project, but the font does not change only in the HtmlTextView.

class MainActivity : AppCompatActivity() {

    private lateinit var router: Router

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        router = Conductor.attachRouter(this, container, savedInstanceState)

        if (!router.hasRootController())
            router.setRoot(RouterTransaction.with(HomeController()))
    }

    override fun onBackPressed() {
        if (!router.handleBack())
            super.onBackPressed()
    }
}
class HomeController : Controller() {
    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
        val view = inflater.inflate(R.layout.controller_home, container, false)
        
        view.htmlTextView.setHtml("Hello <b>World</b> Hello")

        return view
    }
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <org.sufficientlysecure.htmltextview.HtmlTextView
        android:id="@+id/htmlTextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="@android:color/black"
        android:textSize="24sp" />
</LinearLayout>

Screenshot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant