fixed upload image button padding (#142)
* no extra media in offline mode * incognito display in media * fixed upload image button padding
This commit is contained in:
parent
87a9df4c12
commit
4cee512572
5 changed files with 65 additions and 37 deletions
|
@ -2,6 +2,7 @@ package ani.dantotsu.media
|
|||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.SpannableStringBuilder
|
||||
|
@ -16,6 +17,7 @@ import androidx.activity.viewModels
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.drawable.DrawableCompat
|
||||
import androidx.core.text.bold
|
||||
import androidx.core.text.color
|
||||
import androidx.core.view.updateLayoutParams
|
||||
|
@ -158,12 +160,23 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
}
|
||||
})
|
||||
banner.setOnTouchListener { _, motionEvent -> gestureDetector.onTouchEvent(motionEvent);true }
|
||||
binding.mediaTitle.text = media.userPreferredName
|
||||
if (this.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
.getBoolean("incognito", false)) {
|
||||
binding.mediaTitle.text = " ${media.userPreferredName}"
|
||||
binding.mediaTitleCollapse.text = " ${media.userPreferredName}"
|
||||
val drawable = ContextCompat.getDrawable(this, R.drawable.ic_incognito_24)
|
||||
val color = ContextCompat.getColor(this, R.color.incognito)
|
||||
DrawableCompat.setTint(drawable!!, color)
|
||||
binding.mediaTitle.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, null, null, null)
|
||||
binding.mediaTitleCollapse.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, null, null, null)
|
||||
}else {
|
||||
binding.mediaTitle.text = media.userPreferredName
|
||||
binding.mediaTitleCollapse.text = media.userPreferredName
|
||||
}
|
||||
binding.mediaTitle.setOnLongClickListener {
|
||||
copyToClipboard(media.userPreferredName)
|
||||
true
|
||||
}
|
||||
binding.mediaTitleCollapse.text = media.userPreferredName
|
||||
binding.mediaTitleCollapse.setOnLongClickListener {
|
||||
copyToClipboard(media.userPreferredName)
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue