android.support.v4.app.ListFragment.setListShown()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(85)

本文整理了Java中android.support.v4.app.ListFragment.setListShown()方法的一些代码示例,展示了ListFragment.setListShown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListFragment.setListShown()方法的具体详情如下:
包路径:android.support.v4.app.ListFragment
类名称:ListFragment
方法名:setListShown

ListFragment.setListShown介绍

[英]Control whether the list is being displayed. You can make it not displayed if you are waiting for the initial data to show in it. During this time an indeterminant progress indicator will be shown instead.

Applications do not normally need to use this themselves. The default behavior of ListFragment is to start with the list not being shown, only showing it once an adapter is given with #setListAdapter(ListAdapter). If the list at that point had not been shown, when it does get shown it will be do without the user ever seeing the hidden state.
[中]控制是否显示列表。如果等待初始数据在其中显示,则可以使其不显示。在此期间,将显示一个不确定的进度指示器。
应用程序本身通常不需要使用它。ListFragment的默认行为是以未显示的列表开始,仅在使用#setListAdapter(ListAdapter)给出适配器后才显示它。如果当时的列表没有显示,那么当它显示出来时,用户将不会看到隐藏状态。

代码示例

代码示例来源:origin: com.google.android/support-v4

/**
 * Like {@link #setListShown(boolean)}, but no animation is used when
 * transitioning from the previous state.
 */
public void setListShownNoAnimation(boolean shown) {
  setListShown(shown, false);
}

代码示例来源:origin: kingargyle/adt-leanback-support

/**
 * Like {@link #setListShown(boolean)}, but no animation is used when
 * transitioning from the previous state.
 */
public void setListShownNoAnimation(boolean shown) {
  setListShown(shown, false);
}

代码示例来源:origin: com.google.android/support-v4

/**
 * Control whether the list is being displayed.  You can make it not
 * displayed if you are waiting for the initial data to show in it.  During
 * this time an indeterminant progress indicator will be shown instead.
 * 
 * <p>Applications do not normally need to use this themselves.  The default
 * behavior of ListFragment is to start with the list not being shown, only
 * showing it once an adapter is given with {@link #setListAdapter(ListAdapter)}.
 * If the list at that point had not been shown, when it does get shown
 * it will be do without the user ever seeing the hidden state.
 * 
 * @param shown If true, the list view is shown; if false, the progress
 * indicator.  The initial value is true.
 */
public void setListShown(boolean shown) {
  setListShown(shown, true);
}

代码示例来源:origin: kingargyle/adt-leanback-support

/**
 * Control whether the list is being displayed.  You can make it not
 * displayed if you are waiting for the initial data to show in it.  During
 * this time an indeterminant progress indicator will be shown instead.
 * 
 * <p>Applications do not normally need to use this themselves.  The default
 * behavior of ListFragment is to start with the list not being shown, only
 * showing it once an adapter is given with {@link #setListAdapter(ListAdapter)}.
 * If the list at that point had not been shown, when it does get shown
 * it will be do without the user ever seeing the hidden state.
 * 
 * @param shown If true, the list view is shown; if false, the progress
 * indicator.  The initial value is true.
 */
public void setListShown(boolean shown) {
  setListShown(shown, true);
}

代码示例来源:origin: com.google.android/support-v4

/**
 * Provide the cursor for the list view.
 */
public void setListAdapter(ListAdapter adapter) {
  boolean hadAdapter = mAdapter != null;
  mAdapter = adapter;
  if (mList != null) {
    mList.setAdapter(adapter);
    if (!mListShown && !hadAdapter) {
      // The list was hidden, and previously didn't have an
      // adapter.  It is now time to show it.
      setListShown(true, getView().getWindowToken() != null);
    }
  }
}

代码示例来源:origin: kingargyle/adt-leanback-support

/**
 * Provide the cursor for the list view.
 */
public void setListAdapter(ListAdapter adapter) {
  boolean hadAdapter = mAdapter != null;
  mAdapter = adapter;
  if (mList != null) {
    mList.setAdapter(adapter);
    if (!mListShown && !hadAdapter) {
      // The list was hidden, and previously didn't have an
      // adapter.  It is now time to show it.
      setListShown(true, getView().getWindowToken() != null);
    }
  }
}

代码示例来源:origin: com.google.android/support-v4

setListShown(false, false);

代码示例来源:origin: kingargyle/adt-leanback-support

setListShown(false, false);

相关文章