Revision 44ac7bea

b/AndroidManifest.xml
33 33
				<category android:name="android.intent.category.APPLICATION" />
34 34
			</intent-filter>
35 35
		</activity>
36
		<activity android:name=".AddContainerActivity" android:label="@string/app_name">
36
		<activity android:name=".AddContainerActivity" android:label="@string/app_name" >
37 37
			<intent-filter>
38 38
				<action android:name="android.intent.action.MAIN" />
39 39
				<category android:name="android.intent.category.APPLICATION" />
......
67 67
			</intent-filter>
68 68
		</activity>
69 69
		<activity android:name=".ContainerObjectDetails"
70
			android:label="@string/app_name">
70
			android:label="@string/app_name"
71
			android:configChanges="orientation">
71 72
			<intent-filter>
72 73
				<action android:name="android.intent.action.MAIN" />
73 74
				<category android:name="android.intent.category.APPLICATION" />
......
81 82
			</intent-filter>
82 83
		</activity>
83 84

  
84
		<activity android:name=".Preferences" android:label="@string/preference_name" />
85
		<activity android:name=".Preferences" 
86
			android:label="@string/preference_name" />
85 87
		<activity android:name=".BackupServerActivity"></activity>
86 88
		<activity android:name=".PasswordServerActivity"></activity>
87 89
		<activity android:name=".PingServerActivity"></activity>
88
		<activity android:configChanges="orientation" android:name=".ListAccountsActivity">
90
		<activity android:name=".ListAccountsActivity" 
91
			android:configChanges="orientation" >
89 92
			<intent-filter>
90 93
				<action android:name="android.intent.action.MAIN" />
91 94
				<category android:name="android.intent.category.LAUNCHER" />
92 95
			</intent-filter>
93 96
		</activity>
94
		<activity android:name=".AddAccountActivity"></activity>
95
		<activity android:name=".AddFileActivity"></activity>
97
		<activity android:name=".AddAccountActivity">
98
		</activity>
99
		<activity android:name=".AddFileActivity" >
100
		</activity>
96 101

  
97 102
	</application>
98 103
	<uses-sdk android:minSdkVersion="4" />
b/src/com/rackspacecloud/android/AddFileActivity.java
48 48
    }
49 49
    
50 50
    private void setUpInputs(){
51
    	((Button) findViewById(R.id.save_button)).setOnClickListener(this);
51
    	((Button) findViewById(R.id.new_file_button)).setOnClickListener(this);
52 52
    	fileName = ((EditText)findViewById(R.id.file_name_text));
53 53
    	contents = ((EditText)findViewById(R.id.new_file_text));
54 54
    }
b/src/com/rackspacecloud/android/ContainerObjectsActivity.java
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

  
166

  
145 167

  
146 168
	
147 169
	/* load only the files that should display for the 
......
191 213
		String[] fileNames = new String[files.size()];
192 214
		this.files = new ContainerObjects[files.size()];
193 215

  
216
		
217
		
194 218
		if (files != null) {
195 219
			for (int i = 0; i < files.size(); i++) {
196 220
				ContainerObjects file = files.get(i);
......
198 222
				fileNames[i] = file.getName();
199 223
			}
200 224
		}
201

  
225
		
202 226
		displayCurrentFiles();
203 227
	}
204 228
	
205 229
	private void displayCurrentFiles(){
230
		if(curDirFiles!=null)
206 231
		loadCurrentDirectoryFiles();
207 232
		if (curDirFiles.length == 0) {
208 233
			displayNoServersCell();
......
341 366
			return true;
342 367
		case R.id.add_folder:
343 368
			showDialog(R.id.add_folder);
369
			return true;
344 370
		case R.id.add_file:
345 371
			Intent viewIntent2 = new Intent(this, AddFileActivity.class);
346 372
			viewIntent2.putExtra("Cname", container.getName());
......
438 464
        	.setMessage("Enter new name for folder: ")        	         
439 465
        	.setPositiveButton("Add", new DialogInterface.OnClickListener() {
440 466
        		public void onClick(DialogInterface dialog, int whichButton) {
441
        			// User clicked OK so do some stuff
467
        			//User clicked OK so do some stuff
442 468
        			String[] info = {input.getText().toString(), "application/directory"};
443 469
        			new AddFolderTask().execute(info);
444 470
        		}
......
504 530
	class FileAdapter extends ArrayAdapter<ContainerObjects> {
505 531
		FileAdapter() {
506 532
			super(ContainerObjectsActivity.this,
507
					R.layout.listcontainerobjectcell, curDirFiles);
533
					R.layout.listcontainerobjectcell, curDirFiles);		
508 534
		}
509 535
	
510 536
		public View getView(int position, View convertView, ViewGroup parent) {
......
539 565
			AsyncTask<String, Void, ArrayList<ContainerObjects>> {
540 566
	
541 567
		private CloudServersException exception;
542
		
568
		/*
543 569
		protected void onPreExecute(){
544 570
			dialog = ProgressDialog.show(ContainerObjectsActivity.this, "", "Loading Files...", true);
545 571
		}
546
	
572
		*/
547 573
		@Override
548 574
		protected ArrayList<ContainerObjects> doInBackground(String... path) {
549 575
			ArrayList<ContainerObjects> files = null;
......
559 585
	
560 586
		@Override
561 587
		protected void onPostExecute(ArrayList<ContainerObjects> result) {
562
			dialog.dismiss();
588
			//dialog.dismiss();
563 589
			if (exception != null) {
564 590
				showAlert("Error", exception.getMessage());
565 591
			}
......
590 616

  
591 617
		@Override
592 618
		protected void onPostExecute(HttpResponse response) {
619
			dialog.dismiss();
593 620
			if (response != null) {
594 621
				int statusCode = response.getStatusLine().getStatusCode();
595 622
				if (statusCode == 409) {
......
600 627
					setResult(Activity.RESULT_OK);
601 628
					removeFromList(currentPath);
602 629
					goUpDirectory();
603
					dialog.dismiss();
630
					
604 631
				} else {
605 632
					CloudServersException cse = parseCloudServersException(response);
606 633
					if ("".equals(cse.getMessage())) {
......
624 651
	
625 652
		private CloudServersException exception;
626 653
		
627
		protected void onPreExecute(){
628
			dialog = ProgressDialog.show(ContainerObjectsActivity.this, "", "Adding Folder...", true);
629
		}
630
	
631 654
		@Override
632 655
		protected HttpResponse doInBackground(String... data) {
633 656
			HttpResponse resp = null;
......
641 664
	
642 665
		@Override
643 666
		protected void onPostExecute(HttpResponse response) {
644
			dialog.dismiss();
667
			//dialog.dismiss();
645 668
			if (response != null) {
646 669
				int statusCode = response.getStatusLine().getStatusCode();
647 670
				if (statusCode == 201) {

Also available in: Unified diff