Skip to content

Commit

Permalink
add gestures from jitpack
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartToolFactory committed Apr 11, 2022
1 parent db4116b commit b4cd44b
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 415 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### Jetpack Compose Colorful Customizable Sliders
# Jetpack Compose Colorful Customizable Sliders

Colorful sliders that can have Solid or Gradient colors for thumb or track which can have thumb and
track with varying sizes, borders with solid or gradient colors. And Sliders with emojis, or custom
Composables like **Icon**.

|Properties | Dimensions | Slider with Icon | Slider with Label | Gradient |
| Slider with Icon | Gradient | Properties | Slider with Label | Dimensions |
| ----------|-----------| -----------| -----------| -----------|
| <img src="./screenshots/slider_properties.png"/> | <img src="./screenshots/slider_dimensions.png"/> | <img src="./screenshots/slider_icons.png"/> | <img src="./screenshots/slider_labels.png"/> | <img src="./screenshots/slider_gradient.png"/> |
| <img src="./screenshots/slider_icons.png"/> | <img src="./screenshots/slider_gradient.png"/> | <img src="./screenshots/slider_properties.png"/> | <img src="./screenshots/slider_labels.png"/> | <img src="./screenshots/slider_dimensions.png"/> |

### ColorfulSlider
## ColorfulSlider

Sliders that can use Color or gradient for track, thumb, or tick colors with custom thumb and track
heights.
Expand Down Expand Up @@ -122,7 +122,7 @@ data class SliderBrushColor(
}
```

### SliderWithLabel
## SliderWithLabel

Sliders that can move a label above the Slider and display progress

Expand Down Expand Up @@ -173,7 +173,7 @@ SliderWithLabel(
)
```

### ColorfulIconSlider
## ColorfulIconSlider

Sliders that can use any Composable for thumb and use Color or gradient for track, thumb, or tick
colors with custom thumb and track heights.
Expand Down
12 changes: 8 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ dependencies {
implementation project(':slider')

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'

implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.activity:activity-compose:1.4.0'

implementation 'com.google.accompanist:accompanist-systemuicontroller:0.24.3-alpha'
implementation "com.google.accompanist:accompanist-pager:0.24.3-alpha"
implementation "com.google.accompanist:accompanist-pager-indicators:0.24.3-alpha"
def accompanist_version = "0.24.6-alpha"
// Accompanist
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
implementation "com.google.accompanist:accompanist-pager:$accompanist_version"
implementation "com.google.accompanist:accompanist-drawablepainter:$accompanist_version"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.google.accompanist.pager.*
import com.smarttoolfactory.composematerialslider.demo.*
import com.smarttoolfactory.composematerialslider.ui.theme.BlueSmart
import com.smarttoolfactory.composematerialslider.ui.theme.BlueSmartDark
import com.smarttoolfactory.composematerialslider.ui.theme.ComposeMaterialSliderTheme
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -54,11 +51,7 @@ private fun HomeContent() {
// Our selected tab is our current page
selectedTabIndex = pagerState.currentPage,
// Override the indicator, using the provided pagerTabIndicatorOffset modifier
indicator = { tabPositions ->
TabRowDefaults.Indicator(
Modifier.pagerTabIndicatorOffset(pagerState, tabPositions)
)
}
indicator = {}
) {
// Add tabs for all of our pages
tabList.forEachIndexed { index, title ->
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {
ext {
compose_version = '1.2.0-alpha06'
compose_version = '1.2.0-alpha07'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}

Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io'}
}
}
rootProject.name = "Compose Material Slider"
Expand Down
8 changes: 2 additions & 6 deletions slider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,15 @@ android {
dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'

implementation 'com.github.SmartToolFactory:Compose-Extended-Gestures:1.0.0'

// Jetpack Compose
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version"

implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.activity:activity-compose:1.4.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import androidx.compose.ui.layout.SubcomposeLayout
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.unit.*
import com.smarttoolfactory.slider.gesture.pointerMotionEvents
import com.smarttoolfactory.gesture.pointerMotionEvents

/**
* Material Slider allows to choose height for track and thumb radius and selection between
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import com.smarttoolfactory.slider.gesture.pointerMotionEvents
import com.smarttoolfactory.gesture.pointerMotionEvents
import kotlin.math.abs

/**
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit b4cd44b

Please sign in to comment.