修复一些bug
This commit is contained in:
parent
3328827ab6
commit
1d38c635dd
4
app/proguard-rules.pro
vendored
4
app/proguard-rules.pro
vendored
@ -45,3 +45,7 @@
|
|||||||
-keep class * extends com.google.gson.TypeAdapter {
|
-keep class * extends com.google.gson.TypeAdapter {
|
||||||
*;
|
*;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-keep class org.chromium.** { *; }
|
||||||
|
-keep class androidx.media3.datasource.cronet.** { *; }
|
||||||
|
-keep class androidx.media3.exoplayer.scheduler.PlatformScheduler$PlatformSchedulerService { *; }
|
||||||
@ -124,6 +124,10 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="androidx.media3.exoplayer.scheduler.PlatformScheduler$PlatformSchedulerService"
|
||||||
|
android:exported="true"
|
||||||
|
android:permission="android.permission.BIND_JOB_SERVICE" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@ -92,10 +92,17 @@ class MoSingerDetailsActivity : MoBaseActivity() {
|
|||||||
showLoadingUi()
|
showLoadingUi()
|
||||||
Innertube.moSingerListPage(browseId)
|
Innertube.moSingerListPage(browseId)
|
||||||
?.onSuccess {
|
?.onSuccess {
|
||||||
|
if (isFinishing || isDestroyed) {
|
||||||
|
return
|
||||||
|
}
|
||||||
showDataUi()
|
showDataUi()
|
||||||
Glide.with(this)
|
try {
|
||||||
.load(it.thumbnail)
|
Glide.with(this)
|
||||||
.into(binding.singerImg)
|
.load(it.thumbnail)
|
||||||
|
.into(binding.singerImg)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
binding.singerName.text = it.title
|
binding.singerName.text = it.title
|
||||||
if (it.description.isNullOrEmpty()) {
|
if (it.description.isNullOrEmpty()) {
|
||||||
binding.singerDesc.visibility = View.GONE
|
binding.singerDesc.visibility = View.GONE
|
||||||
@ -144,4 +151,9 @@ class MoSingerDetailsActivity : MoBaseActivity() {
|
|||||||
binding.loadingLayout.visibility = View.GONE
|
binding.loadingLayout.visibility = View.GONE
|
||||||
binding.noContentLayout.visibility = View.VISIBLE
|
binding.noContentLayout.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
Glide.with(this).clear(binding.singerImg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -194,53 +194,54 @@ class SearchFragment : MoBaseFragment<FragmentSearchBinding>(), TextWatcher,
|
|||||||
}
|
}
|
||||||
|
|
||||||
is Request.SearchData -> {
|
is Request.SearchData -> {
|
||||||
val input = it.input
|
if (isAdded) {
|
||||||
if (input.isNotEmpty()) {
|
val input = it.input
|
||||||
AnalysisUtil.logEvent(AnalysisUtil.SEARCH_TRIGGER)
|
if (input.isNotEmpty()) {
|
||||||
LolAdWrapper.shared.showAdTiming(
|
AnalysisUtil.logEvent(AnalysisUtil.SEARCH_TRIGGER)
|
||||||
requireActivity(), AdPlacement.INST_SEARCH
|
LolAdWrapper.shared.showAdTiming(
|
||||||
)
|
requireActivity(), AdPlacement.INST_SEARCH
|
||||||
showLoadingLayout()
|
)
|
||||||
binding.contentLayout.removeAllViews()
|
showLoadingLayout()
|
||||||
binding.searchEdit.clearFocus()
|
binding.contentLayout.removeAllViews()
|
||||||
|
binding.searchEdit.clearFocus()
|
||||||
|
|
||||||
searchHistorySet.clear()
|
searchHistorySet.clear()
|
||||||
searchHistorySet.addAll(appStore.searchHistoryStore)
|
searchHistorySet.addAll(appStore.searchHistoryStore)
|
||||||
if (!appStore.searchHistoryStore.contains(input)) {//把不存在的记录保存到集合中
|
if (!appStore.searchHistoryStore.contains(input)) {//把不存在的记录保存到集合中
|
||||||
searchHistorySet.add(input)
|
searchHistorySet.add(input)
|
||||||
}
|
}
|
||||||
appStore.searchHistoryStore = searchHistorySet
|
appStore.searchHistoryStore = searchHistorySet
|
||||||
updateHistoryUi()
|
updateHistoryUi()
|
||||||
AnalysisUtil.logEvent(AnalysisUtil.SEARCH_RESULT_PV)
|
AnalysisUtil.logEvent(AnalysisUtil.SEARCH_RESULT_PV)
|
||||||
Innertube.moSearchPage(SearchBody(query = input))
|
Innertube.moSearchPage(SearchBody(query = input))
|
||||||
?.onSuccess { result ->
|
?.onSuccess { result ->
|
||||||
AnalysisUtil.logEvent(AnalysisUtil.SEARCH_RESULT_SUCCESS_ACTION)
|
AnalysisUtil.logEvent(AnalysisUtil.SEARCH_RESULT_SUCCESS_ACTION)
|
||||||
showResultContent()
|
showResultContent()
|
||||||
for (dataPage: Innertube.SearchDataPage in result) {
|
for (dataPage: Innertube.SearchDataPage in result) {
|
||||||
LogTag.LogD(TAG, "moSearchPage dataPage->$dataPage")
|
LogTag.LogD(TAG, "moSearchPage dataPage->$dataPage")
|
||||||
if (dataPage.type == 1) {//type为1的是最佳结果。
|
if (dataPage.type == 1) {//type为1的是最佳结果。
|
||||||
binding.contentLayout.addView(
|
|
||||||
SearchResultOptimalView(
|
|
||||||
requireActivity(), dataPage
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else if (dataPage.type == 2) {//type为2的是其他搜索结果。
|
|
||||||
if (dataPage.searchResultList.isNotEmpty()) {//如何数据集合为空就不添加view
|
|
||||||
binding.contentLayout.addView(
|
binding.contentLayout.addView(
|
||||||
SearchResultOtherView(
|
SearchResultOptimalView(
|
||||||
requireActivity(), dataPage
|
requireActivity(), dataPage
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
} else if (dataPage.type == 2) {//type为2的是其他搜索结果。
|
||||||
|
if (dataPage.searchResultList.isNotEmpty()) {//如何数据集合为空就不添加view
|
||||||
|
binding.contentLayout.addView(
|
||||||
|
SearchResultOtherView(
|
||||||
|
requireActivity(), dataPage
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}?.onFailure {
|
||||||
|
showNoContentLayout()
|
||||||
}
|
}
|
||||||
}?.onFailure {
|
LolAdWrapper.shared.loadAdIfNotCached(
|
||||||
showNoContentLayout()
|
requireActivity(), AdPlacement.INST_SEARCH
|
||||||
}
|
)
|
||||||
|
}
|
||||||
LolAdWrapper.shared.loadAdIfNotCached(
|
|
||||||
requireActivity(), AdPlacement.INST_SEARCH
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user