Browse Source

small tune up

hanjing 7 years ago
parent
commit
6e407a2346

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -393,6 +393,7 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.TaskDetailAddQQAct"
+            android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActWeb"

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAddQQAct.java

@@ -79,6 +79,7 @@ public class TaskDetailAddQQAct extends AbsChooseImageActivity {
         activity = this;
         newbieTask = (NewbieTask) getIntent().getSerializableExtra("task_entity");
         TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
                 .setTitle(activity, "加入官方QQ群任务详情")
                 .setTitleFinish(activity);
         detail_item_layout_1.setVisibility(View.GONE);

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

@@ -200,7 +200,6 @@ public abstract class BaseListFragment5<T> extends BaseFragment implements IRefr
 
     @Override
     public void initDataOnVisibleToUser() {
-        Log.e("BaseListFragment5", this.getTag());
         if (list.isEmpty()) {
             ViewUtil.refreshXrv(view_list);
         }

+ 10 - 9
app/src/main/java/org/afinal/simplecache/ACache.java

@@ -148,15 +148,17 @@ public class ACache {
      * @return String 数据
      */
     public String getAsString(String key) {
+        long time = System.currentTimeMillis();
         File file = mCache.get(key);
         if (!file.exists())
             return null;
-        if (!key.contains("download_plugin") && System.currentTimeMillis() - file.lastModified() > TIME_HOUR/30) {
+        if (!key.contains("download_plugin") && System.currentTimeMillis() - file.lastModified() > TIME_HOUR) {
             file.deleteOnExit();
             return null;
         }
         boolean removeFile = false;
         BufferedReader in = null;
+        String result = null;
         try {
             in = new BufferedReader(new FileReader(file));
             String readString = "";
@@ -165,14 +167,12 @@ public class ACache {
                 readString += currentLine;
             }
             if (!Utils.isDue(readString)) {
-                return Utils.clearDateInfo(readString);
+                result = Utils.clearDateInfo(readString);
             } else {
                 removeFile = true;
-                return null;
             }
         } catch (IOException e) {
             e.printStackTrace();
-            return null;
         } finally {
             if (in != null) {
                 try {
@@ -181,8 +181,10 @@ public class ACache {
                     e.printStackTrace();
                 }
             }
-            if (removeFile)
+            if (removeFile) {
                 remove(key);
+            }
+            return result;
         }
     }
 
@@ -405,14 +407,13 @@ public class ACache {
         if (data != null) {
             ByteArrayInputStream bais = null;
             ObjectInputStream ois = null;
+            Object reObject = null;
             try {
                 bais = new ByteArrayInputStream(data);
                 ois = new ObjectInputStream(bais);
-                Object reObject = ois.readObject();
-                return reObject;
+                reObject = ois.readObject();
             } catch (Exception e) {
                 e.printStackTrace();
-                return null;
             } finally {
                 try {
                     if (bais != null)
@@ -426,10 +427,10 @@ public class ACache {
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
+                return reObject;
             }
         }
         return null;
-
     }
 
     // =======================================