kandi background
Explore Kits

MaterialDateTimePicker | Pick a date or time on Android in style | Android library

 by   wdullaer Java Version: v4.2.3 License: Apache-2.0

 by   wdullaer Java Version: v4.2.3 License: Apache-2.0

Download this library from

kandi X-RAY | MaterialDateTimePicker Summary

MaterialDateTimePicker is a Java library typically used in Mobile, Android applications. MaterialDateTimePicker has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.
Pick a date or time on Android in style
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • MaterialDateTimePicker has a medium active ecosystem.
  • It has 4580 star(s) with 961 fork(s). There are 110 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 71 open issues and 501 have been closed. On average issues are closed in 23 days. There are 28 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of MaterialDateTimePicker is v4.2.3
This Library - Support
Best in #Android
Average in #Android
This Library - Support
Best in #Android
Average in #Android

quality kandi Quality

  • MaterialDateTimePicker has 0 bugs and 0 code smells.
This Library - Quality
Best in #Android
Average in #Android
This Library - Quality
Best in #Android
Average in #Android

securitySecurity

  • MaterialDateTimePicker has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • MaterialDateTimePicker code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
This Library - Security
Best in #Android
Average in #Android
This Library - Security
Best in #Android
Average in #Android

license License

  • MaterialDateTimePicker is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
This Library - License
Best in #Android
Average in #Android
This Library - License
Best in #Android
Average in #Android

buildReuse

  • MaterialDateTimePicker releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • MaterialDateTimePicker saves you 5253 person hours of effort in developing the same functionality from scratch.
  • It has 11030 lines of code, 674 functions and 179 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
This Library - Reuse
Best in #Android
Average in #Android
This Library - Reuse
Best in #Android
Average in #Android
Top functions reviewed by kandi - BETA

kandi has reviewed MaterialDateTimePicker and discovered the below as its top functions. This is intended to give you an instant insight into MaterialDateTimePicker implemented functionality, and help decide if they suit your requirements.

  • Generate legal times tree .
  • Callback method called when a touch event is pressed .
  • Creates and returns the view which is used to show the view .
  • Set current view .
  • Sets the closest selectable dates to the given calendar .
  • Draw the circle .
  • Go to the specified day .
  • Initializes the RadialSelectorView .
  • Find the start point in the list view .
  • Gets a short label for the given day .

MaterialDateTimePicker Key Features

Pick a date or time on Android in style

Setup

copy iconCopydownload iconDownload
dependencies {
    implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
}

Implement an

copy iconCopydownload iconDownload
@Override
public void onTimeSet(RadialPickerLayout view, int hourOfDay, int minute, int second) {
  String time = "You picked the following time: "+hourOfDay+"h"+minute+"m"+second;
  timeTextView.setText(time);
}

@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
  String date = "You picked the following date: "+dayOfMonth+"/"+(monthOfYear+1)+"/"+year;
  dateTextView.setText(date);
}

Create a

copy iconCopydownload iconDownload
Calendar now = Calendar.getInstance();
DatePickerDialog dpd = DatePickerDialog.newInstance(
  MainActivity.this,
  now.get(Calendar.YEAR), // Initial year selection
  now.get(Calendar.MONTH), // Initial month selection
  now.get(Calendar.DAY_OF_MONTH) // Inital day selection
);
// If you're calling this from a support Fragment
dpd.show(getFragmentManager(), "Datepickerdialog");
// If you're calling this from an AppCompatActivity
// dpd.show(getSupportFragmentManager(), "Datepickerdialog");

Theme the pickers

copy iconCopydownload iconDownload
dpd.setVersion(DatePickerDialog.Version.VERSION_2);

[All]

copy iconCopydownload iconDownload
dialog.setThemeDark(true);

[All]

copy iconCopydownload iconDownload
tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {
    @Override
    public void onCancel(DialogInterface dialogInterface) {
      Log.d("TimePicker", "Dialog was cancelled");
    }
});

How do I use a different version of a support library in my app?

