Update CrashHandler

This commit is contained in:
Ash 2022-04-08 22:45:18 +08:00
parent 25009e9036
commit ed808c768a
5 changed files with 10 additions and 18 deletions

View File

@ -13,8 +13,8 @@ android {
applicationId "me.ash.reader"
minSdk 26
targetSdk 32
versionCode 3
versionName "0.6.5"
versionCode 4
versionName "0.7.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 3,
"versionName": "0.6.5",
"versionCode": 4,
"versionName": "0.7.0",
"outputFile": "app-release.apk"
}
],

View File

@ -6,14 +6,13 @@ import java.lang.Thread.UncaughtExceptionHandler
import kotlin.system.exitProcess
class CrashHandler(private val context: Context) : UncaughtExceptionHandler {
private val mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
init {
Thread.setDefaultUncaughtExceptionHandler(this)
}
override fun uncaughtException(p0: Thread, p1: Throwable) {
Toast.makeText(context, p1.message, Toast.LENGTH_LONG).show()
p1.printStackTrace()
android.os.Process.killProcess(android.os.Process.myPid());
exitProcess(1)
}

View File

@ -174,9 +174,9 @@ class LocalRssRepository @Inject constructor(
return ArticleNotify(listOf(), false)
}
try {
if (feed.icon == null && !articles.isNullOrEmpty()) {
rssHelper.queryRssIcon(feedDao, feed, articles.first().link)
}
// if (feed.icon == null && !articles.isNullOrEmpty()) {
// rssHelper.queryRssIcon(feedDao, feed, articles.first().link)
// }
} catch (e: Exception) {
Log.e("RLog", "queryRssIcon[${feed.name}]: ${e.message}")
return ArticleNotify(listOf(), false)

View File

@ -4,10 +4,7 @@ import androidx.activity.compose.BackHandler
import androidx.compose.animation.*
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
@ -31,7 +28,6 @@ import androidx.navigation.NavHostController
import androidx.paging.LoadState
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.work.WorkInfo
import com.google.accompanist.pager.PagerState
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import me.ash.reader.R
@ -173,6 +169,7 @@ fun FlowPage(
// )
// }
LazyColumn(
modifier = Modifier.fillMaxSize(),
state = viewState.listState,
) {
item {
@ -185,8 +182,6 @@ fun FlowPage(
},
desc = if (isSyncing) stringResource(R.string.syncing) else "",
)
}
item {
AnimatedVisibility(
visible = markAsRead,
enter = fadeIn() + expandVertically(),
@ -211,8 +206,6 @@ fun FlowPage(
)
)
}
}
item {
AnimatedVisibility(
visible = onSearch,
enter = fadeIn() + expandVertically(),