OSDN Git Service

icon
authorYuji Konishi <yuji.k64613@gmail.com>
Fri, 17 Aug 2012 04:52:07 +0000 (13:52 +0900)
committerYuji Konishi <yuji.k64613@gmail.com>
Fri, 17 Aug 2012 04:52:07 +0000 (13:52 +0900)
23 files changed:
icon/base.png [new file with mode: 0644]
icon/close.png [new file with mode: 0644]
icon/dirnode.png [new file with mode: 0644]
icon/filenode.png [new file with mode: 0644]
icon/icon.png [new file with mode: 0644]
icon/notebook.png [new file with mode: 0644]
icon/open.png [new file with mode: 0644]
source/workspace/EverFolder/gen/com/yuji/ef/R.java
source/workspace/EverFolder/res/drawable/android.png [deleted file]
source/workspace/EverFolder/res/drawable/button.xml [new file with mode: 0644]
source/workspace/EverFolder/res/drawable/close.png
source/workspace/EverFolder/res/drawable/dirnode.png [new file with mode: 0644]
source/workspace/EverFolder/res/drawable/filenode.png [new file with mode: 0644]
source/workspace/EverFolder/res/drawable/notebook.png [new file with mode: 0644]
source/workspace/EverFolder/res/drawable/open.png
source/workspace/EverFolder/res/drawable/test2.png [deleted file]
source/workspace/EverFolder/res/drawable/test3.png [deleted file]
source/workspace/EverFolder/res/layout/main.xml
source/workspace/EverFolder/src/com/yuji/ef/EverFolderActivity.java
source/workspace/EverFolder/src/com/yuji/ef/IconFrameLayout.java
source/workspace/EverFolder/src/com/yuji/ef/dao/DirNode.java
source/workspace/EverFolder/src/com/yuji/ef/dao/FileNode.java
source/workspace/EverFolder/src/com/yuji/ef/utility/FolderUtil.java

diff --git a/icon/base.png b/icon/base.png
new file mode 100644 (file)
index 0000000..a147018
Binary files /dev/null and b/icon/base.png differ
diff --git a/icon/close.png b/icon/close.png
new file mode 100644 (file)
index 0000000..01bd1af
Binary files /dev/null and b/icon/close.png differ
diff --git a/icon/dirnode.png b/icon/dirnode.png
new file mode 100644 (file)
index 0000000..32de38f
Binary files /dev/null and b/icon/dirnode.png differ
diff --git a/icon/filenode.png b/icon/filenode.png
new file mode 100644 (file)
index 0000000..0ca46a1
Binary files /dev/null and b/icon/filenode.png differ
diff --git a/icon/icon.png b/icon/icon.png
new file mode 100644 (file)
index 0000000..6a3f1c7
Binary files /dev/null and b/icon/icon.png differ
diff --git a/icon/notebook.png b/icon/notebook.png
new file mode 100644 (file)
index 0000000..f183376
Binary files /dev/null and b/icon/notebook.png differ
diff --git a/icon/open.png b/icon/open.png
new file mode 100644 (file)
index 0000000..f0357c1
Binary files /dev/null and b/icon/open.png differ
index f1ff24d..83d2167 100644 (file)
@@ -18,12 +18,13 @@ public final class R {
     public static final class attr {
     }
     public static final class drawable {
-        public static final int android=0x7f020000;
+        public static final int button=0x7f020000;
         public static final int close=0x7f020001;
-        public static final int icon=0x7f020002;
-        public static final int open=0x7f020003;
-        public static final int test2=0x7f020004;
-        public static final int test3=0x7f020005;
+        public static final int dirnode=0x7f020002;
+        public static final int filenode=0x7f020003;
+        public static final int icon=0x7f020004;
+        public static final int notebook=0x7f020005;
+        public static final int open=0x7f020006;
     }
     public static final class id {
         public static final int frameLayout=0x7f070008;
diff --git a/source/workspace/EverFolder/res/drawable/android.png b/source/workspace/EverFolder/res/drawable/android.png
deleted file mode 100644 (file)
index a4d6697..0000000
Binary files a/source/workspace/EverFolder/res/drawable/android.png and /dev/null differ
diff --git a/source/workspace/EverFolder/res/drawable/button.xml b/source/workspace/EverFolder/res/drawable/button.xml
new file mode 100644 (file)
index 0000000..ca1d7b5
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector
+  xmlns:android="http://schemas.android.com/apk/res/android">
+
+<!-- ボタンが押されている -->
+<!-- フォーカスされていない -->
+<item android:state_pressed="true"
+       android:state_focused="false">
+<layer-list>
+       <item>
+       <shape 
+               xmlns:android="http://schemas.android.com/apk/res/android"
+               android:shape="rectangle">
+               <gradient 
+               android:angle="270"
+               android:startColor="#93cdcc" 
+               android:endColor="#e3e3e3"
+               android:type="linear" />
+               <corners 
+                       android:radius="4dip" />
+               <stroke 
+                       android:width="2dip" 
+                       android:color="#ffffff"/>
+    </shape>
+       </item>
+</layer-list>
+</item>
+
+<!-- ボタンが押されていない -->
+<!-- フォーカスされていない -->
+<item android:state_pressed="false"
+       android:state_focused="false">
+<layer-list>
+       <item>
+       <shape 
+               xmlns:android="http://schemas.android.com/apk/res/android"
+               android:shape="rectangle">
+               <gradient 
+               android:angle="270"
+               android:startColor="#e3e3e3" 
+               android:endColor="#93cdcc"
+               android:type="linear" />
+               <corners 
+                       android:radius="4dip" />
+               <stroke 
+                       android:width="0.5dip" 
+                       android:color="#ffffff"/>
+    </shape>
+       </item>
+</layer-list>
+</item>
+
+<!-- ボタンが押されている -->
+<!-- フォーカスされた -->
+<item android:state_pressed="true"
+       android:state_focused="true">
+<layer-list>
+       <item>
+       <shape 
+               xmlns:android="http://schemas.android.com/apk/res/android"
+               android:shape="rectangle">
+               <gradient 
+               android:angle="270"
+               android:startColor="#93cdcc" 
+               android:endColor="#e3e3e3"
+               android:type="linear" />
+               <corners 
+                       android:radius="4dip" />
+               <stroke 
+                       android:width="2dip" 
+                       android:color="#CC6600"/>
+    </shape>
+       </item>
+</layer-list>
+</item>
+
+<!-- ボタンが押されていない -->
+<!-- フォーカスされた -->
+<item android:state_pressed="false"
+       android:state_focused="true">
+<layer-list>
+       <item>
+       <shape 
+               xmlns:android="http://schemas.android.com/apk/res/android"
+               android:shape="rectangle">
+               <gradient 
+               android:angle="270"
+               android:startColor="#e3e3e3" 
+               android:endColor="#93cdcc"
+               android:type="linear" />
+               <corners 
+                       android:radius="4dip" />
+               <stroke 
+                       android:width="0.5dip" 
+                       android:color="#FF6600"/>
+    </shape>
+       </item>
+</layer-list>
+</item>
+
+</selector>
+
index 21bd1c1..01bd1af 100644 (file)
Binary files a/source/workspace/EverFolder/res/drawable/close.png and b/source/workspace/EverFolder/res/drawable/close.png differ
diff --git a/source/workspace/EverFolder/res/drawable/dirnode.png b/source/workspace/EverFolder/res/drawable/dirnode.png
new file mode 100644 (file)
index 0000000..32de38f
Binary files /dev/null and b/source/workspace/EverFolder/res/drawable/dirnode.png differ
diff --git a/source/workspace/EverFolder/res/drawable/filenode.png b/source/workspace/EverFolder/res/drawable/filenode.png
new file mode 100644 (file)
index 0000000..0ca46a1
Binary files /dev/null and b/source/workspace/EverFolder/res/drawable/filenode.png differ
diff --git a/source/workspace/EverFolder/res/drawable/notebook.png b/source/workspace/EverFolder/res/drawable/notebook.png
new file mode 100644 (file)
index 0000000..f183376
Binary files /dev/null and b/source/workspace/EverFolder/res/drawable/notebook.png differ
index b9f156f..f0357c1 100644 (file)
Binary files a/source/workspace/EverFolder/res/drawable/open.png and b/source/workspace/EverFolder/res/drawable/open.png differ
diff --git a/source/workspace/EverFolder/res/drawable/test2.png b/source/workspace/EverFolder/res/drawable/test2.png
deleted file mode 100644 (file)
index a480ae7..0000000
Binary files a/source/workspace/EverFolder/res/drawable/test2.png and /dev/null differ
diff --git a/source/workspace/EverFolder/res/drawable/test3.png b/source/workspace/EverFolder/res/drawable/test3.png
deleted file mode 100644 (file)
index d51fe30..0000000
Binary files a/source/workspace/EverFolder/res/drawable/test3.png and /dev/null differ
index 0151c70..9cdb345 100644 (file)
         <Button
             android:id="@+id/leftButton"
             android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
+            android:layout_height="32dip"
             android:layout_weight="1"
+            android:background="@drawable/button"
             android:text="@+string/mainLeftButton" />
 
         <Button
             android:id="@+id/rightButton"
             android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
+            android:layout_height="32dip"
             android:layout_weight="1"
+            android:background="@drawable/button"
             android:text="@+string/mainRightButton" />
     </LinearLayout>
 
index 1d28396..4ac0d57 100644 (file)
@@ -187,6 +187,10 @@ public class EverFolderActivity extends BaseActivity {
                        bmpPaddingLeft = bmp.getWidth();
                        bmp = bitmapFactory.get(node.getIconId());
                        bmpWidth = bmp.getWidth();
+
+                       float fSize = 32 * (2 / 3.0f);
+                       leftButton.setTextSize(fSize);
+                       rightButton.setTextSize(fSize);
                } catch (Exception e) {
                        // TODO
                        e.printStackTrace();
@@ -457,8 +461,6 @@ public class EverFolderActivity extends BaseActivity {
        }
 
        private void updateList(Node node, int depth) {
-               ScaleUtil scaleUtil = ScaleUtil.getInstance();
-               float sd = scaleUtil.getScaledDensity();
                int N = (int)(bmpWidth * 0.6);
                int M = (int)(bmpWidth * 1.2);
                int x = N * (depth - indent);
index c55a64a..6dfec9a 100644 (file)
@@ -150,8 +150,8 @@ public class IconFrameLayout extends FrameLayout implements OnLongClickListener
                                if (view.getNodeId() == id) {
                                        selectedTarget = view;
                                        target = view;
-                                       selectedTarget.setAlpha(255);
-                                       selectedTarget.setColorFilter(Color.RED, Mode.LIGHTEN);
+                                       setSelected(selectedTarget);
+
                                }
                        }
                }
@@ -317,8 +317,7 @@ public class IconFrameLayout extends FrameLayout implements OnLongClickListener
                                        currentX = obj.getLeft();
                                        currentY = obj.getTop();
 
-                                       target.setAlpha(255);
-                                       target.setColorFilter(Color.RED, Mode.LIGHTEN);
+                                       setSelected(target);
                                        selectedTarget = target;
                                        activity.targetSelectedChanged(true);
 
@@ -379,6 +378,11 @@ public class IconFrameLayout extends FrameLayout implements OnLongClickListener
                }
        }
 
+       private void setSelected(LabelIconView t) {
+               t.setAlpha(255);
+               t.setColorFilter(0x88ff0000, Mode.LIGHTEN);
+       }
+
        @Override
        public boolean onLongClick(View view) {
                if (!isElabledTouchEvent()){
index 0509637..0eff0eb 100644 (file)
@@ -59,8 +59,8 @@ public class DirNode extends Node {
 
        @Override
        public int getIconId() {
-               return CommonUtil.isNull(this.getGuid()) ? R.drawable.test2
-                               : R.drawable.test3;
+               return CommonUtil.isNull(this.getGuid()) ? R.drawable.dirnode
+                               : R.drawable.notebook;
        }
 
        @Override
index 470121a..0aa2d5b 100644 (file)
@@ -15,6 +15,6 @@ public class FileNode extends Node {
        
        @Override
        public int getIconId(){
-               return R.drawable.android;
+               return R.drawable.filenode;
        }
 }
index de39cc1..d768c7c 100644 (file)
@@ -40,6 +40,7 @@ public class FolderUtil {
                long id;
 
                Node top = new RootNode("", null);
+               top.setStatus(Node.Status.OPEN);
                id = nodeDao.addNT(top);
                top.setId(id);