Skip to content

Commit

Permalink
Merge branches 'improve' and 'master' of https://github.com/ali-sarda…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali.Sardari committed Sep 4, 2018
2 parents cb573db + 9e979a5 commit 221ae82
Show file tree
Hide file tree
Showing 20 changed files with 376 additions and 471 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Step 1. Add the JitPack repository to your build file. Add it in your root build
```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion 27
defaultConfig {
applicationId "com.sardari.persianrangedatepicker"
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.widget.TextView;

import com.sardari.daterangepicker.customviews.DateRangeCalendarView;
import com.sardari.daterangepicker.dialog_fragment.DatePickerDialog;
import com.sardari.daterangepicker.dialog.DatePickerDialog;
import com.sardari.daterangepicker.utils.PersianCalendar;

public class MainActivity extends AppCompatActivity {
Expand All @@ -31,32 +31,22 @@ private void initSingleDate() {
btn_ShowDatePicker.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ShowDatePicker(DateRangeCalendarView.SelectionMode.Range);
ShowDatePicker(DateRangeCalendarView.SelectionMode.None);
}
});
}

private void ShowDatePicker(DateRangeCalendarView.SelectionMode selectionMode) {
// PersianCalendar today = new PersianCalendar();
//
// PersianCalendar persianCalendar_Max = (PersianCalendar) today.clone();
// persianCalendar_Max.setPersianYear(today.getPersianYear() + 1);

DatePickerDialog datePickerDialog = new DatePickerDialog(MainActivity.this);
// datePickerDialog.setTypeface(FontUtils.Default());
datePickerDialog.setCalendarType(DateRangeCalendarView.CalendarType.Persian);
datePickerDialog.setSelectionMode(selectionMode);
datePickerDialog.setSelectableDaysCount(5);
// datePickerDialog.setCalendarType(DateRangeCalendarView.CalendarType.Persian);
// datePickerDialog.setSelectionMode(selectionMode);
// datePickerDialog.setSelectableDaysCount(5);
datePickerDialog.setCanceledOnTouchOutside(true);
// datePickerDialog.setCurrentDate(today);
// datePickerDialog.setMinDate(persianCalendar_Min);
// datePickerDialog.setMaxDate(persianCalendar_Max);

datePickerDialog.setOnRangeDateSelectedListener(new DatePickerDialog.OnRangeDateSelectedListener() {
@Override
public void onRangeDateSelected(PersianCalendar startDate, PersianCalendar endDate) {
txtStartDate.setText(startDate.getPersianShortDate());
txtEndDate.setText(endDate.getPersianShortDate());
txtStartDate.setText(startDate.getPersianShortDateTime());
txtEndDate.setText(endDate.getPersianShortDateTime());
}
});

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
<TextView
android:id="@+id/txtStartDate"
android:layout_width="wrap_content"
android:layout_alignBaseline="@id/txtLabel"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/btn_ShowDatePicker"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:text="Start Date" />

<TextView
android:id="@+id/txtLabel"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/btn_ShowDatePicker"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@id/txtStartDate"
android:text="تا"
Expand All @@ -28,7 +28,7 @@
android:id="@+id/txtEndDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/btn_ShowDatePicker"
android:layout_alignBaseline="@id/txtLabel"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@id/txtLabel"
android:text="End Date" />
Expand All @@ -39,7 +39,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginTop="50dp"
android:text="انتخاب تاریخ" />

</RelativeLayout>

This file was deleted.

151 changes: 3 additions & 148 deletions daterangepicker/build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group = 'com.github.persianrangedatepicker' // Maven Group ID for the artifact

//apply plugin: 'com.github.kt3k.coveralls'

//ext {
// bintrayRepo = 'maven'
// bintrayName = 'PersianRangeDatePicker'
//
// publishedGroupId = 'com.sardari'
// libraryName = 'PersianRangeDatePicker'
// artifact = 'PersianRangeDatePicker'
//
// libraryDescription = 'Persian Range Date Picker'
//
// siteUrl = 'https://github.com/ali-sardari/PersianRangeDatePicker'
// gitUrl = 'https://github.com/ali-sardari/PersianRangeDatePicker.git'
//
// libraryVersion = '0.1.3'
//
// developerId = 'ali-sardari'
// developerName = 'Ali Sardari'
// developerEmail = '[email protected]'
//
// licenseName = 'The Apache Software License, Version 2.0'
// licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
// allLicenses = ["Apache-2.0"]
//}

group = 'com.github.persianrangedatepicker'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
flavorDimensions "default"

defaultConfig {
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0.1"
Expand All @@ -47,122 +20,4 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
}

//---------------------------------------------------------------------
//coveralls {
// jacocoReportPath = "${buildDir}/reports/coverage/debug/report.xml"
//}
//
//tasks.coveralls {
// dependsOn 'connectedAndroidTest'
// onlyIf { System.env.'CI' }
//}
//

//apply plugin: 'com.github.dcendents.android-maven'
//
//group = publishedGroupId // Maven Group ID for the artifact
//
//install {
// repositories.mavenInstaller {
// // This generates POM.xml with proper parameters
// pom {
// project {
// packaging 'aar'
// groupId publishedGroupId
// artifactId artifact
//
// // Add your description here
// name libraryName
// description libraryDescription
// url siteUrl
//
// // Set your license
// licenses {
// license {
// name licenseName
// url licenseUrl
// }
// }
// developers {
// developer {
// id developerId
// name developerName
// email developerEmail
// }
// }
// scm {
// connection gitUrl
// developerConnection gitUrl
// url siteUrl
//
// }
// }
// }
// }
//}
//
//apply plugin: 'com.jfrog.bintray'
//
//version = libraryVersion
//
//if (project.hasProperty("android")) { // Android libraries
// task sourcesJar(type: Jar) {
// classifier = 'sources'
// from android.sourceSets.main.java.srcDirs
// }
//
// task javadoc(type: Javadoc) {
// source = android.sourceSets.main.java.srcDirs
// classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
// }
//} else { // Java libraries
// task sourcesJar(type: Jar, dependsOn: classes) {
// classifier = 'sources'
// from sourceSets.main.allSource
// }
//}
//
//task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
//
//artifacts {
// archives javadocJar
// archives sourcesJar
//}
//
//// Bintray
//File localProps = project.rootProject.file('local.properties')
//
//if (localProps.exists()) {
// Properties properties = new Properties()
// properties.load(localProps.newDataInputStream())
//
// bintray {
// user = properties.getProperty("bintray.user")
// key = properties.getProperty("bintray.apikey")
//
// configurations = ['archives']
// pkg {
// repo = bintrayRepo
// name = bintrayName
// desc = libraryDescription
// websiteUrl = siteUrl
// vcsUrl = gitUrl
// licenses = allLicenses
// publish = true
// publicDownloadNumbers = true
// version {
// desc = libraryDescription
// gpg {
// sign = true //Determines whether to GPG sign the files. The default is false
// passphrase = properties.getProperty("bintray.gpg.password")
// //Optional. The passphrase for GPG signing'
// }
// }
// }
// }
//}
}
Binary file removed daterangepicker/src/main/assets/fonts/Yekan.ttf
Binary file not shown.
Loading

0 comments on commit 221ae82

Please sign in to comment.