77 优化任务领取,log存储data/data/
This commit is contained in:
@@ -28,12 +28,13 @@ import com.xscm.moduleutil.listener.MessageListenerSingleton
|
||||
import com.xscm.moduleutil.utils.CustomMsgCode
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
open class Application : CommonAppContext() {
|
||||
|
||||
var APP_CONENT = ""
|
||||
var APP_CONTENT = ""
|
||||
|
||||
var LOGUTILS_SAVE_PATH = ""
|
||||
var CRASHUTILS_SAVE_PATH = ""
|
||||
@@ -60,9 +61,13 @@ open class Application : CommonAppContext() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
APP_CONENT = getExternalFilesDir("APP_CONTENT")?.absolutePath.toString()
|
||||
LOGUTILS_SAVE_PATH = getExternalFilesDir("APP_CONTENT/APP_LOG")?.absolutePath.toString()
|
||||
CRASHUTILS_SAVE_PATH = getExternalFilesDir("APP_CONTENT/APP_CRASH")?.absolutePath.toString()
|
||||
// 应用内部存储 filesDir 目录的根路径
|
||||
APP_CONTENT = filesDir.absolutePath
|
||||
// 内部存储下的日志目录
|
||||
LOGUTILS_SAVE_PATH = File(filesDir, "APP_CONTENT/APP_LOG").absolutePath
|
||||
// 内部存储下的崩溃日志目录
|
||||
CRASHUTILS_SAVE_PATH = File(filesDir, "APP_CONTENT/APP_CRASH").absolutePath
|
||||
|
||||
// 初始化单例实例
|
||||
instance = this
|
||||
|
||||
@@ -280,7 +285,7 @@ open class Application : CommonAppContext() {
|
||||
}
|
||||
|
||||
fun getAppContent(): String {
|
||||
return APP_CONENT
|
||||
return APP_CONTENT
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -211,6 +211,7 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
|
||||
|
||||
@Override
|
||||
public void setGiftBox(GiftBoxBean giftBoxBean) {
|
||||
int lastTabIdx = currentTab;
|
||||
mBinding.tvTitle.setText("今日累计充值获得金币:" + (giftBoxBean.getUser_gold() != null ? giftBoxBean.getUser_gold() : "0"));
|
||||
mTaskBoxAdapter.setNewData(giftBoxBean.getGift_box_list());
|
||||
taskList.clear();
|
||||
@@ -241,8 +242,8 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
|
||||
}
|
||||
// 4. 默认选中第一个 Tab(可选)
|
||||
mBinding.tabTitle.post(() -> {
|
||||
if (mBinding.tabTitle.getTabCount() > currentTab) {
|
||||
mBinding.tabTitle.selectTab(mBinding.tabTitle.getTabAt(currentTab));
|
||||
if (mBinding.tabTitle.getTabCount() > lastTabIdx) {
|
||||
mBinding.tabTitle.selectTab(mBinding.tabTitle.getTabAt(lastTabIdx));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user