fix: search bars
This commit is contained in:
parent
60752e83ed
commit
449485f06a
16 changed files with 439 additions and 142 deletions
|
@ -119,7 +119,8 @@ dependencies {
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
implementation 'com.google.android.material:material:1.11.0'
|
implementation 'com.google.android.material:material:1.11.0'
|
||||||
implementation 'nl.joery.animatedbottombar:library:1.1.0'
|
//implementation 'nl.joery.animatedbottombar:library:1.1.0'
|
||||||
|
implementation 'com.github.rebelonion:AnimatedBottomBar:v1.1.0'
|
||||||
implementation 'com.flaviofaria:kenburnsview:1.0.7'
|
implementation 'com.flaviofaria:kenburnsview:1.0.7'
|
||||||
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
|
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
|
||||||
implementation 'com.alexvasilkov:gesture-views:2.8.3'
|
implementation 'com.alexvasilkov:gesture-views:2.8.3'
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
android:parentActivityName=".MainActivity" />
|
android:parentActivityName=".MainActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".settings.ExtensionsActivity"
|
android:name=".settings.ExtensionsActivity"
|
||||||
|
android:windowSoftInputMode="adjustResize|stateHidden"
|
||||||
android:parentActivityName=".MainActivity" />
|
android:parentActivityName=".MainActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".others.imagesearch.ImageSearchActivity"
|
android:name=".others.imagesearch.ImageSearchActivity"
|
||||||
|
|
|
@ -217,7 +217,6 @@ class MainActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
binding.includedNavbar.navbarContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
binding.includedNavbar.navbarContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
bottomMargin = navBarHeight
|
bottomMargin = navBarHeight
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intent.extras?.let { extras ->
|
intent.extras?.let { extras ->
|
||||||
|
|
|
@ -2,7 +2,9 @@ package ani.dantotsu.media
|
||||||
|
|
||||||
import android.animation.ObjectAnimator
|
import android.animation.ObjectAnimator
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.Rect
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.SpannableStringBuilder
|
import android.text.SpannableStringBuilder
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
|
@ -10,7 +12,9 @@ import android.view.GestureDetector
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.WindowManager
|
||||||
import android.view.animation.AccelerateDecelerateInterpolator
|
import android.view.animation.AccelerateDecelerateInterpolator
|
||||||
|
import android.widget.FrameLayout
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
@ -18,6 +22,7 @@ import androidx.appcompat.content.res.AppCompatResources
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.text.bold
|
import androidx.core.text.bold
|
||||||
import androidx.core.text.color
|
import androidx.core.text.color
|
||||||
|
import androidx.core.view.marginBottom
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
|
@ -25,7 +30,6 @@ import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||||
import ani.dantotsu.CustomBottomNavBar
|
|
||||||
import ani.dantotsu.GesturesListener
|
import ani.dantotsu.GesturesListener
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.Refresh
|
import ani.dantotsu.Refresh
|
||||||
|
@ -41,6 +45,7 @@ import ani.dantotsu.media.manga.MangaReadFragment
|
||||||
import ani.dantotsu.media.novel.NovelReadFragment
|
import ani.dantotsu.media.novel.NovelReadFragment
|
||||||
import ani.dantotsu.navBarHeight
|
import ani.dantotsu.navBarHeight
|
||||||
import ani.dantotsu.openLinkInBrowser
|
import ani.dantotsu.openLinkInBrowser
|
||||||
|
import ani.dantotsu.others.AndroidBug5497Workaround
|
||||||
import ani.dantotsu.others.ImageViewDialog
|
import ani.dantotsu.others.ImageViewDialog
|
||||||
import ani.dantotsu.others.getSerialized
|
import ani.dantotsu.others.getSerialized
|
||||||
import ani.dantotsu.settings.saving.PrefManager
|
import ani.dantotsu.settings.saving.PrefManager
|
||||||
|
@ -50,7 +55,6 @@ import ani.dantotsu.statusBarHeight
|
||||||
import ani.dantotsu.themes.ThemeManager
|
import ani.dantotsu.themes.ThemeManager
|
||||||
import com.flaviofaria.kenburnsview.RandomTransitionGenerator
|
import com.flaviofaria.kenburnsview.RandomTransitionGenerator
|
||||||
import com.google.android.material.appbar.AppBarLayout
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
import com.google.android.material.navigation.NavigationBarView
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
@ -65,7 +69,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
lateinit var binding: ActivityMediaBinding
|
lateinit var binding: ActivityMediaBinding
|
||||||
private val scope = lifecycleScope
|
private val scope = lifecycleScope
|
||||||
private val model: MediaDetailsViewModel by viewModels()
|
private val model: MediaDetailsViewModel by viewModels()
|
||||||
private lateinit var tabLayout: NavigationBarView
|
lateinit var tabLayout: TripleNavAdapter
|
||||||
var selected = 0
|
var selected = 0
|
||||||
var anime = true
|
var anime = true
|
||||||
private var adult = false
|
private var adult = false
|
||||||
|
@ -96,19 +100,30 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
screenWidth = resources.displayMetrics.widthPixels.toFloat()
|
screenWidth = resources.displayMetrics.widthPixels.toFloat()
|
||||||
|
|
||||||
|
val isVertical = resources.configuration.orientation
|
||||||
//Ui init
|
//Ui init
|
||||||
|
|
||||||
initActivity(this)
|
initActivity(this)
|
||||||
|
val oldMargin = binding.mediaViewPager.marginBottom
|
||||||
|
AndroidBug5497Workaround.assistActivity(this) {
|
||||||
|
if (it) {
|
||||||
|
binding.mediaViewPager.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
bottomMargin = 0
|
||||||
|
}
|
||||||
|
binding.mediaTabContainer.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
binding.mediaViewPager.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
bottomMargin = oldMargin
|
||||||
|
}
|
||||||
|
binding.mediaTabContainer.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
binding.mediaBanner.updateLayoutParams { height += statusBarHeight }
|
binding.mediaBanner.updateLayoutParams { height += statusBarHeight }
|
||||||
binding.mediaBannerNoKen.updateLayoutParams { height += statusBarHeight }
|
binding.mediaBannerNoKen.updateLayoutParams { height += statusBarHeight }
|
||||||
binding.mediaClose.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += statusBarHeight }
|
binding.mediaClose.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += statusBarHeight }
|
||||||
binding.incognito.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += statusBarHeight }
|
binding.incognito.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin += statusBarHeight }
|
||||||
binding.mediaCollapsing.minimumHeight = statusBarHeight
|
binding.mediaCollapsing.minimumHeight = statusBarHeight
|
||||||
|
//binding.mediaViewPager.updateLayoutParams<ViewGroup.MarginLayoutParams> { bottomMargin = navBarHeight }
|
||||||
if (binding.mediaTab is CustomBottomNavBar) binding.mediaTab.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
|
||||||
bottomMargin = navBarHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.mediaTitle.isSelected = true
|
binding.mediaTitle.isSelected = true
|
||||||
|
|
||||||
|
@ -131,7 +146,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
val banner =
|
val banner =
|
||||||
if (bannerAnimations) binding.mediaBanner else binding.mediaBannerNoKen
|
if (bannerAnimations) binding.mediaBanner else binding.mediaBannerNoKen
|
||||||
val viewPager = binding.mediaViewPager
|
val viewPager = binding.mediaViewPager
|
||||||
tabLayout = binding.mediaTab as NavigationBarView
|
//tabLayout = binding.mediaTab as AnimatedBottomBar
|
||||||
viewPager.isUserInputEnabled = false
|
viewPager.isUserInputEnabled = false
|
||||||
viewPager.setPageTransformer(ZoomOutPageTransformer())
|
viewPager.setPageTransformer(ZoomOutPageTransformer())
|
||||||
|
|
||||||
|
@ -325,12 +340,18 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
progress()
|
progress()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tabLayout = TripleNavAdapter(
|
||||||
|
binding.mediaTab1,
|
||||||
|
binding.mediaTab2,
|
||||||
|
binding.mediaTab3,
|
||||||
|
media.anime != null,
|
||||||
|
media.format ?: "",
|
||||||
|
isVertical == 1
|
||||||
|
)
|
||||||
adult = media.isAdult
|
adult = media.isAdult
|
||||||
tabLayout.menu.clear()
|
|
||||||
if (media.anime != null) {
|
if (media.anime != null) {
|
||||||
viewPager.adapter =
|
viewPager.adapter =
|
||||||
ViewPagerAdapter(supportFragmentManager, lifecycle, SupportedMedia.ANIME, media, intent.getIntExtra("commentId", -1))
|
ViewPagerAdapter(supportFragmentManager, lifecycle, SupportedMedia.ANIME, media, intent.getIntExtra("commentId", -1))
|
||||||
tabLayout.inflateMenu(R.menu.anime_menu_detail)
|
|
||||||
} else if (media.manga != null) {
|
} else if (media.manga != null) {
|
||||||
viewPager.adapter = ViewPagerAdapter(
|
viewPager.adapter = ViewPagerAdapter(
|
||||||
supportFragmentManager,
|
supportFragmentManager,
|
||||||
|
@ -339,30 +360,23 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
media,
|
media,
|
||||||
intent.getIntExtra("commentId", -1)
|
intent.getIntExtra("commentId", -1)
|
||||||
)
|
)
|
||||||
if (media.format == "NOVEL") {
|
|
||||||
tabLayout.inflateMenu(R.menu.novel_menu_detail)
|
|
||||||
} else {
|
|
||||||
tabLayout.inflateMenu(R.menu.manga_menu_detail)
|
|
||||||
}
|
|
||||||
anime = false
|
anime = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
selected = media.selected!!.window
|
selected = media.selected!!.window
|
||||||
binding.mediaTitle.translationX = -screenWidth
|
binding.mediaTitle.translationX = -screenWidth
|
||||||
tabLayout.visibility = View.VISIBLE
|
|
||||||
|
|
||||||
tabLayout.setOnItemSelectedListener { item ->
|
tabLayout.selectionListener = { selected, newId ->
|
||||||
selectFromID(item.itemId)
|
this.selected = selected
|
||||||
|
selectFromID(newId)
|
||||||
viewPager.setCurrentItem(selected, false)
|
viewPager.setCurrentItem(selected, false)
|
||||||
val sel = model.loadSelected(media, isDownload)
|
val sel = model.loadSelected(media, isDownload)
|
||||||
sel.window = selected
|
sel.window = selected
|
||||||
model.saveSelected(media.id, sel)
|
model.saveSelected(media.id, sel)
|
||||||
true
|
|
||||||
}
|
}
|
||||||
|
tabLayout.selectTab(selected)
|
||||||
|
selectFromID(tabLayout.selected)
|
||||||
tabLayout.selectedItemId = idFromSelect()
|
|
||||||
viewPager.setCurrentItem(selected, false)
|
viewPager.setCurrentItem(selected, false)
|
||||||
|
|
||||||
if (model.continueMedia == null && media.cameFromContinue) {
|
if (model.continueMedia == null && media.cameFromContinue) {
|
||||||
|
@ -385,7 +399,6 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun selectFromID(id: Int) {
|
private fun selectFromID(id: Int) {
|
||||||
when (id) {
|
when (id) {
|
||||||
R.id.info -> {
|
R.id.info -> {
|
||||||
|
@ -418,7 +431,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
if (this::tabLayout.isInitialized) {
|
if (this::tabLayout.isInitialized) {
|
||||||
tabLayout.selectedItemId = idFromSelect()
|
tabLayout.selectTab(selected)
|
||||||
}
|
}
|
||||||
super.onResume()
|
super.onResume()
|
||||||
}
|
}
|
||||||
|
@ -586,5 +599,4 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
||||||
companion object {
|
companion object {
|
||||||
var mediaSingleton: Media? = null
|
var mediaSingleton: Media? = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
112
app/src/main/java/ani/dantotsu/media/TripleNavAdapter.kt
Normal file
112
app/src/main/java/ani/dantotsu/media/TripleNavAdapter.kt
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
package ani.dantotsu.media
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import ani.dantotsu.R
|
||||||
|
import ani.dantotsu.navBarHeight
|
||||||
|
import nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
|
|
||||||
|
class TripleNavAdapter(
|
||||||
|
private val nav1: AnimatedBottomBar,
|
||||||
|
private val nav2: AnimatedBottomBar,
|
||||||
|
private val nav3: AnimatedBottomBar,
|
||||||
|
anime: Boolean,
|
||||||
|
format: String,
|
||||||
|
isVertical: Boolean = false
|
||||||
|
) {
|
||||||
|
var selected: Int = 0
|
||||||
|
var selectionListener: ((Int, Int) -> Unit)? = null
|
||||||
|
init {
|
||||||
|
nav1.tabs.clear()
|
||||||
|
nav2.tabs.clear()
|
||||||
|
nav3.tabs.clear()
|
||||||
|
val infoTab = nav1.createTab(R.drawable.ic_round_info_24, R.string.info, R.id.info)
|
||||||
|
val watchTab = if (anime) {
|
||||||
|
nav2.createTab(R.drawable.ic_round_movie_filter_24, R.string.watch, R.id.watch)
|
||||||
|
} else if (format == "NOVEL") {
|
||||||
|
nav2.createTab(R.drawable.ic_round_book_24, R.string.read, R.id.read)
|
||||||
|
} else {
|
||||||
|
nav2.createTab(R.drawable.ic_round_import_contacts_24, R.string.read, R.id.read)
|
||||||
|
}
|
||||||
|
val commentTab = nav3.createTab(R.drawable.ic_round_comment_24, R.string.comments, R.id.comment)
|
||||||
|
nav1.addTab(infoTab)
|
||||||
|
nav2.addTab(watchTab)
|
||||||
|
nav3.addTab(commentTab)
|
||||||
|
nav1.visibility = ViewGroup.VISIBLE
|
||||||
|
nav2.visibility = ViewGroup.VISIBLE
|
||||||
|
nav3.visibility = ViewGroup.VISIBLE
|
||||||
|
if (!isVertical) {
|
||||||
|
nav1.indicatorColor = Color.TRANSPARENT
|
||||||
|
nav2.indicatorColor = Color.TRANSPARENT
|
||||||
|
nav3.indicatorColor = Color.TRANSPARENT
|
||||||
|
}
|
||||||
|
nav1.setOnTabSelectListener(object : AnimatedBottomBar.OnTabSelectListener {
|
||||||
|
override fun onTabSelected(
|
||||||
|
lastIndex: Int,
|
||||||
|
lastTab: AnimatedBottomBar.Tab?,
|
||||||
|
newIndex: Int,
|
||||||
|
newTab: AnimatedBottomBar.Tab
|
||||||
|
) {
|
||||||
|
selected = 0
|
||||||
|
deselectOthers(selected)
|
||||||
|
selectionListener?.invoke(selected, newTab.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
nav2.setOnTabSelectListener(object : AnimatedBottomBar.OnTabSelectListener {
|
||||||
|
override fun onTabSelected(
|
||||||
|
lastIndex: Int,
|
||||||
|
lastTab: AnimatedBottomBar.Tab?,
|
||||||
|
newIndex: Int,
|
||||||
|
newTab: AnimatedBottomBar.Tab
|
||||||
|
) {
|
||||||
|
selected = 1
|
||||||
|
deselectOthers(selected)
|
||||||
|
selectionListener?.invoke(selected, newTab.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
nav3.setOnTabSelectListener(object : AnimatedBottomBar.OnTabSelectListener {
|
||||||
|
override fun onTabSelected(
|
||||||
|
lastIndex: Int,
|
||||||
|
lastTab: AnimatedBottomBar.Tab?,
|
||||||
|
newIndex: Int,
|
||||||
|
newTab: AnimatedBottomBar.Tab
|
||||||
|
) {
|
||||||
|
selected = 2
|
||||||
|
deselectOthers(selected)
|
||||||
|
selectionListener?.invoke(selected, newTab.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun deselectOthers(selected: Int) {
|
||||||
|
if (selected == 0) {
|
||||||
|
nav2.clearSelection()
|
||||||
|
nav3.clearSelection()
|
||||||
|
}
|
||||||
|
if (selected == 1) {
|
||||||
|
nav1.clearSelection()
|
||||||
|
nav3.clearSelection()
|
||||||
|
}
|
||||||
|
if (selected == 2) {
|
||||||
|
nav1.clearSelection()
|
||||||
|
nav2.clearSelection()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun selectTab(tab: Int) {
|
||||||
|
when (tab) {
|
||||||
|
0 -> nav1.selectTabAt(0)
|
||||||
|
1 -> nav2.selectTabAt(0)
|
||||||
|
2 -> nav3.selectTabAt(0)
|
||||||
|
}
|
||||||
|
selected = tab
|
||||||
|
deselectOthers(selected)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setVisibility(visibility: Int) {
|
||||||
|
nav1.visibility = visibility
|
||||||
|
nav2.visibility = visibility
|
||||||
|
nav3.visibility = visibility
|
||||||
|
}
|
||||||
|
}
|
|
@ -358,11 +358,9 @@ class AnimeWatchFragment : Fragment() {
|
||||||
activity.findViewById<ViewPager2>(R.id.mediaViewPager).visibility = visibility
|
activity.findViewById<ViewPager2>(R.id.mediaViewPager).visibility = visibility
|
||||||
activity.findViewById<CardView>(R.id.mediaCover).visibility = visibility
|
activity.findViewById<CardView>(R.id.mediaCover).visibility = visibility
|
||||||
activity.findViewById<CardView>(R.id.mediaClose).visibility = visibility
|
activity.findViewById<CardView>(R.id.mediaClose).visibility = visibility
|
||||||
try {
|
|
||||||
activity.findViewById<CustomBottomNavBar>(R.id.mediaTab).visibility = visibility
|
activity.tabLayout.setVisibility(visibility)
|
||||||
} catch (e: ClassCastException) {
|
|
||||||
activity.findViewById<NavigationRailView>(R.id.mediaTab).visibility = visibility
|
|
||||||
}
|
|
||||||
activity.findViewById<FrameLayout>(R.id.fragmentExtensionsContainer).visibility =
|
activity.findViewById<FrameLayout>(R.id.fragmentExtensionsContainer).visibility =
|
||||||
if (show) View.GONE else View.VISIBLE
|
if (show) View.GONE else View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,10 +262,10 @@ class CommentItem(val comment: Comment,
|
||||||
val minutes = diff / (60 * 1000) % 60
|
val minutes = diff / (60 * 1000) % 60
|
||||||
|
|
||||||
return when {
|
return when {
|
||||||
days > 0 -> "$days days ago"
|
days > 0 -> "${days}d"
|
||||||
hours > 0 -> "$hours hours ago"
|
hours > 0 -> "${hours}h"
|
||||||
minutes > 0 -> "$minutes minutes ago"
|
minutes > 0 -> "${minutes}m"
|
||||||
else -> "just now"
|
else -> "now"
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
"now"
|
"now"
|
||||||
|
|
|
@ -11,6 +11,7 @@ import android.text.TextWatcher
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.WindowManager
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
@ -25,6 +26,7 @@ import ani.dantotsu.connections.anilist.Anilist
|
||||||
import ani.dantotsu.connections.comments.Comment
|
import ani.dantotsu.connections.comments.Comment
|
||||||
import ani.dantotsu.connections.comments.CommentResponse
|
import ani.dantotsu.connections.comments.CommentResponse
|
||||||
import ani.dantotsu.connections.comments.CommentsAPI
|
import ani.dantotsu.connections.comments.CommentsAPI
|
||||||
|
import ani.dantotsu.copyToClipboard
|
||||||
import ani.dantotsu.databinding.FragmentCommentsBinding
|
import ani.dantotsu.databinding.FragmentCommentsBinding
|
||||||
import ani.dantotsu.loadImage
|
import ani.dantotsu.loadImage
|
||||||
import ani.dantotsu.media.MediaDetailsActivity
|
import ani.dantotsu.media.MediaDetailsActivity
|
||||||
|
@ -88,7 +90,6 @@ class CommentsFragment : Fragment() {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
activity = requireActivity() as AppCompatActivity
|
activity = requireActivity() as AppCompatActivity
|
||||||
(activity as? MediaDetailsActivity)?.binding?.mediaAppBar?.setExpanded(false, true)
|
|
||||||
//get the media id from the intent
|
//get the media id from the intent
|
||||||
val mediaId = arguments?.getInt("mediaId") ?: -1
|
val mediaId = arguments?.getInt("mediaId") ?: -1
|
||||||
mediaName = arguments?.getString("mediaName") ?: "unknown"
|
mediaName = arguments?.getString("mediaName") ?: "unknown"
|
||||||
|
@ -695,7 +696,7 @@ class CommentsFragment : Fragment() {
|
||||||
.usePlugin(object : AbstractMarkwonPlugin() {
|
.usePlugin(object : AbstractMarkwonPlugin() {
|
||||||
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
||||||
builder.linkResolver { view, link ->
|
builder.linkResolver { view, link ->
|
||||||
// do nothing
|
copyToClipboard(link, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -372,11 +372,7 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
||||||
activity.findViewById<ViewPager2>(R.id.mediaViewPager).visibility = visibility
|
activity.findViewById<ViewPager2>(R.id.mediaViewPager).visibility = visibility
|
||||||
activity.findViewById<CardView>(R.id.mediaCover).visibility = visibility
|
activity.findViewById<CardView>(R.id.mediaCover).visibility = visibility
|
||||||
activity.findViewById<CardView>(R.id.mediaClose).visibility = visibility
|
activity.findViewById<CardView>(R.id.mediaClose).visibility = visibility
|
||||||
try {
|
activity.tabLayout.setVisibility(visibility)
|
||||||
activity.findViewById<CustomBottomNavBar>(R.id.mediaTab).visibility = visibility
|
|
||||||
} catch (e: ClassCastException) {
|
|
||||||
activity.findViewById<NavigationRailView>(R.id.mediaTab).visibility = visibility
|
|
||||||
}
|
|
||||||
activity.findViewById<FrameLayout>(R.id.fragmentExtensionsContainer).visibility =
|
activity.findViewById<FrameLayout>(R.id.fragmentExtensionsContainer).visibility =
|
||||||
if (show) View.GONE else View.VISIBLE
|
if (show) View.GONE else View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
package ani.dantotsu.others
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.graphics.Rect
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
|
||||||
|
class AndroidBug5497Workaround private constructor(activity: Activity, private val callback: (Boolean) -> Unit) {
|
||||||
|
private val mChildOfContent: View
|
||||||
|
private var usableHeightPrevious = 0
|
||||||
|
private val frameLayoutParams: FrameLayout.LayoutParams
|
||||||
|
|
||||||
|
init {
|
||||||
|
val content = activity.findViewById(android.R.id.content) as FrameLayout
|
||||||
|
mChildOfContent = content.getChildAt(0)
|
||||||
|
mChildOfContent.viewTreeObserver.addOnGlobalLayoutListener { possiblyResizeChildOfContent() }
|
||||||
|
frameLayoutParams = mChildOfContent.layoutParams as FrameLayout.LayoutParams
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun possiblyResizeChildOfContent() {
|
||||||
|
val usableHeightNow = computeUsableHeight()
|
||||||
|
if (usableHeightNow != usableHeightPrevious) {
|
||||||
|
val usableHeightSansKeyboard = mChildOfContent.rootView.height
|
||||||
|
val heightDifference = usableHeightSansKeyboard - usableHeightNow
|
||||||
|
if (heightDifference > usableHeightSansKeyboard / 4) {
|
||||||
|
// keyboard probably just became visible
|
||||||
|
callback.invoke(true)
|
||||||
|
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference
|
||||||
|
} else {
|
||||||
|
// keyboard probably just became hidden
|
||||||
|
callback.invoke(false)
|
||||||
|
frameLayoutParams.height = usableHeightSansKeyboard
|
||||||
|
}
|
||||||
|
mChildOfContent.requestLayout()
|
||||||
|
usableHeightPrevious = usableHeightNow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun computeUsableHeight(): Int {
|
||||||
|
val r = Rect()
|
||||||
|
mChildOfContent.getWindowVisibleDisplayFrame(r)
|
||||||
|
return r.bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
// For more information, see https://issuetracker.google.com/issues/36911528
|
||||||
|
// To use this class, simply invoke assistActivity() on an Activity that already has its content view set.
|
||||||
|
fun assistActivity(activity: Activity, callback: (Boolean) -> Unit) {
|
||||||
|
AndroidBug5497Workaround(activity, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.WindowManager
|
||||||
import android.widget.AutoCompleteTextView
|
import android.widget.AutoCompleteTextView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
@ -17,6 +18,7 @@ import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||||
import androidx.viewpager2.widget.ViewPager2
|
import androidx.viewpager2.widget.ViewPager2
|
||||||
import ani.dantotsu.*
|
import ani.dantotsu.*
|
||||||
import ani.dantotsu.databinding.ActivityExtensionsBinding
|
import ani.dantotsu.databinding.ActivityExtensionsBinding
|
||||||
|
import ani.dantotsu.others.AndroidBug5497Workaround
|
||||||
import ani.dantotsu.others.LanguageMapper
|
import ani.dantotsu.others.LanguageMapper
|
||||||
import ani.dantotsu.settings.saving.PrefManager
|
import ani.dantotsu.settings.saving.PrefManager
|
||||||
import ani.dantotsu.settings.saving.PrefName
|
import ani.dantotsu.settings.saving.PrefName
|
||||||
|
@ -34,7 +36,22 @@ class ExtensionsActivity : AppCompatActivity() {
|
||||||
ThemeManager(this).applyTheme()
|
ThemeManager(this).applyTheme()
|
||||||
binding = ActivityExtensionsBinding.inflate(layoutInflater)
|
binding = ActivityExtensionsBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
initActivity(this)
|
||||||
|
AndroidBug5497Workaround.assistActivity(this) {
|
||||||
|
if (it) {
|
||||||
|
binding.searchView.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
bottomMargin = statusBarHeight
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
binding.searchView.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
bottomMargin = statusBarHeight + navBarHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.searchView.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
bottomMargin = statusBarHeight + navBarHeight
|
||||||
|
}
|
||||||
|
|
||||||
val tabLayout = findViewById<TabLayout>(R.id.tabLayout)
|
val tabLayout = findViewById<TabLayout>(R.id.tabLayout)
|
||||||
val viewPager = findViewById<ViewPager2>(R.id.viewPager)
|
val viewPager = findViewById<ViewPager2>(R.id.viewPager)
|
||||||
|
|
|
@ -6,20 +6,73 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.google.android.material.navigationrail.NavigationRailView
|
<LinearLayout
|
||||||
android:id="@+id/mediaTab"
|
android:id="@+id/mediaTabContainer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorSurface"
|
android:layout_gravity="center|bottom"
|
||||||
android:translationZ="0dp"
|
android:orientation="vertical">
|
||||||
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
|
||||||
app:itemIconTint="@color/tab_layout_icon"
|
<nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
app:itemPaddingTop="32dp"
|
android:id="@+id/mediaTab1"
|
||||||
app:itemRippleColor="?attr/colorPrimary"
|
android:layout_width="wrap_content"
|
||||||
app:itemTextAppearanceActive="@style/NavBarText"
|
android:layout_height="0dp"
|
||||||
app:itemTextAppearanceInactive="@style/NavBarText"
|
android:layout_weight="1"
|
||||||
app:itemTextColor="@color/tab_layout_icon"
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
app:menuGravity="center" />
|
android:background="?attr/colorSurface"
|
||||||
|
android:padding="0dp"
|
||||||
|
app:abb_animationInterpolator="@anim/over_shoot"
|
||||||
|
app:abb_selectedTabType="text"
|
||||||
|
app:abb_textAppearance="@style/NavBarText"
|
||||||
|
|
||||||
|
|
||||||
|
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
||||||
|
app:itemIconTint="@color/tab_layout_icon"
|
||||||
|
app:itemRippleColor="#00000000"
|
||||||
|
app:itemTextAppearanceActive="@style/NavBarText"
|
||||||
|
app:itemTextAppearanceInactive="@style/NavBarText"
|
||||||
|
app:itemTextColor="@color/tab_layout_icon" />
|
||||||
|
|
||||||
|
<nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
|
android:id="@+id/mediaTab2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:background="?attr/colorSurface"
|
||||||
|
android:padding="0dp"
|
||||||
|
app:abb_animationInterpolator="@anim/over_shoot"
|
||||||
|
app:abb_selectedTabType="text"
|
||||||
|
app:abb_textAppearance="@style/NavBarText"
|
||||||
|
|
||||||
|
|
||||||
|
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
||||||
|
app:itemIconTint="@color/tab_layout_icon"
|
||||||
|
app:itemRippleColor="#00000000"
|
||||||
|
app:itemTextAppearanceActive="@style/NavBarText"
|
||||||
|
app:itemTextAppearanceInactive="@style/NavBarText"
|
||||||
|
app:itemTextColor="@color/tab_layout_icon" />
|
||||||
|
|
||||||
|
<nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
|
android:id="@+id/mediaTab3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:background="?attr/colorSurface"
|
||||||
|
android:padding="0dp"
|
||||||
|
app:abb_animationInterpolator="@anim/over_shoot"
|
||||||
|
app:abb_selectedTabType="text"
|
||||||
|
app:abb_textAppearance="@style/NavBarText"
|
||||||
|
|
||||||
|
|
||||||
|
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
||||||
|
app:itemIconTint="@color/tab_layout_icon"
|
||||||
|
app:itemRippleColor="#00000000"
|
||||||
|
app:itemTextAppearanceActive="@style/NavBarText"
|
||||||
|
app:itemTextAppearanceInactive="@style/NavBarText"
|
||||||
|
app:itemTextColor="@color/tab_layout_icon" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -97,7 +97,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
android:inputType="textPersonName"
|
android:inputType="textPersonName"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
@ -235,24 +236,77 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:nestedScrollingEnabled="true"
|
android:nestedScrollingEnabled="true"
|
||||||
|
android:layout_marginBottom="72dp"
|
||||||
tools:ignore="SpeakableTextPresentCheck" />
|
tools:ignore="SpeakableTextPresentCheck" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ani.dantotsu.CustomBottomNavBar
|
<LinearLayout
|
||||||
android:id="@+id/mediaTab"
|
android:id="@+id/mediaTabContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center|bottom"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
|
android:id="@+id/mediaTab1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_gravity="center_horizontal|bottom"
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:translationZ="1dp"
|
app:abb_animationInterpolator="@anim/over_shoot"
|
||||||
|
app:abb_selectedTabType="text"
|
||||||
|
app:abb_textAppearance="@style/NavBarText"
|
||||||
|
|
||||||
|
|
||||||
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
||||||
app:itemIconTint="@color/tab_layout_icon"
|
app:itemIconTint="@color/tab_layout_icon"
|
||||||
app:itemRippleColor="#00000000"
|
app:itemRippleColor="#00000000"
|
||||||
app:itemTextAppearanceActive="@style/NavBarText"
|
app:itemTextAppearanceActive="@style/NavBarText"
|
||||||
app:itemTextAppearanceInactive="@style/NavBarText"
|
app:itemTextAppearanceInactive="@style/NavBarText"
|
||||||
app:itemTextColor="@color/tab_layout_icon"
|
app:itemTextColor="@color/tab_layout_icon" />
|
||||||
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
|
|
||||||
|
<nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
|
android:id="@+id/mediaTab2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:background="?attr/colorSurface"
|
||||||
|
android:padding="0dp"
|
||||||
|
app:abb_animationInterpolator="@anim/over_shoot"
|
||||||
|
app:abb_selectedTabType="text"
|
||||||
|
app:abb_textAppearance="@style/NavBarText"
|
||||||
|
|
||||||
|
|
||||||
|
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
||||||
|
app:itemIconTint="@color/tab_layout_icon"
|
||||||
|
app:itemRippleColor="#00000000"
|
||||||
|
app:itemTextAppearanceActive="@style/NavBarText"
|
||||||
|
app:itemTextAppearanceInactive="@style/NavBarText"
|
||||||
|
app:itemTextColor="@color/tab_layout_icon" />
|
||||||
|
|
||||||
|
<nl.joery.animatedbottombar.AnimatedBottomBar
|
||||||
|
android:id="@+id/mediaTab3"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:background="?attr/colorSurface"
|
||||||
|
android:padding="0dp"
|
||||||
|
app:abb_animationInterpolator="@anim/over_shoot"
|
||||||
|
app:abb_selectedTabType="text"
|
||||||
|
app:abb_textAppearance="@style/NavBarText"
|
||||||
|
|
||||||
|
|
||||||
|
app:itemActiveIndicatorStyle="@style/BottomNavBar"
|
||||||
|
app:itemIconTint="@color/tab_layout_icon"
|
||||||
|
app:itemRippleColor="#00000000"
|
||||||
|
app:itemTextAppearanceActive="@style/NavBarText"
|
||||||
|
app:itemTextAppearanceInactive="@style/NavBarText"
|
||||||
|
app:itemTextColor="@color/tab_layout_icon" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/incognito"
|
android:id="@+id/incognito"
|
||||||
|
@ -321,6 +375,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:visibility="gone"></FrameLayout>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
android:id="@+id/commentsRefresh"
|
android:id="@+id/commentsRefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="58dp"
|
android:layout_marginBottom="58dp"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false">
|
android:clipToPadding="false">
|
||||||
|
|
||||||
|
@ -83,67 +83,6 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/commentInputLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingBottom="8dp">
|
|
||||||
|
|
||||||
<com.google.android.material.imageview.ShapeableImageView
|
|
||||||
android:id="@+id/commentUserAvatar"
|
|
||||||
style="@style/CircularImageView"
|
|
||||||
android:layout_width="42dp"
|
|
||||||
android:layout_height="42dp"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:scaleType="center"
|
|
||||||
app:srcCompat="@drawable/ic_round_add_circle_24"
|
|
||||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/commentInput"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="start|center_vertical"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:autofillHints="The One Piece is real"
|
|
||||||
android:background="@drawable/card_outline"
|
|
||||||
android:fontFamily="@font/poppins_semi_bold"
|
|
||||||
android:hint="Add a comment..."
|
|
||||||
android:inputType="textMultiLine"
|
|
||||||
android:maxLength="300"
|
|
||||||
android:maxLines="8"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/commentLabel"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:background="@drawable/ic_label_off_24"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/commentSend"
|
|
||||||
android:layout_width="32dp"
|
|
||||||
android:layout_height="32dp"
|
|
||||||
android:layout_marginEnd="12dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:background="@drawable/ic_round_send_24"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="ContentDescription"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -188,7 +127,67 @@
|
||||||
app:srcCompat="@drawable/ic_round_close_24"
|
app:srcCompat="@drawable/ic_round_close_24"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/commentInputLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
android:id="@+id/commentUserAvatar"
|
||||||
|
style="@style/CircularImageView"
|
||||||
|
android:layout_width="42dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:scaleType="center"
|
||||||
|
app:srcCompat="@drawable/ic_round_add_circle_24"
|
||||||
|
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/commentInput"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:autofillHints="The One Piece is real"
|
||||||
|
android:background="@drawable/card_outline"
|
||||||
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
|
android:hint="Add a comment..."
|
||||||
|
android:inputType="textMultiLine"
|
||||||
|
android:maxLength="300"
|
||||||
|
android:maxLines="8"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/commentLabel"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/ic_label_off_24"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/commentSend"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/ic_round_send_24"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="ContentDescription"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
android:id="@+id/commentsCardView"
|
android:id="@+id/commentsCardView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginBottom="6dp">
|
android:layout_marginBottom="6dp">
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,20 +121,6 @@
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:ignore="HardcodedText,RtlSymmetry" />
|
tools:ignore="HardcodedText,RtlSymmetry" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/modBadge"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="top"
|
|
||||||
android:layout_marginEnd="6dp"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:scaleX="0.8"
|
|
||||||
android:scaleY="0.8"
|
|
||||||
android:src="@drawable/ic_shield"
|
|
||||||
android:visibility="visible"
|
|
||||||
tools:ignore="ContentDescription,RtlSymmetry" />
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/adminBadge"
|
android:id="@+id/adminBadge"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -146,6 +134,18 @@
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
tools:ignore="ContentDescription,RtlSymmetry" />
|
tools:ignore="ContentDescription,RtlSymmetry" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/modBadge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:scaleX="0.8"
|
||||||
|
android:scaleY="0.8"
|
||||||
|
android:src="@drawable/ic_shield"
|
||||||
|
android:visibility="visible"
|
||||||
|
tools:ignore="ContentDescription,RtlSymmetry" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ani.dantotsu.media.comments.SpoilerTextView
|
<ani.dantotsu.media.comments.SpoilerTextView
|
||||||
|
@ -290,7 +290,7 @@
|
||||||
app:layout_constraintStart_toEndOf="@+id/linearLayout5"
|
app:layout_constraintStart_toEndOf="@+id/linearLayout5"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="16dp"
|
||||||
android:background="@color/nav_tab" />
|
android:background="@color/nav_tab" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue