question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RangeSlider] theming of valueLabel applies only to unselected label

See original GitHub issue

Description: After theming a label using the following attributes:

  <com.google.android.material.slider.RangeSlider
      ...
      app:labelStyle="@style/Filters.Style.Criteria.SliderSectionItem.SliderLabel"
      />

in styles.xml:

  <style name="Filters.Style.Criteria.SliderSectionItem.SliderLabel" parent="Widget.MaterialComponents.Tooltip">
    <item name="backgroundTint">?cosmaColorFloatingButtonSecondaryVariantBackground</item>
    <item name="android:textAppearance">@style/Filters.TextAppearance.Criteria.SliderSectionItem.SliderLabel</item>
  </style>

  <style name="Filters.TextAppearance.Criteria.SliderSectionItem.SliderLabel" parent="TextAppearance.MaterialComponents.Tooltip">
    <item name="android:textColor">?colorSurface</item> 
    <item name="fontFamily">@font/cosma_make_it_sans</item>
    <item name="android:fontFamily">@font/cosma_make_it_sans</item>
  </style>

I see only the currently unselected item of the range being styled properly:

sliderbug

Expected behavior: both value label are having the same style (black with white text)

Source code: see above

Android API version: 28

Material Library version: 1.2.0

Device: Samsung Galaxy S10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
NoyaD9commented, Aug 19, 2020

@cketcham thanks for the reply! I will create a project from scratch and try to reproduce. I will contact you as soon as it’s ready

1reaction
MdMahaboobKhancommented, Apr 22, 2021

@cketcham I realize that I encounter this error only when I’m setting initial values for my rangeslider programmatically. It works as expected when I set initial values for my RangeSlider using “app:values”. I’m loading the initial values for the range slider from sharedPreferences initially. How can I fix this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a custom label to material range slider - Stack Overflow
To change the background color of the label you can use a custom style: <com.google.android.material.slider.RangeSlider style="@style/Myslider" ...
Read more >
Labels in Flutter Range Slider (SfRangeSlider) - Syncfusion
Learn here all about adding the Labels feature in Syncfusion Flutter Range Slider (SfRangeSlider) widget and more.
Read more >
Element: <oj-status-meter-gauge> - Oracle
Only applies when thresholds are not defined. The default value varies based on theme. ... An object defining the value label.
Read more >
Designing The Perfect Slider - Smashing Magazine
A price range slider just doesn't yield the same input speed as input ... but turning the value label into an input field...
Read more >
USER GUIDE 6.2 - PrimeFaces
PrimeFaces only requires a JAVA 6+ runtime and a JSF 2.x implementation as mandatory ... unselect(index) ... Styling directly applies to a container...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found