material support library, can't find Cardview/Recycleview - android

I have searched the internet but i couldn't find my answer. How can I use Card view/Recycle view they are not in my layout palette or i can't use them manually and I am using eclipse

The CardView and RecycleView are not by default in the AppCompat library. You should include the CardView and RecycleView libraries manual to your project.
Reference: https://developer.android.com/training/material/lists-cards.html#Dependencies
Gradle (using Android Studio):
dependencies {
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
}

In the layout palette there is a section called "Custom" click on the "CustomView" and you shall see all the imported views from the dependencies added in the gradle file.

my problem when adding the library was the same as this guys problem
Unable to add library to android project
so I fixed it.

Related

dependency "androidx.core:core-ui" not found

When adding constraint layout group to my project, Android studio auto add the dependency in gradle:
implementation 'androidx.core:core-ui:+'
But I've got this error message:
Failed to resolve: androidx.core:core-ui:+
I couldn't find any way to add corresponding androidx dependency, the only solution I know so far is using support lib but It against the guideline to move everything to androidx.
com.android.support:support-core-ui:28.0.0
Is there any androix dependency which includes the ConstraintLayout Group?
Use this in your app gradle file instead...
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0-alpha1'
Try adding this to your build.gradle file implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
constraint layout does not show up for me to drag it into the layout editor(3.2 canary) but I can use it by writing the code in xml and adding this library. For any other dependencies, try writing the specific dependency in gradle, it appears core-ui for androidx not working yet.
Edit:
There should be a download icon next to the dependencies you don't have. You can click on it and there will be a pop up stating the dependency name. In Studio 3.2 Canary on windows, it is not adding these dependencies automatically, which is why my solution is to implement the dependency in build.gradle manually.

Using Android Support Library

I am trying to use the support library.
I have added this dependency to the gradle file
compile 'com.android.support:appcompat-v7:23.1.1'
And I also have downloaded it in the SDK manager
But when I try to use this Control
PercentRelativeLayout it does not work. The layout xml file does not seem to recognize it . android.support.percent.PercentRelativeLayout
Any solutions please?
you need to add the dependency on your build.gradle. E.g.
com.android.support:percent:23.1.0
the appcompat's dependency is not enough. You can read more here
use this dependency in your gradle file
compile 'com.android.support:percent:23.0.0'
PercentRelativeLayout doesn't comes under support library.
There is nice samples also for percent support library, check here

Use android support v7 library classes in my library

I add android.support.v7.appcompat library in my project but I am not able to use this library class and methods in it. I have done it again and again but same problem exist any one please help me.
try adding this in your app gradle dependencies:
compile 'com.android.support:appcompat-v7:22.2.0'
for the design compile this:
compile 'com.android.support:design:22.2.0'

Include Floating Action Button library

I am a beginner at Android Studio and using the following library https://github.com/futuresimple/android-floating-action-button to add Floating Action Button into my project but I don't know how to do that. Please guide me.
Updated for AndroidX:
You can use Google's native implementation of FAB: com.google.android.material.floatingactionbutton.FloatingActionButton
Dependency: com.google.android.material:material:1.0.0
Previously (before AndroidX):
I would suggest using the Design Support Floating Action Button supplied by Google instead as seen here http://android-developers.blogspot.com/2015/05/android-design-support-library.html
add this to your gradle:
dependencies {
compile 'com.android.support:design:23.0.0'
}
and that will include the FloatingActionButton shown here: http://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html?utm_campaign=io15&utm_source=dac&utm_medium=blog
It is generally a better practice to use a supported library than a 3rd party one.
I'm a little bit late, but for those who will be looking on how to add Floating Action Button to project that requires changes in project due to recent migrations to androidx here is the answer. Instead of
com.android.support:design use new com.google.android.material:material:1.0.0-rc01:
dependencies {
implementation 'com.google.android.material:material:1.0.0-rc01'
}
After syncing project just declare FAB in your activity xml file:
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:layout_marginEnd="24dp"/>
Just add the dependency to your build.gradle:
dependencies {
compile 'com.getbase:floatingactionbutton:1.9.0'
}
To see how the buttons are added to your xml layouts, check the sample project.
For knowledge:
There are two ways you can use library:
First way, if the library owner has published library on maven central or any other repository, then we just need to use the given artifact ID in build.gradle file. Example: com.getbase:floatingactionbutton:1.9.0, com.android.support:appcompat-v7:21.0.3
Another way is to refer the library project in your project, same as what we were doing in Eclipse.

how to set dependecy of RecyclerView Of Android L in Eciplse?

Recently RecyclerView and CardView have been introduced by Android L Version.As per information that I have,The RecyclerView and CardView widgets are part of the v7 Support Libraries. To use these widgets in our project, we have add these Gradle dependencies to our app's module
dependencies {
...
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
}
so IT IS SUPPORTED TO ECLIPSE? if yes then how? or it is supported to Android Studio only? Please help me,if you know about it.
Yes, it's supported on Eclipse. But you have to add to eclipse manually (res and java code). You can download source from here.

Categories

Resources