Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes on pre-Lollipop #45

Closed
ClaudeHangui opened this issue Mar 13, 2017 · 10 comments
Closed

App crashes on pre-Lollipop #45

ClaudeHangui opened this issue Mar 13, 2017 · 10 comments

Comments

@ClaudeHangui
Copy link

I ran the app on a samsung device (kitkat) and the app crashed.
I cloned the project and launched it on kitkat device the app crashed. I created a new project, went the other way round i.e I added the library in the gradle file I still got the same crash .. Beyond api 19 it seems to work. I tested using the sample and by creating a custom project (and hence importing the library in the gradle file) it works perfectly .....

The error is on the MainActivity:
this is the line where the error points to: super.onCreate(savedInstanceState);

Exception while inflating org.xmlpull.v1.XmlPullParserException: Binary XML file line #17 tag requires viewportHeight > 0

Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052

Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector

@takahirom
Copy link
Owner

The cause of the crash is obviously VectorDrawable.
This library is irrelevant.

FYR
https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#.t5ojhmpum

@ClaudeHangui
Copy link
Author

ClaudeHangui commented Mar 13, 2017

Yeah....I just saw that:
However as per the official documentation from google
all you need to do (i.e if you want to support vector drawables for pre-lolipop) is to add
vectorDrawables.useSupportLibrary = true
to in your gradle file
Moreover you need to use the new app:srcCompat attribute. So, instead of using:

<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/triangle"/>

you should use

<ImageView android:layout_width="match_parent" android:layout_height="match_parent" app:srcCompat="@drawable/triangle"/>

I applied the changes and it now works on my kitkat device

@takahirom
Copy link
Owner

I don't know that documentation!
Thanks

@ClaudeHangui
Copy link
Author

So one more thing: How will I go about to transition text together with images ???

i.e if I have a list of items where each item has an image (on the left) and some text (on the right).

A click on an item should provide a transition for both the image and the text: i.e on opening a new fragment which provides the details for that item, the image moves up (as per the demo), meanwhile the text moves down i.e below the image.
Can the library solve this problem ???

@takahirom
Copy link
Owner

Can you upload screen shot?

@ClaudeHangui
Copy link
Author

Hi, I think this link speaks more than a plain, still screenshot :)...

Of course the textview doesn't have a "perfect animation" but the idea (at least from my perspective) is to see it popping out from the bottom...

you can check out the AndroidAuthority app which gives a perfect illustration of what i'm talking about

@ClaudeHangui
Copy link
Author

ClaudeHangui commented Mar 13, 2017

Simply put: how do I accomplish what we see (the transition/animation effect) on the gif file you provided as an illustration of how the library works ?

@takahirom
Copy link
Owner

You can do that following code

view.setTraslateY(2000);// screen height
view.animate().translationY(0);

@ClaudeHangui
Copy link
Author

thanks....but where exactly do I add these lines of code ??
Moreover from your ActivityTransitionLauncher and FragmentTransitionLauncher classes how do I include the textview when I call from(View fromView) method in my code ??

@takahirom
Copy link
Owner

takahirom commented Mar 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants