Ejemplo n.º 1
0
 @Override
 public void onEvent(Event event) {
   if (model.getIsSearchShowing()) {
     searchView.setVisibility(View.VISIBLE);
   } else {
     searchView.setVisibility(View.GONE);
   }
 }
Ejemplo n.º 2
0
  /** Find our references to the objects in the XML layout */
  @Override
  protected void onFinishInflate() {
    super.onFinishInflate();
    listView = (PullToRefreshListView) findViewById(R.id.pull_to_refresh_listview);
    listView.setOnRefreshListener(
        new OnRefreshListener<ListView>() {
          @Override
          public void onRefresh(PullToRefreshBase<ListView> refreshView) {
            viewListener.onListViewRefresh();
          }
        });
    listView.setMode(Mode.BOTH);
    model.addListener(ApplicationsModel.ChangeEvent.LIST_REFRESH_COMPLETE, refreshListener);
    model.addListener(ApplicationsModel.ChangeEvent.SEARCH_DIALOG_CHANGE, searchViewChangeListener);
    LinearLayout emptyLayout = (LinearLayout) View.inflate(getContext(), R.layout.empty, null);
    mEmptyView = (TextView) emptyLayout.findViewById(android.R.id.empty);
    listView.setEmptyView(emptyLayout);

    searchView = (TextView) findViewById(R.id.inputSearchApps);
  }
Ejemplo n.º 3
0
 public void destroy() {
   model.removeListener(ApplicationsModel.ChangeEvent.LIST_REFRESH_COMPLETE, refreshListener);
   model.removeListener(
       ApplicationsModel.ChangeEvent.SEARCH_DIALOG_CHANGE, searchViewChangeListener);
 }
Ejemplo n.º 4
0
 public ApplicationsView(Context context, AttributeSet attrs) {
   super(context, attrs);
   model = ApplicationsModel.getInstance();
 }