Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Switch to the Advanced Edit interface

  • Loading branch information...
commit f6c9e25a9b8c935994f2d6a5b20630c72b49cb2f 1 parent b92eccb
@matburt authored
View
27 res/layout/longcontext.xml
@@ -16,30 +16,9 @@
<TableRow/>
<TableRow>
<Button
- android:id="@+id/documentSetTitle"
- android:text="Edit Title"
+ android:id="@+id/documentEdit"
+ android:text="Edit"
android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
- </TableRow>
- <TableRow>
- <Button
- android:id="@+id/documentSetBody"
- android:text="Edit Body"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
- </TableRow>
- <TableRow>
- <Button
- android:id="@+id/documentSetTodo"
- android:text="...TODO..."
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
- </TableRow>
- <TableRow>
- <Button
- android:id="@+id/documentSetPriority"
- android:text="...PRIORITY..."
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
+ android:layout_height="fill_parent" />
</TableRow>
</TableLayout>
View
68 src/com/matburt/mobileorg/OrgContextMenu.java
@@ -6,10 +6,8 @@
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
-import com.matburt.mobileorg.Capture.Capture;
-import com.matburt.mobileorg.Capture.EditDetailsActivity;
+import com.matburt.mobileorg.Capture.ViewNodeDetailsActivity;
import com.matburt.mobileorg.Parsing.Node;
-
import java.util.ArrayList;
public class OrgContextMenu extends Activity implements OnClickListener
@@ -17,27 +15,16 @@
public static final String LT = "MobileOrg";
ArrayList<Integer> npath;
private Button docButton;
- private Button docEditTitleButton;
- private Button docEditBodyButton;
- private Button docTodoButton;
- private Button docPriorityButton;
+ private Button docEditButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.longcontext);
this.docButton = (Button)this.findViewById(R.id.documentMode);
- this.docEditTitleButton = (Button)this.findViewById(R.id.documentSetTitle);
- this.docEditBodyButton = (Button)this.findViewById(R.id.documentSetBody);
- //NOTE: Remove when editing the body works
- this.docEditBodyButton.setVisibility(View.GONE);
- this.docTodoButton = (Button)this.findViewById(R.id.documentSetTodo);
- this.docPriorityButton = (Button)this.findViewById(R.id.documentSetPriority);
+ this.docEditButton = (Button)this.findViewById(R.id.documentEdit);
this.docButton.setOnClickListener(this);
- this.docEditTitleButton.setOnClickListener(this);
- this.docEditBodyButton.setOnClickListener(this);
- this.docTodoButton.setOnClickListener(this);
- this.docPriorityButton.setOnClickListener(this);
+ this.docEditButton.setOnClickListener(this);
this.poplateDisplay();
}
@@ -55,13 +42,7 @@ public void poplateDisplay() {
thisNode = thisNode.subNodes.get(
this.npath.get(idx));
}
- if (thisNode.todo == null || thisNode.todo.length() < 1) {
- this.docTodoButton.setVisibility(View.GONE);
- }
-
- if (thisNode.priority == null || thisNode.priority.length() < 1) {
- this.docPriorityButton.setVisibility(View.GONE);
- }
+ //If we need to do something special with the context menu based on the Node we'll do it here
appInst.popSelection();
}
@@ -71,46 +52,19 @@ public void onClick(View v) {
if (thisNode == null) {
return;
}
-
Intent textIntent = new Intent();
String displayBuffer = new String();
if (v == this.docButton) {
textIntent.setClass(this,
SimpleTextDisplay.class);
textIntent.putExtra("txtValue", thisNode.nodePayload);
+ textIntent.putExtra("nodeTitle", thisNode.nodeName);
}
- else if (v == this.docEditTitleButton) {
- textIntent.setClass(this,
- Capture.class);
- if (thisNode.nodeId != null && thisNode.nodeId.length() > 0) {
- textIntent.putExtra("nodeId", thisNode.nodeId);
- }
- textIntent.putExtra("editType", "heading");
- textIntent.putExtra("txtValue", thisNode.nodeName);
- }
- else if (v == this.docEditBodyButton) {
- textIntent.setClass(this,
- Capture.class);
- if (thisNode.nodeId != null && thisNode.nodeId.length() > 0) {
- textIntent.putExtra("nodeId", thisNode.nodeId);
- }
- textIntent.putExtra("editType", "body");
- textIntent.putExtra("txtValue", thisNode.nodePayload);
- }
-
- else if (v == this.docTodoButton) {
- textIntent.setClass(this,
- EditDetailsActivity.class);
- textIntent.putExtra("nodePath", this.npath);
- textIntent.putExtra("editType", "todo");
- }
- else if (v == this.docPriorityButton) {
- textIntent.setClass(this,
- EditDetailsActivity.class);
- textIntent.putExtra("nodePath", this.npath);
- textIntent.putExtra("editType", "priority");
+ else if (v == this.docEditButton) {
+ textIntent.setClass(this, ViewNodeDetailsActivity.class);
+ textIntent.putExtra("actionMode", "edit");
+ textIntent.putIntegerArrayListExtra("nodePath", this.npath);
}
- textIntent.putExtra("nodeTitle", thisNode.nodeName);
startActivity(textIntent);
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.