OSDN Git Service

Android11での動作を確認。
authorMRSa <mrsa@myad.jp>
Wed, 14 Oct 2020 13:55:03 +0000 (22:55 +0900)
committerMRSa <mrsa@myad.jp>
Wed, 14 Oct 2020 13:55:03 +0000 (22:55 +0900)
.idea/compiler.xml [new file with mode: 0644]
.idea/gradle.xml
.idea/misc.xml
.idea/modules.xml
app/build.gradle
app/src/main/java/net/osdn/gokigen/a01d/liveview/StoreImage.kt
build.gradle
gradle/wrapper/gradle-wrapper.properties

diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644 (file)
index 0000000..61a9130
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="1.8" />
+  </component>
+</project>
\ No newline at end of file
index 674414f..41871c2 100644 (file)
@@ -15,6 +15,7 @@
           </set>
         </option>
         <option name="resolveModulePerSourceSet" value="false" />
+        <option name="useQualifiedModuleNames" value="true" />
       </GradleProjectSettings>
     </option>
   </component>
index c852d32..c43a9bb 100644 (file)
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">
index b8d872c..740045d 100644 (file)
@@ -2,8 +2,8 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://$PROJECT_DIR$/A01d.iml" filepath="$PROJECT_DIR$/A01d.iml" group="A01d" />
-      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" group="A01d/app" />
+      <module fileurl="file://$PROJECT_DIR$/A01d.iml" filepath="$PROJECT_DIR$/A01d.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/A01d.app.iml" filepath="$PROJECT_DIR$/.idea/modules/app/A01d.app.iml" />
     </modules>
   </component>
 </project>
\ No newline at end of file
index 5b955d9..0cea436 100644 (file)
@@ -24,11 +24,11 @@ dependencies {
     implementation 'androidx.exifinterface:exifinterface:1.3.0'
     implementation 'androidx.preference:preference:1.1.1'
     implementation 'com.google.android.material:material:1.2.1'
-    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
     implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
 
     api files('libs/olycamerakit.jar')
-    implementation "androidx.core:core-ktx:1.3.1"
+    implementation "androidx.core:core-ktx:1.3.2"
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
 }
 repositories {
index d0823fe..caa08e7 100644 (file)
@@ -18,19 +18,17 @@ import java.util.*
 
 class StoreImage(private val context: Context, private val dumpLog : Boolean = false) : IStoreImage
 {
-    private val TAG = toString()
-    private val FILENAME_FORMAT = "yyyyMMdd_HHmmss"
 
     override fun doStore(bitmapToStore: Bitmap)
     {
         try
         {
-            // 保存処理(プログレスダイアログ(「保存中...」)を表示
+            // ここで 保存処理(プログレスダイアログ(「保存中...」)を表示
 
             val preference = PreferenceManager.getDefaultSharedPreferences(context)
-            val isLocalLocation  = preference.getBoolean(
-                IPreferencePropertyAccessor.SAVE_LOCAL_LOCATION,
-                IPreferencePropertyAccessor.SAVE_LOCAL_LOCATION_DEFAULT_VALUE
+            val isLocalLocation = preference.getBoolean(
+                    IPreferencePropertyAccessor.SAVE_LOCAL_LOCATION,
+                    IPreferencePropertyAccessor.SAVE_LOCAL_LOCATION_DEFAULT_VALUE
             )
             if (isLocalLocation)
             {
@@ -41,7 +39,7 @@ class StoreImage(private val context: Context, private val dumpLog : Boolean = f
                 saveImageExternal(bitmapToStore)
             }
 
-            // 保存処理(プログレスダイアログ(「保存中...」)を削除
+            // ここで 保存処理(プログレスダイアログ(「保存中...」)を削除
         }
         catch (t: Throwable)
         {
@@ -117,11 +115,10 @@ class StoreImage(private val context: Context, private val dumpLog : Boolean = f
             val outputDir = getExternalOutputDirectory()
             val resolver = context.contentResolver
             val mimeType = "image/jpeg"
-            //val now = System.currentTimeMillis()
             val path = Environment.DIRECTORY_DCIM + File.separator + context.getString(R.string.app_name2)
             val fileName = SimpleDateFormat(FILENAME_FORMAT, Locale.US).format(Calendar.getInstance().time) + ".jpg"
 
-            val extStorageUri : Uri
+            val extStorageUri: Uri
             val values = ContentValues()
             values.put(MediaStore.Images.Media.TITLE, fileName)
             values.put(MediaStore.Images.Media.DISPLAY_NAME, fileName)
@@ -137,11 +134,10 @@ class StoreImage(private val context: Context, private val dumpLog : Boolean = f
                 values.put(MediaStore.Images.Media.DATA, outputDir.absolutePath + File.separator + fileName)
                 extStorageUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI
             }
+
             val imageUri = resolver.insert(extStorageUri, values)
             if (imageUri != null)
             {
-                resolver.update(imageUri, values, null, null)
-
                 ////////////////////////////////////////////////////////////////
                 if (dumpLog)
                 {
@@ -165,6 +161,10 @@ class StoreImage(private val context: Context, private val dumpLog : Boolean = f
 
                 }
             }
+            else
+            {
+                Log.v(TAG, " cannot get imageUri...")
+            }
         }
         catch (t: Throwable)
         {
@@ -177,4 +177,9 @@ class StoreImage(private val context: Context, private val dumpLog : Boolean = f
         return (Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED)
     }
 
+    companion object
+    {
+        private val TAG = this.toString()
+        private const val FILENAME_FORMAT = "yyyyMMdd_HHmmss"
+    }
 }
index 50d3579..28d7982 100644 (file)
@@ -7,7 +7,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:4.0.1'
+        classpath 'com.android.tools.build:gradle:4.1.0'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
 
         // NOTE: Do not place your application dependencies here; they belong
index 1d4f4d7..0b9e0ab 100644 (file)
@@ -1,6 +1,6 @@
-#Sat May 30 16:05:10 JST 2020
+#Wed Oct 14 21:48:19 JST 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip