import android.graphics.Matrix;
import android.net.Uri;
import android.os.Bundle;
+import android.text.Html;
import android.text.TextUtils;
+import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@Override
public void onBackPressed() {
+ PathLayout pl = (PathLayout) findViewById(R.id.pathLayout1);
if (mIsDisplayingFile) {
mIsDisplayingFile = false;
setContentView(R.layout.main);
+ pl = (PathLayout) findViewById(R.id.pathLayout1);
Uri uri;
if (mParents.empty()) {
uri = ProviderTableMeta.CONTENT_URI;
new String[]{mAccount.name}, null);
if (mCursor.moveToFirst()) {
- TextView tv = (TextView) findViewById(R.id.directory_name);
- tv.setText(mCursor.getString(mCursor.getColumnIndex(ProviderTableMeta.FILE_PATH)));
+ String s = mCursor.getString(mCursor.getColumnIndex(ProviderTableMeta.FILE_PATH));
+ for (String str : s.split("/")) {
+ if (!TextUtils.isEmpty(str))
+ pl.push(str.replace("%20", " "));
+ }
}
getListView().setAdapter(new FileListListAdapter(mCursor, this));
getListView().invalidate();
return;
} else if (mParents.size() == 1) {
mParents.pop();
+ pl.pop();
mCursor = managedQuery(ProviderTableMeta.CONTENT_URI,
null,
ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",
null);
} else {
mParents.pop();
+ pl.pop();
mCursor = managedQuery(Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, mParents.peek()),
null,
ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",
setListAdapter(new FileListListAdapter(mCursor, this));
getListView().invalidate();
-
- TextView tv = (TextView) findViewById(R.id.directory_name);
- String s = tv.getText().toString();
- if (s.endsWith("/")) {
- s = s.substring(0, s.length() - 1);
- }
- s = s.substring(0, s.lastIndexOf('/') + 1);
- tv.setText(s);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
+ PathLayout pl = (PathLayout) findViewById(R.id.pathLayout1);
if (!mCursor.moveToPosition(position)) {
throw new IndexOutOfBoundsException("Incorrect item selected");
}
if (mCursor.getString(mCursor.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)).equals("DIR")) {
String id_ = mCursor.getString(mCursor.getColumnIndex(ProviderTableMeta._ID));
String dirname = mCursor.getString(mCursor.getColumnIndex(ProviderTableMeta.FILE_NAME));
- TextView tv = (TextView) findViewById(R.id.directory_name);
- tv.setText(tv.getText().toString()+dirname+"/");
+ pl.push(dirname);
mParents.push(id_);
mCursor = managedQuery(Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, id_),
null,
}
private void populateFileList() {
- TextView tv = (TextView) findViewById(R.id.directory_name);
- tv.setText("/");
mCursor = getContentResolver().query(ProviderTableMeta.CONTENT_URI,
null,
ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",