Skip to content

Commit

Permalink
修复找不到vm的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
linxiangcheer committed Mar 21, 2021
1 parent dbb0a84 commit 3e96058
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PlayVideoActivity : BaseActivity<FragmentPlayVideoBinding>() {

//点击某个分组监听事件
mBinding.listview.setOnGroupClickListener { parent, v, groupPosition, id ->
ToastUtils.showShort("你点击了${viewmodel.arrayLiveCourseDetails[groupPosition]}")
ToastUtils.showShort("你点击了${viewmodel.arrayLiveCourseDetails[groupPosition]?.title}")
false //true 屏蔽一级列表点击
}

Expand Down
1 change: 0 additions & 1 deletion login/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ if (singleModule.toBoolean()){
apply plugin: 'com.android.library'
}
apply from: '../dependencies.gradle'
apply plugin: 'kotlin-android'

android {
//from dependencies.gradle
Expand Down
3 changes: 2 additions & 1 deletion login/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:theme="@style/CommonTheme">
<activity
android:name=".ui.LoginActivity"
android:label="@string/modelu_name">
android:label="@string/modelu_name"
android:launchMode="singleTop">
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package login
import android.content.Context
import android.view.View
import androidx.databinding.ObservableField
import androidx.lifecycle.LiveData
import com.blankj.utilcode.util.ToastUtils
import com.cniao5.common.base.BaseViewModel
import login.net.LoginReqBody
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package login.net

import androidx.annotation.Keep
import androidx.room.ColumnInfo
import com.google.gson.annotations.SerializedName
import com.test.service.repo.UserInfo

/*
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {

override fun initView() {
super.initView()

mBinding.apply {
vm = viewModel
//左上角退出按钮点击事件
Expand Down
2 changes: 1 addition & 1 deletion login/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:hint="任意8位或以上的密码"
android:inputType="textPassword"
android:maxLength="20"
android:text="@={vm.obPassword}"
Expand Down
6 changes: 6 additions & 0 deletions study/src/main/java/com/cniao5/study/ui/StudiedAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.cniao5.study.ui
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.blankj.utilcode.util.ToastUtils
import com.cniao5.study.databinding.ItemCourseStudyBinding
import com.cniao5.study.net.StudiedRsp

Expand Down Expand Up @@ -48,6 +49,11 @@ class StudiedVH(private val binding: ItemCourseStudyBinding) : RecyclerView.View
binding.info = info
//把获取到的progress进度条数据给进度条 也可以用扩展函数app:progress_current实现
// binding.npbProgressItemStudy.progress = info.progress.toInt()

binding.card.setOnClickListener {
ToastUtils.showShort("点击了${info.name}")
}

binding.executePendingBindings()
}

Expand Down
1 change: 1 addition & 0 deletions study/src/main/java/com/cniao5/study/ui/StudyFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.databinding.ViewDataBinding
import com.blankj.utilcode.util.ToastUtils
import com.cniao5.common.base.BaseFragment
import com.cniao5.study.R
import com.cniao5.study.StudyViewModel
Expand Down
1 change: 1 addition & 0 deletions study/src/main/res/layout/item_course_study.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</data>

<androidx.cardview.widget.CardView
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
Expand Down

0 comments on commit 3e96058

Please sign in to comment.