Skip to content

Commit

Permalink
EOF-20
Browse files Browse the repository at this point in the history
EOF-20
  • Loading branch information
umerov1999 committed Aug 5, 2023
1 parent 2879ea1 commit 63e7cfc
Show file tree
Hide file tree
Showing 1,308 changed files with 17,203 additions and 7,376 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<b>Инструкция по сборке:</b>
Требуется:
1) Android Studio Giraffe (2022.3.1) или выше. Kotlin 1.9.*
2) Android SDK 33
3) Android NDK 25.2.9519653
2) Android SDK 34
3) Android NDK 26.0.10404224

Если не работает музыка в Fenrir Kate, обновите kate_receipt_gms_token в app.build_config.
Взять токен можно из Kate Mobile Extra Mod
Expand Down
11 changes: 7 additions & 4 deletions app_fenrir/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Expand Down Expand Up @@ -389,23 +390,20 @@
<activity
android:name="dev.ragnarok.fenrir.activity.gifpager.GifPagerActivity"
android:configChanges="keyboardHidden|orientation"
android:exported="true"
android:label="@string/gif_player"
android:theme="@style/App.DayNight.Swipes"
android:windowSoftInputMode="adjustResize|stateHidden" />

<activity
android:name="dev.ragnarok.fenrir.activity.storypager.StoryPagerActivity"
android:configChanges="keyboardHidden|orientation"
android:exported="true"
android:label="@string/story"
android:theme="@style/App.DayNight.Swipes"
android:windowSoftInputMode="adjustResize|stateHidden" />

<activity
android:name="dev.ragnarok.fenrir.activity.shortvideopager.ShortVideoPagerActivity"
android:configChanges="keyboardHidden|orientation"
android:exported="true"
android:label="@string/clips"
android:theme="@style/App.DayNight.Swipes"
android:windowSoftInputMode="adjustResize|stateHidden" />
Expand Down Expand Up @@ -634,7 +632,12 @@

<service
android:name="dev.ragnarok.fenrir.service.KeepLongpollService"
android:exported="false" />
android:exported="false"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="longpoll" />
</service>

