页面跳转,window bg透明
This commit is contained in:
parent
c0480c12e6
commit
6971784f98
|
|
@ -43,6 +43,7 @@
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.splash.SplashActivity"
|
android:name=".ui.splash.SplashActivity"
|
||||||
|
android:theme="@style/AppTheme.Launcher"
|
||||||
android:exported="true" >
|
android:exported="true" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,15 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun start() {
|
const val ACTOR_ID = "ACTOR_ID"
|
||||||
|
|
||||||
|
fun start(actorId: Int) {
|
||||||
ARouter.getInstance()
|
ARouter.getInstance()
|
||||||
.build(Routers.CHAT)
|
.build(Routers.CHAT)
|
||||||
|
.withInt(ACTOR_ID, actorId)
|
||||||
.navigation()
|
.navigation()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import kotlin.math.max
|
||||||
@Route(path = Routers.ROUTE_FRAG_ACTORLIST)
|
@Route(path = Routers.ROUTE_FRAG_ACTORLIST)
|
||||||
class ActorListFragment : BaseBindingFragment<FragmentMainActorBinding>() {
|
class ActorListFragment : BaseBindingFragment<FragmentMainActorBinding>() {
|
||||||
|
|
||||||
private lateinit var actorAdapter: ActorsAdapter
|
private lateinit var mActorAdapter: ActorsAdapter
|
||||||
private val actorsViewModel by viewModels<ActorListViewModel>()
|
private val actorsViewModel by viewModels<ActorListViewModel>()
|
||||||
|
|
||||||
override fun onCreated(bundle: Bundle?) {
|
override fun onCreated(bundle: Bundle?) {
|
||||||
|
|
@ -51,15 +51,15 @@ class ActorListFragment : BaseBindingFragment<FragmentMainActorBinding>() {
|
||||||
private fun initRecyclerView() {
|
private fun initRecyclerView() {
|
||||||
with(binding) {
|
with(binding) {
|
||||||
val layoutManager = LayoutManagerHelper.createAdaptiveStaggeredGridLayoutManager()
|
val layoutManager = LayoutManagerHelper.createAdaptiveStaggeredGridLayoutManager()
|
||||||
actorsRv.layoutManager = layoutManager
|
mActorsRv.layoutManager = layoutManager
|
||||||
actorsRv.addItemDecoration(GridSpacingItemDecoration(16))
|
mActorsRv.addItemDecoration(GridSpacingItemDecoration(16))
|
||||||
actorsRv.setHasFixedSize(true)
|
mActorsRv.setHasFixedSize(true)
|
||||||
actorsRv.itemAnimator = DefaultItemAnimator()
|
mActorsRv.itemAnimator = DefaultItemAnimator()
|
||||||
actorAdapter = ActorsAdapter()
|
mActorAdapter = ActorsAdapter()
|
||||||
actorsRv.adapter = actorAdapter
|
mActorsRv.adapter = mActorAdapter
|
||||||
|
|
||||||
val characterList = createSampleData()
|
val characterList = createSampleData()
|
||||||
actorAdapter.setList(characterList)
|
mActorAdapter.setList(characterList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,19 @@ import com.chad.library.adapter.base.module.LoadMoreModule
|
||||||
import com.remax.visualnovel.R
|
import com.remax.visualnovel.R
|
||||||
import com.remax.visualnovel.app.BaseBindingQuickAdapter
|
import com.remax.visualnovel.app.BaseBindingQuickAdapter
|
||||||
import com.remax.visualnovel.databinding.FragmentMainActorItemBinding
|
import com.remax.visualnovel.databinding.FragmentMainActorItemBinding
|
||||||
|
import com.remax.visualnovel.ui.Chat.ChatActivity
|
||||||
|
|
||||||
class ActorsAdapter : BaseBindingQuickAdapter<ActorItem, FragmentMainActorItemBinding>(FragmentMainActorItemBinding::inflate), LoadMoreModule {
|
class ActorsAdapter : BaseBindingQuickAdapter<ActorItem, FragmentMainActorItemBinding>(FragmentMainActorItemBinding::inflate), LoadMoreModule {
|
||||||
init {
|
init {
|
||||||
addChildClickViewIds(R.id.top_container_left_top)
|
setOnItemClickListener { _, _, position ->
|
||||||
|
val item = getItem(position)
|
||||||
|
ChatActivity.start(item.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
addChildClickViewIds(R.id.top_container_left_top)
|
||||||
setOnItemChildClickListener { _, _, position ->
|
setOnItemChildClickListener { _, _, position ->
|
||||||
val item = getItem(position)
|
val item = getItem(position)
|
||||||
// TODO - goto
|
ChatActivity.start(item.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
app:tag_shrink_drawable="@mipmap/tag_flow_shrink" />
|
app:tag_shrink_drawable="@mipmap/tag_flow_shrink" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/actors_rv"
|
android:id="@+id/m_actors_rv"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
|
|
||||||
|
|
@ -240,4 +240,11 @@
|
||||||
<item name="cornerSizeBottomRight">25dp</item>
|
<item name="cornerSizeBottomRight">25dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<style name="AppTheme.Launcher" parent="AppTheme">
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowDisablePreview">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue