last day (14 days later) » 

12:15
6
A: VectorDrawable Backwards Compatibility And Installing Unofficial Support Libraries

Mikelis KanepsHere is a option that worked for me Use this library - https://github.com/wnafee/vector-compat (api 14+) android { // use version 22 or higher buildToolsVersion "22.0.1" ... } dependencies { compile 'com.wnafee:vector-compat:1.0.5' ... } And create a custom ImageView class ...

Add the dependencies in gradle file, add the class, add vector image in drawable folder, and use SVGImageView instead of ImageView, in packagename set your package where you added the SVGImageView. logo_dimen = 20dp, view_port_dimen_logo = 25
Hi, can I use this library in my Eclipse project. I can't use Android Studio at the moment. I am using Eclipse.
@Solace it is possible to use Gradle in Eclipse, with tools like gradle.org/eclipse, but you can always just copy paste the code from the lib
I have been trying to use Gradle in Eclipse using the Buildship plugin, but when I try to import the AS project of this library, it fails with the error Synchronize Gradle builds with Workspace failed due to an error in the referenced Gradle build.... I want to copy the project in Eclipse, but I am not sure about the dependencies declared in its build.gradle. I posted a question here. I'll be very thankful if you can take a look?
12:15
@MikelisKaneps I did that. I am getting a strange error at line 84 of this file: The return type is incompatible with Drawable.setLayoutDirection(int)
@Solace yes, I see. Just comment out that method, you don't need it probably.
Now I have got many compiler errors like "Call requires <later version>. Current is 14". I think it's time for me to start looking for an alternate to vector drawables for my app.
@Solace Library min sdk is 14, it should work at 14.
@MikelisKaneps Yeah but complains. Actually there should be no errors at all as I copy-pasted all files, but it complains.
@MikelisKaneps I think it has to do with dependencies of the library project mentioned in the end of this build.gradle file.
I need more information to help you, can you upload a screenshot or paste the code where the problem is
12:21
Yes. Please give me a minute.
Please see "Edit 1" in this question: stackoverflow.com/questions/38477849/…
The error is in file "AnimatedVectorDrawable.java".
Have you added android.support.v4 to your Eclipse project?
can you show source code of AnimatedVectorDrawable and VectorDrawable you have copied is your project?
12:41
Yes. Please give me a minute
By the way I downloaded the project and copied the .java files from it to my Eclipse project's directory. So the files are the same as those in Github.
it is not going to make it worse, if I check them anyway.
maybe you imported something different
why is the package the same as in github, it should be your project package if it is copied inside it.
12:49
I gave my project this same name.
package*
Just posted a screenshot showing my project structure (including names) here in "Edit 2": stackoverflow.com/questions/38477849/…
can you just comment out the methods, I can' t find the reason for the error at the moment
?
Lemme try that.
The errors are gone
Thank you so much.
I am now trying to use it in a test project. I hope that works
13:08
use the correct syntax for vector files only.
Here a example file -

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:width="100dp"
android:height="100dp"
android:viewportHeight="100"
android:viewportWidth="100"
app:vc_viewportHeight="100"
app:vc_viewportWidth="100">


<path
android:name="1"
android:fillColor="@color/white"
android:pathData="M 49.888887 2.5 C 76.122412617 2.5 97.388887 23.766474383 97.388887 50 C 97.388887 76.233525617 76.122412617 97.5 49.888887 97.5 C 23.65
Oh no
As soon as I added the vector-compat library to my just-created test project, I got a ton of errors
Pasted them here pastebin.com/BLujF3c8
Ok those errors are gone.
Now I am getting "<vector> requires API level 21 (current min is 14)" on the first line of vector drawable xml
13:25
Ignore that error, it doesn't apply
It's a compiler error. Because of it, the R file of the project is gone. How do I ignore it
I don't know how to do it in Eclipse, I haven't used it in ages, but vector file is valid.
have you added it to drawable folder?
res/drawable/vector_file.xml
Yes
have you added <?xml version="1.0" encoding="utf-8"?> ?
Oh yes
Copied yours
here is the file:
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:width="300dp"
android:height="300dp"
android:viewportWidth="600"
android:viewportHeight="600"

app:vc_viewportWidth="600"
app:vc_viewportHeight="600">
<group
android:name="rotationGroup"
android:pivotX="0"
android:pivotY="0"
android:rotation="0">

<path
android:name="v"
android:fillColor="#fff"
android:pathData="m15.5,15.6c0,-1.5 2.8,-1.9 2.8,-5c0,-1.5 -0.7,-2.6 -1.8,-3.5h1.6l1.7,-1.1h-5c-1.7,0 -3.5,0.4 -4.8,1.6c-1,0.8 -1.6,2.1
13:34
have you added support library to your project?
Yep.
=(
remove Lint markers or disable them in your Eclipse project
I know this will be done by
xmlns:tools="http://schemas.android.com/tools"
tools:ignore=""
but I can't find value to use for tools:ignore
8
Q: Is there a way to disable the xml warnings?

Genia S.I just did an update of my SDK and now eclipse is giving me all sorts of totally unwanted warnings in my xml... for example I have a RelativeLayout that doesn't have an id or a background (it's actually a transparent button) and eclipse is warning me that it's a useless element. Is there a way t...

13:49
Hey do I use this drawable normally
<ImageView
...
android:background="@drawable/vector" />
Like this?
Yes I disabled the warnings
 
2 hours later…
15:31
Check my original answer in stackoverflow.

last day (14 days later) »