Revision 2c815395 src/com/rackspacecloud/android/ContainerObjectsActivity.java
b/src/com/rackspacecloud/android/ContainerObjectsActivity.java | ||
---|---|---|
137 | 137 |
loadCurrentDirectoryFiles(); |
138 | 138 |
displayCurrentFiles(); |
139 | 139 |
} |
140 |
|
|
141 | 140 |
|
142 |
/* |
|
143 | 141 |
private void loadFiles() { |
144 | 142 |
//displayLoadingCell(); |
145 | 143 |
new LoadFilesTask().execute(); |
146 | 144 |
} |
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 |
|
|
166 | 145 |
|
167 |
|
|
168 |
|
|
169 | 146 |
/* load only the files that should display for the |
170 | 147 |
* current directory in the curDirFiles[] |
171 | 148 |
*/ |
... | ... | |
184 | 161 |
curDirFiles[i] = curFiles.get(i); |
185 | 162 |
} |
186 | 163 |
} |
164 |
else{ |
|
165 |
curDirFiles = new ContainerObjects[0]; |
|
166 |
} |
|
187 | 167 |
} |
188 | 168 |
|
189 | 169 |
/* |
... | ... | |
213 | 193 |
String[] fileNames = new String[files.size()]; |
214 | 194 |
this.files = new ContainerObjects[files.size()]; |
215 | 195 |
|
216 |
|
|
217 |
|
|
218 | 196 |
if (files != null) { |
219 | 197 |
for (int i = 0; i < files.size(); i++) { |
220 | 198 |
ContainerObjects file = files.get(i); |
... | ... | |
227 | 205 |
} |
228 | 206 |
|
229 | 207 |
private void displayCurrentFiles(){ |
230 |
if(curDirFiles!=null) |
|
208 |
|
|
231 | 209 |
loadCurrentDirectoryFiles(); |
232 | 210 |
if (curDirFiles.length == 0) { |
233 | 211 |
displayNoServersCell(); |
... | ... | |
527 | 505 |
return cse; |
528 | 506 |
} |
529 | 507 |
|
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 |
|
|
530 | 516 |
class FileAdapter extends ArrayAdapter<ContainerObjects> { |
531 | 517 |
FileAdapter() { |
532 | 518 |
super(ContainerObjectsActivity.this, |
533 | 519 |
R.layout.listcontainerobjectcell, curDirFiles); |
520 |
Log.d("info", "captin" + arrToString()); |
|
534 | 521 |
} |
535 | 522 |
|
536 | 523 |
public View getView(int position, View convertView, ViewGroup parent) { |
537 |
|
|
524 |
Log.d("info", "captin using position: " + position); |
|
538 | 525 |
ContainerObjects file = curDirFiles[position]; |
539 | 526 |
LayoutInflater inflater = getLayoutInflater(); |
540 | 527 |
View row = inflater.inflate(R.layout.listcontainerobjectcell, |
Also available in: Unified diff