Giter VIP home page Giter VIP logo

Comments (6)

depau avatar depau commented on May 24, 2024

Hi,
The issue is caused by an Android <4.4 limitation. Android versions before Lollipop do not support vector graphics out of the box.

I tried to keep support for Android 4.4 but there are too many differences between that version and newer ones, so I'll drop support for it with next release unless somebody is willing to send patches.

I'll keep this issue open so I remember to raise the minimum Android version required to Lollipop.

from etchdroid.

c-sanchez avatar c-sanchez commented on May 24, 2024

Maybe avoid the vector graphics usage?
At least an "special build" for android 4.4 users, like me..

from etchdroid.

depau avatar depau commented on May 24, 2024

@c-sanchez Feel free to send a pull request. It should be quite doable with compatibility library (which I'm pretty sure are already used, I might not be doing it right in that particular screen).

I'm simply not interested in it because 1) I haven't had any device running KitKat for years 2) it's like 1% of the user base.

But if anybody sends good patches I'll sure merge them.

from etchdroid.

depau avatar depau commented on May 24, 2024

Relevant code is in this layout: https://github.com/EtchDroid/EtchDroid/blob/master/app/src/main/res/layout/activity_usb_drive_picker.xml

As you can see there's a TextView with an embedded graphic drawableTop (which is vector and that doesn't work on Android <5).

You should be able to do something like this: https://github.com/Depau/POuLBITS-Android/blob/master/app/src/main/res/layout/activity_main.xml#L31

That is convert the standalone TextView to a ConstraintLayout (or another layout, whatever you prefer) containing an ImageView and a TextView without the image. In the ImageView you should be able to use the attribute app:srcCompat instead of android:src, which will be picked up by AndroidX vector compatibility libraries.

It will generate a non-vector version of the drawable that will be used instead of the vector version on older versions of Android.

Note that I enabled the Google Play Store option that automatically reduces the size of the APK when possible, so the non-vector image will only be downloaded by people using older versions of Android.

Anyway, beware that I might still think of dropping support for Android KitKat for some more reasons, namely:

As I mentioned in my development update in my blog I will be able to finish later this summer the changes I started in February, currenty pending in the development branch. If I find some way to test it on KitKat with my current hardware I definitely will keep an eye on it. But if I cannot find a way, I will have to rely on someone else or end up dropping support for it.

I would also like to implement instrumented integration tests which would be VERY helpful for problems like this. And that's going to suck because I have no idea how to emulate USB drives in a Travis CI-like environment. I'll keep you posted though.

from etchdroid.

depau avatar depau commented on May 24, 2024

Oh and, by the way, I'm quite sure that if you plug in the USB drive before starting the app, Android won't even try to render the drawable so it should not crash. That can be a nasty workaround for the time being lol

from etchdroid.

depau avatar depau commented on May 24, 2024

I eventually dropped support for Android 4.4 because of all this little issues and inconsistencies. 5.0 and up will only be supported, that is unless somebody steps in and helps me fix it. I'll close this issue for now.

from etchdroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.