anurag1203 / android-dateslider

Automatically exported from code.google.com/p/android-dateslider
0 stars 0 forks source link

Support for using DateSlider as library #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
To reproduce the problem:
1. In eclipse, right click DateSlider project, select properties.
2. Choose Android and check Is Library.
3. Right click the project you want to use the lib in and select properties. 
Choose Android->Add... and select DateSlider

I would expect that the Android eclipse plugin would add the DateSlider source 
and R.java to the project i want to use it in (see attached picture). Instead I 
get many error messages which i think means that the R.java isn't generated. 
Errormsg: "...res\layout\timeslider.xml:13: error: No resource identifier found 
for attribute 'childWidth' in package 
'com.googlecode.android.widgets.DateSlider'"

It would be very nice to have this working. Dunno what causes this to happen. 
It works awesome with Cyril Mottier's GreenDroid. Check it out

Original issue reported on code.google.com by kristian@hellang.com on 19 Jul 2011 at 2:26

Attachments:

GoogleCodeExporter commented 8 years ago
I have not tested it myself but the fork at
https://github.com/Fusion/DateSlider
should be able to include as a library.

Original comment by bennyhan...@gmail.com on 24 Aug 2011 at 7:31

GoogleCodeExporter commented 8 years ago
I'm also using GreenDroid! To fix this issue (so the project can be included as 
a library) you can simply comment out all the functions in Demo.java or delete 
the file. Hope this helps.

Original comment by zach...@gmail.com on 28 Sep 2011 at 2:38

GoogleCodeExporter commented 8 years ago
Removed Demo.java but still does not work (errors continue to show up)

Original comment by thiago.a...@generaltech.com.br on 1 Oct 2011 at 10:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This appears to be an issue with the Android SDK: 
http://code.google.com/p/android/issues/detail?id=9656

The temporary work-around is to reference it as a library, copy all of the 
layout xml files into your res/layout folder and modify them so that the 
xmlns:app property references your namespace.

I wrote an ant task to take care of the manual labor which you can read about 
here: 
http://blog.patrickbaumann.com/2011/10/android-widghets-and-library-projects/

Original comment by baumann...@gmail.com on 21 Oct 2011 at 4:57

GoogleCodeExporter commented 8 years ago
The latest SDK tools "added support for custom views with custom attributes in 
libraries".

I updated to Android SDK Tool v17 and Eclipse ADT v17. 
I replaced in the layout files 
xmlns:app="http://schemas.android.com/apk/res/com.googlecode.android.widgets.Dat
eSlider" with
xmlns:app="http://schemas.android.com/apk/res-auto"

Now I can use DateSlider as library project. 

Original comment by michael....@gmail.com on 27 Mar 2012 at 12:10

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Still doesn't work and I am using SDK Tool v19 and ADT 18... but I did find a 
solution, once you set it as a library project look in the bin directory, you 
should find a dateslider.jar file. Added that to your project and viola it 
works.

Original comment by grnd...@gmail.com on 13 May 2012 at 8:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I used michaels suggestion in comment 6 and it does work, I wonder what the 
real fix is though...

Original comment by grnd...@gmail.com on 14 May 2012 at 1:48

GoogleCodeExporter commented 8 years ago
+1 for michael's fix in comment #6, worked like a charm for me. using r19 and 
not using DateSlider as a library but incorporated all java/xml files into my 
project and changed package names.

Original comment by wocks...@gmail.com on 12 Jun 2012 at 9:15

GoogleCodeExporter commented 8 years ago
I did run into the same problem when working with DateSlider as Library.
These errors about resource identifier not found ....
The way recommneded in post#6 works (Comment 6 by michael....@gmail.com, Mar 
27, 2012)

Thank you Michael :) you saved my day :">

Original comment by trantoan...@gmail.com on 4 Sep 2012 at 3:38