Search in sources :

Example 41 with Parcelable

use of android.os.Parcelable in project mortar by square.

the class PopupPresenterTest method showTwiceWithSameInfoDebounces.

@Test
public void showTwiceWithSameInfoDebounces() {
    presenter.takeView(view);
    Parcelable info = mock(Parcelable.class);
    presenter.show(info);
    presenter.show(info);
    verify(view).show(same(info), anyBoolean(), same(presenter));
}
Also used : Parcelable(android.os.Parcelable) Test(org.junit.Test)

Example 42 with Parcelable

use of android.os.Parcelable in project mortar by square.

the class PopupPresenterTest method showingReturnsInfo.

@Test
public void showingReturnsInfo() {
    Parcelable info = mock(Parcelable.class);
    presenter.show(info);
    assertThat(presenter.showing()).isSameAs(info);
}
Also used : Parcelable(android.os.Parcelable) Test(org.junit.Test)

Example 43 with Parcelable

use of android.os.Parcelable in project mortar by square.

the class PopupPresenterTest method showAfterTakeViewShowsView.

@Test
public void showAfterTakeViewShowsView() {
    presenter.takeView(view);
    Parcelable info = mock(Parcelable.class);
    presenter.show(info);
    verify(view).show(same(info), eq(WITH_FLOURISH), same(presenter));
}
Also used : Parcelable(android.os.Parcelable) Test(org.junit.Test)

Example 44 with Parcelable

use of android.os.Parcelable in project robolectric by robolectric.

the class ShadowBundleTest method parcelableArray.

@Test
public void parcelableArray() {
    Bundle innerBundle = new Bundle();
    innerBundle.putInt("value", 1);
    Parcelable[] arr = new Parcelable[] { innerBundle };
    bundle.putParcelableArray("foo", arr);
    assertThat(bundle.getParcelableArray("foo")).isEqualTo(arr);
    assertThat(bundle.getParcelableArray("bar")).isNull();
}
Also used : Bundle(android.os.Bundle) Parcelable(android.os.Parcelable) Test(org.junit.Test)

Example 45 with Parcelable

use of android.os.Parcelable in project material by rey5137.

the class WeekView method onSaveInstanceState.

@Override
protected Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState ss = new SavedState(superState);
    ss.selected = 0;
    int mask = 1;
    for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
        if (isSelected(i))
            ss.selected += mask;
        mask <<= 1;
    }
    return ss;
}
Also used : Parcelable(android.os.Parcelable) Paint(android.graphics.Paint)

Aggregations

Parcelable (android.os.Parcelable)826 Bundle (android.os.Bundle)99 View (android.view.View)85 Intent (android.content.Intent)58 SparseArray (android.util.SparseArray)38 Test (org.junit.Test)31 ArrayList (java.util.ArrayList)26 MenuItem (android.view.MenuItem)23 ImageView (android.widget.ImageView)23 TextView (android.widget.TextView)17 MenuItem (com.actionbarsherlock.view.MenuItem)14 SuppressLint (android.annotation.SuppressLint)13 Dialog (android.app.Dialog)13 MediumTest (android.support.test.filters.MediumTest)13 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)12 Paint (android.graphics.Paint)12 MenuView (com.android.internal.view.menu.MenuView)12 RemoteException (android.os.RemoteException)11 Bitmap (android.graphics.Bitmap)10 ShortcutIconResource (android.content.Intent.ShortcutIconResource)9