Skip to content

Commit

Permalink
Standardize file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Super12138 committed Aug 14, 2024
1 parent 46b1747 commit 9fd6d41
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import cn.super12138.todo.utils.TextUtils
import cn.super12138.todo.utils.VibrationUtils
import cn.super12138.todo.utils.showToast
import cn.super12138.todo.utils.toEditable
import cn.super12138.todo.views.progress.ProgressFragmentViewModel
import cn.super12138.todo.views.todo.ToDoFragmentViewModel
import cn.super12138.todo.views.progress.ProgressViewModel
import cn.super12138.todo.views.todo.ToDoViewModel
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
Expand All @@ -25,8 +25,8 @@ import java.util.UUID
class ToDoBottomSheet : BottomSheetDialogFragment() {
private lateinit var binding: BottomSheetTodoBinding

private val progressViewModel: ProgressFragmentViewModel by viewModels({ requireActivity() })
private val todoViewModel: ToDoFragmentViewModel by viewModels({ requireActivity() })
private val progressViewModel: ProgressViewModel by viewModels({ requireActivity() })
private val todoViewModel: ToDoViewModel by viewModels({ requireActivity() })

private var editMode: Boolean = false
private var todoState: Int = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import cn.super12138.todo.databinding.FragmentProgressBinding


class ProgressFragment : Fragment() {
private val viewModel: ProgressFragmentViewModel by viewModels({ requireActivity() })
private val viewModel: ProgressViewModel by viewModels({ requireActivity() })
private lateinit var binding: FragmentProgressBinding

override fun onCreateView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import cn.super12138.todo.logic.Repository
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class ProgressFragmentViewModel : ViewModel() {
class ProgressViewModel : ViewModel() {
val totalCount: MutableLiveData<Int> = MutableLiveData()
val completeCount: MutableLiveData<Int> = MutableLiveData()
val remainCount: MutableLiveData<Int> = MutableLiveData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import cn.super12138.todo.logic.model.ToDo
import cn.super12138.todo.utils.VibrationUtils
import cn.super12138.todo.utils.showToast
import cn.super12138.todo.views.bottomsheet.ToDoBottomSheet
import cn.super12138.todo.views.progress.ProgressFragmentViewModel
import cn.super12138.todo.views.progress.ProgressViewModel

class ToDoAdapter(
private val todoList: MutableList<ToDo>,
Expand Down Expand Up @@ -48,9 +48,9 @@ class ToDoAdapter(
}*/

val progressViewModel =
ViewModelProvider(viewModelStoreOwner)[ProgressFragmentViewModel::class.java]
ViewModelProvider(viewModelStoreOwner)[ProgressViewModel::class.java]
val todoViewModel =
ViewModelProvider(viewModelStoreOwner)[ToDoFragmentViewModel::class.java]
ViewModelProvider(viewModelStoreOwner)[ToDoViewModel::class.java]

holder.checkToDoBtn.setOnClickListener {
VibrationUtils.performHapticFeedback(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import cn.super12138.todo.databinding.FragmentTodoBinding
import cn.super12138.todo.logic.Repository
import cn.super12138.todo.utils.VibrationUtils
import cn.super12138.todo.views.bottomsheet.ToDoBottomSheet
import cn.super12138.todo.views.progress.ProgressFragmentViewModel
import cn.super12138.todo.views.progress.ProgressViewModel
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import kotlinx.coroutines.launch
import me.zhanghai.android.fastscroll.FastScrollerBuilder

class ToDoFragment : Fragment() {
private val progressViewModel: ProgressFragmentViewModel by viewModels({ requireActivity() })
private val todoViewModel: ToDoFragmentViewModel by viewModels({ requireActivity() })
private val progressViewModel: ProgressViewModel by viewModels({ requireActivity() })
private val todoViewModel: ToDoViewModel by viewModels({ requireActivity() })
private lateinit var binding: FragmentTodoBinding

override fun onCreateView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import cn.super12138.todo.logic.dao.ToDoRoom
import cn.super12138.todo.logic.model.ToDo
import kotlinx.coroutines.launch

class ToDoFragmentViewModel : ViewModel() {
class ToDoViewModel : ViewModel() {
val emptyTipVis = MutableLiveData<Int>(View.GONE)

val addData = MutableLiveData<Int>(0)
Expand Down

0 comments on commit 9fd6d41

Please sign in to comment.