Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c412d61
- deprecate old view and related classes
Oct 22, 2019
311305d
- prepare classes for the view redesign
Nov 1, 2019
26e9e60
- add attributes for new view
Nov 28, 2019
5d45848
- fix issues with styles
Nov 28, 2019
b6706ad
Merge pull request #9 from yaroslav-android/feature/basic-setup_prepa…
yaroslav-android Nov 28, 2019
7ca0c0a
Merge branch 'develop' into feature/new_scope-picker
yaroslav-android Nov 28, 2019
a1774fd
- setup basics for mode switch
Nov 28, 2019
717e25b
Merge pull request #11 from yaroslav-android/feature/mode_scope-picke…
yaroslav-android Nov 29, 2019
0995507
- add debug tools
Dec 13, 2019
7ce7592
Merge pull request #12 from yaroslav-android/feature/debug-tools_inte…
yaroslav-android Dec 13, 2019
af94234
Delete misc.xml
yaroslav-android Dec 13, 2019
8c7fdd9
Delete runConfigurations.xml
yaroslav-android Dec 13, 2019
c299913
Delete vcs.xml
yaroslav-android Dec 13, 2019
bdb4973
Delete Project.xml
yaroslav-android Dec 13, 2019
1b0967c
Delete codeStyleConfig.xml
yaroslav-android Dec 13, 2019
37a93a0
- add Hyperion
Dec 13, 2019
b70ce77
- add gradle properties
Dec 13, 2019
29690ad
Merge pull request #13 from yaroslav-android/feature/hyperion_integra…
yaroslav-android Dec 13, 2019
b1ba3c1
- add changes
Mar 29, 2020
e841f71
- update verions of plugin and wrapper
Mar 29, 2020
ee5c405
Merge branch 'feature/new_scope-picker' of https://github.com/yarosla…
Mar 29, 2020
934fb52
- remove IDEA files
Mar 29, 2020
1462980
Merge pull request #15 from yaroslav-android/fix/git-ignore_change-pr…
yaroslav-android Mar 29, 2020
252a531
Merge branches 'feature/new_scope-picker' and 'upd/gradle-upgrade_3-6…
Mar 29, 2020
b70dd56
Merge pull request #14 from yaroslav-android/upd/gradle-upgrade_3-6-1
yaroslav-android Mar 29, 2020
a2f58db
- replace mode with strategy
Mar 30, 2020
c755a06
View updates and improvements
Apr 25, 2020
3992457
- remove scopepicker package
Apr 25, 2020
2696734
- add comments to RangePickerView
Apr 25, 2020
fb52896
DuoOptionView improvements:
Apr 9, 2021
299945b
- move drawStrip method from base view to duo option view
Apr 9, 2021
0e85091
- fix release compile issues
Apr 9, 2021
d55c7d4
- fix kapt failure
Apr 9, 2021
586e130
- remove hyperion from lib
Apr 9, 2021
3f9153b
- remove activity from manifest
Apr 9, 2021
c5cab5e
Merge pull request #16 from yaroslav-android/feature/scope-picker_fro…
yaroslav-android Apr 11, 2021
04095d1
Delete markdown-navigator.xml
yaroslav-android May 12, 2021
302ca59
Delete markdown-navigator-enh.xml
yaroslav-android May 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ captures/
.idea/runConfigurations.xml
.idea/misc.xml
.idea/inspectionProfiles
.idea/markdown-navigator-enh.xml
.idea/markdown-navigator.xml
.idea/codeStyles
.idea/codeStyles/Project.xml
.idea/compiler.xml
.idea/jarRepositories.xml

≈codeStyles

# Android Studio 3 in .gitignore file.
.idea/caches
Expand Down
22 changes: 14 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
applicationId "yaroslav.ovdiienko.idivision.rangepicker"

minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29

versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

testOptions {
unitTests.includeAndroidResources = true
}
Expand All @@ -39,13 +44,14 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

// Android libs
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'com.google.android.material:material:1.2.1'

// Tests
testImplementation 'junit:junit:4.12'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'org.mockito:mockito-core:2.23.0'
Expand Down
25 changes: 25 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,28 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class com.google.**
-dontwarn com.google.** -dontwarn com.google.**

-keep class **.R$* {
<fields>; <fields>;
}

-keep public class * extends java.lang.Exception

-dontwarn kotlin.Unit

-dontwarn javax.annotation.**

-keep class com.squareup.picasso.** { *; }

-keep class * implements com.willowtreeapps.hyperion.plugin.v1.Plugin {
*;
}
-keep class * implements com.willowtreeapps.hyperion.plugin.v1.PluginModule {
*;
}
-keep class * implements com.willowtreeapps.hyperion.attr.collectors.TypedAttributeCollector {
<init>();
}
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
package yaroslav.ovdiienko.idivision.rangepicker

import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import yaroslav.ovdiienko.idivision.rangepickerview.rangepicker.model.Option


class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

picker.apply {
setOptions(getOptions())
setDefaultSelectedPositions(0 to 4)
setOnRangeSelectedListener { view, leftPoint, rightPoint ->
Toast.makeText(
this@MainActivity,
view.getSelectedIndexes().toString(),
Toast.LENGTH_SHORT
).show()
}
}

btn_get_values.setOnClickListener {
Toast.makeText(this, "${picker.getSelectedItems()}", Toast.LENGTH_SHORT).show()
picker.resetToDefaultState()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

// oldView()
newView()
}

private fun oldView() {
picker.apply {
visibility = View.VISIBLE
setOptions(getOptions())
setDefaultSelectedPositions(0 to 4)
setOnRangeSelectedListener { view, leftPoint, rightPoint ->
Toast.makeText(
this@MainActivity,
view.getSelectedIndexes().toString(),
Toast.LENGTH_SHORT
).show()
}
}

private fun getOptions(): List<Option> {
return listOf(
Option("Single"),
Option("2"),
Option("3"),
Option("4"),
Option("5+")
)
btn_get_values.visibility = View.VISIBLE
btn_get_values.setOnClickListener {
Toast.makeText(this, "${picker.getSelectedItems()}", Toast.LENGTH_SHORT).show()
picker.resetToDefaultState()
}
}
}

private fun newView() {
dov.apply {
addOptions(getOptionsStrings())
}
}

private fun getOptions(): List<Option> {
return getOptionsStrings().map { Option(it) }
}

private fun getOptionsStrings() = listOf("Single", "2", "3", "4", "5+")
}
25 changes: 17 additions & 8 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,32 @@
android:orientation="vertical"
tools:context=".MainActivity">

<Button
android:id="@+id/btn_get_values"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:text="get"
android:visibility="gone" />

<yaroslav.ovdiienko.idivision.rangepickerview.rangepicker.RangePickerView
android:id="@+id/picker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="16dp"
android:layout_marginRight="8dp"
android:visibility="gone"
app:backgroundSelectedTint="@color/colorPrimary"
app:cornerRadius="5dp" />

<Button
android:id="@+id/btn_get_values"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:text="get" />
<yaroslav.ovdiienko.idivision.rangepickerview.pickers.DuoOptionView
android:id="@+id/dov"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
</LinearLayout>

8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.31'
ext.kotlin_version = '1.4.10'

repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m
# org.gradle.parallel=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 22 19:08:07 EEST 2019
#Tue Sep 15 18:39:25 EEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
21 changes: 14 additions & 7 deletions rangepickerview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.yaroslav-android'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29

versionCode 3
versionName "1.0.8-beta02"
Expand All @@ -19,13 +20,18 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
testCoverageEnabled false
debuggable true
}
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

testOptions {
Expand All @@ -38,10 +44,11 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

// Android libs
implementation 'androidx.appcompat:appcompat:1.1.0'
// Android libs
implementation 'androidx.appcompat:appcompat:1.2.0'

testImplementation 'junit:junit:4.12'
testImplementation 'androidx.test:core:1.2.0'
Expand Down
1 change: 1 addition & 0 deletions rangepickerview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
package="yaroslav.ovdiienko.idivision.rangepickerview">

<uses-permission android:name="android.permission.VIBRATE" />

</manifest>
Loading