当前位置: 首页>>代码示例>>Java>>正文


Java AbsSavedState.EMPTY_STATE属性代码示例

本文整理汇总了Java中android.view.AbsSavedState.EMPTY_STATE属性的典型用法代码示例。如果您正苦于以下问题:Java AbsSavedState.EMPTY_STATE属性的具体用法?Java AbsSavedState.EMPTY_STATE怎么用?Java AbsSavedState.EMPTY_STATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.view.AbsSavedState的用法示例。


在下文中一共展示了AbsSavedState.EMPTY_STATE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGridViewSavedState

public void testGridViewSavedState() throws Throwable {
    Parcel parcel = Parcel.obtain();
    ObservableGridView.SavedState state1 = new ObservableGridView.SavedState(AbsSavedState.EMPTY_STATE);
    state1.prevFirstVisiblePosition = 1;
    state1.prevFirstVisibleChildHeight = 2;
    state1.prevScrolledChildrenHeight = 3;
    state1.prevScrollY = 4;
    state1.scrollY = 5;
    state1.childrenHeights = new SparseIntArray();
    state1.childrenHeights.put(0, 10);
    state1.childrenHeights.put(1, 20);
    state1.childrenHeights.put(2, 30);
    state1.writeToParcel(parcel, 0);

    parcel.setDataPosition(0);

    ObservableGridView.SavedState state2 = ObservableGridView.SavedState.CREATOR.createFromParcel(parcel);
    assertNotNull(state2);
    assertEquals(state1.prevFirstVisiblePosition, state2.prevFirstVisiblePosition);
    assertEquals(state1.prevFirstVisibleChildHeight, state2.prevFirstVisibleChildHeight);
    assertEquals(state1.prevScrolledChildrenHeight, state2.prevScrolledChildrenHeight);
    assertEquals(state1.prevScrollY, state2.prevScrollY);
    assertEquals(state1.scrollY, state2.scrollY);
    assertNotNull(state1.childrenHeights);
    assertEquals(3, state1.childrenHeights.size());
    assertEquals(10, state1.childrenHeights.get(0));
    assertEquals(20, state1.childrenHeights.get(1));
    assertEquals(30, state1.childrenHeights.get(2));
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:29,代码来源:SavedStateTest.java

示例2: testListViewSavedState

public void testListViewSavedState() throws Throwable {
    Parcel parcel = Parcel.obtain();
    ObservableListView.SavedState state1 = new ObservableListView.SavedState(AbsSavedState.EMPTY_STATE);
    state1.prevFirstVisiblePosition = 1;
    state1.prevFirstVisibleChildHeight = 2;
    state1.prevScrolledChildrenHeight = 3;
    state1.prevScrollY = 4;
    state1.scrollY = 5;
    state1.childrenHeights = new SparseIntArray();
    state1.childrenHeights.put(0, 10);
    state1.childrenHeights.put(1, 20);
    state1.childrenHeights.put(2, 30);
    state1.writeToParcel(parcel, 0);

    parcel.setDataPosition(0);

    ObservableListView.SavedState state2 = ObservableListView.SavedState.CREATOR.createFromParcel(parcel);
    assertNotNull(state2);
    assertEquals(state1.prevFirstVisiblePosition, state2.prevFirstVisiblePosition);
    assertEquals(state1.prevFirstVisibleChildHeight, state2.prevFirstVisibleChildHeight);
    assertEquals(state1.prevScrolledChildrenHeight, state2.prevScrolledChildrenHeight);
    assertEquals(state1.prevScrollY, state2.prevScrollY);
    assertEquals(state1.scrollY, state2.scrollY);
    assertNotNull(state1.childrenHeights);
    assertEquals(3, state1.childrenHeights.size());
    assertEquals(10, state1.childrenHeights.get(0));
    assertEquals(20, state1.childrenHeights.get(1));
    assertEquals(30, state1.childrenHeights.get(2));
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:29,代码来源:SavedStateTest.java

示例3: testRecyclerViewSavedState

public void testRecyclerViewSavedState() throws Throwable {
    Parcel parcel = Parcel.obtain();
    ObservableRecyclerView.SavedState state1 = new ObservableRecyclerView.SavedState(AbsSavedState.EMPTY_STATE);
    state1.prevFirstVisiblePosition = 1;
    state1.prevFirstVisibleChildHeight = 2;
    state1.prevScrolledChildrenHeight = 3;
    state1.prevScrollY = 4;
    state1.scrollY = 5;
    state1.childrenHeights = new SparseIntArray();
    state1.childrenHeights.put(0, 10);
    state1.childrenHeights.put(1, 20);
    state1.childrenHeights.put(2, 30);
    state1.writeToParcel(parcel, 0);

    parcel.setDataPosition(0);

    ObservableRecyclerView.SavedState state2 = ObservableRecyclerView.SavedState.CREATOR.createFromParcel(parcel);
    assertNotNull(state2);
    assertEquals(state1.prevFirstVisiblePosition, state2.prevFirstVisiblePosition);
    assertEquals(state1.prevFirstVisibleChildHeight, state2.prevFirstVisibleChildHeight);
    assertEquals(state1.prevScrolledChildrenHeight, state2.prevScrolledChildrenHeight);
    assertEquals(state1.prevScrollY, state2.prevScrollY);
    assertEquals(state1.scrollY, state2.scrollY);
    assertNotNull(state1.childrenHeights);
    assertEquals(3, state1.childrenHeights.size());
    assertEquals(10, state1.childrenHeights.get(0));
    assertEquals(20, state1.childrenHeights.get(1));
    assertEquals(30, state1.childrenHeights.get(2));
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:29,代码来源:SavedStateTest.java

示例4: testScrollViewSavedState

public void testScrollViewSavedState() throws Throwable {
    Parcel parcel = Parcel.obtain();
    ObservableScrollView.SavedState state1 = new ObservableScrollView.SavedState(AbsSavedState.EMPTY_STATE);
    state1.prevScrollY = 1;
    state1.scrollY = 2;
    state1.writeToParcel(parcel, 0);

    parcel.setDataPosition(0);

    ObservableScrollView.SavedState state2 = ObservableScrollView.SavedState.CREATOR.createFromParcel(parcel);
    assertNotNull(state2);
    assertEquals(state1.prevScrollY, state2.prevScrollY);
    assertEquals(state1.scrollY, state2.scrollY);
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:14,代码来源:SavedStateTest.java

示例5: testWebViewSavedState

public void testWebViewSavedState() throws Throwable {
    Parcel parcel = Parcel.obtain();
    ObservableWebView.SavedState state1 = new ObservableWebView.SavedState(AbsSavedState.EMPTY_STATE);
    state1.prevScrollY = 1;
    state1.scrollY = 2;
    state1.writeToParcel(parcel, 0);

    parcel.setDataPosition(0);

    ObservableWebView.SavedState state2 = ObservableWebView.SavedState.CREATOR.createFromParcel(parcel);
    assertNotNull(state2);
    assertEquals(state1.prevScrollY, state2.prevScrollY);
    assertEquals(state1.scrollY, state2.scrollY);
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:14,代码来源:SavedStateTest.java

示例6: saveInstanceState

/**
 * If you decide to override this method, do not forget to call {@code super.saveInstanceState()}
 * and pass the obtained super state to the corresponding constructor of your saved state
 * implementation to ensure the state of all classes along the chain is properly saved.
 */
@NonNull
@Override
@CallSuper
public Parcelable saveInstanceState() {
	return AbsSavedState.EMPTY_STATE;
}
 
开发者ID:universum-studios,项目名称:android_database,代码行数:11,代码来源:BaseCursorAdapter.java

示例7: saveInstanceState

/**
 * Speichert den aktuellen Status der SearchView in ein Parcelable Objekt
 * @return {@link Parcelable}
 */
public Parcelable saveInstanceState(){
    SavedState savedState = new SavedState(AbsSavedState.EMPTY_STATE);
    savedState.setQuery(searchView.getQuery().toString());
    savedState.setFocused(searchView.isFocused());
    savedState.setExpanded(MenuItemCompat.isActionViewExpanded(searchViewMenuItem));
    return savedState;
}
 
开发者ID:aschattney,项目名称:photostream-tools,代码行数:11,代码来源:SearchViewDelegate.java

示例8: onSaveInstanceState

public Parcelable onSaveInstanceState() {
    SavedState ss = new SavedState(AbsSavedState.EMPTY_STATE);

    ss.text = getText();
    ss.textColor = getTextColorStateList();
    ss.textSize = getTextSize();
    ss.autoMirrored = isAutoMirrored();
    //noinspection deprecation
    ss.needMirroring = isNeedMirroring();

    return ss;
}
 
开发者ID:yinghuihong,项目名称:fonticon,代码行数:12,代码来源:FontIconDrawable.java

示例9: onRestoreInstanceState

protected void onRestoreInstanceState(Parcelable state) {
    mBaseMethodCalled = true;
    if (state != AbsSavedState.EMPTY_STATE && state != null) {
        throw new IllegalArgumentException(
                "Wrong state class -- expecting Preference State");
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:7,代码来源:Preference.java

示例10: onSaveInstanceState

protected Parcelable onSaveInstanceState() {
    mBaseMethodCalled = true;
    return AbsSavedState.EMPTY_STATE;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:4,代码来源:Preference.java


注:本文中的android.view.AbsSavedState.EMPTY_STATE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。