Revision cc71758a src/com/rackspacecloud/android/ContainerObjectsActivity.java
b/src/com/rackspacecloud/android/ContainerObjectsActivity.java | ||
---|---|---|
137 | 137 |
loadCurrentDirectoryFiles(); |
138 | 138 |
displayCurrentFiles(); |
139 | 139 |
} |
140 |
|
|
140 | 141 |
|
142 |
/* |
|
141 | 143 |
private void loadFiles() { |
142 | 144 |
//displayLoadingCell(); |
143 | 145 |
new LoadFilesTask().execute(); |
144 | 146 |
} |
147 |
*/ |
|
148 |
|
|
149 |
private void loadFiles(){ |
|
150 |
CloudServersException exception = null; |
|
151 |
|
|
152 |
ArrayList<ContainerObjects> result = null; |
|
153 |
try { |
|
154 |
result = (new ContainerObjectManager(context)).createList(true, |
|
155 |
container.getName()); |
|
156 |
} catch (CloudServersException e) { |
|
157 |
exception = e; |
|
158 |
e.printStackTrace(); |
|
159 |
} |
|
160 |
if (exception != null) { |
|
161 |
showAlert("Error", exception.getMessage()); |
|
162 |
} |
|
163 |
setFileList(result); |
|
164 |
} |
|
165 |
|
|
145 | 166 |
|
167 |
|
|
168 |
|
|
146 | 169 |
/* load only the files that should display for the |
147 | 170 |
* current directory in the curDirFiles[] |
148 | 171 |
*/ |
... | ... | |
161 | 184 |
curDirFiles[i] = curFiles.get(i); |
162 | 185 |
} |
163 | 186 |
} |
164 |
else{ |
|
165 |
curDirFiles = new ContainerObjects[0]; |
|
166 |
} |
|
167 | 187 |
} |
168 | 188 |
|
169 | 189 |
/* |
... | ... | |
193 | 213 |
String[] fileNames = new String[files.size()]; |
194 | 214 |
this.files = new ContainerObjects[files.size()]; |
195 | 215 |
|
216 |
|
|
217 |
|
|
196 | 218 |
if (files != null) { |
197 | 219 |
for (int i = 0; i < files.size(); i++) { |
198 | 220 |
ContainerObjects file = files.get(i); |
... | ... | |
205 | 227 |
} |
206 | 228 |
|
207 | 229 |
private void displayCurrentFiles(){ |
208 |
|
|
230 |
if(curDirFiles!=null) |
|
209 | 231 |
loadCurrentDirectoryFiles(); |
210 | 232 |
if (curDirFiles.length == 0) { |
211 | 233 |
displayNoServersCell(); |
... | ... | |
505 | 527 |
return cse; |
506 | 528 |
} |
507 | 529 |
|
508 |
private String arrToString(){ |
|
509 |
String res = ""; |
|
510 |
for(int i = 0; i < curDirFiles.length; i++){ |
|
511 |
res += curDirFiles[i].getCName() + " "; |
|
512 |
} |
|
513 |
return res; |
|
514 |
} |
|
515 |
|
|
516 | 530 |
class FileAdapter extends ArrayAdapter<ContainerObjects> { |
517 | 531 |
FileAdapter() { |
518 | 532 |
super(ContainerObjectsActivity.this, |
519 | 533 |
R.layout.listcontainerobjectcell, curDirFiles); |
520 |
Log.d("info", "captin" + arrToString()); |
|
521 | 534 |
} |
522 | 535 |
|
523 | 536 |
public View getView(int position, View convertView, ViewGroup parent) { |
524 |
Log.d("info", "captin using position: " + position); |
|
537 |
|
|
525 | 538 |
ContainerObjects file = curDirFiles[position]; |
526 | 539 |
LayoutInflater inflater = getLayoutInflater(); |
527 | 540 |
View row = inflater.inflate(R.layout.listcontainerobjectcell, |
Also available in: Unified diff