DatePickerTimeline icon indicating copy to clipboard operation
DatePickerTimeline copied to clipboard

Selected date background color

Open magnusfernandes opened this issue 6 years ago • 10 comments

Ability to change the background color of the selected date.

magnusfernandes avatar May 20 '19 20:05 magnusfernandes

Will add this in the next version of library.

iamvivekkaushik avatar May 21 '19 04:05 iamvivekkaushik

how to change the selected background color?

ziyadrahman avatar Sep 27 '19 17:09 ziyadrahman

Any update for this feature? @iamvivekkaushik

www0488 avatar Aug 13 '20 15:08 www0488

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

akardas16 avatar Aug 13 '20 17:08 akardas16

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

akardas16 avatar Aug 13 '20 17:08 akardas16

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.

www0488 avatar Aug 14 '20 07:08 www0488

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

akardas16 avatar Aug 14 '20 07:08 akardas16

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

akardas16 avatar Aug 14 '20 07:08 akardas16

I will give a try, thanks @akardas16.

www0488 avatar Aug 14 '20 07:08 www0488

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

www0488 avatar Aug 14 '20 08:08 www0488