Replacing old library with another - android

I'm new in android programming , I downloaded project that uses holoeverywhere library so I wont to know if I can replace it by another one (like ActionBarSherlock replaced by AppCompat ) ? the project uses those , how I deal with it?
import org.holoeverywhere.app.Activity;
import org.holoeverywhere.widget.LinearLayout;
import org.holoeverywhere.widget.datetimepicker.date.DatePickerDialog;
I found this tutoria here but I its not working for me !
I can replace it with new library according to my code (my imports) ?
Please I need any solution !!

Related

Cannot locate ChangeText class/symbol

I am trying to add some animation in my Android app for a text change on a TextView.
I found a post with sample:
Smooth text change in android animation
Sample code:
TransitionManager.beginDelayedTransition(transitionsContainer,
new ChangeText().setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN));
I have imported the following package:
import androidx.transition.TransitionManager;
However, when I use this, I get an error in Android Studio: Cannot resolve symbol ChangeText
What am I missing? Please help!
The original Answer mentions that a library is needed:
If you want to support Android 4+. check out the Transitions Everywhere lib. You can achieve all sorts of different animations with backward compatibility.
Here you can find some examples.
Therefore you might need to install the library via gradle and then import it like so:
import com.transitionseverywhere.ChangeText;
or
import com.transitionseverywhere.*;

Android, Type argument listadapter

so i'm following a guide online to make a room db. In the adapter section i followed his way of doing it but when i did it, i keep having the "No Type Argument expected for Interface ListAdapter".
Error example: https://imgur.com/kPT7DkE
Here's the whole project so far on github.
https://github.com/OlivierLabelle/BudgetProject/tree/master/app/src/main/java/com/example/android/budgetproject
And the guide i was following.
https://medium.com/#trionkidnapper/recyclerview-more-animations-with-less-code-using-support-library-listadapter-62e65126acdb
So with the help of devboi, i found out i was using the wrong import.
In the top right corner on the Dev documentation it show the right import.
https://imgur.com/vGrCOVd
And here how the import on my project should look like.
import android.support.v7.recyclerview.extensions.ListAdapter
Just came across this very problem myself.
If you're using AndroidX/Jetpack/whatever the official name is I'm still new at this, Android Studio might
import android.widget.ListAdapter
automatically, but the one you want is
import androidx.recyclerview.widget.ListAdapter
From what I see in your code, you should replace ListAdapter<Transaction> with ListAdapter<Transaction, Viewholder>.
You can see an example in the docs here :(https://developer.android.com/reference/android/support/v7/recyclerview/extensions/ListAdapter.html), where ListAdapter has 2 arguments inside the diamonds: one for the list-object and the other for your custom viewholder.
Hope this helps.

What is an alternative for using com.nineoldandroids library

I want to replace the dependency of com.nineoldandroids library from my project and replace it with an android native library.
I am trying to make a project based on this http://www.tutecentral.com/android-swipe-listview/ .
However, I don't need to have support for android versions less than v11. Therefore there is no need to use this library. But I cannot find what to use in its place, while not making changes to the code itself.
The project import the classes
import com.nineoldandroids.animation.Animator;
import com.nineoldandroids.animation.AnimatorListenerAdapter;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.ViewHelper;
import static com.nineoldandroids.view.ViewHelper.setAlpha;
import static com.nineoldandroids.view.ViewHelper.setTranslationX;
import static com.nineoldandroids.view.ViewPropertyAnimator.animate;
Thank you.
I had the same issue, wanted to get rid of nineoldandroids library.
As per #Selvin comment this is what you need to do:
1.) Remove all Imports
2.) Animation and ValueAnimator are available as part of the android.animation package
3.) ViewHelper doesn't really do anything that is not already available as part of each view's method.
For example:
ViewHelper.setScaleX -> view.setScaleX
ViewHelper.setY -> view.setY
ViewHelper.setAlpha -> view.setAlpha
Hope it helps.

Android L - android.graphics.outline

According to the android developer page for the developer preview of L, it's possible to use the Outline class & define outlines for view's to display the shadows in the correct way.
(http://developer.android.com/preview/material/views-shadows.html#shadows)
In my case, the "L"-sdk I use, didn't found it. Therefore I couldn't import and use the class.
According to the test project, stored in sdk/samples/android-L/ui/views/Elevation/ElevationDrag this class should be stored in "android.graphics.outline", but even in this project it can't be located correctly.
Is this feature not implemented in the developer preview yet or did I missed something?
Finally got it.
It's a bug in android studio. I just added manually the import to my activity:
import android.graphics.Outline
It will be shown as error, but it can compile & run.
I hope they will fix this soon.
EDIT: I created an issue here: https://code.google.com/p/android/issues/detail?id=72788&q=android%20studio%20android%20l&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
It looks like, they're working on it.
The same problem than you but your answer it didn't work for me, I am trying to import
import android.graphics.outline;
And de output is:
Error:(7, 24) error: cannot find symbol class outline
The build.gradleseems to be well configurated with the
compileSdkVersion 'android-L'
sentence
** Fixed
the right import is: import android.graphics.Outline;

adding jodo to android project

I am a newbie to java and android world, and I want to use 'Period ' class of 'jodo' project to calculate the differences between to dates.
I imported 'joda-time-2.1.jar' like what I read in this manual. It added a lot of pckages with white icon beside every package into 'src' folder. But when I want to use a code like the following :
Period p = new Period(startDate, endDate);
The eclipse ide cant recognize the 'jodo' package, and even if I type
import jodo.org.joda.time.*;
it will not help to make 'Period' recognizable for ide.
Regards.
i think this should recognize the Period class:
import org.joda.time.Period;

Categories

Resources