move mainactivity to root package

This commit is contained in:
2023-07-14 19:37:46 +03:00
parent 4b84275f3a
commit 9e582d3788
4 changed files with 39 additions and 14 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
android:theme="@style/NPSTheme"
android:usesCleartextTraffic="true">
<activity
android:name=".activities.MainActivity"
android:name=".MainActivity"
android:configChanges="screenSize|screenLayout|keyboardHidden|orientation"
android:exported="true"
android:theme="@style/NPSTheme.Splash"
@@ -1,4 +1,4 @@
package com.illusionware.npsbrowser.activities
package com.illusionware.npsbrowser
import android.os.Bundle
import androidx.activity.ComponentActivity
@@ -28,6 +28,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Downloading
import androidx.compose.material.icons.filled.GridView
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.Settings
@@ -84,8 +85,6 @@ import androidx.navigation.compose.rememberNavController
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.illusionware.npsbrowser.R
import com.illusionware.npsbrowser.Routes
import com.illusionware.npsbrowser.data.ItemLayout
import com.illusionware.npsbrowser.data.SettingsPreferences
import com.illusionware.npsbrowser.model.ConsoleType
@@ -283,17 +282,29 @@ fun HomePage(
tooltip = stringResource(id = R.string.layout),
onClick = { layoutDialogOpen = true }
) {
Icon(imageVector = if (settingsPrefs.layout == ItemLayout.GRID.ordinal) Icons.Filled.GridView else Icons.Filled.ViewList, contentDescription = stringResource(
id = R.string.layout
))
Icon(
imageVector = if (settingsPrefs.layout == ItemLayout.GRID.ordinal) Icons.Filled.GridView else Icons.Filled.ViewList,
contentDescription = stringResource(
id = R.string.layout
)
)
}
NPSIconButton(
tooltip = "Download queue",
onClick = { /*TODO*/ }
) {
Icon(imageVector = Icons.Filled.Downloading, contentDescription = "Download queue")
}
NPSIconButton(
tooltip = stringResource(id = R.string.title_activity_settings),
onClick = { navigateToSettings() }
){
Icon(imageVector = Icons.Filled.Settings, contentDescription = stringResource(
id = R.string.title_activity_settings
))
Icon(
imageVector = Icons.Filled.Settings,
contentDescription = stringResource(
id = R.string.title_activity_settings
)
)
}
}
)
@@ -64,7 +64,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.illusionware.npsbrowser.R
import com.illusionware.npsbrowser.activities.PlaceholderColor
import com.illusionware.npsbrowser.PlaceholderColor
import com.illusionware.npsbrowser.data.ItemLayout
import com.illusionware.npsbrowser.data.SettingsPreferences
import com.illusionware.npsbrowser.data.Theme
@@ -24,7 +24,9 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.outlined.ArrowDropDown
import androidx.compose.material.icons.outlined.ExpandMore
import androidx.compose.material.icons.outlined.FileDownload
import androidx.compose.material.icons.outlined.Palette
import androidx.compose.material.icons.outlined.Unarchive
@@ -44,6 +46,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
@@ -116,7 +119,6 @@ fun SettingsScreen(
Pkg2Zip(viewModel, prefs)
}
}
}
}
@@ -184,7 +186,7 @@ fun TsvFiles(viewModel: SettingsViewModel, prefs: SettingsPreferences) {
DialogSetting(
title = "Expand",
value = "PS3 DLC, PSP Games, PSP DLC, PSX Games, PSM Games",
icon = Icons.Outlined.ArrowDropDown,
icon = Icons.Outlined.ExpandMore,
singleLine = true,
onClick = { expanded = true },
)
@@ -515,7 +517,19 @@ fun ToggleSetting(title: String, icon: ImageVector? = null, checked: Boolean, on
Box(modifier = Modifier.width(56.dp))
}
Text(text = title, color = MaterialTheme.colorScheme.onBackground, modifier = Modifier.weight(1.0f))
Switch(checked = checked, onCheckedChange = null)
Switch(
checked = checked,
onCheckedChange = null,
thumbContent = if (checked) {
{
Icon(
imageVector = Icons.Default.Check,
contentDescription = null,
modifier = Modifier.size(16.dp)
)
}
} else null
)
}
}
}