Search in sources :

Example 21 with VideoPreference

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);
}
Also used : Bundle(android.os.Bundle) VideoPreference(com.android.settings.widget.VideoPreference) Test(org.junit.Test)

Example 22 with VideoPreference

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);
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider) VideoPreference(com.android.settings.widget.VideoPreference)

Example 23 with VideoPreference

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();
}
Also used : VideoPreference(com.android.settings.widget.VideoPreference) Test(org.junit.Test)

Example 24 with VideoPreference

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();
}
Also used : VideoPreference(com.android.settings.widget.VideoPreference) Test(org.junit.Test)

Aggregations

VideoPreference (com.android.settings.widget.VideoPreference)24 Test (org.junit.Test)23 Bundle (android.os.Bundle)7 SharedPreferences (android.content.SharedPreferences)1 SuggestionFeatureProvider (com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)1