Merge branch 'dev' of https://github.com/rebelonion/Dantotsu into dev
This commit is contained in:
commit
ca0162fb9c
2 changed files with 59 additions and 22 deletions
|
@ -1,5 +1,6 @@
|
|||
package ani.dantotsu.media
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -19,6 +20,7 @@ import ani.dantotsu.databinding.ActivityCharacterBinding
|
|||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.openLinkInBrowser
|
||||
import ani.dantotsu.others.ImageViewDialog
|
||||
import ani.dantotsu.others.getSerialized
|
||||
import ani.dantotsu.px
|
||||
|
@ -75,7 +77,17 @@ class CharacterDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChang
|
|||
character.image
|
||||
)
|
||||
}
|
||||
|
||||
val link = "https://anilist.co/character/${character.id}"
|
||||
binding.characterShare.setOnClickListener {
|
||||
val i = Intent(Intent.ACTION_SEND)
|
||||
i.type = "text/plain"
|
||||
i.putExtra(Intent.EXTRA_TEXT, link)
|
||||
startActivity(Intent.createChooser(i, character.name))
|
||||
}
|
||||
binding.characterShare.setOnLongClickListener {
|
||||
openLinkInBrowser(link)
|
||||
true
|
||||
}
|
||||
model.getCharacter().observe(this) {
|
||||
if (it != null && !loaded) {
|
||||
character = it
|
||||
|
@ -139,13 +151,11 @@ class CharacterDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChang
|
|||
isCollapsed = true
|
||||
if (immersiveMode) this.window.statusBarColor =
|
||||
ContextCompat.getColor(this, R.color.nav_bg)
|
||||
binding.characterAppBar.setBackgroundResource(R.color.nav_bg)
|
||||
}
|
||||
if (percentage <= percent && isCollapsed) {
|
||||
isCollapsed = false
|
||||
if (immersiveMode) this.window.statusBarColor =
|
||||
ContextCompat.getColor(this, R.color.transparent)
|
||||
binding.characterAppBar.setBackgroundResource(R.color.bg)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,25 +46,52 @@
|
|||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/characterTitle"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/characterAccessContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="64dp"
|
||||
android:layout_marginEnd="64dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center_vertical"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:minHeight="60dp"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:text="@string/slogan"
|
||||
android:textSize="16sp"
|
||||
android:transitionName="characterTitle" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/characterTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:layout_marginStart="24dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center_vertical"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:singleLine="true"
|
||||
android:text="@string/slogan"
|
||||
android:textSize="16sp"
|
||||
android:transitionName="characterTitle" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/characterFav"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="8dp"
|
||||
android:tintMode="src_atop"
|
||||
app:srcCompat="@drawable/ic_round_favorite_border_24"
|
||||
app:tint="@color/bg_opp"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/characterShare"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="8dp"
|
||||
app:srcCompat="@drawable/ic_round_share_24"
|
||||
app:tint="@color/bg_opp"
|
||||
app:tintMode="src_atop"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
@ -120,7 +147,7 @@
|
|||
android:translationZ="4dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="16dp"
|
||||
app:layout_anchor="@id/characterTitle"
|
||||
app:layout_anchor="@id/characterAccessContainer"
|
||||
app:layout_anchorGravity="center_horizontal">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue