feat : qol things

This commit is contained in:
aayush262 2024-05-22 00:20:59 +05:30
parent 039e3d63fe
commit 48ccb2c581
9 changed files with 98 additions and 110 deletions

View file

@ -84,6 +84,7 @@ import androidx.core.view.updateLayoutParams
import androidx.core.view.updatePadding
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.MutableLiveData
import androidx.recyclerview.widget.RecyclerView
@ -96,6 +97,7 @@ import ani.dantotsu.connections.crashlytics.CrashlyticsInterface
import ani.dantotsu.databinding.ItemCountDownBinding
import ani.dantotsu.media.Media
import ani.dantotsu.notifications.IncognitoNotificationClickReceiver
import ani.dantotsu.others.ImageViewDialog
import ani.dantotsu.others.SpoilerPlugin
import ani.dantotsu.parsers.ShowResponse
import ani.dantotsu.settings.saving.PrefManager
@ -1392,6 +1394,13 @@ fun Context.getThemeColor(@AttrRes attribute: Int): Int {
theme.resolveAttribute(attribute, typedValue, true)
return typedValue.data
}
fun ImageView.openImage(title: String, image: String) {
setOnLongClickListener{
ImageViewDialog.newInstance(
context as FragmentActivity, title, image
)
}
}
/**
* Builds the markwon instance with all the plugins
* @return the markwon instance