use of com.android.settings.widget.VideoPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GesturePreferenceControllerTest method onResume_shouldStartVideoPreferenceWithVideoPauseState.
@Test
public void onResume_shouldStartVideoPreferenceWithVideoPauseState() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
final Bundle savedState = new Bundle();
mController.onCreate(null);
mController.onResume();
verify(videoPreference).onViewVisible(false);
reset(videoPreference);
savedState.putBoolean(GesturePreferenceController.KEY_VIDEO_PAUSED, true);
mController.onCreate(savedState);
mController.onResume();
verify(videoPreference).onViewVisible(true);
reset(videoPreference);
savedState.putBoolean(GesturePreferenceController.KEY_VIDEO_PAUSED, false);
mController.onCreate(savedState);
mController.onResume();
verify(videoPreference).onViewVisible(false);
}
use of com.android.settings.widget.VideoPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SystemNavigationGestureSettings method onAttach.
@Override
public void onAttach(Context context) {
super.onAttach(context);
SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
mOverlayManager = IOverlayManager.Stub.asInterface(ServiceManager.getService(Context.OVERLAY_SERVICE));
mVideoPreference = new VideoPreference(context);
setIllustrationVideo(mVideoPreference, getDefaultKey());
mVideoPreference.setHeight(/* Illustration height in dp */
getResources().getDimension(R.dimen.system_navigation_illustration_height) / getResources().getDisplayMetrics().density);
}
use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by omnirom.
the class GesturePreferenceControllerTest method onStart_shouldStartVideoPreference.
@Test
public void onStart_shouldStartVideoPreference() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
mController.onStart();
verify(videoPreference).onViewVisible();
}
use of com.android.settings.widget.VideoPreference in project android_packages_apps_Settings by omnirom.
the class GesturePreferenceControllerTest method onStop_shouldStopVideoPreference.
@Test
public void onStop_shouldStopVideoPreference() {
final VideoPreference videoPreference = mock(VideoPreference.class);
when(mScreen.findPreference(mController.getVideoPrefKey())).thenReturn(videoPreference);
mController.mIsPrefAvailable = true;
mController.displayPreference(mScreen);
mController.onStop();
verify(videoPreference).onViewInvisible();
}
Aggregations