copy iconCopydownload iconDownload
implementation ('com.wdullaer:materialdatetimepicker:4.2.3') {
        exclude group: 'androidx.appcompat'
        exclude group: 'androidx.recyclerview'
}

How do I use my custom logic to enable/disable dates?

copy iconCopydownload iconDownload
class MyDateRangeLimiter implements DateRangeLimiter {
  public MyDateRangeLimiter(Parcel in) {

  }

  @Override
  public int getMinYear() {
    return 1900;
  }

  @Override
  public int getMaxYear() {
    return 2100;
  }

  @Override
  public Calendar getStartDate() {
    Calendar output = Calendar.newInstance();
    output.set(Calendar.YEAR, 1900);
    output.set(Calendar.DAY_OF_MONTH, 1);
    output.set(Calendar.MONTH, Calendar.JANUARY);
    return output;
  }

  @Override
  public Calendar getEndDate() {
    Calendar output = Calendar.newInstance();
    output.set(Calendar.YEAR, 2100);
    output.set(Calendar.DAY_OF_MONTH, 1);
    output.set(Calendar.MONTH, Calendar.JANUARY);
    return output;
  }

  @Override
  public boolean isOutOfRange(int year, int month, int day) {
    return false;
  }

  @Override
  public Calendar setToNearestDate(Calendar day) {
      return day;
  }

  @Override
  public void writeToParcel(Parcel out) {

  }

  @Override
  public int describeContents() {
    return 0;
  }

  public static final Parcelable.Creator<MyDateRangeLimiter> CREATOR
        = new Parcelable.Creator<MyDateRangeLimiter>() {
    public MyDateRangeLimiter createFromParcel(Parcel in) {
        return new MyDateRangeLimiter(in);
    }

    public MyDateRangeLimiter[] newArray(int size) {
        return new MyDateRangeLimiter[size];
    }
  };
}

Why do the OK and Cancel buttons have the accent color as a background when combined with the Material Components library

copy iconCopydownload iconDownload
<style name="mdtp_ActionButton.Text" parent="Widget.MaterialComponents.Button.TextButton.Dialog"/>

Why are my callbacks lost when the device changes orientation?

copy iconCopydownload iconDownload
tpd.dismissOnPause(true);

License

copy iconCopydownload iconDownload
Copyright (c) 2015 Wouter Dullaert

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

cant import dependency implementation on android studio

copy iconCopydownload iconDownload
implementation 'com.github.wdullaer:MaterialDateTimePicker:v4.2.3'
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
-----------------------
implementation 'com.github.wdullaer:MaterialDateTimePicker:v4.2.3'
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'

Error java.lang.ClassNotFoundException After Upgrading to AndroidX and Android Studio 4.0

copy iconCopydownload iconDownload
<uses-library android:name="org.apache.http.legacy" android:required="false" />

MaterialDatePicker shows current date instead of needed

copy iconCopydownload iconDownload
CalendarConstraints.Builder constraintsBuilder = new CalendarConstraints.Builder();

LocalDateTime local = LocalDateTime.of(2020, 11, 1, 0, 0);
long openAt= local.atZone(ZoneId.ofOffset("UTC", ZoneOffset.UTC)).toInstant().toEpochMilli();
//you can also use Calendar.getInstance()...
constraintsBuilder.setOpenAt(openAt);

builder.setCalendarConstraints(constraintsBuilder.build());
builder.setSelection(....);
-----------------------
CalendarConstraints.Builder constraintsBuilder = new CalendarConstraints.Builder();

LocalDateTime local = LocalDateTime.of(2020, 11, 1, 0, 0);
long openAt= local.atZone(ZoneId.ofOffset("UTC", ZoneOffset.UTC)).toInstant().toEpochMilli();
//you can also use Calendar.getInstance()...
constraintsBuilder.setOpenAt(openAt);

builder.setCalendarConstraints(constraintsBuilder.build());
builder.setSelection(....);

