Open magnusfernandes opened 5 years ago
Will add this in the next version of library.
how to change the selected background color?
Any update for this feature? @iamvivekkaushik
Actually this is very easy. if you import library as module or copy library java classes, layouts and resource values you will see that
if (selectedPosition == position) { rootView.setBackground(timelineView.getResources().getDrawable(R.drawable.background_shape)); selectedView = rootView; } else { rootView.setBackground(null); }
in TimelineAdapter.java class. R.drawable.background_shape is your selected background. just change it
Also if you want to change week names and month names in your language or other language you can change lists as private static final String[] WEEK_DAYS = DateFormatSymbols.getInstance(new Locale("tr","TR")).getShortWeekdays(); private static final String[] MONTH_NAME = DateFormatSymbols.getInstance(new Locale("tr","TR")).getShortMonths();
in TimelineAdapter. for example above code shows week names and month names in Turkish. if you want you can add your Locale or use default locales
that's actually a good idea @akardas16 , but when I tried to import the module and I got this issue: A problem occurred configuring project ':datepicker'.
Could not create an instance of type com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3. org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
Isn't that means I need to downgrade my gradle version? if in that case, I think I will not do that.
that's actually a good idea @akardas16 , but when I tried to import the module and I got this issue: A problem occurred configuring project ':datepicker'.
Could not create an instance of type com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3. org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
Isn't that means I need to downgrade my gradle version? if in that case, I think I will not do that.
I didn't understand error but if you can just copy library class and resource files to your project this is will be more easy
that's actually a good idea @akardas16 , but when I tried to import the module and I got this issue: A problem occurred configuring project ':datepicker'.
Could not create an instance of type com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3. org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
Isn't that means I need to downgrade my gradle version? if in that case, I think I will not do that.
I didn't understand error but if you can just copy library class and resource files to your project this is will be more easy
I don't think it's related to gradle version
I will give a try, thanks @akardas16.
By doing some researches and I found this issue. When you update your android studio to 4.0.0, the issue LazyConfigurationUsageContext will show up. This is because the gradle version which is over 6.0.0 does not support that.
The solution is after when you tried to import the module, use finder in path and search for code line: " apply plugin: 'com.novoda.bintray-release' ".
Then these code lines(may be different value, but just remove these lines):
apply plugin: 'com.novoda.bintray-release'
publish { userOrg = 'zhihu' groupId = 'com.zhihu.android' artifactId = 'matisse' publishVersion = '0.5.2-beta4' desc = 'A well-designed local image selector for Android' website = 'https://www.zhihu.com/' }
After that you shall be able to use the latest gradle version and add the module in your project.
Latest stable versions you can use with Android Studio 4.0.1 (July 2020): ndroid Plugin version: 4.0.1 Gradle version: 6.1.1 ref: https://stackoverflow.com/a/35272475/11055217
Ability to change the background color of the selected date.