B3nedikt / reword

Reword is a android library to update the texts of views when the apps texts have changed due to a language change or an update of the apps string resources.
Apache License 2.0
32 stars 7 forks source link

Unable to use the actual ViewTransformer, it's always using the parent one #25

Closed Vittt2008 closed 2 years ago

Vittt2008 commented 2 years ago

Description

ViewTransformerManager has predefined ViewTransformers, so based on the code viewTransformer.viewType.isInstance(view), it finds always the first viewTransformers, so it means that the order is important.

For instance, we have CustomEditText with CustomEditTextViewTransformer, and due to the fact that EditText inherits classic Android TextView, ViewTransformerManager always return TextViewViewTransformer, but not the specific one CustomEditTextViewTransformer

Suggestion

Link To PR

Created PR: https://github.com/B3nedikt/reword/pull/24

B3nedikt commented 2 years ago

I merged your PR, thanks for your contribution :) Released with version 4.0.2