hbb20 / CountryCodePickerProject

Country Code Picker (CCP) is an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.
Apache License 2.0
1.52k stars 505 forks source link

how to provide accessible name for country code form field #460

Closed srikanthgsm closed 3 years ago

srikanthgsm commented 3 years ago

how to provide accessible name for country code form field? as of now talkback only announces the value country code. I need to provide custom accessible name for country code form field.

hbb20 commented 3 years ago

Thanks you for reporting. I will have to take a look at it.

On Fri, Jan 8, 2021 at 01:31 srikanthgsm notifications@github.com wrote:

how to provide accessible name for country code form field? as of now it only announces the value country code. I need to provide custom accessible name.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/460, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32GAMTA2CI5NNH3MED3SY27HVANCNFSM4V2D72MQ .

srikanthgsm commented 3 years ago

Hi team, did you get chance to look into it. Expecting your fix ASAP.

hbb20 commented 3 years ago

It's been a crazy week. Sorry about that. If you can create a PR , that would be great I'll be happy to merge and release new version. Otherwise please explain little more about what exactly you are looking for since accessibility is not my strong hold yet.

On Mon, Jan 11, 2021 at 11:08 srikanthgsm notifications@github.com wrote:

Hi team, did you get chance to look into it. Expecting your fix ASAP.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/460#issuecomment-758126738, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32DN7XNB46GCTJWM3H3SZM5B5ANCNFSM4V2D72MQ .

srikanthgsm commented 3 years ago

When I enable talkback and navigate to edit phone number screen..., I have country code picker. In which country code is prefilled based on the region where the user is located. while the country code field(country code field doesn't have label as per design) is focused, talkback announced the value country code. The expected behavior is, talkback should announce ("Country code is +1) but now the country code pick announces simply (+1). The differently abled users cannot understand what is +1 when talkback announces, if we provide proper value as ("Country code is +1<>). Then it would be useful. Because of this issue our app fails for accessibility standards.

Thanks

hbb20 commented 3 years ago

Thanks for the feedback. I will look into how can I do this and will do tonight after office. I don't want you to hold any longer because of this. Meanwhile if you know and can share how can I do that that would be greatly appreciated.

On Mon, Jan 11, 2021 at 11:29 srikanthgsm notifications@github.com wrote:

When I enable talkback and navigate to edit phone number screen..., I have country code picker. In which country code is prefilled based on the region where the user is located. while the country code field(country code field doesn't have label as per design) is focused, talkback announced the value country code. The expected behavior is, talkback should announce ("Country code is +1) but now the country code pick announces simply (+1). The differently abled users cannot understand what is +1 when talkback announces, if we provide proper value as ("Country code is +1<>). Then it would be useful. Because of this issue our app fails for accessibility standards.

Thanks

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/460#issuecomment-758138945, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32DTQ3BOZQMQZW7K6YTSZM7QJANCNFSM4V2D72MQ .

srikanthgsm commented 3 years ago

I could see countrypicker extends Relativelayout. with this I have added ContentDescription. but ContentDescription is not read by talkback, rather it reads the value of the formfield. below is my xml.

<com.hbb20.CountryCodePicker android:id="@+id/country_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="40dp" android:layout_marginTop="20dp" android:layout_marginRight="10dp" android:contentDescription="country code is +1" android:background="@drawable/edit_text_book_border" android:gravity="center|center_vertical" android:includeFontPadding="false" android:minHeight="65dp" app:ccpDialog_backgroundColor="@color/colorWhite" app:ccpDialog_showCloseIcon="true" app:ccpDialog_textColor="@color/colorPurple" app:ccp_areaCodeDetectedCountry="true" app:ccp_autoDetectCountry="true" app:ccp_countryPreference="@string/drop_down_country_pref" app:ccp_showNameCode="false" />

Hope this will help.

hbb20 commented 3 years ago

Thanks for heads up. Will get into this and get back to you.

On Mon, Jan 11, 2021 at 11:40 srikanthgsm notifications@github.com wrote:

I could see countrypicker extends Relativelayout. with this I have added ContentDescription. but ContentDescription is not read by talkback, rather it reads the value of the formfield. below is my xml.

<com.hbb20.CountryCodePicker android:id="@+id/country_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="40dp" android:layout_marginTop="20dp" android:layout_marginRight="10dp" android:contentDescription="country code is +1" android:background="@drawable/edit_text_book_border" android:gravity="center|center_vertical" android:includeFontPadding="false" android:minHeight="65dp" app:ccpDialog_backgroundColor="@color/colorWhite" app:ccpDialog_showCloseIcon="true" app:ccpDialog_textColor="@color/colorPurple" app:ccp_areaCodeDetectedCountry="true" app:ccp_autoDetectCountry="true" app:ccp_countryPreference="@string/drop_down_country_pref" app:ccp_showNameCode="false" />

Hope this will help.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hbb20/CountryCodePickerProject/issues/460#issuecomment-758144952, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFQ32CDYGJDKQNNAZ5SPZ3SZNA3VANCNFSM4V2D72MQ .

hbb20 commented 3 years ago

Hey,

I have released new version 2.4.5 which should have better talkback content. Default will be country.name + " phone code is +" + country.phoneCode;

You can also override this by setting your own CCPTalkBackTextProvider. You can find an example here.

Please let me know if that works for you.

hbb20 commented 3 years ago

@srikanthgsm ☝🏼

srikanthgsm commented 3 years ago

Will try and update you. Thanks

srikanthgsm commented 3 years ago

i'm getting below error while gradle sync. but with 2.4.4 compiling, only 2.4.5 i'm getting error.

Could not determine the dependencies of task ':app:compileProdDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:prodDebugCompileClasspath'. Could not find com.hbb20:ccp:2.4.5. Required by: project :app

hbb20 commented 3 years ago

oops.. build failed.. try again please.

srikanthgsm commented 3 years ago

Thanks Harsh, build successful. The fix is working.