Skip to content

Commit

Permalink
- Fix RTL Direction
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-sardari committed Aug 30, 2019
1 parent 1a33a62 commit d649dc9
Show file tree
Hide file tree
Showing 10 changed files with 213 additions and 63 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild


bin
gen
out
lib

.idea
*.iml
classes

obj

.DS_Store

# Gradle
.gradle
jniLibs
build
local.properties
reports
134 changes: 109 additions & 25 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
apply plugin: 'com.android.application'

def appConfig = rootProject.ext.configuration

android {
compileSdkVersion 28
compileSdkVersion appConfig.compileSdkVersion
buildToolsVersion appConfig.buildToolsVersion

defaultConfig {
applicationId "com.sardari.persianrangedatepicker"
minSdkVersion 17
versionCode 1
versionName "1.0"
applicationId appConfig.applicationId

minSdkVersion appConfig.minSdkVersion
targetSdkVersion appConfig.targetSdkVersion

versionCode appConfig.versionCode
versionName appConfig.versionName

vectorDrawables.useSupportLibrary = true
}

buildTypes {
release {
minifyEnabled false
Expand Down
19 changes: 11 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
Expand All @@ -30,11 +30,14 @@ task clean(type: Delete) {
}

ext {
compileSdkVersion = 28
buildToolsVersion = "28.0.3"
minSdkVersion = 17
targetSdkVersion = 28
supportLibraryVersion = "28.0.0"

junitVersion = "4.12"
configuration = [
appName : "MyRefah",
applicationId : "com.sardari.persianrangedatepicker",
compileSdkVersion: 29,
buildToolsVersion: "29.0.1",
minSdkVersion : 17,
targetSdkVersion : 29,
versionCode : 2,
versionName : "1.2.1",
]
}
16 changes: 10 additions & 6 deletions daterangepicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ apply plugin: 'com.github.dcendents.android-maven'

group = 'com.github.persianrangedatepicker'

def appConfig = rootProject.ext.configuration

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
flavorDimensions "default"
compileSdkVersion appConfig.compileSdkVersion
buildToolsVersion appConfig.buildToolsVersion

defaultConfig {
minSdkVersion 17
versionCode 1
versionName "1.0.1"
minSdkVersion appConfig.minSdkVersion
targetSdkVersion appConfig.targetSdkVersion

versionCode appConfig.versionCode
versionName appConfig.versionName

vectorDrawables.useSupportLibrary = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,21 +183,32 @@ private void init() {

//region Core
//region NavigationClickListener & dayClickListener
private void nextMonth() {
currentCalendarMonth.setPersianMonth(currentCalendarMonth.getPersianMonth() + 1);
currentCalendarMonth.setPersianDay(1);

drawCalendarForMonth(currentCalendarMonth);
}

private void prevMonth() {
if (currentCalendarMonth.getPersianMonth() == 0) {
currentCalendarMonth.setPersianYear(currentCalendarMonth.getPersianYear() - 1);
currentCalendarMonth.setPersianMonth(11);
} else {
currentCalendarMonth.setPersianMonth(currentCalendarMonth.getPersianMonth() - 1);
}

currentCalendarMonth.setPersianDay(1);

drawCalendarForMonth(currentCalendarMonth);
}

private void setListeners() {
//region imgVNavLeft.setOnClickListener
imgVNavLeft.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (currentCalendarMonth.getPersianMonth() == 0) {
currentCalendarMonth.setPersianYear(currentCalendarMonth.getPersianYear() - 1);
currentCalendarMonth.setPersianMonth(11);
} else {
currentCalendarMonth.setPersianMonth(currentCalendarMonth.getPersianMonth() - 1);
}

currentCalendarMonth.setPersianDay(1);

drawCalendarForMonth(currentCalendarMonth);
nextMonth();
}
});
//endregion
Expand All @@ -206,10 +217,7 @@ public void onClick(View v) {
imgVNavRight.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
currentCalendarMonth.setPersianMonth(currentCalendarMonth.getPersianMonth() + 1);
currentCalendarMonth.setPersianDay(1);

drawCalendarForMonth(currentCalendarMonth);
prevMonth();
}
});
//endregion
Expand Down Expand Up @@ -293,7 +301,7 @@ public void onCancel() {
}

if (shouldEnabledTime) {
Log.w("TAG", "DateRangeCalendarView_onClick_296-> :" );
Log.w("TAG", "DateRangeCalendarView_onClick_296-> :");

//region shouldEnabledTime
TimePickerDialog awesomeTimePickerDialog = new TimePickerDialog(mContext, mContext.getString(R.string.select_time), new TimePickerDialog.TimePickerCallback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
android:id="@+id/rlHeaderCalendar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:background="@color/headerBackgroundColor">

<android.support.v7.widget.AppCompatImageView
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Aug 26 22:28:52 IRDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

0 comments on commit d649dc9

Please sign in to comment.