1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-01 03:10:06 +00:00

WebBrowserComponent: Android: Add accessibility integration

This commit is contained in:
attila 2023-04-20 20:58:38 +02:00 committed by Attila Szarvas
parent d8c282e293
commit f519af3b62
5 changed files with 931 additions and 767 deletions

View file

@ -140,7 +140,10 @@ AndroidViewComponent::AndroidViewComponent()
{
}
AndroidViewComponent::~AndroidViewComponent() {}
AndroidViewComponent::~AndroidViewComponent()
{
AccessibilityHandler::setNativeChildForComponent (*this, nullptr);
}
void AndroidViewComponent::setView (void* view)
{
@ -156,6 +159,12 @@ void AndroidViewComponent::setView (void* view)
auto localref = LocalRef<jobject>(env->NewLocalRef((jobject) view));
pimpl.reset (new Pimpl (localref, *this));
AccessibilityHandler::setNativeChildForComponent (*this, getView());
}
else
{
AccessibilityHandler::setNativeChildForComponent (*this, nullptr);
}
}
}
@ -173,4 +182,9 @@ void AndroidViewComponent::resizeToFitView()
void AndroidViewComponent::paint (Graphics&) {}
std::unique_ptr<AccessibilityHandler> AndroidViewComponent::createAccessibilityHandler()
{
return std::make_unique<AccessibilityHandler> (*this, AccessibilityRole::group);
}
} // namespace juce