pref: 去除复制崩溃报告链接
This commit is contained in:
parent
0c6af9156b
commit
c64d427c4d
|
|
@ -19,17 +19,17 @@ import com.google.android.material.navigation.NavigationBarItemView
|
||||||
import com.google.android.material.navigation.NavigationBarMenuView
|
import com.google.android.material.navigation.NavigationBarMenuView
|
||||||
import com.google.android.material.navigation.NavigationBarView
|
import com.google.android.material.navigation.NavigationBarView
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import com.huanchengfly.tieba.post.*
|
import com.huanchengfly.tieba.post.BaseApplication
|
||||||
|
import com.huanchengfly.tieba.post.R
|
||||||
import com.huanchengfly.tieba.post.adapters.ViewPagerAdapter
|
import com.huanchengfly.tieba.post.adapters.ViewPagerAdapter
|
||||||
import com.huanchengfly.tieba.post.api.Error
|
import com.huanchengfly.tieba.post.api.Error
|
||||||
import com.huanchengfly.tieba.post.api.LiteApi
|
|
||||||
import com.huanchengfly.tieba.post.api.interfaces.CommonCallback
|
import com.huanchengfly.tieba.post.api.interfaces.CommonCallback
|
||||||
import com.huanchengfly.tieba.post.api.retrofit.doIfFailure
|
import com.huanchengfly.tieba.post.dpToPxFloat
|
||||||
import com.huanchengfly.tieba.post.api.retrofit.doIfSuccess
|
|
||||||
import com.huanchengfly.tieba.post.fragments.MainForumListFragment
|
import com.huanchengfly.tieba.post.fragments.MainForumListFragment
|
||||||
import com.huanchengfly.tieba.post.fragments.MessageFragment
|
import com.huanchengfly.tieba.post.fragments.MessageFragment
|
||||||
import com.huanchengfly.tieba.post.fragments.MyInfoFragment
|
import com.huanchengfly.tieba.post.fragments.MyInfoFragment
|
||||||
import com.huanchengfly.tieba.post.fragments.PersonalizedFeedFragment
|
import com.huanchengfly.tieba.post.fragments.PersonalizedFeedFragment
|
||||||
|
import com.huanchengfly.tieba.post.goToActivity
|
||||||
import com.huanchengfly.tieba.post.interfaces.Refreshable
|
import com.huanchengfly.tieba.post.interfaces.Refreshable
|
||||||
import com.huanchengfly.tieba.post.models.MyInfoBean
|
import com.huanchengfly.tieba.post.models.MyInfoBean
|
||||||
import com.huanchengfly.tieba.post.services.NotifyJobService
|
import com.huanchengfly.tieba.post.services.NotifyJobService
|
||||||
|
|
@ -37,8 +37,6 @@ import com.huanchengfly.tieba.post.utils.*
|
||||||
import com.huanchengfly.tieba.post.widgets.MyViewPager
|
import com.huanchengfly.tieba.post.widgets.MyViewPager
|
||||||
import com.microsoft.appcenter.crashes.Crashes
|
import com.microsoft.appcenter.crashes.Crashes
|
||||||
import com.microsoft.appcenter.distribute.Distribute
|
import com.microsoft.appcenter.distribute.Distribute
|
||||||
import kotlinx.coroutines.Dispatchers.IO
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
@ -181,16 +179,9 @@ open class MainActivity : BaseActivity(), NavigationBarView.OnItemSelectedListen
|
||||||
showDialog {
|
showDialog {
|
||||||
setTitle(R.string.title_dialog_crash)
|
setTitle(R.string.title_dialog_crash)
|
||||||
setMessage(R.string.message_dialog_crash)
|
setMessage(R.string.message_dialog_crash)
|
||||||
setPositiveButton(R.string.button_copy_crash_link) { _, _ ->
|
setPositiveButton(R.string.button_copy_crash) { _, _ ->
|
||||||
launch(IO + job) {
|
TiebaUtil.copyText(
|
||||||
LiteApi.instance.pastebinAsync(
|
this@MainActivity, """
|
||||||
"崩溃报告 ${
|
|
||||||
formatDateTime(
|
|
||||||
"yyyy-MM-dd HH:mm:ss",
|
|
||||||
it.appErrorTime.time
|
|
||||||
)
|
|
||||||
}",
|
|
||||||
"""
|
|
||||||
App 版本:${device.appVersion}
|
App 版本:${device.appVersion}
|
||||||
系统版本:${device.osVersion}
|
系统版本:${device.osVersion}
|
||||||
机型:${device.oemName} ${device.model}
|
机型:${device.oemName} ${device.model}
|
||||||
|
|
@ -198,13 +189,9 @@ open class MainActivity : BaseActivity(), NavigationBarView.OnItemSelectedListen
|
||||||
崩溃:
|
崩溃:
|
||||||
${it.stackTrace}
|
${it.stackTrace}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
).doIfSuccess {
|
)
|
||||||
TiebaUtil.copyText(this@MainActivity, it)
|
|
||||||
}.doIfFailure {
|
|
||||||
toastShort(R.string.toast_get_link_failed)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
setNegativeButton(R.string.button_cancel, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -503,4 +503,5 @@
|
||||||
<string name="summary_battery_optimization_old_android_version">旧版 Android 无“电池优化”</string>
|
<string name="summary_battery_optimization_old_android_version">旧版 Android 无“电池优化”</string>
|
||||||
<string name="summary_battery_optimization_ignored">“电池优化”已忽略</string>
|
<string name="summary_battery_optimization_ignored">“电池优化”已忽略</string>
|
||||||
<string name="toast_ignore_battery_optimization_already">已忽略电池优化</string>
|
<string name="toast_ignore_battery_optimization_already">已忽略电池优化</string>
|
||||||
|
<string name="button_copy_crash">复制崩溃报告</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue