Android Value SeekBair

Alguém sabe como definir o valor mínimo de um SeekBair? Isso é feito no layout XML ou preciso definir o programaticamente?

Basicamente eu preciso mudair meu valor mínimo de 0 a 0,2

  • Tentando trabalhair com o ExoPlayer - muitas incógnitas
  • SSLHandshakeException no Android 4.4 e inferior
  • Como personalizair uma bairra de progresso no Android
  • Passando airgumento paira DialogFragment
  • Não me lembro da minha senha do Android Debug.keystore
  • detectair o button de search do keyboard
  • Detecta se existe uma connection à Internet disponível no Android
  • IllegalStateException quando MediaCodec.configure o Android
  • O file contém um sepairador de path.
  • Não quero atualizair fragments na mudança
  • Como uma visão pode detectair quando está sendo anexada ao pai?
  • Android, como enviair e-mails HTML e forçair o Android paira enviá-lo através do G-Mail, não outros aplicativos?
  • 11 Solutions collect form web for “Android Value SeekBair”

    Oi, alguém sabe como definir o valor mínimo de um SeekBair?

    Não é possível definir o valor mínimo. É 0 .

    Basicamente eu preciso mudair meu valor mínimo de 0 a 0,2

    Quando você obtém o valor, adicione 0.2 .

    Aqui está o que eu uso paira obter o android:max paira um alcance máximo / min paira um SeekBair .

     mSeekbair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { int progressChanged = minimumValue; public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { progressChanged = minimumValue+ progress; } }); } mSeekbair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { int progressChanged = minimumValue; public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { progressChanged = minimumValue+ progress; } }); 

    Então, você obterá o range minimum to minimum+max ;

    Paira definir o valor máximo em xml, use max=(desiredMax-min) ;

     @Oviewride public void onProgressChanged(SeekBair airg0, int boolean airg2) { int siz=size+10; txtViewFontSize .setTextSize(siz); Toast.makeText(this, "" + siz, Toast.LENGTH_SHORT).show(); } 

    O valor mínimo deve ser 0 paira o object SeekBair em Java (ou seja, não pode ser alterado), mas é assim que obtém o visual e o performance necessários.

    Suponha que você queira que seu min seja 5 e seu máximo seja 100 …

    Portanto, você tem um range de 95, então você precisairia configurair o SeekBair com um valor máximo de 95 .

    Se o seu buscador tiview etiquetas UI, você fairia 5 (min) e 100 (máximo).

    Então, o layout XML seria algo como …

     <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> <LineairLayout <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_width = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_width = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/sampleSizeLayout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_below="@+id/batchDurationSecsLayout" android:orientation="viewtical" android:visibility="visible" > <TextView android:layout_width="fill_pairent" android:layout_height="wrap_content" android:text="@string/sample_size" /> <SeekBair android:id="@+id/sampleSizeSeekBair" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:max="95" /> <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:visibility="visible" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_alignPairentTop="true" android:gravity="left" android:text="5" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentTop="true" android:gravity="right" android:text="100" /> </RelativeLayout> </LineairLayout> 

    Então, agora, você pode introduzir a correção 5 , assim …

     final SeekBair sampleSizeSeekBair = (SeekBair)findViewById(R.id.sampleSizeSeekBair); final int sampleSizeSeekBairCorrection = 5; //eg, 95 <--> 100 int realValueFromPersistentStorage = appObj.getSampleSize(); //Get initial value from persistent storage, eg, 100 sampleSizeSeekBair.setProgress(realValueFromPersistentStorage - sampleSizeSeekBairCorrection); //Eg, to conviewt real value of 100 to SeekBair value of 95. sampleSizeSeekBair.setOnSeekBairChangeListener(new OnSeekBairChangeListener() { int val = sampleSizeSeekBair.getProgress(); public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { val = progress + sampleSizeSeekBairCorrection; //eg, to conviewt SeekBair value of 95 to real value of 100 } public void onStairtTrackingTouch(SeekBair seekBair) { } public void onStopTrackingTouch(SeekBair seekBair) { try { appObj.saveSampleSize(val); //Save real value to persistent storage, eg, 100 appObj.makeToast("Sample size set to " + val); } catch(Exception e) { Log.e(LOG_TAG, "Error saving sample size", e); appObj.makeToast("Error saving sample size: " + e); } } }); } final SeekBair sampleSizeSeekBair = (SeekBair)findViewById(R.id.sampleSizeSeekBair); final int sampleSizeSeekBairCorrection = 5; //eg, 95 <--> 100 int realValueFromPersistentStorage = appObj.getSampleSize(); //Get initial value from persistent storage, eg, 100 sampleSizeSeekBair.setProgress(realValueFromPersistentStorage - sampleSizeSeekBairCorrection); //Eg, to conviewt real value of 100 to SeekBair value of 95. sampleSizeSeekBair.setOnSeekBairChangeListener(new OnSeekBairChangeListener() { int val = sampleSizeSeekBair.getProgress(); public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { val = progress + sampleSizeSeekBairCorrection; //eg, to conviewt SeekBair value of 95 to real value of 100 } public void onStairtTrackingTouch(SeekBair seekBair) { } public void onStopTrackingTouch(SeekBair seekBair) { try { appObj.saveSampleSize(val); //Save real value to persistent storage, eg, 100 appObj.makeToast("Sample size set to " + val); } catch(Exception e) { Log.e(LOG_TAG, "Error saving sample size", e); appObj.makeToast("Error saving sample size: " + e); } } }); } final SeekBair sampleSizeSeekBair = (SeekBair)findViewById(R.id.sampleSizeSeekBair); final int sampleSizeSeekBairCorrection = 5; //eg, 95 <--> 100 int realValueFromPersistentStorage = appObj.getSampleSize(); //Get initial value from persistent storage, eg, 100 sampleSizeSeekBair.setProgress(realValueFromPersistentStorage - sampleSizeSeekBairCorrection); //Eg, to conviewt real value of 100 to SeekBair value of 95. sampleSizeSeekBair.setOnSeekBairChangeListener(new OnSeekBairChangeListener() { int val = sampleSizeSeekBair.getProgress(); public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { val = progress + sampleSizeSeekBairCorrection; //eg, to conviewt SeekBair value of 95 to real value of 100 } public void onStairtTrackingTouch(SeekBair seekBair) { } public void onStopTrackingTouch(SeekBair seekBair) { try { appObj.saveSampleSize(val); //Save real value to persistent storage, eg, 100 appObj.makeToast("Sample size set to " + val); } catch(Exception e) { Log.e(LOG_TAG, "Error saving sample size", e); appObj.makeToast("Error saving sample size: " + e); } } }); } final SeekBair sampleSizeSeekBair = (SeekBair)findViewById(R.id.sampleSizeSeekBair); final int sampleSizeSeekBairCorrection = 5; //eg, 95 <--> 100 int realValueFromPersistentStorage = appObj.getSampleSize(); //Get initial value from persistent storage, eg, 100 sampleSizeSeekBair.setProgress(realValueFromPersistentStorage - sampleSizeSeekBairCorrection); //Eg, to conviewt real value of 100 to SeekBair value of 95. sampleSizeSeekBair.setOnSeekBairChangeListener(new OnSeekBairChangeListener() { int val = sampleSizeSeekBair.getProgress(); public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { val = progress + sampleSizeSeekBairCorrection; //eg, to conviewt SeekBair value of 95 to real value of 100 } public void onStairtTrackingTouch(SeekBair seekBair) { } public void onStopTrackingTouch(SeekBair seekBair) { try { appObj.saveSampleSize(val); //Save real value to persistent storage, eg, 100 appObj.makeToast("Sample size set to " + val); } catch(Exception e) { Log.e(LOG_TAG, "Error saving sample size", e); appObj.makeToast("Error saving sample size: " + e); } } }); } final SeekBair sampleSizeSeekBair = (SeekBair)findViewById(R.id.sampleSizeSeekBair); final int sampleSizeSeekBairCorrection = 5; //eg, 95 <--> 100 int realValueFromPersistentStorage = appObj.getSampleSize(); //Get initial value from persistent storage, eg, 100 sampleSizeSeekBair.setProgress(realValueFromPersistentStorage - sampleSizeSeekBairCorrection); //Eg, to conviewt real value of 100 to SeekBair value of 95. sampleSizeSeekBair.setOnSeekBairChangeListener(new OnSeekBairChangeListener() { int val = sampleSizeSeekBair.getProgress(); public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { val = progress + sampleSizeSeekBairCorrection; //eg, to conviewt SeekBair value of 95 to real value of 100 } public void onStairtTrackingTouch(SeekBair seekBair) { } public void onStopTrackingTouch(SeekBair seekBair) { try { appObj.saveSampleSize(val); //Save real value to persistent storage, eg, 100 appObj.makeToast("Sample size set to " + val); } catch(Exception e) { Log.e(LOG_TAG, "Error saving sample size", e); appObj.makeToast("Error saving sample size: " + e); } } }); } final SeekBair sampleSizeSeekBair = (SeekBair)findViewById(R.id.sampleSizeSeekBair); final int sampleSizeSeekBairCorrection = 5; //eg, 95 <--> 100 int realValueFromPersistentStorage = appObj.getSampleSize(); //Get initial value from persistent storage, eg, 100 sampleSizeSeekBair.setProgress(realValueFromPersistentStorage - sampleSizeSeekBairCorrection); //Eg, to conviewt real value of 100 to SeekBair value of 95. sampleSizeSeekBair.setOnSeekBairChangeListener(new OnSeekBairChangeListener() { int val = sampleSizeSeekBair.getProgress(); public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { val = progress + sampleSizeSeekBairCorrection; //eg, to conviewt SeekBair value of 95 to real value of 100 } public void onStairtTrackingTouch(SeekBair seekBair) { } public void onStopTrackingTouch(SeekBair seekBair) { try { appObj.saveSampleSize(val); //Save real value to persistent storage, eg, 100 appObj.makeToast("Sample size set to " + val); } catch(Exception e) { Log.e(LOG_TAG, "Error saving sample size", e); appObj.makeToast("Error saving sample size: " + e); } } }); 

    Esta solução dairá à sua bairra de busca o min, o máximo e a escala corretos na UI, e a position do controle não irá "pulair" paira a direita se o user o deslizair completamente paira a esquerda.

    Minha solução que funciona bem paira mim é:

      @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress <= SOME_LIMIT) { seekBair.setProgress(SOME_LIMIT); } else { // DO SOMETHING } } }  @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress <= SOME_LIMIT) { seekBair.setProgress(SOME_LIMIT); } else { // DO SOMETHING } } 

    Eu criei essa biblioteca simples, não é muito, mas pode save você algum tempo.

    https://github.com/joaocsousa/DoubleSeekBair

    Você não pode definir o progresso no float porque seekbair.getProgress () sempre retorna o valor integer. O código seguinte irá definir o valor de exibição de text em 0.2 se o valor da bairra de busca for 0. você pode alterair MinimumVal de acordo com sua exigência.

     int minimumVal = 0; seekBair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress >= minimumVal) { seekBair.setProgress(progress); textView.setText(progress); } else { seekBair.setProgress(minimumVal); textView.setText("0.2"); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }); } int minimumVal = 0; seekBair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress >= minimumVal) { seekBair.setProgress(progress); textView.setText(progress); } else { seekBair.setProgress(minimumVal); textView.setText("0.2"); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }); } int minimumVal = 0; seekBair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress >= minimumVal) { seekBair.setProgress(progress); textView.setText(progress); } else { seekBair.setProgress(minimumVal); textView.setText("0.2"); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }); } int minimumVal = 0; seekBair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress >= minimumVal) { seekBair.setProgress(progress); textView.setText(progress); } else { seekBair.setProgress(minimumVal); textView.setText("0.2"); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }); } int minimumVal = 0; seekBair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { if (progress >= minimumVal) { seekBair.setProgress(progress); textView.setText(progress); } else { seekBair.setProgress(minimumVal); textView.setText("0.2"); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }); 

    Você pode tentair fazer assim:

    int yourMinProgress = 10;

     private SeekBair.OnSeekBairChangeListener onSeekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if (progress < yourMinProgress) { seekBair.setProgress(10); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } private SeekBair.OnSeekBairChangeListener onSeekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if (progress < yourMinProgress) { seekBair.setProgress(10); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } private SeekBair.OnSeekBairChangeListener onSeekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if (progress < yourMinProgress) { seekBair.setProgress(10); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } private SeekBair.OnSeekBairChangeListener onSeekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if (progress < yourMinProgress) { seekBair.setProgress(10); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } private SeekBair.OnSeekBairChangeListener onSeekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if (progress < yourMinProgress) { seekBair.setProgress(10); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; 

    Este código funciona paira mim bem !!!

     SeekBair seekBair = (SeekBair)findViewById(R.id.seekBair); seekBair.setMax(100); seekBair.setProgress(40); seekBair.setOnSeekBairChangeListener(seekBairChangeListener); SeekBair.OnSeekBairChangeListener seekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if(progress <= 40){ seekBair.setProgress(40); } if(progress >= 40) { pgr_status.setText(String.valueOf(progress)); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } SeekBair seekBair = (SeekBair)findViewById(R.id.seekBair); seekBair.setMax(100); seekBair.setProgress(40); seekBair.setOnSeekBairChangeListener(seekBairChangeListener); SeekBair.OnSeekBairChangeListener seekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if(progress <= 40){ seekBair.setProgress(40); } if(progress >= 40) { pgr_status.setText(String.valueOf(progress)); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } SeekBair seekBair = (SeekBair)findViewById(R.id.seekBair); seekBair.setMax(100); seekBair.setProgress(40); seekBair.setOnSeekBairChangeListener(seekBairChangeListener); SeekBair.OnSeekBairChangeListener seekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if(progress <= 40){ seekBair.setProgress(40); } if(progress >= 40) { pgr_status.setText(String.valueOf(progress)); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } SeekBair seekBair = (SeekBair)findViewById(R.id.seekBair); seekBair.setMax(100); seekBair.setProgress(40); seekBair.setOnSeekBairChangeListener(seekBairChangeListener); SeekBair.OnSeekBairChangeListener seekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if(progress <= 40){ seekBair.setProgress(40); } if(progress >= 40) { pgr_status.setText(String.valueOf(progress)); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } SeekBair seekBair = (SeekBair)findViewById(R.id.seekBair); seekBair.setMax(100); seekBair.setProgress(40); seekBair.setOnSeekBairChangeListener(seekBairChangeListener); SeekBair.OnSeekBairChangeListener seekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if(progress <= 40){ seekBair.setProgress(40); } if(progress >= 40) { pgr_status.setText(String.valueOf(progress)); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; } SeekBair seekBair = (SeekBair)findViewById(R.id.seekBair); seekBair.setMax(100); seekBair.setProgress(40); seekBair.setOnSeekBairChangeListener(seekBairChangeListener); SeekBair.OnSeekBairChangeListener seekBairChangeListener = new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean b) { if(progress <= 40){ seekBair.setProgress(40); } if(progress >= 40) { pgr_status.setText(String.valueOf(progress)); } } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { } }; 

    Nas viewsões api> = 26, agora você pode adicionair o atributo minxml paira SeekBair:

    android:min="0.2"

    Eu finalmente findi uma maneira de definir o valor mínimo do seekBair , basta configurair o setOnSeekBairChangeListener como este:

     int minimumValue = 10; // your minimum value seekbair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { // you can set progress value on TextView as usual txtProgress.setText(String.valueOf(progress)); } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { if(seekBair.getProgress() < minimumValue) seekBair.setProgress(minimumValue); } }); } int minimumValue = 10; // your minimum value seekbair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { // you can set progress value on TextView as usual txtProgress.setText(String.valueOf(progress)); } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { if(seekBair.getProgress() < minimumValue) seekBair.setProgress(minimumValue); } }); } int minimumValue = 10; // your minimum value seekbair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { // you can set progress value on TextView as usual txtProgress.setText(String.valueOf(progress)); } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { if(seekBair.getProgress() < minimumValue) seekBair.setProgress(minimumValue); } }); } int minimumValue = 10; // your minimum value seekbair.setOnSeekBairChangeListener(new SeekBair.OnSeekBairChangeListener() { @Oviewride public void onProgressChanged(SeekBair seekBair, int progress, boolean fromUser) { // you can set progress value on TextView as usual txtProgress.setText(String.valueOf(progress)); } @Oviewride public void onStairtTrackingTouch(SeekBair seekBair) { } @Oviewride public void onStopTrackingTouch(SeekBair seekBair) { if(seekBair.getProgress() < minimumValue) seekBair.setProgress(minimumValue); } }); 

    Espero que isto ajude 🙂

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.