Skip to content

Commit

Permalink
Merge pull request #71 from TimPushkin/codestyle
Browse files Browse the repository at this point in the history
Improve codestyle
  • Loading branch information
TimPushkin authored Jun 28, 2023
2 parents 2243702 + e8c73d9 commit 1ce2ea9
Show file tree
Hide file tree
Showing 45 changed files with 55 additions and 51 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# DepNav – Department Navigator

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c24bf04feb8840ebb9a6fea2f0389020)](https://www.codacy.com/gh/TimPushkin/DepNav/dashboard?utm_source=github.com&utm_medium=referral&utm_content=TimPushkin/DepNav&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bc683c7328e847a49fe41f69b21a41b1)](https://app.codacy.com/gh/TimPushkin/DepNav/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Known Vulnerabilities](https://snyk.io/test/github/TimPushkin/DepNav/badge.svg)](https://snyk.io/test/github/TimPushkin/DepNav)

**DepNav** is an Android application for viewing indoor maps of departments and searching for
Expand Down Expand Up @@ -35,6 +35,7 @@ The following download sources are available:
or [AppGallery](https://appgallery.cloud.huawei.com/ag/n/app/C106717783?channelId=GitHub+repository&id=05d3f9cea9c44d829cd43b9f79593c88&s=A358D75497B3480E158A47713DE08E03B4047FD6FD5F2DA45C7AF9D9B5410F64&detailType=0&v=&callType=AGDLINK&installType=0000)
(**recommended**) – install DepNav from app stores and receive its updates automatically

- [APK](https://github.com/TimPushkin/DepNav/releases) – download, install, and update DepNav manually
- [APK](https://github.com/TimPushkin/DepNav/releases) – download, install, and update DepNav
manually

Android 5.0 or newer required.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@ -18,7 +18,7 @@

@file:Suppress(
"MethodOverloading", // Overloading insertAll for different tables
"TooManyFunctions" // All these function belong together
"TooManyFunctions" // All these functions belong together
)

package ru.spbu.depnav.data.db
Expand All @@ -37,10 +37,8 @@ private fun MarkerText.values() = listOf(markerId, languageId.name, title, descr

@Suppress("ComplexMethod") // Further "simplification" is unreasonable
private fun createContentValues(columnNames: Array<String>, values: List<Any?>): ContentValues {
if (columnNames.size != values.size) {
throw IllegalArgumentException(
"Expected ${columnNames.size} values, but was ${values.size}"
)
require(columnNames.size == values.size) {
"Expected ${columnNames.size} values, but was ${values.size}"
}
return ContentValues().apply {
for ((col, v) in columnNames.zip(values)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/DepNavApplication.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/db/AppDatabase.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/db/DatabaseModule.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/db/MapInfoDao.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/model/MapInfo.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/model/Marker.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/model/MarkerText.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/NavDestination.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
3 changes: 2 additions & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/FloorSwitch.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@ -98,6 +98,7 @@ fun FloorSwitch(

@Preview
@Composable
@Suppress("UnusedPrivateMember")
private fun FloorSwitchPreview() {
DepNavTheme {
FloorSwitch(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/MapLegendDialog.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2023 Timofey Pushkin
* Copyright (C) 2023 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/MapScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/MarkerInfoLines.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
6 changes: 5 additions & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/MarkerView.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@ -151,6 +151,7 @@ private fun RoomName(name: String, lineTrough: Boolean, modifier: Modifier = Mod

@Preview
@Composable
@Suppress("UnusedPrivateMember")
private fun MarkerIconPreview() {
DepNavTheme {
MarkerView(
Expand All @@ -163,6 +164,7 @@ private fun MarkerIconPreview() {

@Preview
@Composable
@Suppress("UnusedPrivateMember")
private fun MarkerIconClosedPreview() {
DepNavTheme {
MarkerView(
Expand All @@ -175,6 +177,7 @@ private fun MarkerIconClosedPreview() {

@Preview
@Composable
@Suppress("UnusedPrivateMember")
private fun RoomIconPreview() {
DepNavTheme(darkTheme = false) {
MarkerView(
Expand All @@ -187,6 +190,7 @@ private fun RoomIconPreview() {

@Preview
@Composable
@Suppress("UnusedPrivateMember")
private fun RoomIconClosedPreview() {
DepNavTheme {
MarkerView(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/Pin.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/SettingsDialog.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/TopButton.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/map/ZoomInHint.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/search/SearchField.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/search/SearchScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/theme/Color.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/utils/ranking/Bm25.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DepNav -- department navigator.
* Copyright (C) 2022 Timofey Pushkin
* Copyright (C) 2022 Timofei Pushkin
*
* 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
Loading

0 comments on commit 1ce2ea9

Please sign in to comment.