zengjiebin лет назад: 7
Родитель
Сommit
d39da6a908

+ 1 - 5
app/build.gradle

@@ -271,11 +271,7 @@ android.applicationVariants.all {
         variant.outputs.each {
             output ->
                 if(buildType.name == "release") {
-                    if (productFlavors[0].name == "sheep") {
-                        output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk")
-                    } else {
-                        output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name +".apk")
-                    }
+                    output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk")
                 }
 
         }

+ 0 - 334
app/src/main/java/com/kfzs/duanduan/PicBottomSheetActivity.java

@@ -1,334 +0,0 @@
-package com.kfzs.duanduan;
-
-import android.Manifest;
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.os.Handler;
-import android.os.Message;
-import android.provider.MediaStore;
-import android.support.annotation.IdRes;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.StringRes;
-import android.support.v4.app.ActivityCompat;
-import android.text.TextUtils;
-import android.widget.ImageView;
-
-import com.flipboard.bottomsheet.BottomSheetLayout;
-import com.flipboard.bottomsheet.commons.ImagePickerSheetView;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.ref.WeakReference;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-/**
- * <pre>
- *     sinlov
- *
- *     /\__/\
- *    /`    '\
- *  ≈≈≈ 0  0 ≈≈≈ Hello world!
- *    \  --  /
- *   /        \
- *  /          \
- * |            |
- *  \  ||  ||  /
- *   \_oo__oo_/≡≡≡≡≡≡≡≡o
- *
- * </pre>
- * Created by sinlov on 17/3/30.
- */
-public abstract class PicBottomSheetActivity extends BaseCompatActivity {
-
-    private static final int REQUEST_STORAGE = 9525;
-    private static final int REQUEST_IMAGE_CAPTURE = REQUEST_STORAGE + 1;
-    private static final int REQUEST_LOAD_IMAGE = REQUEST_IMAGE_CAPTURE + 1;
-
-    private static int what;
-    protected static PicBottomSheetHandler picBottomSheetHandler;
-
-    protected BottomSheetLayout bottomSheetLayout;
-    private Uri callBackImageUri = null;
-    private String chooseTitleString;
-
-//    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
-//    @Override
-//    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
-//        super.onCreate(savedInstanceState, persistentState);
-//    }
-
-    protected void initPicBottomSheetHandler() {
-        picBottomSheetHandler = new PicBottomSheetHandler(this);
-    }
-
-    protected void initBottomSheetLayoutByID(@IdRes int bottomSheetID, @StringRes int titleStringID) {
-        bottomSheetLayout = findViewById(bottomSheetID);
-        chooseTitleString = getString(titleStringID);
-        if (bottomSheetLayout != null || !TextUtils.isEmpty(chooseTitleString)) {
-            bottomSheetLayout.setPeekOnDismiss(true);
-        } else {
-            throw new IllegalArgumentException("in this activity you are not use right ID" +
-                    " at setting initBottomSheetLayoutByID(id)!");
-        }
-    }
-
-    protected abstract boolean showSheetImageView(ImageView imageView, Uri imageUri, int size);
-
-    protected abstract void callBackSelectedImageUriByBottomSheet(Uri selectedImageUri);
-
-
-    /**
-     * You can send message for {@link #safeHandleCallBack(WeakReference, int, Object)}
-     *
-     * @param what int
-     * @param obj  object
-     */
-    protected void sendSafeHandle(int what, Object obj) {
-        setInstanceWhat(what);
-        picBottomSheetHandler.obtainMessage(what, obj).sendToTarget();
-    }
-
-    /**
-     * you can use this tCallBack to do safe handler things by method {@link #sendSafeHandle(int, Object)}
-     *
-     * @param wrAct WeakReference
-     * @param what  int
-     * @param obj   object
-     */
-    public abstract void safeHandleCallBack(WeakReference<PicBottomSheetActivity> wrAct, int what, Object obj);
-
-    protected boolean callSheetImageViewPop() {
-        boolean needsPermission = checkNeedsPermission();
-        if (needsPermission) {
-            requestStoragePermission();
-        } else {
-            showSheetView();
-        }
-        return needsPermission;
-    }
-
-    protected static void setWhat(int what) {
-        PicBottomSheetActivity.what = what;
-    }
-
-
-    public static class PicBottomSheetHandler extends Handler {
-
-        private static WeakReference<PicBottomSheetActivity> wrActivity;
-
-        /**
-         * set target Activity to Weak reference and the customize handler be recycle timely.
-         *
-         * @param wrActivity WeakActivity
-         */
-        public PicBottomSheetHandler(PicBottomSheetActivity wrActivity) {
-            PicBottomSheetHandler.wrActivity = new WeakReference<PicBottomSheetActivity>(wrActivity);
-        }
-
-        public WeakReference<PicBottomSheetActivity> get() {
-            return wrActivity;
-        }
-
-        @Override
-        public void handleMessage(Message msg) {
-            super.handleMessage(msg);
-            PicBottomSheetActivity ba = wrActivity.get();
-            Object obj = msg.obj;
-            if (null != ba && null != obj) {
-                ba.safeHandleCallBack(wrActivity, what, obj);
-            }
-        }
-    }
-
-    private void setInstanceWhat(int what) {
-        setWhat(what);
-    }
-
-
-    private boolean checkNeedsPermission() {
-        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && ActivityCompat.checkSelfPermission(PicBottomSheetActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED;
-    }
-
-    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
-    private void requestStoragePermission() {
-        if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
-            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_STORAGE);
-        } else {
-            // Eh, prompt anyway
-            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_STORAGE);
-        }
-    }
-
-    @TargetApi(Build.VERSION_CODES.M)
-    @Override
-    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
-        if (requestCode == REQUEST_STORAGE) {
-            if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
-                showSheetView();
-            } else {
-                // Permission denied
-                showToast("Sheet is useless without access to external storage : ");
-            }
-        } else {
-            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
-        }
-    }
-
-    /**
-     * Show an {@link ImagePickerSheetView}
-     */
-    private void showSheetView() {
-        ImagePickerSheetView sheetView = new ImagePickerSheetView.Builder(this)
-                .setMaxItems(30)
-                .setShowCameraOption(createCameraIntent() != null)
-                .setShowPickerOption(createPickIntent() != null)
-                .setImageProvider(new ImagePickerSheetView.ImageProvider() {
-                    @Override
-                    public void onProvideImage(ImageView imageView, Uri imageUri, int size) {
-                        boolean isSetting = showSheetImageView(imageView, imageUri, size);
-                        if (!isSetting) {
-                            throw new IllegalArgumentException("you are not use showSheetImageView() and return true!");
-                        }
-                    }
-                })
-                .setOnTileSelectedListener(new ImagePickerSheetView.OnTileSelectedListener() {
-                    @Override
-                    public void onTileSelected(ImagePickerSheetView.ImagePickerTile selectedTile) {
-                        bottomSheetLayout.dismissSheet();
-                        if (selectedTile.isCameraTile()) {
-                            dispatchTakePictureIntent();
-                        } else if (selectedTile.isPickerTile()) {
-                            startActivityForResult(createPickIntent(), REQUEST_LOAD_IMAGE);
-                        } else if (selectedTile.isImageTile()) {
-                            callBackSelectedImageUriByBottomSheet(selectedTile.getImageUri());
-                        } else {
-                            genericError();
-                        }
-                    }
-                })
-                .setTitle(chooseTitleString)
-                .create();
-        if (bottomSheetLayout != null) {
-            bottomSheetLayout.showWithSheetView(sheetView);
-        } else {
-            throw new IllegalArgumentException("in this activity you are not setting initBottomSheetLayoutByID(id) at Layout!");
-        }
-    }
-
-    /**
-     * For images captured from the camera, we need to create a File first to tell the camera
-     * where to store the image.
-     *
-     * @return the File created for the image to be store under.
-     */
-    private File createImageFile() throws IOException {
-        // Create an image file name
-        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
-        String imageFileName = "JPEG_" + timeStamp + "_";
-        File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
-        File imageFile = File.createTempFile(
-                imageFileName,  /* prefix */
-                ".jpg",         /* suffix */
-                storageDir      /* directory */
-        );
-
-        // Save a file: path for use with ACTION_VIEW intents
-        callBackImageUri = Uri.fromFile(imageFile);
-        return imageFile;
-    }
-
-    /**
-     * This checks to see if there is a suitable activity to handle the `ACTION_PICK` intent
-     * and returns it if found. {@link Intent#ACTION_PICK} is for picking an image from an external app.
-     *
-     * @return A prepared intent if found.
-     */
-    @Nullable
-    private Intent createPickIntent() {
-        Intent picImageIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
-        if (picImageIntent.resolveActivity(getPackageManager()) != null) {
-            return picImageIntent;
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * This checks to see if there is a suitable activity to handle the {@link MediaStore#ACTION_IMAGE_CAPTURE}
-     * intent and returns it if found. {@link MediaStore#ACTION_IMAGE_CAPTURE} is for letting another app take
-     * a picture from the camera and store it in a file that we specify.
-     *
-     * @return A prepared intent if found.
-     */
-    @Nullable
-    private Intent createCameraIntent() {
-        Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
-        if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
-            return takePictureIntent;
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * This utility function combines the camera intent creation and image file creation, and
-     * ultimately fires the intent.
-     *
-     * @see {@link #createCameraIntent()}
-     * @see {@link #createImageFile()}
-     */
-    private void dispatchTakePictureIntent() {
-        Intent takePictureIntent = createCameraIntent();
-        // Ensure that there's a camera activity to handle the intent
-        if (takePictureIntent != null) {
-            // Create the File where the photo should go
-            try {
-                File imageFile = createImageFile();
-                takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imageFile));
-                startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
-            } catch (IOException e) {
-                // Error occurred while creating the File
-                genericError("Could not create imageFile for camera");
-            }
-        }
-    }
-
-    @Override
-    public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
-        if (resultCode == Activity.RESULT_OK) {
-            Uri selectedImage = null;
-            if (requestCode == REQUEST_LOAD_IMAGE && data != null) {
-                selectedImage = data.getData();
-                if (selectedImage == null) {
-                    genericError();
-                }
-            } else if (requestCode == REQUEST_IMAGE_CAPTURE) {
-                // Do something with imagePath
-                selectedImage = callBackImageUri;
-            }
-
-            if (selectedImage != null) {
-                callBackSelectedImageUriByBottomSheet(selectedImage);
-            } else {
-                genericError();
-            }
-        }
-    }
-
-    private void genericError() {
-        genericError(null);
-    }
-
-    private void genericError(String message) {
-        showToast(message == null ? "Something went wrong." : message);
-    }
-}

+ 3 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtAskgetmoney.java

@@ -1,5 +1,6 @@
 package com.kfzs.duanduan.fragment;
 
+import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
@@ -111,7 +112,7 @@ public class FgtAskgetmoney extends BaseCompatFragment {
                 "    </style>\n" +
                 "  </head>\n" +
                 "  <body>\n" +
-                "    <img src=\"http://cdngame.kuaifazs.com/ask_bg2.png\" width=\"100%\">\n" +
+                "    <img src=\"http://cdngame.kuaifazs.com/yaoqingzq_bg.png\" width=\"100%\">\n" +
                 "  </body>\n" +
                 "</html>";
         ask_bg.getSettings().setDefaultTextEncodingName("UTF-8");
@@ -137,6 +138,7 @@ public class FgtAskgetmoney extends BaseCompatFragment {
         super.onDestroyView();
     }
 
+    @SuppressLint("ClickableViewAccessibility")
     public void initListener() {
         scrollView.setOnTouchListener(new View.OnTouchListener() {
             @Override

+ 1 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java

@@ -316,8 +316,8 @@ public class FgtFindChild extends BaseCompatFragment {
             ListUtil.addAll(list, newList);
             if(!list.isEmpty())
                 list.add(null);//底部部分----我是有底线的
-            notifyDataSetChanged();
         }
+        notifyDataSetChanged();
     }
 
     private void notifyDataSetChanged(){

+ 0 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -284,7 +284,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         }
     }
 
-    @RequiresApi(api = Build.VERSION_CODES.M)
     @Override
     protected void initView(Bundle savedInstanceState) {
         setContentView(R.layout.homepage_act_layout);

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/model/util/CacheInterceptor.java

@@ -30,7 +30,6 @@ import okio.BufferedSource;
  */
 public class CacheInterceptor implements Interceptor {
     private static final Charset UTF8 = Charset.forName("UTF-8");
-    public static final int DEFAULT_SAVE_TIME = 300;//单位秒
 
     public Response intercept(Chain chain) throws IOException {
         Request request = chain.request();

+ 6 - 1
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -206,7 +206,12 @@ public class DataUtil {
         if (BuildConfig.XXTEA_ENCRYPT) {
             cacheData = BaseMessageConverter.decrypt(cacheData);
         }
-        return JSON.parseObject(cacheData, BaseMessage.class).getDataList(classT);
+        try {
+            return JSON.parseObject(cacheData, BaseMessage.class).getDataList(classT);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return ListUtil.emptyList();
+        }
     }
 
 

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java

@@ -92,7 +92,6 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
             tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.BEGIN_TASK, releaseEtyListsBegin));
         tryMakeMoneyAdp.refreshAdapter();
         boolean showEmpty = acceptedEtyList.isEmpty() && releaseEtyLists.isEmpty() && releaseEtyListsBegin.isEmpty();
-        LogUtil.println("showEmpty", showEmpty);
         CommonUtil.getInstance().updateEmptyView(empty_view, showEmpty);
         refresh.setRefreshing(false);
         if(!TextUtils.isEmpty(show_type))

+ 2 - 2
app/src/main/res/layout/fgt_try_makemoney_layout.xml

@@ -3,8 +3,8 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:paddingBottom="@dimen/content_padding_10"
-    android:paddingStart="@dimen/content_padding_10"
-    android:paddingEnd="@dimen/content_padding_10">
+    android:paddingStart="4dp"
+    android:paddingEnd="4dp">
 
     <include
         android:id="@+id/empty_view"

+ 0 - 1
app/src/main/res/layout/x_ask_getmoney_act_layout.xml

@@ -11,7 +11,6 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_marginBottom="60dp"
-        android:layout_marginTop="-13dp"
         android:orientation="vertical"
         android:fillViewport="true"
         android:layout_gravity="fill_vertical"