问题
I am developing app for blind community. I want to give an option for the user to explore the screen by scraping finger through the screen (exploring by touch). I am unable to find any api to build this functionality. I am trying to achieve this in android 2.3.3 (api level 10).
I know in Android 4.1 talkback with 'touch by explore' functionality comes by default, but I want to give this feature to the users who are using below android 4.1 devices. Any ideas are appreciated.
回答1:
You may want try using the AccessibilityShim library from Eyes-Free Project. It implements ICS-style touch exploration for individual Activities in Gingerbread and below.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
// This call must occur after setContentView().
AccessiblityShim.attachToActivity(this);
}
It can also be applied to Dialogs.
AccessiblityShim.attachToDialog(dialog);
来源:https://stackoverflow.com/questions/14296612/android-2-3-3-touch-by-explore