Skip to content

Commit

Permalink
migrated package names
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Smithy-x committed Dec 11, 2023
1 parent f4edfda commit cc33d1b
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<activity
android:launchMode="singleInstance"
android:taskAffinity=""
android:name="io.vonley.mi.ui.compose.MainActivity"
android:name="io.vonley.mi.ui.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/vonley/mi/Mi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object Mi {
}
}

private val analytics: FirebaseAnalytics = Firebase.analytics
private val analytics: FirebaseAnalytics get() = Firebase.analytics

fun log(
event: MiEvent,
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/io/vonley/mi/MiApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.net.nsd.NsdManager.RegistrationListener
import android.net.nsd.NsdManager.ResolveListener
import android.net.nsd.NsdServiceInfo
import android.util.Log
import com.google.firebase.FirebaseApp
import dagger.hilt.android.HiltAndroidApp
import io.vonley.mi.extensions.e
import io.vonley.mi.intents.PSXService
Expand All @@ -17,6 +18,7 @@ class MiApplication : Application() {

override fun onCreate() {
super.onCreate()
FirebaseApp.initializeApp(this)
startService(Intent(this, PSXService::class.java))
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/vonley/mi/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import androidx.navigation.compose.rememberNavController
import dagger.hilt.android.AndroidEntryPoint
import io.vonley.mi.common.templates.nav.BottomNavigationBar
import io.vonley.mi.common.templates.nav.TopBar
import io.vonley.mi.ui.screens.*
import io.vonley.mi.ui.screens.consoles.presentation.ConsolesView
import io.vonley.mi.ui.screens.ftp.presentation.FTPView
import io.vonley.mi.ui.screens.home.HomeView
import io.vonley.mi.ui.screens.packages.presentation.RepositoryView
import io.vonley.mi.ui.screens.settings.SettingsView

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/vonley/mi/ui/TabItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package io.vonley.mi.ui

import androidx.compose.runtime.Composable
import io.vonley.mi.R
import io.vonley.mi.ui.screens.*
import io.vonley.mi.ui.screens.consoles.presentation.ConsolesView
import io.vonley.mi.ui.screens.ftp.presentation.FTPView
import io.vonley.mi.ui.screens.home.HomeView
import io.vonley.mi.ui.screens.packages.presentation.RepositoryView
import io.vonley.mi.ui.screens.settings.SettingsView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fun PreviewConsoleView() {
//ConsolesView()
val consoles = arrayOf(
Console(
ip = "192.168.11.45",
ip = "192.168.1.184",
name = "PS4",
type = PlatformType.PS4,
features = arrayListOf(
Expand All @@ -91,7 +91,7 @@ fun PreviewConsoleView() {
pinned = true
),
Console(
ip = "192.168.11.46",
ip = "192.168.11.185",
name = "PS3",
type = PlatformType.PS3,
features = arrayListOf(
Expand All @@ -102,7 +102,7 @@ fun PreviewConsoleView() {
pinned = true
),
Console(
ip = "192.168.11.47",
ip = "192.168.1.1",
name = "Unknown",
type = PlatformType.UNKNOWN,
features = arrayListOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import io.vonley.mi.ui.screens.consoles.domain.usecase.SelectConsoleUseCase
import io.vonley.mi.utils.SharedPreferenceManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
Expand All @@ -42,30 +43,28 @@ class ConsoleViewModel @Inject constructor(
}.onCompletion { error ->
if (error != null) {
"Error ${error.message}".e("ERROR", error)
_consoles.value = ConsoleState.Error("Unable to fetch consoles: ${error.message}")
_consoles.value =
ConsoleState.Error("Unable to fetch consoles: ${error.message}")
}
}.catch { error ->
"Error ${error.message}".e("ERROR", error)
_consoles.value = ConsoleState.Error("Unable to fetch consoles: ${error.message}")
}.launchIn(viewModelScope)
}

fun addConsole(input: String) {
addConsoleUseCase(input).onEach { console ->
fun addConsole(input: String) = viewModelScope.launch {
addConsoleUseCase(input).collect { console ->

}.launchIn(viewModelScope)
}
}

fun pin(client: Client) {
suspend {
addConsoleUseCase.pin(client.ip, true)
}.asFlow().launchIn(viewModelScope)

fun pin(client: Client) = viewModelScope.launch {
addConsoleUseCase.pin(client.ip, true)
}

fun unpin(client: Client) {
suspend {
addConsoleUseCase.pin(client.ip, false)
}.asFlow().launchIn(viewModelScope)
fun unpin(client: Client) = viewModelScope.launch {
addConsoleUseCase.pin(client.ip, false)
}

fun select(console: Console) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/vonley/mi/ui/screens/home/HomeView.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.vonley.mi.ui.screens
package io.vonley.mi.ui.screens.home

import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.Column
Expand Down

0 comments on commit cc33d1b

Please sign in to comment.