Accessibility of Ratingbars using TalkBack 8.2.0

58 views
Skip to first unread message

Petra Zugang

unread,
Sep 3, 2020, 7:07:52 AM9/3/20
to Eyes-free Programming and development
Hello,

In the newer versions of TalkBack there is for Ratingbars the option "seek control" available in the "Local Content menu".

If I use the option  "seek control" the following code get timende have way throw. 

Can Someone help me to update this code so that it works even if using a newer version of TalkBack?


     View v = inflater.inflate (R.layout.fragment_rating_bar, container, false);

    final RatingBar ratingbar = (RatingBar) v.findViewById(R.id.ratingBar2);

    ratingbar.setContentDescription (ratingbar.getRating () +
    "ort of " + ratingbar.getNumStars () + "Stars") ;
    ratingbar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
        @Override
        public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
            ratingbar.setContentDescription(rating + " out of " +
                    ratingbar.getNumStars() + " Stars");
        }

    });




    return v;

}

  Best Regards 


Petra Riter
Reply all
Reply to author
Forward
0 new messages