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