Coder Social home page Coder Social logo

Comments (13)

qiujuer avatar qiujuer commented on August 16, 2024 2

Now you can try to use compile 'net.qiujuer.genius:ui:1.5.2' version.

from genius-android.

qiujuer avatar qiujuer commented on August 16, 2024

Thank you feedback. I will check it.

from genius-android.

qiujuer avatar qiujuer commented on August 16, 2024

In my test:

        SeekBar seekBar = (SeekBar) findViewById(R.id.seekBar);
        seekBar.setMax(3);
        seekBar.setMin(1);
        // we try change progress to 0 value
        seekBar.setProgress(0);
        // the progress < min value, so progress auto change to 1 value

        findViewById(R.id.opt).setOnClickListener(new View.OnClickListener() {
            int optCount = 0;

            @Override
            public void onClick(View v) {
                SeekBar seekBar = (SeekBar) findViewById(R.id.seekBar);
                Log.e(MainActivity.this.getClass().getName(),
                        String.format("Before: progress:%s max:%s min:%s", seekBar.getProgress(), seekBar.getMax(), seekBar.getMin()));

                int progress = seekBar.getProgress();
                Log.e(MainActivity.this.getClass().getName(),
                        String.format("Running: try change progress:%s to %s, optCount:%s", progress, ++progress, ++optCount));

                seekBar.setProgress(progress);

                Log.e(MainActivity.this.getClass().getName(),
                        String.format("After: progress:%s max:%s min:%s", seekBar.getProgress(), seekBar.getMax(), seekBar.getMin()));

                // if onclick count > 10
                // we will change the SeekBar max value
                if (optCount == 5) {
                    Log.e(MainActivity.this.getClass().getName(), "Change SeekBar max value to 10.");
                    seekBar.setMax(10);
                    // in this, the SeekBar not refresh progress bar
                    // ....

                    // if you need refresh the widget, you can call
                    seekBar.setProgress(seekBar.getProgress());
                    // or wait me update the SeekBar widget, I fixed quickly
                }
            }
        });

This is bug, I will fix it.

from genius-android.

XxGoliathusxX avatar XxGoliathusxX commented on August 16, 2024

When will there be an update?

from genius-android.

qiujuer avatar qiujuer commented on August 16, 2024

Now, you can set compile 'net.qiujuer.genius:ui:1.5.1' to use new version.

from genius-android.

XxGoliathusxX avatar XxGoliathusxX commented on August 16, 2024

Thanks a lot!!!

from genius-android.

XxGoliathusxX avatar XxGoliathusxX commented on August 16, 2024

How can I refresh the view the best way?

from genius-android.

qiujuer avatar qiujuer commented on August 16, 2024

In ui:1.5.1 , the view will auto refresh the draw on call setMax() or setMin().
If you only call invalidate() , the view will refresh draw; but the draw parameters not correct.

The view have some logical operations on call setMax() or setMin().

from genius-android.

XxGoliathusxX avatar XxGoliathusxX commented on August 16, 2024

It doesnt work for me. I think it has something to do with genius:gAllowTrackClickToDrag="false".

from genius-android.

XxGoliathusxX avatar XxGoliathusxX commented on August 16, 2024

Here is my code:

 <net.qiujuer.genius.ui.widget.SeekBar
        android:id="@+id/seekBarSatz"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/custom_margin_left_and_right"
        android:layout_marginRight="@dimen/custom_margin_left_and_right"
        android:layout_marginEnd="@dimen/custom_margin_left_and_right"
        android:layout_marginStart="@dimen/custom_margin_left_and_right"
        genius:gAllowTrackClickToDrag="false"
        genius:gIndicator="auto"
        genius:gIndicatorBackgroundColor="@color/primary_dark"
        genius:gIndicatorSeparation="30dp"
        genius:gIndicatorTextAppearance="@style/Genius.Widget.BalloonMarker.TextAppearance"
        genius:gRippleColor="@color/primary_light"
        genius:gScrubberColor="@color/primary_light"
        genius:gScrubberStroke="4dp"
        genius:gThumbColor="@color/primary_dark"
        genius:gThumbSize="6dp"
        genius:gTickSize="5dp"
        genius:gTouchSize="12dp"
        genius:gTrackColor="@color/grey_light"
        genius:gTrackStroke="2dp" />
 seekBarSatz = (SeekBar) findViewById(R.id.seekBarSatz);
        seekBarSatz.setMin(1);
        if(parents.get(0).getChildItemList() == null){
           seekBarSatz.setMax(1);
        }else{
            seekBarSatz.setMax(parents.get(0).getChildItemList().size());
        }

void next(View v){ //This is called by a button
if(child != null){
            seekBarSatz.setMax(parent.getChildItemList().size());
        }else{
            seekBarSatz.setMax(1);
        }}

from genius-android.

qiujuer avatar qiujuer commented on August 16, 2024

Oh, ok I know. I will test it. Thanks.

from genius-android.

XxGoliathusxX avatar XxGoliathusxX commented on August 16, 2024

Now it works. Thx a lot!

from genius-android.

qiujuer avatar qiujuer commented on August 16, 2024

You’re welcome!

from genius-android.

Related Issues (20)

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.