Yuvipanda has uploaded a new change for review.
https://gerrit.wikimedia.org/r/106706
Change subject: Implement actually saving a section.
......................................................................
Implement actually saving a section.
Change-Id: Id9eef5fdec925f2652feac0ad748a90cd640d0e5
---
M wikipedia/res/values/strings.xml
M wikipedia/src/main/java/org/wikipedia/editing/EditSectionActivity.java
2 files changed, 23 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/06/106706/1
diff --git a/wikipedia/res/values/strings.xml b/wikipedia/res/values/strings.xml
index ee66038..03b6254 100644
--- a/wikipedia/res/values/strings.xml
+++ b/wikipedia/res/values/strings.xml
@@ -46,4 +46,5 @@
<string name="langlinks_activity_title">Other languages</string>
<string name="editsection_activity_title">Edit Section</string>
<string name="edit_section_error_retry">Retry</string>
+ <string name="dialog_saving_in_progress">Saving...</string>
</resources>
\ No newline at end of file
diff --git
a/wikipedia/src/main/java/org/wikipedia/editing/EditSectionActivity.java
b/wikipedia/src/main/java/org/wikipedia/editing/EditSectionActivity.java
index 9e8e6cf..6e1b5c2 100644
--- a/wikipedia/src/main/java/org/wikipedia/editing/EditSectionActivity.java
+++ b/wikipedia/src/main/java/org/wikipedia/editing/EditSectionActivity.java
@@ -1,6 +1,7 @@
package org.wikipedia.editing;
import android.app.Activity;
+import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
@@ -65,13 +66,33 @@
fetchSectionText();
}
+ private void doSave() {
+ final ProgressDialog dialog = new ProgressDialog(this);
+ dialog.setIndeterminate(true);
+ dialog.setCancelable(false);
+ dialog.setMessage(getString(R.string.dialog_saving_in_progress));
+ new DoEditTask(this, title, sectionText.getText().toString(),
section.getId()) {
+ @Override
+ public void onBeforeExecute() {
+ dialog.show();
+ }
+
+ @Override
+ public void onFinish(String result) {
+ dialog.hide();
+ finish();
+ }
+ }.execute();
+
+ }
+
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
case R.id.menu_save_section:
- Toast.makeText(this, "This will save things, eventually",
Toast.LENGTH_LONG).show();
+ doSave();
return true;
default:
throw new RuntimeException("WAT");
--
To view, visit https://gerrit.wikimedia.org/r/106706
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9eef5fdec925f2652feac0ad748a90cd640d0e5
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits