OSDN Git Service

画像の詳細情報取得を一括取得から都度取得に変えた。アプリ終了ボタンを追加した。
[gokigen/Gr2Control.git] / app / src / main / java / net / osdn / gokigen / gr2control / camera / playback / CameraFileInfo.java
index 36dd439..e11eac4 100644 (file)
@@ -4,7 +4,9 @@ import android.support.annotation.NonNull;
 
 import net.osdn.gokigen.gr2control.camera.ICameraFileInfo;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 
 public class CameraFileInfo implements ICameraFileInfo
 {
@@ -28,47 +30,6 @@ public class CameraFileInfo implements ICameraFileInfo
         this.dateTime = new Date();
     }
 
-    public void setDateTime(@NonNull Date dateTime)
-    {
-        this.dateTime = dateTime;
-    }
-    public void setCaptured(boolean captured)
-    {
-        this.captured = captured;
-    }
-    public void setAperature(String av)
-    {
-        this.av = av;
-    }
-    public void setShutterSpeed(String tv)
-    {
-        this.tv = tv;
-    }
-    public void setIso(String sv)
-    {
-        this.sv = sv;
-    }
-    public void setExpRev(String xv)
-    {
-        this.xv = xv;
-    }
-    public void setOrientation(int orientation)
-    {
-        this.orientation = orientation;
-    }
-    public void setAspectRatio(String aspectRatio)
-    {
-        this.aspectRatio = aspectRatio;
-    }
-    public void setModel(String cameraModel)
-    {
-        this.cameraModel = cameraModel;
-    }
-    public void setLatLng(String latlng)
-    {
-        this.latlng = latlng;
-    }
-
     @Override
     public Date getDatetime()
     {
@@ -140,4 +101,26 @@ public class CameraFileInfo implements ICameraFileInfo
     {
         return (captured);
     }
+
+    @Override
+    public void updateValues(String dateTime, String av, String tv, String sv, String xv, int orientation, String aspectRatio, String model, String latLng, boolean captured) {
+        this.av = av;
+        this.tv = tv;
+        this.sv = sv;
+        this.xv = xv;
+        this.orientation = orientation;
+        this.aspectRatio = aspectRatio;
+        this.cameraModel = model;
+        this.latlng = latLng;
+        this.captured = captured;
+        try
+        {
+            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
+            this.dateTime = df.parse(dateTime);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
 }