0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

Fix invalid cast: onSystemUiVisibilityChange

LinearLayout had changed to a FrameLayout

Also add a lint check to ensure this doesn't happen in the future

Fixes 6977
This commit is contained in:
David Allison 2020-08-28 16:30:04 +01:00 committed by Mike Hardy
parent 03461ab949
commit f04aae0a4f
2 changed files with 4 additions and 4 deletions

View File

@ -45,9 +45,9 @@ public class CompatV19 extends CompatV18 implements Compat {
(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int flags) {
final Toolbar toolbar = (Toolbar) a.findViewById(R.id.toolbar);
final LinearLayout answerButtons = (LinearLayout) a.findViewById(R.id.answer_options_layout);
final RelativeLayout topbar = (RelativeLayout) a.findViewById(R.id.top_bar);
final View toolbar = a.findViewById(R.id.toolbar);
final View answerButtons = a.findViewById(R.id.answer_options_layout);
final View topbar = a.findViewById(R.id.top_bar);
if (toolbar == null || topbar == null || answerButtons == null) {
return;
}

View File

@ -4,7 +4,7 @@ tasks.whenTaskAdded { task ->
task.doFirst {
android.lintOptions.abortOnError = true
android.lintOptions.warningsAsErrors true
android.lintOptions.check 'NewApi', 'InlinedApi'
android.lintOptions.check 'NewApi', 'InlinedApi', 'WrongViewCast'
}
} else {
task.doFirst {