Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base class clenup #23

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ indent_size = 2
[*.{kt, kts, java}]
indent_size = 4
max_line_length = 120
ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,kotlinx.**,^
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
test:
name: Run unit tests & static analysis checks
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v1
Expand Down
31 changes: 31 additions & 0 deletions app/src/main/kotlin/androidx/lifecycle/ViewModelExt.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package androidx.lifecycle

import com.adesso.movee.base.FailureData
import com.adesso.movee.internal.util.Event
import com.adesso.movee.navigation.NavigationCommand

private const val KEY_NAVIGATION = "navigation"
private const val KEY_FAILURE_POPUP = "failure-popup"

private val ViewModel.navigationEvents: MutableLiveData<Event<NavigationCommand>>
get() {
return getTag(KEY_NAVIGATION) ?: setTagIfAbsent(KEY_NAVIGATION, MutableLiveData())
}

val ViewModel.navigation: LiveData<Event<NavigationCommand>>
get() = this.navigationEvents

private val ViewModel._failurePopup: MutableLiveData<Event<FailureData>>
get() {
return getTag(KEY_FAILURE_POPUP) ?: setTagIfAbsent(KEY_FAILURE_POPUP, MutableLiveData())
}
val ViewModel.failurePopup: MutableLiveData<Event<FailureData>>
get() = this._failurePopup

fun ViewModel.navigate(command: NavigationCommand) {
navigationEvents.value = Event(command)
}

fun ViewModel.setFailure(data: FailureData) {
_failurePopup.value = Event(data)
}
16 changes: 0 additions & 16 deletions app/src/main/kotlin/com/adesso/movee/base/BaseActivity.kt

This file was deleted.

17 changes: 0 additions & 17 deletions app/src/main/kotlin/com/adesso/movee/base/BaseBindingActivity.kt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.adesso.movee.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment

abstract class BaseBottomSheetFragment(private val contentLayoutId: Int) : BottomSheetDialogFragment() {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return if (contentLayoutId != 0) {
inflater.inflate(contentLayoutId, container, false)
} else null
}
}
154 changes: 0 additions & 154 deletions app/src/main/kotlin/com/adesso/movee/base/BaseFragment.kt

This file was deleted.

Loading
Loading