Skip to content

Commit

Permalink
15
Browse files Browse the repository at this point in the history
15
  • Loading branch information
umerov1999 committed Mar 5, 2023
1 parent bae0022 commit 06b1472
Show file tree
Hide file tree
Showing 680 changed files with 2,026 additions and 1,046 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import io.reactivex.rxjava3.core.Single
import io.reactivex.rxjava3.core.SingleEmitter
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.builtins.serializer
import java.util.Collections

internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersStorage {
override fun storeStickerSets(accountId: Long, sets: List<StickerSetEntity>): Completable {
Expand Down Expand Up @@ -126,7 +125,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS
}
stickers.add(mapStickerSet(cursor))
}
Collections.sort(stickers, COMPARATOR_STICKER_SET)
stickers.sortWith(COMPARATOR_STICKER_SET)
cursor.close()
e.onSuccess(stickers)
log("StickersStorage.get", start, "count: " + stickers.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import java.io.FileOutputStream
import java.io.IOException
import java.io.OutputStream
import java.lang.Boolean.compare
import java.util.*
import kotlin.math.abs

abstract class AbsWallPresenter<V : IWallView> internal constructor(
Expand Down Expand Up @@ -547,7 +546,7 @@ abstract class AbsWallPresenter<V : IWallView> internal constructor(
post.setPinned(it.isPinned)
}
if (pinStateChanged) {
Collections.sort(wall, COMPARATOR)
wall.sortWith(COMPARATOR)
safeNotifyWallDataSetChanged()
} else {
view?.notifyWallItemChanged(index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import dev.ragnarok.fenrir.util.Objects.safeEquals
import io.reactivex.rxjava3.core.Single
import java.io.File
import java.io.FilenameFilter
import java.util.*
import java.util.Locale

class FileManagerSelectPresenter(
private var path: File,
Expand Down Expand Up @@ -202,8 +202,8 @@ class FileManagerSelectPresenter(
for (i in fileListTmp) {
if (i.isDir) dirsList.add(i) else flsList.add(i)
}
Collections.sort(dirsList, ItemModificationComparator())
Collections.sort(flsList, ItemModificationComparator())
dirsList.sortWith(ItemModificationComparator())
flsList.sortWith(ItemModificationComparator())
fileListTmp.clear()
fileListTmp.addAll(dirsList)
fileListTmp.addAll(flsList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import dev.ragnarok.fenrir.util.Utils.needReloadStickers
import dev.ragnarok.fenrir.util.rxutils.RxUtils.dummy
import dev.ragnarok.fenrir.util.rxutils.RxUtils.ignore
import io.reactivex.rxjava3.disposables.CompositeDisposable
import java.util.*

class DialogsPresenter(
accountId: Long,
Expand Down Expand Up @@ -339,7 +338,7 @@ class DialogsPresenter(
dialog.setTitle(it)
}
if (index != -1) {
Collections.sort(dialogs, COMPARATOR)
dialogs.sortWith(COMPARATOR)
safeNotifyDataSetChanged()
} else {
if (Peer.isGroup(peerId) || Peer.isUser(peerId)) {
Expand All @@ -353,15 +352,15 @@ class DialogsPresenter(
.fromIOToMain()
.subscribe({
dialogs.add(dialog)
Collections.sort(dialogs, COMPARATOR)
dialogs.sortWith(COMPARATOR)
safeNotifyDataSetChanged()
}, ignore())
)
}, ignore())
)
} else {
dialogs.add(dialog)
Collections.sort(dialogs, COMPARATOR)
dialogs.sortWith(COMPARATOR)
safeNotifyDataSetChanged()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import dev.ragnarok.fenrir.nonNullNoEmpty
import dev.ragnarok.fenrir.orZero
import dev.ragnarok.fenrir.settings.Settings
import dev.ragnarok.fenrir.util.Utils.safeCountOfMultiple
import java.util.Collections
import java.util.regex.Pattern
import kotlin.math.abs

Expand Down Expand Up @@ -44,7 +43,7 @@ object OwnerLinkSpanFactory {
if (othersLinks.nonNullNoEmpty()) {
all.addAll(othersLinks)
}
Collections.sort(all, LINK_COMPARATOR)
all.sortWith(LINK_COMPARATOR)
return all
}
return null
Expand Down Expand Up @@ -74,7 +73,7 @@ object OwnerLinkSpanFactory {
if (othersLinks.nonNullNoEmpty()) {
all.addAll(othersLinks)
}
Collections.sort(all, LINK_COMPARATOR)
all.sortWith(LINK_COMPARATOR)
val result = Spannable.Factory.getInstance().newSpannable(replace(input, all))
for (link in all) {
//TODO Нужно ли удалять spannable перед установкой новых
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import dev.ragnarok.fenrir.util.CoverSafeResize
import dev.ragnarok.fenrir.util.Utils
import okio.source
import java.io.*
import java.util.*

class PicassoFileManagerHandler(val context: Context) : RequestHandler() {
companion object {
Expand Down Expand Up @@ -267,9 +266,7 @@ class PicassoFileManagerHandler(val context: Context) : RequestHandler() {

val fList = direct.listFiles(filter)
val dst = if (fList != null && fList.isNotEmpty()) {
val tmp = fList.toList()
Collections.sort(tmp, ItemModificationComparator())
tmp[0]
fList.sortedWith(ItemModificationComparator())[0]
} else {
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,22 @@ class SearchRequestHelperStorage internal constructor(context: Context) :
return File(path).length()
}

private class ItemModificationComparator : Comparator<TagDir> {
override fun compare(lhs: TagDir, rhs: TagDir): Int {
return when {
lhs.type == FileType.folder && rhs.type != FileType.folder -> {
-1
}

lhs.type != FileType.folder && rhs.type == FileType.folder -> {
1
}

else -> rhs.id.compareTo(lhs.id)
}
}
}

override fun getTagDirs(ownerId: Int): Single<List<TagDir>> {
return Single.fromCallable {
val where = TagDirsColumns.OWNER_ID + " = ?"
Expand Down Expand Up @@ -382,6 +398,7 @@ class SearchRequestHelperStorage internal constructor(context: Context) :
)
}
}
data.sortWith(ItemModificationComparator())
data
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Single
import java.io.File
import java.io.FilenameFilter
import java.util.*
import java.util.Locale

class FileManagerPresenter(
private var path: File,
Expand Down Expand Up @@ -285,8 +285,8 @@ class FileManagerPresenter(
for (i in fileListTmp) {
if (i.type == FileType.folder) dirsList.add(i) else flsList.add(i)
}
Collections.sort(dirsList, ItemModificationComparator())
Collections.sort(flsList, ItemModificationComparator())
dirsList.sortWith(ItemModificationComparator())
flsList.sortWith(ItemModificationComparator())
fileListTmp.clear()
fileListTmp.addAll(dirsList)
fileListTmp.addAll(flsList)
Expand Down Expand Up @@ -366,8 +366,8 @@ class FileManagerPresenter(
for (i in fileListTmp) {
if (i.type == FileType.folder) dirsList.add(i) else flsList.add(i)
}
Collections.sort(dirsList, ItemModificationComparator())
Collections.sort(flsList, ItemModificationComparator())
dirsList.sortWith(ItemModificationComparator())
flsList.sortWith(ItemModificationComparator())
fileListTmp.clear()
fileListTmp.addAll(dirsList)
fileListTmp.addAll(flsList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import dev.ragnarok.filegallery.util.Objects.safeEquals
import io.reactivex.rxjava3.core.Single
import java.io.File
import java.io.FilenameFilter
import java.util.*
import java.util.Locale

class FileManagerSelectPresenter(
private var path: File,
Expand Down Expand Up @@ -202,8 +202,8 @@ class FileManagerSelectPresenter(
for (i in fileListTmp) {
if (i.isDir) dirsList.add(i) else flsList.add(i)
}
Collections.sort(dirsList, ItemModificationComparator())
Collections.sort(flsList, ItemModificationComparator())
dirsList.sortWith(ItemModificationComparator())
flsList.sortWith(ItemModificationComparator())
fileListTmp.clear()
fileListTmp.addAll(dirsList)
fileListTmp.addAll(flsList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import dev.ragnarok.filegallery.util.CoverSafeResize
import dev.ragnarok.filegallery.util.Utils
import okio.source
import java.io.*
import java.util.*

class PicassoFileManagerHandler(val context: Context) : RequestHandler() {
companion object {
Expand Down Expand Up @@ -257,9 +256,7 @@ class PicassoFileManagerHandler(val context: Context) : RequestHandler() {

val fList = direct.listFiles(filter)
val dst = if (fList != null && fList.isNotEmpty()) {
val tmp = fList.toList()
Collections.sort(tmp, ItemModificationComparator())
tmp[0]
fList.sortedWith(ItemModificationComparator())[0]
} else {
null
}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ buildscript {
ext.autoValueVersion = "1.10.1"

//common libraries
ext.kotlin_version = "1.8.10"
ext.kotlin_version = "1.8.20-Beta"
ext.kotlin_coroutines = "1.6.4"
ext.kotlin_serializer = "1.5.0"
ext.okhttpLibraryVersion = "5.0.0-alpha.11"
Expand Down Expand Up @@ -89,7 +89,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.0.0-beta03"
classpath "com.android.tools.build:gradle:8.0.0-beta04"
classpath "com.google.gms:google-services:4.3.15"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Aug 17 12:17:04 MSK 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ extern "C" {
// The following are available for GCC 32 or 64 bit:
#if !defined(LIBYUV_DISABLE_X86) && (defined(__i386__) || defined(__x86_64__))
#define HAS_TRANSPOSEWX8_SSSE3
#define HAS_TRANSPOSE4X4_32_SSE2
#define HAS_TRANSPOSE4X4_32_AVX2
#endif

// The following are available for 64 bit GCC:
Expand All @@ -56,6 +58,11 @@ extern "C" {
#define HAS_TRANSPOSEUVWX8_NEON
#endif

#if !defined(LIBYUV_DISABLE_NEON) && \
(defined(LIBYUV_NEON) || defined(__aarch64__))
#define HAS_TRANSPOSE4X4_32_NEON
#endif

#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
#define HAS_TRANSPOSEWX16_MSA
#define HAS_TRANSPOSEUVWX16_MSA
Expand Down Expand Up @@ -240,19 +247,24 @@ void Transpose4x4_32_NEON(const uint8_t* src,
int dst_stride,
int width);

void Transpose4x4_32_C(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void Transpose4x4_32_SSE2(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);

// Transpose 32 bit values (ARGB)
void Transpose8x8_32_NEON(const uint8_t* src,
void Transpose4x4_32_AVX2(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);

void Transpose4x4_32_C(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);

#ifdef __cplusplus
} // extern "C"
} // namespace libyuv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_

#define LIBYUV_VERSION 1861
#define LIBYUV_VERSION 1862

#endif // INCLUDE_LIBYUV_VERSION_H_
Loading

0 comments on commit 06b1472

Please sign in to comment.