Giter Site home page Giter Site logo

florent37 / android-slidr Goto Github PK

View Code? Open in Web Editor NEW
347.0 9.0 55.0 359 KB

Another android slider / seekbar, but different :-)

License: Apache License 2.0

Java 99.93% Shell 0.07%
android seekbar android-slide android-slidr view custom seek range bar

android-slidr's Introduction

android-slidr

Another android slider / seekbar, but different :-)

Android app on Google Play

Download

Buy Me a Coffee at ko-fi.com

Download

dependencies {
    compile 'com.github.florent37:android-slidr:1.0.4'
}

png

<com.github.florent37.androidslidr.Slidr
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        app:slidr_regions_centerText="false"
        app:slidr_region_leftColor="#4CAF50" />

Step

png png

<com.github.florent37.androidslidr.Slidr
       android:id="@+id/slidr"
       android:layout_width="250dp"
       android:layout_height="wrap_content"
       app:slidr_region_leftColor="#4CAF50"
       app:slidr_step_colorizeAfterLast="true" />
final Slidr slidr = (Slidr) findViewById(R.id.slideure);
slidr.setMax(500);
slidr.addStep(new Slidr.Step("test", 250, Color.parseColor("#007E90"), Color.RED));
slidr.setTextMax("max\nvalue");
slidr.setCurrentValue(300);
slidr.setListener(new Slidr.Listener() {
    @Override
    public void valueChanged(Slidr slidr, float currentValue) {

    }

    @Override
    public void bubbleClicked(Slidr slidr) {

    }
});

Region

png

<com.github.florent37.androidslidr.Slidr
       android:id="@+id/slideure_regions"
       android:layout_margin="20dp"
       android:layout_width="250dp"
       android:layout_height="wrap_content"
       app:slidr_regions="true"
       app:slidr_region_leftColor="@color/colorLeft"
       app:slidr_region_rightColor="@color/colorRight"
       app:slidr_regions_textFollowRegionColor="true"
       app:slidr_regions_centerText="true"
       app:slidr_draw_bubble="false"
       />
final Slidr slidr = (Slidr) findViewById(R.id.slideure_regions);
slidr.setMax(3000);
slidr.setRegionTextFormatter(new Slidr.RegionTextFormatter() {
    @Override
    public String format(int region, float value) {
        return String.format("region %d : %d", region, (int) value);
    }
});
slidr.addStep(new Slidr.Step("test", 1500, Color.parseColor("#007E90"), Color.parseColor("#111111")));

Credits

Author: Florent Champigny

Blog : http://www.tutos-android-france.com/

Android app on Google Play Follow me on Google+ Follow me on Twitter Follow me on LinkedIn

License

Copyright 2017 Florent37, Inc.

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.

android-slidr's People

Contributors

florent37 avatar merteroglu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-slidr's Issues

addStep(List) from Slidr not sorting

Hello,

The method addStep(List) does not seem to work correctly when the steps are not sorted. It seems like the Collections.sort should be sorting this.steps and not the argument.

line ~385
public void addStep(List<Step> steps) { this.steps.addAll(steps); Collections.sort(steps); update(); }

Have a nice day.

bubble text

how to hide bubble Programmatically. without handling in xml.

slider lost finger (stop sliding) when slide in ScrollView

hi. Library is awesome :) niceee

but 1 problem.
if layout have scrollView - very hard sliding. 90% i cant slide to left or right side
sliding stopped after some moving because ScrollView change vertival page offset

lets try move faster, and you will see problem (layout from demo + ScrollView):

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_height="match_parent"
            android:layout_width="match_parent">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="15dp"
    tools:context="com.github.florent37.slidr.MainActivity">

    <com.github.florent37.androidslidr.Slidr
        android:layout_margin="20dp"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:slidr_regions_centerText="false"
        app:slidr_region_leftColor="@color/colorLeft" />


    <com.github.florent37.androidslidr.Slidr
        android:id="@+id/slideure"
        android:layout_margin="20dp"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:slidr_region_leftColor="@color/colorLeft"
        app:slidr_step_colorizeAfterLast="true" />


    <com.github.florent37.androidslidr.Slidr
        android:id="@+id/slideure_regions"
        android:layout_margin="20dp"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:slidr_regions="true"
        app:slidr_region_leftColor="@color/colorLeft"
        app:slidr_region_rightColor="@color/colorRight"
        app:slidr_regions_textFollowRegionColor="true"
        app:slidr_regions_centerText="true"
        app:slidr_draw_bubble="false"
        />


    <com.github.florent37.androidslidr.Slidr
        android:id="@+id/slideure2"
        android:layout_margin="20dp"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:slidr_barHeight="10dp"
        app:slidr_step_colorizeAfterLast="true"
        app:slidr_textBottom_visible="false"
        app:slidr_textTop_visible="false" />

    <Button
        android:id="@+id/max"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="change max"
        />

    <Button
        android:id="@+id/current"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="change current"
        />

</LinearLayout>
</ScrollView>

Set min value

Dear Florent!

Could you please help me to set min value to other value rather then "0".

app:slidr_textTop_visible="false" cut down top view

<com.github.florent37.androidslidr.Slidr
        android:id="@+id/slidr"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"

        app:slidr_barHeight="8dp"
        app:slidr_draw_bubble="false"
        app:slidr_region_leftColor="#4CAF50"
        app:slidr_regions_centerText="false"
        app:slidr_step_colorizeAfterLast="true"
        app:slidr_textBottom_visible="false"
        app:slidr_textTop_visible="false"/>

as like this

Untitled

Getting error while including the library

Gradle sync is throwing following error when I add the library with implementation 'com.github.florent37:android-slidr:1.0.4' -

Failed to resolve: com.github.florent37:android-slidr:1.0.4

Is there anything wrong I am doing?

Ajust Slider per any digit rounded

ENJOY!

slidr.setListener(new Slidr.Listener() {
                @Override
                public void valueChanged(Slidr slidr, float currentValue) {
               //TO ROUND DIGIT TO NEAREST 5
                  slidr.setCurrentValue( (float)Math.ceil(currentValue / 5d) * 5);
                }

            });

Question - not an issue

Is there a way to make the current value indicator come closer to the bar without showing the max and min value straight out the box?

New features

Hi @florent37 :
It would be possible to add the following features:

  1. Set min and max.
  2. Change the symbol
  3. Set the color of the speech bubble
  4. Set the color of the comic book text
  5. Set the color of the start and end text
  6. Set the color of the seek, in this case it is always white
  7. Set the color of the part of the bar not selected, in this case it is gray.

All through xml.

The version com.github.florent37: android-slidr: 1.0.4, does not work is not installed.

Set Minimum

How can I set the minimum value for the slidr?

Resize the slider

Two questions:
Is there a way to change the slider height? and is there a way to remove the bubble above the slider?
I need it to be shown like an Android default SeekBar.

app: Build.grade cannot

Cannot find it

compile 'com.github.florent37:android-slidr:1.0.4'

Error:(52, 13) Failed to resolve: com.github.florent37:android-slidr:1.0.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.