Obsolete
Status Update
Comments
da...@gmail.com <da...@gmail.com> #2
Proof of concept demo on Github: https://github.com/casperbang/MissingNonLocalizedDrawableCrash
No problem compiling, lint'ing or running the app on a Danish device. Crash when running on a device set to any other locale.
No problem compiling, lint'ing or running the app on a Danish device. Crash when running on a device set to any other locale.
gr...@gmail.com <gr...@gmail.com> #3
I should probably generalize the translation detector's extra strings check, which is exactly this issue (but currently limited to strings checks).
si...@gmail.com <si...@gmail.com> #4
Finally got to this one. This is implemented for 3.2 canary 7 (along with a bunch of other fixes; it can now run the translation checks on the fly in the IDE; there are some quickfixes, etc.)
Here's what I get on the sample project:
> Task :app:lintDebug
/home/tnorbye/AndroidStudioProjects/bugs/MissingNonLocalizedDrawableCrash/app/src/main/res/drawable-da-xxxhdpi/sticker_ci.png: Error: The drawable "sticker_ci" in drawable-da-xxxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
Explanation for issues of type "MissingDefaultResource":
If a resource is only defined in folders with qualifiers like -land or -en,
and there is no default declaration in the base folder (layout or values
etc), then the app will crash if that resource is accessed on a device
where the device is in a configuration missing the given qualifier.
As a special case, drawables do not have to be specified in the base
folder; if there is a match in a density folder (such as drawable-mdpi)
that image will be used and scaled. Note however that if you only specify
a drawable in a folder like drawable-en-hdpi, the app will crash in
non-English locales.
There may be scenarios where you have a resource, such as a -fr drawable,
which is only referenced from some other resource with the same qualifiers
(such as a -fr style), which itself has safe fallbacks. However, this still
makes it possible for somebody to accidentally reference the drawable and
crash, so it is safer to create a default dummy fallback in the base
folder. Alternatively, you can suppress the issue by adding
tools:ignore="MissingDefaultResource" on the element.
(This scenario frequently happens with string translations, where you might
delete code and the corresponding resources, but forget to delete a
translation. There is a dedicated issue id for that scenario, with the id
ExtraTranslation.)
1 errors, 0 warnings
Thanks for the report!
Here's what I get on the sample project:
> Task :app:lintDebug
/home/tnorbye/AndroidStudioProjects/bugs/MissingNonLocalizedDrawableCrash/app/src/main/res/drawable-da-xxxhdpi/sticker_ci.png: Error: The drawable "sticker_ci" in drawable-da-xxxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
Explanation for issues of type "MissingDefaultResource":
If a resource is only defined in folders with qualifiers like -land or -en,
and there is no default declaration in the base folder (layout or values
etc), then the app will crash if that resource is accessed on a device
where the device is in a configuration missing the given qualifier.
As a special case, drawables do not have to be specified in the base
folder; if there is a match in a density folder (such as drawable-mdpi)
that image will be used and scaled. Note however that if you only specify
a drawable in a folder like drawable-en-hdpi, the app will crash in
non-English locales.
There may be scenarios where you have a resource, such as a -fr drawable,
which is only referenced from some other resource with the same qualifiers
(such as a -fr style), which itself has safe fallbacks. However, this still
makes it possible for somebody to accidentally reference the drawable and
crash, so it is safer to create a default dummy fallback in the base
folder. Alternatively, you can suppress the issue by adding
tools:ignore="MissingDefaultResource" on the element.
(This scenario frequently happens with string translations, where you might
delete code and the corresponding resources, but forget to delete a
translation. There is a dedicated issue id for that scenario, with the id
ExtraTranslation.)
1 errors, 0 warnings
Thanks for the report!
sa...@google.com <sa...@google.com> #5
Thank you for your feedback. We assure you that we are doing our best to address all issues reported. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with the bug report here https://goo.gl/TbMiIO and reference this bug for context.
wu...@gmail.com <wu...@gmail.com> #6
Text get cut off when editText set italic and Alignment.ALIGN_OPPOSITE
val paint = editText.paint
paint.textSkewX = -0.25f
editText.text.setSpan(Standard(Alignment.ALIGN_OPPOSITE), 0, textView.text.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
val paint = editText.paint
paint.textSkewX = -0.25f
editText.text.setSpan(Standard(Alignment.ALIGN_OPPOSITE), 0, textView.text.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
Description
Create a TextView with a custom or italic font such as cursive
* What was the expected result?
The text is not cut off
* What was the actual result?
The text is cut off (see screenshot)
Related StackOverflow post: