Skip to content

Commit

Permalink
Improved accessibility support
Browse files Browse the repository at this point in the history
- For accessibility (a11y) mode, updated the entire button to receive and act as a normal button instead of just the thumb component.
- Switching from a11y to normal or vice-versa is not detecting the a11y enabled check value correctly. So, reading the value again in onFocus. 
- Made changes to make the button work better in a11y mode. However, testing with iOS simulator is not going well.
- A11y status listener event name 'change' has been deprecated. So, updated it to the latest value 'screenReaderChanged'.
  • Loading branch information
UdaySravanK authored Jan 24, 2025
1 parent c43b2bf commit f60ee18
Show file tree
Hide file tree
Showing 15 changed files with 1,168 additions and 776 deletions.
214 changes: 113 additions & 101 deletions coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -1,129 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1737607767404" clover="3.2.0">
<project timestamp="1737607767404" name="All files">
<metrics statements="125" coveredstatements="68" conditionals="106" coveredconditionals="54" methods="27" coveredmethods="10" elements="258" coveredelements="132" complexity="0" loc="125" ncloc="125" packages="3" files="5" classes="5"/>
<coverage generated="1737685075706" clover="3.2.0">
<project timestamp="1737685075706" name="All files">
<metrics statements="137" coveredstatements="81" conditionals="113" coveredconditionals="63" methods="30" coveredmethods="12" elements="280" coveredelements="156" complexity="0" loc="137" ncloc="137" packages="3" files="5" classes="5"/>
<package name="components.SwipeButton">
<metrics statements="25" coveredstatements="20" conditionals="39" coveredconditionals="32" methods="6" coveredmethods="5"/>
<metrics statements="41" coveredstatements="33" conditionals="55" coveredconditionals="43" methods="9" coveredmethods="7"/>
<file name="index.js" path="/Users/uday-kybing/work/RNSwipeButton/src/components/SwipeButton/index.js">
<metrics statements="24" coveredstatements="19" conditionals="39" coveredconditionals="32" methods="6" coveredmethods="5"/>
<metrics statements="40" coveredstatements="32" conditionals="55" coveredconditionals="43" methods="9" coveredmethods="7"/>
<line num="32" count="2" type="stmt"/>
<line num="69" count="36" type="stmt"/>
<line num="70" count="36" type="stmt"/>
<line num="71" count="36" type="stmt"/>
<line num="78" count="36" type="stmt"/>
<line num="79" count="12" type="cond" truecount="3" falsecount="1"/>
<line num="80" count="0" type="stmt"/>
<line num="82" count="12" type="stmt"/>
<line num="85" count="36" type="stmt"/>
<line num="86" count="12" type="stmt"/>
<line num="87" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="88" count="0" type="stmt"/>
<line num="90" count="0" type="stmt"/>
<line num="92" count="12" type="stmt"/>
<line num="93" count="12" type="stmt"/>
<line num="98" count="12" type="stmt"/>
<line num="99" count="12" type="cond" truecount="1" falsecount="1"/>
<line num="100" count="0" type="stmt"/>
<line num="102" count="12" type="stmt"/>
<line num="105" count="12" type="stmt"/>
<line num="106" count="12" type="stmt"/>
<line num="107" count="12" type="stmt"/>
<line num="111" count="36" type="stmt"/>
<line num="182" count="2" type="stmt"/>
<line num="69" count="38" type="stmt"/>
<line num="70" count="38" type="stmt"/>
<line num="71" count="38" type="stmt"/>
<line num="72" count="38" type="stmt"/>
<line num="73" count="38" type="stmt"/>
<line num="79" count="38" type="stmt"/>
<line num="80" count="12" type="cond" truecount="3" falsecount="1"/>
<line num="81" count="0" type="stmt"/>
<line num="83" count="12" type="stmt"/>
<line num="91" count="38" type="stmt"/>
<line num="92" count="12" type="cond" truecount="3" falsecount="1"/>
<line num="93" count="0" type="stmt"/>
<line num="95" count="12" type="stmt"/>
<line num="99" count="38" type="stmt"/>
<line num="100" count="25" type="cond" truecount="3" falsecount="1"/>
<line num="101" count="25" type="stmt"/>
<line num="103" count="0" type="stmt"/>
<line num="106" count="38" type="stmt"/>
<line num="107" count="25" type="stmt"/>
<line num="108" count="25" type="stmt"/>
<line num="113" count="25" type="stmt"/>
<line num="115" count="25" type="stmt"/>
<line num="116" count="25" type="stmt"/>
<line num="117" count="25" type="cond" truecount="1" falsecount="1"/>
<line num="118" count="25" type="stmt"/>
<line num="123" count="38" type="stmt"/>
<line num="125" count="12" type="cond" truecount="2" falsecount="0"/>
<line num="126" count="1" type="stmt"/>
<line num="127" count="11" type="cond" truecount="1" falsecount="1"/>
<line num="128" count="0" type="stmt"/>
<line num="130" count="11" type="stmt"/>
<line num="134" count="38" type="stmt"/>
<line num="135" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="136" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="138" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="142" count="38" type="stmt"/>
<line num="143" count="0" type="stmt"/>
<line num="146" count="38" type="stmt"/>
<line num="225" count="2" type="stmt"/>
</file>
<file name="styles.js" path="/Users/uday-kybing/work/RNSwipeButton/src/components/SwipeButton/styles.js">
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
<line num="3" count="2" type="stmt"/>
</file>
</package>
<package name="components.SwipeThumb">
<metrics statements="88" coveredstatements="36" conditionals="67" coveredconditionals="22" methods="21" coveredmethods="5"/>
<metrics statements="84" coveredstatements="36" conditionals="58" coveredconditionals="20" methods="21" coveredmethods="5"/>
<file name="index.js" path="/Users/uday-kybing/work/RNSwipeButton/src/components/SwipeThumb/index.js">
<metrics statements="84" coveredstatements="32" conditionals="67" coveredconditionals="22" methods="21" coveredmethods="5"/>
<line num="17" count="3" type="stmt"/>
<line num="18" count="3" type="stmt"/>
<line num="20" count="3" type="stmt"/>
<line num="49" count="14" type="stmt"/>
<metrics statements="80" coveredstatements="32" conditionals="58" coveredconditionals="20" methods="21" coveredmethods="5"/>
<line num="11" count="3" type="stmt"/>
<line num="12" count="3" type="stmt"/>
<line num="14" count="3" type="stmt"/>
<line num="41" count="14" type="stmt"/>
<line num="43" count="13" type="stmt"/>
<line num="44" count="13" type="stmt"/>
<line num="45" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="46" count="12" type="stmt"/>
<line num="48" count="1" type="stmt"/>
<line num="50" count="13" type="stmt"/>
<line num="51" count="13" type="stmt"/>
<line num="52" count="13" type="stmt"/>
<line num="53" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="54" count="12" type="stmt"/>
<line num="56" count="1" type="stmt"/>
<line num="58" count="13" type="stmt"/>
<line num="53" count="13" type="stmt"/>
<line num="56" count="13" type="stmt"/>
<line num="57" count="13" type="stmt"/>
<line num="59" count="13" type="stmt"/>
<line num="61" count="13" type="stmt"/>
<line num="64" count="13" type="stmt"/>
<line num="65" count="13" type="stmt"/>
<line num="67" count="13" type="stmt"/>
<line num="68" count="13" type="stmt"/>
<line num="70" count="13" type="stmt"/>
<line num="72" count="0" type="stmt"/>
<line num="73" count="0" type="stmt"/>
<line num="74" count="0" type="stmt"/>
<line num="75" count="0" type="stmt"/>
<line num="76" count="0" type="stmt"/>
<line num="60" count="13" type="stmt"/>
<line num="62" count="13" type="stmt"/>
<line num="64" count="0" type="stmt"/>
<line num="65" count="0" type="stmt"/>
<line num="66" count="0" type="stmt"/>
<line num="67" count="0" type="stmt"/>
<line num="68" count="0" type="stmt"/>
<line num="76" count="13" type="stmt"/>
<line num="77" count="13" type="stmt"/>
<line num="84" count="13" type="stmt"/>
<line num="85" count="13" type="stmt"/>
<line num="92" count="13" type="stmt"/>
<line num="93" count="13" type="cond" truecount="1" falsecount="1"/>
<line num="96" count="13" type="stmt"/>
<line num="97" count="13" type="cond" truecount="1" falsecount="1"/>
<line num="102" count="0" type="stmt"/>
<line num="103" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="107" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="108" count="0" type="stmt"/>
<line num="85" count="13" type="cond" truecount="1" falsecount="1"/>
<line num="88" count="13" type="stmt"/>
<line num="89" count="13" type="cond" truecount="1" falsecount="1"/>
<line num="94" count="0" type="stmt"/>
<line num="95" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="99" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="100" count="0" type="stmt"/>
<line num="101" count="0" type="stmt"/>
<line num="103" count="0" type="stmt"/>
<line num="104" count="0" type="stmt"/>
<line num="108" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="109" count="0" type="stmt"/>
<line num="111" count="0" type="stmt"/>
<line num="112" count="0" type="stmt"/>
<line num="116" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="117" count="0" type="stmt"/>
<line num="111" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="115" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="116" count="0" type="stmt"/>
<line num="118" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="119" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="121" count="0" type="stmt"/>
<line num="123" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="124" count="0" type="stmt"/>
<line num="125" count="0" type="stmt"/>
<line num="126" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="127" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="128" count="0" type="stmt"/>
<line num="129" count="0" type="stmt"/>
<line num="131" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="133" count="0" type="stmt"/>
<line num="134" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="136" count="0" type="stmt"/>
<line num="131" count="0" type="stmt"/>
<line num="132" count="0" type="stmt"/>
<line num="137" count="0" type="stmt"/>
<line num="139" count="0" type="stmt"/>
<line num="140" count="0" type="stmt"/>
<line num="145" count="0" type="stmt"/>
<line num="150" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="151" count="0" type="stmt"/>
<line num="153" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="154" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="156" count="0" type="stmt"/>
<line num="142" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="143" count="0" type="stmt"/>
<line num="145" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="146" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="148" count="0" type="stmt"/>
<line num="150" count="0" type="stmt"/>
<line num="151" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="157" count="0" type="stmt"/>
<line num="158" count="0" type="stmt"/>
<line num="159" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="166" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="167" count="0" type="stmt"/>
<line num="163" count="0" type="stmt"/>
<line num="164" count="0" type="stmt"/>
<line num="168" count="0" type="stmt"/>
<line num="174" count="0" type="stmt"/>
<line num="175" count="0" type="stmt"/>
<line num="179" count="0" type="stmt"/>
<line num="172" count="0" type="stmt"/>
<line num="173" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="178" count="0" type="stmt"/>
<line num="179" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="183" count="0" type="stmt"/>
<line num="184" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="184" count="0" type="stmt"/>
<line num="188" count="0" type="stmt"/>
<line num="189" count="0" type="stmt"/>
<line num="190" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="194" count="0" type="stmt"/>
<line num="195" count="0" type="stmt"/>
<line num="197" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="198" count="0" type="stmt"/>
<line num="199" count="0" type="stmt"/>
<line num="204" count="0" type="stmt"/>
<line num="205" count="0" type="stmt"/>
<line num="209" count="13" type="stmt"/>
<line num="210" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="211" count="12" type="stmt"/>
<line num="213" count="1" type="stmt"/>
<line num="215" count="13" type="stmt"/>
<line num="228" count="13" type="stmt"/>
<line num="245" count="13" type="stmt"/>
<line num="253" count="13" type="stmt"/>
<line num="282" count="3" type="stmt"/>
<line num="193" count="13" type="stmt"/>
<line num="194" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="195" count="12" type="stmt"/>
<line num="197" count="1" type="stmt"/>
<line num="199" count="13" type="stmt"/>
<line num="212" count="13" type="stmt"/>
<line num="229" count="13" type="stmt"/>
<line num="237" count="13" type="stmt"/>
<line num="249" count="3" type="stmt"/>
</file>
<file name="styles.js" path="/Users/uday-kybing/work/RNSwipeButton/src/components/SwipeThumb/styles.js">
<metrics statements="4" coveredstatements="4" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
Expand Down
Loading

0 comments on commit f60ee18

Please sign in to comment.