Memory leak in DatePickerDialog. How to identify what is the problem?

copy iconCopydownload iconDownload
private val datePicker: DatePickerDialog
-----------------------
private lateinit var datePicker: DatePickerDialog
override fun onDestroy() {
    datePicker = null;
    super.onDestroy()
}
-----------------------
private lateinit var datePicker: DatePickerDialog
override fun onDestroy() {
    datePicker = null;
    super.onDestroy()
}

my project failed to run , saying "build failed"

copy iconCopydownload iconDownload
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
-----------------------
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
-----------------------
android {
 ...
 compileOptions {
   sourceCompatibility JavaVersion.VERSION_1_8
   targetCompatibility JavaVersion.VERSION_1_8
 }
}
kotlinOptions {
  jvmTarget = JavaVersion.VERSION_1_8.toString()
}
-----------------------
android {
 ...
 compileOptions {
   sourceCompatibility JavaVersion.VERSION_1_8
   targetCompatibility JavaVersion.VERSION_1_8
 }
}
kotlinOptions {
  jvmTarget = JavaVersion.VERSION_1_8.toString()
}

Duplicate Classes on adding Firestore

copy iconCopydownload iconDownload
dependencies {
  compile('com.example.m:m:1.0') {
     exclude group: 'org.unwanted', module: 'x 
  }
}

Community Discussions

Trending Discussions on MaterialDateTimePicker
  • cant import dependency implementation on android studio
  • Notification from Google Play || Malicious Behavior or User Data policy || Intent Redirection
  • Error java.lang.ClassNotFoundException After Upgrading to AndroidX and Android Studio 4.0
  • MaterialDatePicker shows current date instead of needed
  • Memory leak in DatePickerDialog. How to identify what is the problem?
  • my project failed to run , saying "build failed"
  • Duplicate Classes on adding Firestore
Trending Discussions on MaterialDateTimePicker

QUESTION

cant import dependency implementation on android studio

Asked 2022-Jan-21 at 21:42

I am beginner to android studio and I am trying to import a remote dependency for a library of DatePickerDialog (link for its github) but the import doesn't work for me.

I tried to import it by the Group Id (com.github.wdullaer) and Artifact Name (MaterialDateTimePicker) as it shows in the ProjectStructure/dependencies

I tried - import com.github.wdullaer.MaterialDateTimePicker

I also tried - import com.wdullaer.MaterialDateTimePicker

and more but the import does not work but

here is my gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.4"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and here is the DateTimePicker implementation:

    plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.speedq"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        viewBinding true
    }
}
dependencies {
    implementation 'com.github.wdullaer:MaterialDateTimePicker:v4.2.3' // this is the implementation I cant import

}

if any one knows how can I import it it will be very helpful

ANSWER

Answered 2022-Jan-21 at 21:42

that is wrong:

implementation 'com.github.wdullaer:MaterialDateTimePicker:v4.2.3'

first of all dont use v near version, so just remove it

also you got wrong path, read again guide - you should use this:

implementation 'com.wdullaer:materialdatetimepicker:4.2.3'

Source https://stackoverflow.com/questions/70807818

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install MaterialDateTimePicker

The easiest way to add the Material DateTime Picker library to your project is by adding it as a dependency to your build.gradle. You may also add the library as an Android Library to your project. All the library files live in library. The library also uses some Java 8 features, which Android Studio will need to transpile. This requires the following stanza in your app's build.gradle. See https://developer.android.com/studio/write/java8-support.html for more information on Java 8 support in Android.

Support

This library depends on some androidx support libraries. Because the jvm allows only one version of a fully namespaced class to be loaded, you will run into issues if your app depends on a different version of a library than the one used in this app. Gradle is generally quite good at resolving version conflicts (by default it will retain the latest version of a library), but should you run into problems (eg because you disabled conflict resolution), you can disable loading a specific library for MaterialDateTimePicker. Using the following snippet in your apps build.gradle file you can exclude this library's transitive appcompat library dependency from being installed.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.