android.widget.ExpandableListView.setEmptyView()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(182)

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

ExpandableListView.setEmptyView介绍

暂无

代码示例

代码示例来源:origin: tianshaojie/AndroidFine

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: shanyao0/SimpleApp

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: gdpancheng/LoonAndroid3

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: myxh/CoolShopping

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: kaku2015/WeatherAlarmClock

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: alienjun/AJWaveRefreshForAndroid

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: Wan7451/Wan_RecycleViewAdapter

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: open-android/PullToRefresh

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: Uphie/ONE-Unofficial

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: AndroidHensen/YaNi

@Override
  public void setEmptyViewInternal(View emptyView) {
    super.setEmptyView(emptyView);
  }
}

代码示例来源:origin: stackoverflow.com

ExpandableListView expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);

TextView txtEmptyView = (TextView) view.findViewById(R.id.txtEmptyView);

expandableListView.setEmptyView(txtEmptyView);

代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android

/**
 * The default content for a ListFragment has a TextView that can
 * be shown when the list is empty.  If you would like to have it
 * shown, call this method to supply the text it should use.
 */
public void setEmptyText(CharSequence text) {
  ensureList();
  if (mStandardEmptyView == null) {
    throw new IllegalStateException("Can't be used with a custom content view");
  }
  mStandardEmptyView.setText(text);
  if (mEmptyText == null) {
    mExpandableList.setEmptyView(mStandardEmptyView);
  }
  mEmptyText = text;
}

代码示例来源:origin: openmrs/openmrs-contrib-android-client

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
  View root = inflater.inflate(R.layout.fragment_visit_dashboard, container, false);
  mEmptyListView = (TextView) root.findViewById(R.id.visitDashboardEmpty);
  FontsUtil.setFont(mEmptyListView, FontsUtil.OpenFonts.OPEN_SANS_BOLD);
  mExpandableListView = (ExpandableListView) root.findViewById(R.id.visitDashboardExpList);
  mExpandableListView.setEmptyView(mEmptyListView);
  setEmptyListVisibility(false);
  return root;
}

代码示例来源:origin: jclehner/rxdroid

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
  View v = inflater.inflate(R.layout.layout_expandable_list, null);
  mList = (ExpandableListView) v.findViewById(android.R.id.list);
  mEmptyView = (TextView) v.findViewById(android.R.id.empty);
  mList.setAdapter(mAdapter);
  mList.setOnGroupCollapseListener(mGroupCollapseExpandListener);
  mList.setOnGroupExpandListener(mGroupCollapseExpandListener);
  mList.setOnGroupClickListener(this);
  mList.setOnChildClickListener(this);
  if(mExpandAll)
    expandAllInternal();
  mList.setEmptyView(mEmptyView);
  mEmptyView.setText(mEmptyViewTextResId);
  return v;
}

代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android

/**
   * Updates the screen state (current list and other views) when the
   * content changes.
   *
   * @see Activity.onContentChanged()
   */

  public void onContentChanged() {
//        super.onContentChanged();
    View emptyView = getView().findViewById(android.R.id.empty);
    mExpandableList = (ExpandableListView) getView().findViewById(android.R.id.list);
    if (mExpandableList == null) {
      throw new RuntimeException(
          "Your content must have a ExpandableListView whose id attribute is " +
              "'android.R.id.list'");
    }
    if (emptyView != null) {
      mExpandableList.setEmptyView(emptyView);
    }
    mExpandableList.setOnChildClickListener(this);
    mExpandableList.setOnGroupExpandListener(this);
    mExpandableList.setOnGroupCollapseListener(this);

    if (mFinishedStart) {
      setListAdapter(mAdapter);
    }
    mFinishedStart = true;
  }

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

/**
 * Updates the screen state (current list and other views) when the content changes.
 * 
 * @see android.support.v7.app.AppCompatActivity#onContentChanged()
 */
@Override
public void onContentChanged() {
  super.onContentChanged();
  View emptyView = findViewById(R.id.empty);
  mList = findViewById(R.id.list);
  if (mList == null) {
    throw new RuntimeException(
        "Your content must have a ExpandableListView whose id attribute is " +
            "'R.id.list'");
  }
  if (emptyView != null) {
    mList.setEmptyView(emptyView);
  }
  mList.setOnChildClickListener(this);
  mList.setOnGroupExpandListener(this);
  mList.setOnGroupCollapseListener(this);
  if (mFinishedStart) {
    setListAdapter(mAdapter);
  }
  mFinishedStart = true;
}

代码示例来源:origin: StevenRudenko/BleSensorTag

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.device_services_activity);
  gattServicesList = (ExpandableListView) findViewById(R.id.gatt_services_list);
  gattServicesList.setOnChildClickListener(this);
  final View emptyView = findViewById(R.id.empty_view);
  gattServicesList.setEmptyView(emptyView);
  dataCharacteristic = (TextView) findViewById(R.id.data_characteristic_uuid);
  dataValue = (TextView) findViewById(R.id.data_characteristic_value);
  //noinspection ConstantConditions
  final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  final ActionBar actionBar = getSupportActionBar();
  final String deviceName = getDeviceName();
  if (TextUtils.isEmpty(deviceName)) {
    //noinspection ConstantConditions
    actionBar.setTitle(getDeviceAddress());
  } else {
    //noinspection ConstantConditions
    actionBar.setTitle(deviceName);
    actionBar.setSubtitle(getDeviceAddress());
  }
  actionBar.setDisplayHomeAsUpEnabled(true);
}

代码示例来源:origin: SecUSo/privacy-friendly-todo-list

public void updateAdapter() {
  dbhelper = DatabaseHelper.getInstance(this);
  ArrayList<TodoTask> tasks;
  tasks = DBQueryHandler.getBin(dbhelper.getReadableDatabase());
  expandableTodoTaskAdapter = new ExpandableTodoTaskAdapter(this, tasks);
  lv.setAdapter(expandableTodoTaskAdapter);
  lv.setEmptyView(tv);
  lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
    @Override
    public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
      int groupPosition = ExpandableListView.getPackedPositionGroup(id);
      if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
        int childPosition = ExpandableListView.getPackedPositionChild(id);
        expandableTodoTaskAdapter.setLongClickedSubTaskByPos(groupPosition, childPosition);
      } else {
        expandableTodoTaskAdapter.setLongClickedTaskByPos(groupPosition);
      }
      registerForContextMenu(lv);
      return false;
    }
  });
}

代码示例来源:origin: SecUSo/privacy-friendly-todo-list

private void showAllTasks() {
  dbHelper = DatabaseHelper.getInstance(this);
  ArrayList<TodoTask> tasks;
  tasks = DBQueryHandler.getAllToDoTasks(dbHelper.getReadableDatabase());
  expandableTodoTaskAdapter = new ExpandableTodoTaskAdapter(this, tasks);
  exLv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
    @Override
    public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
      int groupPosition = ExpandableListView.getPackedPositionGroup(id);
      if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
        int childPosition = ExpandableListView.getPackedPositionChild(id);
        expandableTodoTaskAdapter.setLongClickedSubTaskByPos(groupPosition, childPosition);
      } else {
        expandableTodoTaskAdapter.setLongClickedTaskByPos(groupPosition);
      }
      registerForContextMenu(exLv);
      return false;
    }
  });
  exLv.setAdapter(expandableTodoTaskAdapter);
  exLv.setEmptyView(tv);
  optionFab.setVisibility(View.VISIBLE);
  initFab(true, 0, false);
  hints();
}

相关文章

ExpandableListView类方法