Ejemplo n.º 1
0
        public void handleMessage(Message msg) {
          Ball B;
          for (int idx = 0; idx < arBall.size(); idx++) {
            B = arBall.get(idx);
            B.Move(getWidth(), getHeight());
            if (B.count > 4) {
              arBall.remove(idx);
              idx--;
            }
          }

          invalidate();
          mHandler.sendEmptyMessageDelayed(0, DELAY);
        }
Ejemplo n.º 2
0
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (backStack.size() > 1) {
        backStack.remove(backStack.size() - 1);
        wrapFiles();
      } else {
        Intent intent = new Intent();
        setResult(RESULT_CANCELED, intent);
        finish();
      }
      return true;
    }

    return super.onKeyDown(keyCode, event);
  }
Ejemplo n.º 3
0
  @Override
  public void onItemClick(AdapterView<?> aListView, View aView, int aPosition, long aID) {
    final FileWrapper item = adapter.getItem(aPosition);

    if (item.parentItem && backStack.get(backStack.size() - 1).parentIsBack) {
      backStack.remove(backStack.size() - 1);
      wrapFiles();
      return;
    } else if (item.dirSelectItem) {
      finishWithPath(listedDirectory.getAbsolutePath());
      return;
    }

    final File selected = item.parentItem ? listedDirectory.getParentFile() : item.file;

    if (selected.isDirectory()) {
      backStack.add(new BackStackItem(selected.getAbsolutePath(), !item.parentItem));
      wrapFiles();
    } else {
      String filePath = selected.getAbsolutePath();
      finishWithPath(filePath);
    }
  }