<service
android:name="dev.ragnarok.fenrir.FcmListenerService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import android.content.ServiceConnection
import android.graphics.Color
import android.os.Bundle
import android.os.IBinder
import android.view.View
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import androidx.annotation.ColorInt
import androidx.core.view.WindowInsetsControllerCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import dev.ragnarok.fenrir.Extra
Expand Down Expand Up @@ -214,31 +214,17 @@ class ChatActivity : NoMainActivity(), PlaceProvider, AppStyleable, ServiceConne
val statusbarNonColored = CurrentTheme.getStatusBarNonColored(this)
val statusbarColored = CurrentTheme.getStatusBarColor(this)
val w = window
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
w.statusBarColor = if (colored) statusbarColored else statusbarNonColored
@ColorInt val navigationColor =
if (colored) CurrentTheme.getNavigationBarColor(this) else Color.BLACK
w.navigationBarColor = navigationColor
if (Utils.hasMarshmallow()) {
var flags = window.decorView.systemUiVisibility
flags = if (invertIcons) {
flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv()
}
window.decorView.systemUiVisibility = flags
}
if (Utils.hasOreo()) {
var flags = window.decorView.systemUiVisibility
if (invertIcons) {
flags = flags or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
w.decorView.systemUiVisibility = flags
w.navigationBarColor = Color.WHITE
} else {
flags = flags and View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
w.decorView.systemUiVisibility = flags
}
val ins = WindowInsetsControllerCompat(w, w.decorView)
ins.isAppearanceLightStatusBars = invertIcons
ins.isAppearanceLightNavigationBars = invertIcons

if (!Utils.hasMarshmallow()) {
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import android.content.ServiceConnection
import android.graphics.Color
import android.os.Bundle
import android.os.IBinder
import android.view.View
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import androidx.annotation.ColorInt
import androidx.core.view.WindowInsetsControllerCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import dev.ragnarok.fenrir.Extra
Expand Down Expand Up @@ -235,31 +235,17 @@ class ChatActivityBubbles : NoMainActivity(), PlaceProvider, AppStyleable, Servi
val statusbarNonColored = CurrentTheme.getStatusBarNonColored(this)
val statusbarColored = CurrentTheme.getStatusBarColor(this)
val w = window
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
w.statusBarColor = if (colored) statusbarColored else statusbarNonColored
@ColorInt val navigationColor =
if (colored) CurrentTheme.getNavigationBarColor(this) else Color.BLACK
w.navigationBarColor = navigationColor
if (Utils.hasMarshmallow()) {
var flags = window.decorView.systemUiVisibility
flags = if (invertIcons) {
flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv()
}
window.decorView.systemUiVisibility = flags
}
if (Utils.hasOreo()) {
var flags = window.decorView.systemUiVisibility
if (invertIcons) {
flags = flags or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
w.decorView.systemUiVisibility = flags
w.navigationBarColor = Color.WHITE
} else {
flags = flags and View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
w.decorView.systemUiVisibility = flags
}
val ins = WindowInsetsControllerCompat(w, w.decorView)
ins.isAppearanceLightStatusBars = invertIcons
ins.isAppearanceLightNavigationBars = invertIcons

if (!Utils.hasMarshmallow()) {
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import android.widget.TextView
import androidx.annotation.ColorInt
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.view.WindowInsetsControllerCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
Expand Down Expand Up @@ -42,9 +43,11 @@ import dev.ragnarok.fenrir.util.AppTextUtils.getDateFromUnixTime
import dev.ragnarok.fenrir.util.DownloadWorkUtils
import dev.ragnarok.fenrir.util.Utils
import dev.ragnarok.fenrir.util.serializeble.json.Json
import dev.ragnarok.fenrir.util.serializeble.json.decodeFromStream
import dev.ragnarok.fenrir.util.serializeble.json.decodeFromBufferedSource
import dev.ragnarok.fenrir.util.toast.CustomToast
import io.reactivex.rxjava3.disposables.Disposable
import okio.buffer
import okio.source
import java.io.File
import java.io.FileOutputStream
import java.text.DateFormat
Expand Down Expand Up @@ -83,7 +86,10 @@ class DeltaOwnerActivity : AppCompatActivity(), PlaceProvider, AppStyleable {
contentResolver.openInputStream(
uri
)?.let {
val s = kJson.decodeFromStream(DeltaOwner.serializer(), it)
val s = kJson.decodeFromBufferedSource(
DeltaOwner.serializer(),
it.source().buffer()
)
it.close()
s
}
Expand Down Expand Up @@ -274,31 +280,17 @@ class DeltaOwnerActivity : AppCompatActivity(), PlaceProvider, AppStyleable {
val statusbarNonColored = CurrentTheme.getStatusBarNonColored(this)
val statusbarColored = CurrentTheme.getStatusBarColor(this)
val w = window
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
w.statusBarColor = if (colored) statusbarColored else statusbarNonColored
@ColorInt val navigationColor =
if (colored) CurrentTheme.getNavigationBarColor(this) else Color.BLACK
w.navigationBarColor = navigationColor
if (Utils.hasMarshmallow()) {
var flags = window.decorView.systemUiVisibility
flags = if (invertIcons) {
flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv()
}
window.decorView.systemUiVisibility = flags
}
if (Utils.hasOreo()) {
var flags = window.decorView.systemUiVisibility
if (invertIcons) {
flags = flags or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
w.decorView.systemUiVisibility = flags
w.navigationBarColor = Color.WHITE
} else {
flags = flags and View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
w.decorView.systemUiVisibility = flags
}
val ins = WindowInsetsControllerCompat(w, w.decorView)
ins.isAppearanceLightStatusBars = invertIcons
ins.isAppearanceLightNavigationBars = invertIcons

if (!Utils.hasMarshmallow()) {
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import android.content.ServiceConnection
import android.graphics.Color
import android.os.Bundle
import android.os.IBinder
import android.view.View
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import androidx.annotation.ColorInt
import androidx.core.view.WindowInsetsControllerCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import dev.ragnarok.fenrir.Extra
Expand Down Expand Up @@ -202,31 +202,17 @@ class LocalJsonToChatActivity : NoMainActivity(), PlaceProvider, AppStyleable, S
val statusbarNonColored = CurrentTheme.getStatusBarNonColored(this)
val statusbarColored = CurrentTheme.getStatusBarColor(this)
val w = window
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
w.statusBarColor = if (colored) statusbarColored else statusbarNonColored
@ColorInt val navigationColor =
if (colored) CurrentTheme.getNavigationBarColor(this) else Color.BLACK
w.navigationBarColor = navigationColor
if (Utils.hasMarshmallow()) {
var flags = window.decorView.systemUiVisibility
flags = if (invertIcons) {
flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv()
}
window.decorView.systemUiVisibility = flags
}
if (Utils.hasOreo()) {
var flags = window.decorView.systemUiVisibility
if (invertIcons) {
flags = flags or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
w.decorView.systemUiVisibility = flags
w.navigationBarColor = Color.WHITE
} else {
flags = flags and View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
w.decorView.systemUiVisibility = flags
}
val ins = WindowInsetsControllerCompat(w, w.decorView)
ins.isAppearanceLightStatusBars = invertIcons
ins.isAppearanceLightNavigationBars = invertIcons

if (!Utils.hasMarshmallow()) {
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
}
}
Loading

0 comments on commit 63e7cfc

Please sign in to comment.