private void setEmptyMessage() { int icon = 0; int str = R.string.label_no_records_found; switch (mType) { case Inbox: icon = R.drawable.ic_action_inbox; str = R.string.message_inbox_all_read; break; case ToMe: icon = R.drawable.ic_action_user; str = R.string.message_tome_all_read; break; case ToDo: icon = R.drawable.ic_action_clipboard; str = R.string.message_todo_all_read; break; case Outbox: icon = R.drawable.ic_action_unsent_mail; str = R.string.message_no_outbox_message; break; case Archives: icon = R.drawable.ic_action_briefcase; break; case Group: icon = R.drawable.ic_action_social_group; str = R.string.message_no_group_message; break; } OControls.setImage(mView, R.id.emptyListIcon, icon); OControls.setText(mView, R.id.emptyListMessage, _s(str)); if (mType != Type.Outbox) mView.findViewById(R.id.checkForNewData).setOnClickListener(this); else mView.findViewById(R.id.checkForNewData).setVisibility(View.GONE); }
public LoadInstances(List<OdooInstance> instances) { mInstances.addAll(instances); OControls.setGone(mView, R.id.progressLoader); OControls.setVisible(mView, R.id.instanceList); mGridView = (ExpandableHeightGridView) mView.findViewById(R.id.gridInstances); mGridView.setExpanded(true); mGridView.setAdapter(mListAdapter); }
public CreateAccount(OdooInstance instance, Boolean selfHosted) { mOdooInstance = instance; mSelfHosted = selfHosted; OControls.setGone(mView, R.id.instanceList); OControls.setVisible(mView, R.id.progressLoader); OControls.setText( mView, R.id.progressStatus, getActivity().getResources().getString(R.string.title_account_create)); }
@Override protected void onPostExecute(Boolean result) { super.onPostExecute(result); if (result) { DatabaseCreate databaseCreate = new DatabaseCreate(); databaseCreate.execute(); } else { if (mOdooException != null) { OExceptionDialog dialog = new OExceptionDialog(getActivity(), true, mOdooException); dialog.show(); OControls.setVisible(mView, R.id.instanceList); OControls.setGone(mView, R.id.progressLoader); } } }
@Override protected void onPostExecute(Void result) { super.onPostExecute(result); if (bmp != null) { View mView = mGridView.getChildAt(view_pos); OControls.setImage(mView, image_view, bmp); } }
private void init(View view) { mTouch = scope.main().getTouchAttacher(); setHasSwipeRefreshView(view, R.id.swipe_container, this); mFab = (FloatingActionButton) view.findViewById(R.id.fabbutton); mailList = (ListView) view.findViewById(R.id.mail_list_view); mAdapter = new OCursorListAdapter(getActivity(), null, R.layout.mail_list_item); mAdapter.setOnViewBindListener(this); mAdapter.setBeforeBindUpdateData(this); mailList.setAdapter(mAdapter); mailList.setOnItemClickListener(this); mailList.setEmptyView(mView.findViewById(R.id.loadingProgress)); if (getPref().getBoolean("archive_with_swipe", false)) { if (mType != Type.Archives) mTouch.setSwipeableView(mailList, this); } mFab.listenTo(mailList); mFab.setOnClickListener(this); mAdapter.setOnRowViewClickListener(R.id.img_starred_mlist, this); OControls.setVisible(view, R.id.loadingProgress); OControls.setGone(view, R.id.emptyView); getLoaderManager().initLoader(0, null, this); }
@Override protected void onPreExecute() { OControls.setText( mView, R.id.progressStatus, getResources().getString(R.string.title_database_create)); }
@Override protected void onPreExecute() { OControls.setText( mView, R.id.progressStatus, getResources().getString(R.string.title_getting_instances)); }
public void toggleEmptyView(boolean show) { OControls.toggleViewVisibility(mView, R.id.emptyView, show); if (show) setEmptyMessage(); }
@Override public void onLoadFinished(Loader<Cursor> arg0, Cursor cursor) { mAdapter.changeCursor(cursor); toggleEmptyView((cursor.getCount() == 0)); OControls.setGone(mView, R.id.loadingProgress); }