KeyEventCompat not supported at build
change this
if (KeyEventCompat.hasNoModifiers(event)) { handled = arrowScroll(FOCUS_FORWARD);} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) { handled = arrowScroll(FOCUS_BACKWARD);}
to
if (event.hasNoModifiers()) { handled = arrowScroll(FOCUS_FORWARD);} else if (event.hasModifiers(KeyEvent.META_SHIFT_ON)) { handled = arrowScroll(FOCUS_BACKWARD);}
KeyEventCompat class was deprecated in API level 26.0.0
I resolved this KeyEventCompat issue by adding this line to the app's build gradle (Above dependencies)
configurations.all { exclude group: 'com.google.code.gson' resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '26.0.2' } } }}