@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
@Override public void setEmptyViewInternal(View emptyView) { super.setEmptyView(emptyView); } }
ExpandableListView expandableListView = (ExpandableListView) findViewById(R.id.expandableListView); TextView txtEmptyView = (TextView) view.findViewById(R.id.txtEmptyView); expandableListView.setEmptyView(txtEmptyView);
/** * 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; }
@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; }
@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; }
/** * 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; }
/** * 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; }
@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); }
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; } }); }
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(); }