Bladeren bron

版本兼容处理

Signed-off-by: 刁铃刚 <315096953@qq.com>
刁铃刚 8 jaren geleden
bovenliggende
commit
aeb7333706

+ 1 - 4
.idea/misc.xml

@@ -1,8 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="EntryPointsManager">
-    <entry_points version="2.0" />
-  </component>
   <component name="NullableNotNullManager">
     <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
@@ -27,7 +24,7 @@
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 1 - 2
.idea/modules.xml

@@ -2,8 +2,7 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://$PROJECT_DIR$/SamllSheepPlugin.iml" filepath="$PROJECT_DIR$/SamllSheepPlugin.iml" />
-      <module fileurl="file://D:/Dlg/AndroidStudioProjects/small_sheep_android/SamllSheepPlugin.iml" filepath="D:/Dlg/AndroidStudioProjects/small_sheep_android/SamllSheepPlugin.iml" />
+      <module fileurl="file://D:\Dlg\AndroidStudioProjects\small_sheep_android\SamllSheepPlugin.iml" filepath="D:\Dlg\AndroidStudioProjects\small_sheep_android\SamllSheepPlugin.iml" />
       <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
       <module fileurl="file://$PROJECT_DIR$/small_sheep_android.iml" filepath="$PROJECT_DIR$/small_sheep_android.iml" />
     </modules>

+ 10 - 5
app/build.gradle

