mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-25 06:52:13 +01:00
Remove dependency on getUserVisibleHint
This commit is contained in:
@@ -25,12 +25,9 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
@@ -158,19 +155,6 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
return Helper.hasPermission(this, name);
|
||||
}
|
||||
|
||||
protected View getVisibleView() {
|
||||
for (Fragment fragment : getSupportFragmentManager().getFragments())
|
||||
if (fragment.getUserVisibleHint()) {
|
||||
View view = fragment.getView();
|
||||
Log.i("Visible fragment=" + fragment.getClass().getName() + " view=" + view);
|
||||
if (view != null && !(view instanceof ScrollView)) // Snackbar cannot be attached to ScrollView
|
||||
return view;
|
||||
}
|
||||
|
||||
Log.i("Visible activity=" + this.getClass().getName());
|
||||
return findViewById(android.R.id.content);
|
||||
}
|
||||
|
||||
void addBackPressedListener(final IBackPressedListener listener, LifecycleOwner owner) {
|
||||
Log.i("Adding back listener=" + listener);
|
||||
backPressedListeners.add(listener);
|
||||
|
||||
Reference in New Issue
Block a user