Merge branch 'maintenance'

This commit is contained in:
Tlaster 2021-04-21 17:04:41 +08:00
commit e04beceaec
4 changed files with 18 additions and 7 deletions

View File

@ -17,8 +17,8 @@ buildscript {
allprojects { allprojects {
ext { ext {
projectGroupId = 'org.mariotaku.twidere' projectGroupId = 'org.mariotaku.twidere'
projectVersionCode = 515 projectVersionCode = 517
projectVersionName = '4.1.6' projectVersionName = '4.1.8'
globalCompileSdkVersion = 30 globalCompileSdkVersion = 30
globalBuildToolsVersion = "30.0.3" globalBuildToolsVersion = "30.0.3"

View File

@ -703,6 +703,7 @@
<provider <provider
android:name=".provider.ShareProvider" android:name=".provider.ShareProvider"
android:authorities="twidere.share" android:authorities="twidere.share"
android:grantUriPermissions="true"
android:exported="true" android:exported="true"
tools:ignore="ExportedContentProvider"/> tools:ignore="ExportedContentProvider"/>
<provider <provider

View File

@ -128,19 +128,27 @@ class StatusDetailsAdapter(
ITEM_IDX_CONVERSATION -> { ITEM_IDX_CONVERSATION -> {
data?.let { data -> data?.let { data ->
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION) var idx = position - getIndexStart(ITEM_IDX_CONVERSATION)
if (data[idx].is_filtered) idx++ if (idx in data.indices) {
if (data[idx].is_filtered) {
idx++
}
return data[idx] return data[idx]
} }
} }
}
ITEM_IDX_REPLY -> { ITEM_IDX_REPLY -> {
data?.let { data -> data?.let { data ->
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION) - var idx = position - getIndexStart(ITEM_IDX_CONVERSATION) -
getTypeCount(ITEM_IDX_CONVERSATION) - getTypeCount(ITEM_IDX_STATUS) + getTypeCount(ITEM_IDX_CONVERSATION) - getTypeCount(ITEM_IDX_STATUS) +
replyStart replyStart
if (data[idx].is_filtered) idx++ if (idx in data.indices) {
if (data[idx].is_filtered) {
idx++
}
return data[idx] return data[idx]
} }
} }
}
ITEM_IDX_STATUS -> { ITEM_IDX_STATUS -> {
return status!! return status!!
} }

View File

@ -213,7 +213,9 @@ abstract class AbsContentListViewFragment<A : ListAdapter> : BaseFragment(),
val density = resources.displayMetrics.density val density = resources.displayMetrics.density
val progressCircleDiameter = swipeLayout.progressCircleDiameter val progressCircleDiameter = swipeLayout.progressCircleDiameter
val controlBarOffsetPixels = val controlBarOffsetPixels =
(activity.controlBarHeight * (1 - activity.controlBarOffset)).roundToInt() ((activity.controlBarHeight * (1 - activity.controlBarOffset)).takeIf { !it.isNaN() }
?: 0f)
.roundToInt()
val swipeStart = systemWindowsInsets.top - controlBarOffsetPixels - progressCircleDiameter val swipeStart = systemWindowsInsets.top - controlBarOffsetPixels - progressCircleDiameter
// 64: SwipeRefreshLayout.DEFAULT_CIRCLE_TARGET // 64: SwipeRefreshLayout.DEFAULT_CIRCLE_TARGET
val swipeDistance = (64 * density).roundToInt() val swipeDistance = (64 * density).roundToInt()