@@ -2,22 +2,25 @@ apply plugin: 'com.android.application'
 
 
 android {
-    compileSdkVersion 26
-    buildToolsVersion '26.0.2'
+    compileSdkVersion 27
+//    buildToolsVersion '27.0.2'
     defaultConfig {
         applicationId "com.sheep.jiuyan.samllsheep"
         minSdkVersion 18
-        targetSdkVersion 26
+        targetSdkVersion 27
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        ndk {
+            abiFilters "armeabi-v7a", "x86"
+        }
     }
 
     signingConfigs {
         config {
             keyAlias 'sheep'
             keyPassword 'zhaoyi2004'
-            storeFile file('./sign.jks')
+            storeFile file('.././sign.jks')
             storePassword 'zhaoyi2004'
         }
 
@@ -41,6 +44,7 @@ repositories {
     flatDir {
         dirs 'libs'
     }
+    google()
 }
 
 dependencies {
@@ -48,6 +52,8 @@ dependencies {
 //    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
 //        exclude group: 'com.android.support', module: 'support-annotations'
 //    })
+    implementation 'com.android.support:appcompat-v7:27.0.2'
+    implementation 'com.android.support:design:27.0.2'
     compile 'com.android.support.constraint:constraint-layout:1.0.2'
     testCompile 'junit:junit:4.12'
     //    compile 'com.shark:screencapture:1.0.0'
@@ -68,5 +74,4 @@ dependencies {
     compile 'com.mylhyl:acp:1.1.7'
     compile 'cn.yipianfengye.android:zxing-library:2.2'
 
-
 }

+ 2 - 3
app/src/main/java/com/sheep/jiuyan/samllsheep/floatwindow/ShotScreen.java

@@ -16,7 +16,6 @@ import android.media.projection.MediaProjectionManager;
 import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Handler;
-import android.support.v4.os.AsyncTaskCompat;
 import android.text.TextUtils;
 
 import java.io.File;
@@ -95,8 +94,8 @@ public class ShotScreen {
                                     public void run() {
 
                                         Image image = mImageReader.acquireLatestImage();
-
-                                        AsyncTaskCompat.executeParallel(new SaveTask(), image);
+//                                        AsyncTaskCompat.executeParallel(new SaveTask(), image);
+                                        new SaveTask().doInBackground(image);
                                     }
                                 },
                     1000);

+ 18 - 19
app/src/main/res/layout/main_activity.xml

@@ -1,22 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
     <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                                                  xmlns:app="http://schemas.android.com/apk/res-auto"
-                                                  android:id="@+id/swipe_main_activity"
-                                                  android:layout_width="match_parent"
-                                                  android:layout_height="match_parent"
-                                                  android:addStatesFromChildren="true"
-                                                  app:layout_behavior="@string/appbar_scrolling_view_behavior">
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:id="@+id/swipe_main_activity"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:addStatesFromChildren="true"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
         <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                                                         xmlns:app="http://schemas.android.com/apk/res-auto"
-                                                         android:layout_width="match_parent"
-                                                         android:layout_height="match_parent">
+            xmlns:app="http://schemas.android.com/apk/res-auto"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
 
             <android.support.design.widget.AppBarLayout
                 android:id="@+id/app_layout_main_activity"
@@ -47,7 +46,7 @@
                             android:textSize="@dimen/text_size_4"
                             app:layout_constraintLeft_toLeftOf="parent"
                             app:layout_constraintRight_toRightOf="parent"
-                            app:layout_constraintTop_toTopOf="parent"/>
+                            app:layout_constraintTop_toTopOf="parent" />
 
                         <LinearLayout
                             android:id="@+id/linearLayout"
@@ -68,7 +67,7 @@
                                 android:layout_width="20dp"
                                 android:layout_height="20dp"
                                 android:layout_centerVertical="true"
-                                android:src="@drawable/icon"/>
+                                android:src="@drawable/icon" />
 
                             <TextView
                                 android:id="@+id/txt_main_activity_nick"
@@ -76,7 +75,7 @@
                                 android:layout_height="wrap_content"
                                 android:layout_marginLeft="@dimen/content_padding_small"
                                 android:textColor="@color/orange_text_light"
-                                android:textSize="@dimen/text_size_3"/>
+                                android:textSize="@dimen/text_size_3" />
                         </LinearLayout>
 
 
@@ -95,7 +94,7 @@
                             android:textColor="@color/orange_text_light"
                             android:textSize="@dimen/text_size_3"
                             app:layout_constraintRight_toRightOf="parent"
-                            app:layout_constraintTop_toTopOf="@+id/linearLayout"/>
+                            app:layout_constraintTop_toTopOf="@+id/linearLayout" />
 
                     </android.support.constraint.ConstraintLayout>
 
@@ -108,7 +107,7 @@
                         app:contentInsetStart="0dp"
                         app:layout_collapseMode="pin">
 
-                        <include layout="@layout/title"/>
+                        <include layout="@layout/title" />
                     </android.support.v7.widget.Toolbar>
 
                 </android.support.design.widget.CollapsingToolbarLayout>
@@ -117,7 +116,7 @@
                     android:id="@+id/tab_main_activity"
                     android:layout_width="match_parent"
                     android:layout_height="40dp"
-                    android:background="@color/colorPrimary"/>
+                    android:background="@color/colorPrimary" />
             </android.support.design.widget.AppBarLayout>
 
             <android.support.v4.widget.NestedScrollView
@@ -147,7 +146,7 @@
         android:layout_gravity="right|bottom"
         android:layout_marginBottom="50dp"
         android:layout_marginRight="20dp"
-        android:src="@drawable/icon_ask"/>
+        android:src="@drawable/icon_ask" />
 
     <ImageView
         android:id="@+id/img_red"
@@ -156,6 +155,6 @@
         android:layout_marginLeft="10dp"
         android:layout_marginTop="10dp"
         android:src="@drawable/hongbao"
-        android:visibility="gone"/>
+        android:visibility="gone" />
 
 </FrameLayout>

+ 2 - 1
build.gradle

@@ -3,9 +3,10 @@
 buildscript {
     repositories {
         jcenter()
+        google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.3.3'
+        classpath 'com.android.tools.build:gradle:3.0.0'
         classpath 'com.didi.virtualapk:gradle:0.9.1'
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Tue Dec 12 19:40:12 CST 2017
+#Sat Jan 27 17:34:14 CST 2018
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip