Revision 856ad13d src/com/rackspace/cloud/android/ListContainerActivity.java
b/src/com/rackspace/cloud/android/ListContainerActivity.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
protected static final int DELETE_ID = 0; |
35 | 35 |
|
36 |
private Container[] containers;
|
|
36 |
protected Container[] containers;
|
|
37 | 37 |
public Container container; |
38 | 38 |
public Container cdnContainer; |
39 | 39 |
public String[] containerNames; |
... | ... | |
41 | 41 |
public Object kiloBytes; |
42 | 42 |
public int bConver = 1048576; |
43 | 43 |
public int kbConver = 1024; |
44 |
private Context context;
|
|
45 |
private boolean loading;
|
|
44 |
protected Context context;
|
|
45 |
protected boolean loading;
|
|
46 | 46 |
|
47 | 47 |
@Override |
48 | 48 |
public void onCreate(Bundle savedInstanceState) { |
... | ... | |
87 | 87 |
} |
88 | 88 |
} |
89 | 89 |
|
90 |
private void loadContainers() {
|
|
90 |
protected void loadContainers() {
|
|
91 | 91 |
displayLoadingCell(); |
92 | 92 |
new LoadContainersTask().execute((Void[]) null); |
93 | 93 |
} |
... | ... | |
112 | 112 |
getListView().setItemsCanFocus(false); |
113 | 113 |
} |
114 | 114 |
|
115 |
private void displayNoServersCell() {
|
|
115 |
protected void displayNoServersCell() {
|
|
116 | 116 |
String a[] = new String[1]; |
117 | 117 |
a[0] = "No Containers"; |
118 | 118 |
setListAdapter(new ArrayAdapter<String>(this, |
... | ... | |
142 | 142 |
} |
143 | 143 |
} |
144 | 144 |
|
145 |
private class LoadContainersTask extends
|
|
145 |
protected class LoadContainersTask extends
|
|
146 | 146 |
AsyncTask<Void, Void, ArrayList<Container>> { |
147 | 147 |
|
148 | 148 |
private CloudServersException exception; |
... | ... | |
157 | 157 |
ArrayList<Container> containers = null; |
158 | 158 |
|
159 | 159 |
try { |
160 |
containers = (new ContainerManager(context)).createList(true);
|
|
160 |
containers = loadContainersInner();
|
|
161 | 161 |
} catch (CloudServersException e) { |
162 | 162 |
exception = e; |
163 | 163 |
} |
... | ... | |
174 | 174 |
ArrayList<Container> containerList = result; |
175 | 175 |
if(result==null) |
176 | 176 |
result = new ArrayList<Container>(); |
177 |
Container containerToAdd = new Container(); |
|
177 |
/*Container containerToAdd = new Container();
|
|
178 | 178 |
containerToAdd.setCount(0); |
179 | 179 |
containerToAdd.setBytes(0); |
180 | 180 |
containerToAdd.setName(Container.MYSHARED); |
... | ... | |
189 | 189 |
containerToAdd.setLogRetention(false); |
190 | 190 |
containerToAdd.setCdnEnabled(false); |
191 | 191 |
containerToAdd.setTtl(0); |
192 |
containerList.add(containerToAdd); |
|
192 |
containerList.add(containerToAdd);*/
|
|
193 | 193 |
|
194 | 194 |
if (containerList != null) { |
195 | 195 |
containerNames = new String[containerList.size()]; |
... | ... | |
207 | 207 |
new LoadCDNContainersTask().execute((Void[]) null); |
208 | 208 |
} |
209 | 209 |
} |
210 |
|
|
210 |
|
|
211 |
protected ArrayList<Container> loadContainersInner() throws CloudServersException{ |
|
212 |
return (new ContainerManager(context)).createList(true); |
|
213 |
} |
|
214 |
public Context getContext() { |
|
215 |
return context; |
|
216 |
} |
|
211 | 217 |
private class LoadCDNContainersTask extends |
212 | 218 |
AsyncTask<Void, Void, ArrayList<Container>> { |
213 | 219 |
|
... | ... | |
297 | 303 |
false); |
298 | 304 |
|
299 | 305 |
TextView label = (TextView) row.findViewById(R.id.label); |
300 |
label.setText(container.getName()); |
|
306 |
if(container.getOtherUser()!=null) |
|
307 |
label.setText(container.getOtherUser()+"/"+container.getName()); |
|
308 |
else |
|
309 |
label.setText(container.getName()); |
|
301 | 310 |
|
302 | 311 |
if (container.getBytes() >= bConver) { |
303 | 312 |
megaBytes = Math.abs(container.getBytes() / bConver + 0.2); |
Also available in: Unified diff