public static final int mainAddMsg=0x7f050008;
public static final int mainConfirmMsg=0x7f050006;
public static final int mainConfirmTitle=0x7f050005;
- public static final int mainLeftButton=0x7f05000a;
- public static final int mainRenameMsg=0x7f050009;
- public static final int mainRightButton=0x7f05000b;
+ public static final int mainDeleteMsg=0x7f050009;
+ public static final int mainLeftButton=0x7f05000b;
+ public static final int mainRenameMsg=0x7f05000a;
+ public static final int mainRightButton=0x7f05000c;
public static final int mainUpdateMsg=0x7f050007;
public static final int noButton=0x7f050002;
- public static final int settingConfirmMsg=0x7f05000d;
- public static final int settingConfirmTitle=0x7f05000c;
- public static final int settingLoginButton=0x7f050010;
- public static final int settingLoginTitle=0x7f05000f;
- public static final int settingUpdateButton=0x7f050012;
- public static final int settingUpdateMsg=0x7f05000e;
- public static final int settingUpdateTimeTitle=0x7f050013;
- public static final int settingUpdateTitle=0x7f050011;
+ public static final int settingConfirmMsg=0x7f05000e;
+ public static final int settingConfirmTitle=0x7f05000d;
+ public static final int settingLoginButton=0x7f050011;
+ public static final int settingLoginTitle=0x7f050010;
+ public static final int settingUpdateButton=0x7f050013;
+ public static final int settingUpdateMsg=0x7f05000f;
+ public static final int settingUpdateTimeTitle=0x7f050014;
+ public static final int settingUpdateTitle=0x7f050012;
public static final int yesButton=0x7f050001;
}
}
public class EverFolderActivity extends BaseActivity {
private enum ScreenStatus {
- Normal, AddNode, RenameNode
+ Normal, AddNode, DeleteNode, RenameNode
};
private LinearLayout msgLayout;
}
private void selectMenuDelete() {
- FolderUtil util = FolderUtil.getInstance();
- LabelIconView target = layout.getSelectedTarget();
- long id = target.getNodeId();
- NodeDao dao = (NodeDao) NodeCacheDao.getInstance();
- Node node = dao.searchById(id);
- if (node != null) {
- util.deleteNode(node);
- // TODO 三角マークも消さないといけないのでは
- layout.removeView(target);
- updateList();
- setStatus();
- }
+ setStatus(ScreenStatus.DeleteNode);
}
private void selectMenuRename() {
}
private void updateList(Node node, int depth) {
- int N = (int)(bmpWidth * 0.6);
- int M = (int)(bmpWidth * 1.2);
+ int N = (int) (bmpWidth * 0.6);
+ int M = (int) (bmpWidth * 1.2);
int x = N * (depth - indent);
if (depth - indent >= 0
protected void onStart() {
super.onStart();
}
-
+
@Override
protected void onResume() {
super.onResume();
DirNode node = new DirNode(text, null);
util.addDirNode(parent, node);
}
+ layout.setCutTarget(null, false);
+ }
+ else if (status == ScreenStatus.DeleteNode) {
+ long id = target.getNodeId();
+ Node node = dao.searchById(id);
+ if (node != null) {
+ util.deleteNode(node);
+ layout.removeView(target);
+ }
+ layout.setCutTarget(null, false);
} else if (status == ScreenStatus.RenameNode) {
long id = target.getNodeId();
Node node = dao.searchById(id);
dao.updateName(node, text);
}
+ layout.setCutTarget(null, false);
}
layout.clearTarget();
updateList();
NodeDao dao = (NodeDao) NodeCacheDao.getInstance();
Node node = dao.searchById(id);
- if (!isFileNode(node)){
+ if (!isFileNode(node)) {
return;
}
String guid = node.getGuid();
leftButton.setEnabled(false);
rightButton.setEnabled(false);
+ } else if (status == ScreenStatus.DeleteNode) {
+ msgLayout.setVisibility(View.VISIBLE);
+ msgEditText.setVisibility(View.GONE);
+ msgButtonLayout.setVisibility(View.VISIBLE);
+ confirmMsg.setText(getString(R.string.mainDeleteMsg));
+
+ layout.setElabledTouchEvent(false);
+ leftButton.setEnabled(false);
+ rightButton.setEnabled(false);
} else if (status == ScreenStatus.RenameNode) {
msgLayout.setVisibility(View.VISIBLE);
msgEditText.setVisibility(View.VISIBLE);