Skip to content

Commit

Permalink
Rename stuff
Browse files Browse the repository at this point in the history
- no more childish "my..." names
- reduced the usage of app name
  • Loading branch information
sadellie committed Jan 20, 2024
1 parent 27620e8 commit e90c30a
Show file tree
Hide file tree
Showing 69 changed files with 903 additions and 903 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -35,7 +35,7 @@ import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.sadellie.unitto.core.ui.common.UnittoNavigationDrawer
import com.sadellie.unitto.core.ui.common.NavigationDrawer
import com.sadellie.unitto.core.ui.common.rememberDrawerState
import com.sadellie.unitto.core.ui.model.DrawerItem
import com.sadellie.unitto.core.ui.pushDynamicShortcut
Expand All @@ -48,7 +48,7 @@ import io.github.sadellie.themmo.ThemmoController
import kotlinx.coroutines.launch

@Composable
internal fun UnittoApp(prefs: AppPreferences?) {
internal fun App(prefs: AppPreferences?) {

val mContext = LocalContext.current
val navController = rememberNavController()
Expand Down Expand Up @@ -88,7 +88,7 @@ internal fun UnittoApp(prefs: AppPreferences?) {
val backgroundColor = MaterialTheme.colorScheme.background
val useDarkIcons = remember(backgroundColor) { backgroundColor.luminance() > 0.5f }

UnittoNavigationDrawer(
NavigationDrawer(
modifier = Modifier,
state = drawerState,
gesturesEnabled = gesturesEnabled,
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/sadellie/unitto/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2022-2022 Elshan Agaev
* Copyright (c) 2022-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -71,7 +71,7 @@ internal class MainActivity : AppCompatActivity() {
LocalWindowSize provides calculateWindowSizeClass(this@MainActivity),
LocalNumberTypography provides numbersTypography
) {
UnittoApp(prefs)
App(prefs)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,7 +40,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color

@Composable
fun UnittoButton(
fun Button(
modifier: Modifier = Modifier,
onClick: () -> Unit,
onLongClick: (() -> Unit)? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -28,7 +28,7 @@ import androidx.compose.ui.res.stringResource
import com.sadellie.unitto.core.ui.model.DrawerItem

@Composable
internal fun UnittoDrawerItem(
internal fun DrawerItem(
modifier: Modifier = Modifier,
destination: DrawerItem,
icon: ImageVector,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -24,6 +24,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

@Composable
fun UnittoEmptyScreen() {
fun EmptyScreen() {
Spacer(modifier = Modifier.fillMaxSize())
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2022-2022 Elshan Agaev
* Copyright (c) 2022-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -44,7 +44,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

@Composable
fun UnittoListItem(
fun ListItem(
modifier: Modifier = Modifier,
headlineContent: @Composable () -> Unit,
supportingContent: @Composable (() -> Unit)? = null,
Expand Down Expand Up @@ -90,14 +90,14 @@ fun UnittoListItem(
}

@Composable
fun UnittoListItem(
fun ListItem(
modifier: Modifier = Modifier,
headlineText: String,
supportingText: String? = null,
icon: ImageVector,
iconDescription: String = headlineText,
trailing: @Composable (() -> Unit)? = null,
) = UnittoListItem(
) = ListItem(
modifier = modifier,
headlineContent = { Text(headlineText) },
supportingContent = supportingText?.let { { Text(it) } },
Expand All @@ -113,15 +113,15 @@ fun UnittoListItem(
)

@Composable
fun UnittoListItem(
fun ListItem(
modifier: Modifier = Modifier,
headlineText: String,
icon: ImageVector,
iconDescription: String = headlineText,
supportingText: String? = null,
switchState: Boolean,
onSwitchChange: (Boolean) -> Unit
) = UnittoListItem(
) = ListItem(
modifier = modifier
.clickable(
interactionSource = remember { MutableInteractionSource() },
Expand All @@ -143,9 +143,9 @@ fun UnittoListItem(

@Preview
@Composable
fun PreviewUnittoListItem1() {
fun PreviewListItem1() {
Column {
UnittoListItem(
ListItem(
modifier = Modifier,
headlineContent = { Text("Headline") },
supportingContent = { Text("Support") },
Expand All @@ -157,15 +157,15 @@ fun PreviewUnittoListItem1() {
},
)

UnittoListItem(
ListItem(
modifier = Modifier,
headlineContent = { Text("Headline") },
leadingContent = {
RadioButton(selected = false, onClick = {})
},
)

UnittoListItem(
ListItem(
icon = Icons.Default.Home,
headlineText = "Text text",
supportingText = "Support text support text support text support text",
Expand All @@ -174,7 +174,7 @@ fun PreviewUnittoListItem1() {
iconDescription = ""
)

UnittoListItem(
ListItem(
icon = Icons.Default.Home,
headlineText = "Text text",
supportingText = "Support text support text support text support text",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -107,7 +107,7 @@ fun rememberDrawerState(
}

@Composable
fun UnittoNavigationDrawer(
fun NavigationDrawer(
modifier: Modifier,
gesturesEnabled: Boolean,
state: DrawerState = rememberDrawerState(),
Expand Down Expand Up @@ -275,7 +275,7 @@ private fun PreviewUnittoModalNavigationDrawerClose() {
val corScope = rememberCoroutineScope()
val drawerState = rememberDrawerState(DrawerValue.Open)

UnittoNavigationDrawer(
NavigationDrawer(
modifier = Modifier,
state = drawerState,
gesturesEnabled = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2022 Elshan Agaev
* Copyright (c) 2022-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,7 +37,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
* @param content See [Scaffold]
*/
@Composable
fun UnittoScreenWithLargeTopBar(
fun ScaffoldWithLargeTopBar(
title: String,
navigationIcon: @Composable () -> Unit,
actions: @Composable RowScope.() -> Unit = {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2022 Elshan Agaev
* Copyright (c) 2022-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,11 +31,11 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.TopAppBarColors
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.TopAppBarScrollBehavior
import com.sadellie.unitto.core.ui.WindowHeightSizeClass
import com.sadellie.unitto.core.ui.WindowWidthSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.sadellie.unitto.core.ui.LocalWindowSize
import com.sadellie.unitto.core.ui.WindowHeightSizeClass
import com.sadellie.unitto.core.ui.WindowWidthSizeClass

/**
* Template screen. Uses [Scaffold] and [CenterAlignedTopAppBar]
Expand All @@ -50,7 +50,7 @@ import com.sadellie.unitto.core.ui.LocalWindowSize
* @param content See [Scaffold]
*/
@Composable
fun UnittoScreenWithTopBar(
fun ScaffoldWithTopBar(
modifier: Modifier = Modifier,
title: @Composable () -> Unit,
navigationIcon: @Composable () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -76,7 +76,7 @@ import com.sadellie.unitto.core.base.R
import kotlin.math.roundToInt

@Composable
fun UnittoSearchBar(
fun SearchBar(
modifier: Modifier = Modifier,
query: TextFieldValue,
onQueryChange: (TextFieldValue) -> Unit,
Expand Down Expand Up @@ -255,7 +255,7 @@ private object UnittoSearchBarTokens {
@Preview
@Composable
fun UnittoSearchBarPreview() {
UnittoSearchBar(
SearchBar(
query = TextFieldValue("test"),
onQueryChange = {},
navigateUp = {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -81,7 +81,7 @@ internal fun ColumnScope.SheetContent(

tabs.forEach { drawerItem ->
val selected = drawerItem.start == currentDestination
UnittoDrawerItem(
DrawerItem(
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding),
destination = drawerItem,
icon = if (selected) drawerItem.selectedIcon else drawerItem.defaultIcon,
Expand All @@ -94,7 +94,7 @@ internal fun ColumnScope.SheetContent(
if (LocalWindowSize.current.heightSizeClass == WindowHeightSizeClass.Compact) {
HorizontalDivider(Modifier.padding(horizontal = 12.dp, vertical = 8.dp))

UnittoDrawerItem(
DrawerItem(
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding),
destination = DrawerItem.Settings,
icon = DrawerItem.Settings.defaultIcon,
Expand All @@ -106,7 +106,7 @@ internal fun ColumnScope.SheetContent(

@Preview
@Composable
private fun PreviewUnittoDrawerSheet() {
private fun PreviewDrawerSheet() {
Column {
SheetContent(
tabs = listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2023 Elshan Agaev
* Copyright (c) 2023-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -51,7 +51,7 @@ import kotlin.math.ceil
import kotlin.math.roundToInt

@Composable
fun UnittoSlider(
fun Slider(
modifier: Modifier = Modifier,
value: Float,
valueRange: ClosedFloatingPointRange<Float>,
Expand Down Expand Up @@ -162,7 +162,7 @@ private fun SquigglyTrack(
private fun PreviewNewSlider() {
var currentValue by remember { mutableFloatStateOf(9f) }

UnittoSlider(
com.sadellie.unitto.core.ui.common.Slider(
value = currentValue,
valueRange = 0f..16f,
onValueChange = { currentValue = it }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Unitto is a unit converter for Android
* Copyright (c) 2022-2022 Elshan Agaev
* Copyright (c) 2022-2024 Elshan Agaev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +23,7 @@ package com.sadellie.unitto.data.converter
*
* NEVER CHANGE IDS THAT ARE ALREADY HERE, THESE IDS ARE USED IN DATABASE
*/
object MyUnitIDS {
object UnitID {
// LENGTH
const val attometer = "attometer"
const val nanometer = "nanometer"
Expand Down
Loading

0 comments on commit e90c30a

Please sign in to comment.