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

Updated ViewTransformerManager for using the most accurate ViewTransformer #24

Closed Vittt2008 closed 2 years ago

Vittt2008 commented 2 years ago

Description

Based on the code viewTransformer.viewType.isInstance(view), it finds always the firsts viewTransformers, so it means that the order is important and we can't specify viewTransformers for some inheritors.

This PR is fixing the problem. Firstly we're trying to find the most specific and accurate viewTransformers and if it's impossible, then we're trying to find the parent one.

Summary of changes

codecov-commenter commented 2 years ago

Codecov Report

Merging #24 (d39d3f6) into master (5189bb5) will not change coverage. The diff coverage is 0.00%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #24   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          20      20           
  Lines         279     280    +1     
  Branches       81      81           
======================================
- Misses        279     280    +1     
Impacted Files Coverage Δ
...java/dev/b3nedikt/reword/ViewTransformerManager.kt 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5189bb5...d39d3f6. Read the comment docs.