Skip to content

Commit

Permalink
30
Browse files Browse the repository at this point in the history
30
  • Loading branch information
umerov1999 committed Jun 4, 2023
1 parent bb170c2 commit f50def9
Show file tree
Hide file tree
Showing 105 changed files with 3,204 additions and 19,814 deletions.
Binary file modified FileGallery.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<b>Инструкция по сборке:</b>
Требуется:
1) Android Studio Flamingo (2022.2.1) или выше. Kotlin 1.8.*
1) Android Studio Giraffe (2022.3.1) или выше. Kotlin 1.9.*
2) Android SDK 33
3) Android NDK 25.1.8937393
3) Android NDK 25.2.9519653

Если не работает музыка в Fenrir Kate, обновите kate_receipt_gms_token в app.build_config.
Взять токен можно из Kate Mobile Extra Mod
Expand Down
5 changes: 2 additions & 3 deletions app_fenrir/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
checkReleaseBuilds = true
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xmaxwarns" << "1000" << "-Xmaxerrs" << "1000"
}

Expand All @@ -76,15 +76,14 @@ android {
release {
minifyEnabled = false
shrinkResources = false
zipAlignEnabled = true
}
debug {
minifyEnabled = false
shrinkResources = false
}
}

flavorDimensions "type"
flavorDimensions.add("type")
productFlavors {
fenrir {
applicationId = "dev.ragnarok.fenrir"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import dev.ragnarok.fenrir.kJson
import dev.ragnarok.fenrir.longpoll.LongpollInstance
import dev.ragnarok.fenrir.model.Account
import dev.ragnarok.fenrir.model.IOwnersBundle
import dev.ragnarok.fenrir.model.MessageStatus
import dev.ragnarok.fenrir.model.SaveAccount
import dev.ragnarok.fenrir.model.User
import dev.ragnarok.fenrir.model.criteria.DialogsCriteria
Expand Down Expand Up @@ -507,13 +508,19 @@ class AccountsPresenter(savedInstanceState: Bundle?) :
val dialogsJsonElem =
i.jsonObject["conversation"]?.jsonArray ?: continue
if (!dialogsJsonElem.isEmpty()) {
Includes.stores.dialogs().insertDialogs(
aid, kJson.decodeFromJsonElement(
ListSerializer(
DialogDboEntity.serializer()
), dialogsJsonElem
), true
).blockingAwait()
val btmp = kJson.decodeFromJsonElement(
ListSerializer(
DialogDboEntity.serializer()
), dialogsJsonElem
)
if (btmp.nonNullNoEmpty()) {
for (o in btmp) {
o.message?.setStatus(MessageStatus.SENT)
}
Includes.stores.dialogs().insertDialogs(
aid, btmp, true
).blockingAwait()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ abstract class RecyclerBindableAdapter<T, VH : RecyclerView.ViewHolder>(private
}

//empty out our FrameLayout and replace with our header/footer
(vh.itemView as ViewGroup).removeAllViews()
vh.itemView.addView(view)
(vh.itemView as ViewGroup).let {
it.removeAllViews()
it.addView(view)
}
}

private fun isHeader(position: Int): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.annotation.SuppressLint
import android.app.Activity.RESULT_OK
import android.app.Dialog
import android.content.*
import android.graphics.Bitmap
import android.net.*
import android.os.Build
import android.os.Bundle
Expand Down Expand Up @@ -1570,7 +1571,12 @@ class ChatFragment : PlaceSupportMvpFragment<ChatPresenter, IChatView>(), IChatV
it,
Uri.fromFile(File(requireActivity().externalCacheDir.toString() + File.separator + "scale.jpg"))
)
.withAspectRatio(1f, 1f)
.withOptions(
UCrop.Options().withAspectRatio(1f, 1f)
.setCompressionQuality(100)
.setCompressionFormat(Bitmap.CompressFormat.JPEG)
.setHideBottomControls(false)
)
.getIntent(requireActivity())
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ class UserWallFragment : AbsWallFragment<IUserWallView, UserWallPresenter>(), IU
to_up,
Uri.fromFile(File(requireActivity().externalCacheDir.toString() + File.separator + "scale.jpg"))
)
.withAspectRatio(1f, 1f)
.withOptions(
UCrop.Options().withAspectRatio(1f, 1f).setCompressionQuality(100)
.setCompressionFormat(Bitmap.CompressFormat.JPEG)
.setHideBottomControls(false)
)
.getIntent(requireActivity())
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ object NotificationHelper {
return if (urit != null) Content(MimeType, urit) else null
}

@SuppressLint("RestrictedApi")
@SuppressLint("RestrictedApi", "ReportShortcutUsage")
private fun createNotificationShortcut(
context: Context,
builder: NotificationCompat.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.content.IntentFilter
import android.content.ServiceConnection
import android.os.IBinder
import android.os.RemoteException
import androidx.core.content.ContextCompat
import dev.ragnarok.fenrir.R
import dev.ragnarok.fenrir.model.Audio
import dev.ragnarok.fenrir.settings.Settings
Expand Down Expand Up @@ -55,7 +56,12 @@ object MusicPlaybackController {
filter.addAction(MusicPlaybackService.META_CHANGED)
filter.addAction(MusicPlaybackService.PREPARED)
filter.addAction(MusicPlaybackService.QUEUE_CHANGED)
appContext.registerReceiver(receiver, filter)
ContextCompat.registerReceiver(
appContext,
receiver,
filter,
ContextCompat.RECEIVER_NOT_EXPORTED
)
}

fun bindToServiceWithoutStart(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import android.support.v4.media.session.MediaControllerCompat
import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat
import android.util.Log
import androidx.core.content.ContextCompat
import androidx.media.session.MediaButtonReceiver
import androidx.media3.common.AudioAttributes
import androidx.media3.common.C
Expand Down Expand Up @@ -157,7 +158,12 @@ class MusicPlaybackService : Service() {
filter.addAction(PREVIOUS_ACTION)
filter.addAction(REPEAT_ACTION)
filter.addAction(SHUFFLE_ACTION)
registerReceiver(mIntentReceiver, filter)
ContextCompat.registerReceiver(
this,
mIntentReceiver,
filter,
ContextCompat.RECEIVER_NOT_EXPORTED
)

// Initialize the delayed shutdown intent
val shutdownIntent = Intent(this, MusicPlaybackService::class.java)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.ragnarok.fenrir.util

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Context
import android.content.Intent
Expand Down Expand Up @@ -216,6 +217,7 @@ object ShortcutUtils {
}


@SuppressLint("ReportShortcutUsage")
@TargetApi(Build.VERSION_CODES.N_MR1)
fun addDynamicShortcut(context: Context, accountId: Long, peer: Peer): Completable {
val app = context.applicationContext
Expand Down
6 changes: 3 additions & 3 deletions app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/util/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ object Utils {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
drawable.colorFilter = BlendModeColorFilter(color, BlendMode.MODULATE)
drawable.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY)
} else {
drawable.setColorFilter(color, PorterDuff.Mode.MULTIPLY)
}
Expand All @@ -1013,7 +1013,7 @@ object Utils {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
view.colorFilter = BlendModeColorFilter(color, BlendMode.MODULATE)
view.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY)
} else {
view.setColorFilter(color, PorterDuff.Mode.MULTIPLY)
}
Expand All @@ -1024,7 +1024,7 @@ object Utils {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
view.colorFilter = BlendModeColorFilter(color, BlendMode.MODULATE)
view.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY)
} else {
view.setColorFilter(color, PorterDuff.Mode.MULTIPLY)
}
Expand Down
3 changes: 1 addition & 2 deletions app_filegallery/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ android {
checkReleaseBuilds = true
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xmaxwarns" << "1000" << "-Xmaxerrs" << "1000"
}

Expand All @@ -75,7 +75,6 @@ android {
release {
minifyEnabled = false
shrinkResources = false
zipAlignEnabled = true
}
debug {
minifyEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ class PreferencesFragment : AbsPreferencesFragment(), PreferencesAdapter.OnScree
".SLOGAN"
).absolutePath || sel.absolutePath == File(
Environment.getExternalStorageDirectory(),
".OplusOS"
"OplusOS"
).absolutePath || sel.absolutePath == File(
Environment.getExternalStorageDirectory(),
".time"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.content.IntentFilter
import android.content.ServiceConnection
import android.os.IBinder
import android.os.RemoteException
import androidx.core.content.ContextCompat
import dev.ragnarok.filegallery.R
import dev.ragnarok.filegallery.model.Audio
import dev.ragnarok.filegallery.settings.Settings
Expand Down Expand Up @@ -56,7 +57,12 @@ object MusicPlaybackController {
filter.addAction(MusicPlaybackService.META_CHANGED)
filter.addAction(MusicPlaybackService.PREPARED)
filter.addAction(MusicPlaybackService.QUEUE_CHANGED)
appContext.registerReceiver(receiver, filter)
ContextCompat.registerReceiver(
appContext,
receiver,
filter,
ContextCompat.RECEIVER_NOT_EXPORTED
)
}

fun bindToServiceWithoutStart(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import android.support.v4.media.session.MediaControllerCompat
import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat
import android.util.Log
import androidx.core.content.ContextCompat
import androidx.media.session.MediaButtonReceiver
import androidx.media3.common.AudioAttributes
import androidx.media3.common.C
Expand Down Expand Up @@ -150,7 +151,12 @@ class MusicPlaybackService : Service() {
filter.addAction(PREVIOUS_ACTION)
filter.addAction(REPEAT_ACTION)
filter.addAction(SHUFFLE_ACTION)
registerReceiver(mIntentReceiver, filter)
ContextCompat.registerReceiver(
this,
mIntentReceiver,
filter,
ContextCompat.RECEIVER_NOT_EXPORTED
)

// Initialize the delayed shutdown intent
val shutdownIntent = Intent(this, MusicPlaybackService::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ object Utils {

fun setColorFilter(view: ImageView?, @ColorInt color: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
view?.colorFilter = BlendModeColorFilter(color, BlendMode.MODULATE)
view?.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY)
} else {
view?.setColorFilter(color, PorterDuff.Mode.MULTIPLY)
}
Expand All @@ -202,7 +202,7 @@ object Utils {
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
view.colorFilter = BlendModeColorFilter(color, BlendMode.MODULATE)
view.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY)
} else {
view.setColorFilter(color, PorterDuff.Mode.MULTIPLY)
}
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ buildscript {
ext.tracingVersion = "1.2.0-rc01"
ext.transitionVersion = "1.4.1"
ext.vectordrawableVersion = "1.2.0-beta01"
ext.webkitVersion = "1.7.0-rc01"
ext.webkitVersion = "1.7.0"
ext.workVersion = "2.8.1"

//firebase libraries
Expand All @@ -57,7 +57,7 @@ buildscript {
ext.autoValueVersion = "1.10.1"

//common libraries
ext.kotlin_version = "1.8.21"
ext.kotlin_version = "1.9.0-Beta"
ext.kotlin_coroutines = "1.7.1"
ext.kotlin_serializer = "1.5.1"
ext.okhttpLibraryVersion = "5.0.0-alpha.11"
Expand All @@ -66,7 +66,7 @@ buildscript {
ext.guavaVersion = "32.0.0-android"
ext.errorproneVersion = "2.15.0"
ext.checkerCompatQualVersion = "2.5.5"
ext.checkerQualAndroidVersion = "3.34.0"
ext.checkerQualAndroidVersion = "3.35.0"
ext.desugarLibraryVersion = "2.0.3"

//APP_PROPS
Expand All @@ -91,7 +91,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.0.2"
classpath "com.android.tools.build:gradle:8.1.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 All @@ -106,6 +106,6 @@ allprojects {
}
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading

0 comments on commit f50def9

Please sign in to comment.