Merge "Fix videoPreference is broken when switch to multiple window"
This commit is contained in:
committed by
Android (Google) Code Review
commit
74e60b1010
@@ -68,7 +68,7 @@ public class AssistGestureSettingsPreferenceController extends GesturePreference
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
public void onStart() {
|
||||
if (mWasAvailable != isAvailable()) {
|
||||
// Only update the preference visibility if the availability has changed -- otherwise
|
||||
// the preference may be incorrectly added to screens with collapsed sections.
|
||||
|
||||
@@ -25,12 +25,12 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settings.widget.VideoPreference;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnPause;
|
||||
import com.android.settingslib.core.lifecycle.events.OnResume;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStart;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStop;
|
||||
|
||||
public abstract class GesturePreferenceController extends TogglePreferenceController
|
||||
implements Preference.OnPreferenceChangeListener,
|
||||
LifecycleObserver, OnResume, OnPause {
|
||||
LifecycleObserver, OnStart, OnStop {
|
||||
|
||||
private VideoPreference mVideoPreference;
|
||||
|
||||
@@ -62,16 +62,16 @@ public abstract class GesturePreferenceController extends TogglePreferenceContro
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
public void onStart() {
|
||||
if (mVideoPreference != null) {
|
||||
mVideoPreference.onViewInvisible();
|
||||
mVideoPreference.onViewVisible();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
public void onStop() {
|
||||
if (mVideoPreference != null) {
|
||||
mVideoPreference.onViewVisible();
|
||||
mVideoPreference.onViewInvisible();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnPause;
|
||||
import com.android.settingslib.core.lifecycle.events.OnResume;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStart;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStop;
|
||||
|
||||
public class VideoPreferenceController extends BasePreferenceController implements
|
||||
LifecycleObserver, OnResume, OnPause {
|
||||
LifecycleObserver, OnStart, OnStop {
|
||||
|
||||
private VideoPreference mVideoPreference;
|
||||
|
||||
@@ -47,17 +47,16 @@ public class VideoPreferenceController extends BasePreferenceController implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
if (mVideoPreference != null) {
|
||||
mVideoPreference.onViewInvisible();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
public void onStart() {
|
||||
if (mVideoPreference != null) {
|
||||
mVideoPreference.onViewVisible();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
if (mVideoPreference != null) {
|
||||
mVideoPreference.onViewInvisible();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user