Skip to content
Snippets Groups Projects
Verified Commit 5f94d490 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: skeleton

parent 371c2833
Branches
Tags
No related merge requests found
Showing
with 1008 additions and 0 deletions
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
[{*.mod, *.dtd, *.ent, *.elt}]
indent_style = space
indent_size = 2
[{*.jhm, *.rng, *.wsdl, *.fxml, *.xslt, *.jrxml, *.ant, *.xul, *.xsl, *.xsd, *.tld, *.jnlp, *.xml}]
indent_style = space
indent_size = 2
[*.json]
indent_style = space
indent_size = 2
[*.java]
indent_style = space
indent_size = 2
[{*.kts, *.kt}]
indent_style = space
indent_size = 2
[{*.yml, *.yaml}]
indent_style = space
indent_size = 2
*.iml
.gradle
/local.properties
/signing.properties
/.idea/*
!/.idea/copyright/
.DS_Store
/captures
build/
/reports/
/persistence/schemas/
<component name="CopyrightManager">
<copyright>
<option name="notice" value="The MIT License (MIT)&#10;&#10;Copyright (c) 2013-&amp;#36;today.year Chaosdorf e.V.&#10;&#10;Permission is hereby granted, free of charge, to any person obtaining a copy&#10;of this software and associated documentation files (the &quot;Software&quot;), to deal&#10;in the Software without restriction, including without limitation the rights&#10;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&#10;copies of the Software, and to permit persons to whom the Software is&#10;furnished to do so, subject to the following conditions:&#10;&#10;The above copyright notice and this permission notice shall be included in&#10;all copies or substantial portions of the Software.&#10;&#10;THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&#10;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&#10;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&#10;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&#10;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&#10;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN&#10;THE SOFTWARE." />
<option name="myName" value="Meteroid" />
</copyright>
</component>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="Meteroid" />
</component>
\ No newline at end of file
[![Build Status](https://travis-ci.org/chaosdorf/meteroid.svg?branch=master)](https://travis-ci.org/chaosdorf/meteroid)
![logo](/metadata/en-US/images/featureGraphic.png)
### What
Small Android application to use with mete, the Matekasse of Chaosdorf.
### Where
* [Chaosdorf Wiki](https://wiki.chaosdorf.de/Meteroid)
* [Google Play](https://play.google.com/store/apps/details?id=de.chaosdorf.meteroid2)
* [F-Droid](https://f-droid.org/repository/browse/?fdid=de.chaosdorf.meteroid)
* [apk](https://github.com/chaosdorf/meteroid/releases/)
### How does it look?
![the main screen](/metadata/en-US/images/phoneScreenshots/1.png)
![adding an account](/metadata/en-US/images/phoneScreenshots/2.png)
![your logs](/metadata/en-US/images/phoneScreenshots/3.png)
### License
The MIT License (MIT)
Copyright (c) 2013-2016 Chaosdorf e.V.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
### Privacy
The meteroid app stores a few things permanently on your device
("permanently" meaning, until you uninstall the app or clear its data):
* the URL of your chosen mete instance
* your user ID (just a number that identifies you)
* your last five used items
Additionally, some data may be cached temporarily:
* your avatar
* the avatars of other users
* the images of drinks
The rest of the data is kept in your mete instance. Please check its terms
and make sure you trust its operators:
* your chosen name (this can just be a nickname)
* your e-mail address (optional)
* your usage history (optional)
@file:Suppress("UnstableApiUsage")
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2019 Janne Mareike Koschinski
* Copyright (c) 2019 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
plugins {
id("justjanne.android.app")
}
android {
namespace = "de.chaosdorf.meteroid"
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
}
getByName("debug") {
applicationIdSuffix = ".debug"
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}
}
dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.kotlin.test)
testImplementation(libs.junit.api)
testImplementation(libs.junit.params)
testRuntimeOnly(libs.junit.engine)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.appcompat.resources)
implementation(libs.androidx.activity)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.compiler)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material.icons)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.navigation.compose)
debugImplementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.ui.preview)
testImplementation(libs.androidx.compose.ui.test)
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/lib/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# The project is open source anyway, obfuscation is useless.
-dontobfuscate
# remove unnecessary warnings
# Android HTTP Libs
-dontnote android.net.http.**
-dontnote org.apache.http.**
# Kotlin stuff
-dontnote kotlin.**
# Gson
-dontnote com.google.gson.**
# Dagger
-dontwarn com.google.errorprone.annotations.*
# Retrofit
-dontwarn retrofit2.**
# Annotation used by Retrofit on Java 8 VMs
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-dontwarn javax.annotation.concurrent.GuardedBy
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
# Okio
-dontwarn okio.**
-dontwarn org.conscrypt.**
# OkHttp3
-dontwarn okhttp3.**
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.chaosdorf.meteroid">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/application_name"
android:supportsRtl="true"
android:theme="@style/Theme.Meteroid"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/application_name"
android:theme="@style/Theme.Meteroid">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.ui.Modifier
import androidx.navigation.compose.rememberNavController
import de.chaosdorf.meteroid.ui.MeteroidBottomBar
import de.chaosdorf.meteroid.ui.MeteroidRouter
import de.chaosdorf.meteroid.ui.theme.MeteroidTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val navController = rememberNavController()
MeteroidTheme {
Scaffold(
bottomBar = { MeteroidBottomBar(navController) }
) { padding: PaddingValues ->
MeteroidRouter(
navController,
modifier = Modifier.padding(padding)
)
}
}
}
}
}
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.icons
object MeteroidIcons {
object Outlined
object Filled
object TwoTone
}
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.icons.filled
import androidx.compose.material.icons.materialPath
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import de.chaosdorf.meteroid.icons.MeteroidIcons
public val MeteroidIcons.Filled.WaterFull: ImageVector
get() {
if (_waterFull != null) {
return _waterFull!!
}
_waterFull = ImageVector.Builder(
name = "Filled.WaterFull",
defaultWidth = 24f.dp,
defaultHeight = 24f.dp,
viewportWidth = 960f,
viewportHeight = 960f
).apply {
materialPath {
moveTo(211f, 357f)
quadTo(262f, 325f, 322.5f, 308f)
quadTo(383f, 291f, 444f, 290f)
quadTo(474f, 290f, 503.5f, 294f)
quadTo(533f, 298f, 560f, 306f)
quadTo(611.13f, 320f, 638.23f, 325f)
quadTo(665.32f, 330f, 696f, 330f)
lineTo(752f, 330f)
lineTo(773f, 140f)
lineTo(187f, 140f)
lineTo(211f, 357f)
close()
moveTo(262f, 880f)
quadTo(238.75f, 880f, 221.5f, 865.07f)
quadTo(204.25f, 850.14f, 202f, 827f)
lineTo(120f, 80f)
lineTo(840f, 80f)
lineTo(758f, 827f)
quadTo(755.75f, 850.14f, 738.5f, 865.07f)
quadTo(721.25f, 880f, 698f, 880f)
lineTo(262f, 880f)
close()
moveTo(444f, 820f)
quadTo(470f, 820f, 494.5f, 820f)
quadTo(519f, 820f, 544f, 820f)
quadTo(598f, 820f, 629f, 820f)
quadTo(660f, 820f, 697f, 820f)
lineTo(697f, 820f)
lineTo(697f, 820f)
quadTo(697f, 820f, 697f, 820f)
quadTo(697f, 820f, 697f, 820f)
lineTo(262f, 820f)
quadTo(262f, 820f, 262f, 820f)
quadTo(262f, 820f, 262f, 820f)
lineTo(262f, 820f)
quadTo(277.67f, 820f, 330.83f, 820f)
quadTo(384f, 820f, 444f, 820f)
close()
}
}.build()
return _waterFull!!
}
private var _waterFull: ImageVector? = null
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.icons.outlined
import androidx.compose.material.icons.materialPath
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import de.chaosdorf.meteroid.icons.MeteroidIcons
public val MeteroidIcons.Outlined.WaterFull: ImageVector
get() {
if (_waterFull != null) {
return _waterFull!!
}
_waterFull = ImageVector.Builder(
name = "Outlined.WaterFull",
defaultWidth = 24f.dp,
defaultHeight = 24f.dp,
viewportWidth = 960f,
viewportHeight = 960f
).apply {
materialPath {
moveTo(444f, 350f)
quadTo(384f, 350f, 325f, 369.5f)
quadTo(266f, 389f, 218f, 424f)
lineTo(262f, 820f)
quadTo(262f, 820f, 262f, 820f)
quadTo(262f, 820f, 262f, 820f)
lineTo(698f, 820f)
quadTo(698f, 820f, 698f, 820f)
quadTo(698f, 820f, 698f, 820f)
lineTo(745f, 390f)
lineTo(697f, 390f)
quadTo(659.75f, 390f, 628.88f, 384.5f)
quadTo(598f, 379f, 544f, 364f)
quadTo(519f, 357f, 494.5f, 353.5f)
quadTo(470f, 350f, 444f, 350f)
close()
moveTo(211f, 357f)
quadTo(262f, 325f, 322.5f, 308f)
quadTo(383f, 291f, 444f, 290f)
quadTo(474f, 290f, 503.5f, 294f)
quadTo(533f, 298f, 560f, 306f)
quadTo(611.13f, 320f, 638.23f, 325f)
quadTo(665.32f, 330f, 696f, 330f)
lineTo(752f, 330f)
lineTo(773f, 140f)
lineTo(187f, 140f)
lineTo(211f, 357f)
close()
moveTo(262f, 880f)
quadTo(238.75f, 880f, 221.5f, 865.07f)
quadTo(204.25f, 850.14f, 202f, 827f)
lineTo(120f, 80f)
lineTo(840f, 80f)
lineTo(758f, 827f)
quadTo(755.75f, 850.14f, 738.5f, 865.07f)
quadTo(721.25f, 880f, 698f, 880f)
lineTo(262f, 880f)
close()
moveTo(444f, 820f)
quadTo(470f, 820f, 494.5f, 820f)
quadTo(519f, 820f, 544f, 820f)
quadTo(598f, 820f, 629f, 820f)
quadTo(660f, 820f, 697f, 820f)
lineTo(697f, 820f)
lineTo(697f, 820f)
quadTo(697f, 820f, 697f, 820f)
quadTo(697f, 820f, 697f, 820f)
lineTo(262f, 820f)
quadTo(262f, 820f, 262f, 820f)
quadTo(262f, 820f, 262f, 820f)
lineTo(262f, 820f)
quadTo(277.67f, 820f, 330.83f, 820f)
quadTo(384f, 820f, 444f, 820f)
close()
}
}.build()
return _waterFull!!
}
private var _waterFull: ImageVector? = null
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.icons.twotone
import androidx.compose.material.icons.materialPath
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import de.chaosdorf.meteroid.icons.MeteroidIcons
public val MeteroidIcons.TwoTone.WaterFull: ImageVector
get() {
if (_waterFull != null) {
return _waterFull!!
}
_waterFull = ImageVector.Builder(
name = "TwoTone.WaterFull",
defaultWidth = 24f.dp,
defaultHeight = 24f.dp,
viewportWidth = 960f,
viewportHeight = 960f
).apply {
materialPath {
moveTo(444f, 350f)
quadTo(384f, 350f, 325f, 369.5f)
quadTo(266f, 389f, 218f, 424f)
lineTo(262f, 820f)
quadTo(262f, 820f, 262f, 820f)
quadTo(262f, 820f, 262f, 820f)
lineTo(698f, 820f)
quadTo(698f, 820f, 698f, 820f)
quadTo(698f, 820f, 698f, 820f)
lineTo(745f, 390f)
lineTo(697f, 390f)
quadTo(659.75f, 390f, 628.88f, 384.5f)
quadTo(598f, 379f, 544f, 364f)
quadTo(519f, 357f, 494.5f, 353.5f)
quadTo(470f, 350f, 444f, 350f)
close()
moveTo(211f, 357f)
quadTo(262f, 325f, 322.5f, 308f)
quadTo(383f, 291f, 444f, 290f)
quadTo(474f, 290f, 503.5f, 294f)
quadTo(533f, 298f, 560f, 306f)
quadTo(611.13f, 320f, 638.23f, 325f)
quadTo(665.32f, 330f, 696f, 330f)
lineTo(752f, 330f)
lineTo(773f, 140f)
lineTo(187f, 140f)
lineTo(211f, 357f)
close()
moveTo(262f, 880f)
quadTo(238.75f, 880f, 221.5f, 865.07f)
quadTo(204.25f, 850.14f, 202f, 827f)
lineTo(120f, 80f)
lineTo(840f, 80f)
lineTo(758f, 827f)
quadTo(755.75f, 850.14f, 738.5f, 865.07f)
quadTo(721.25f, 880f, 698f, 880f)
lineTo(262f, 880f)
close()
moveTo(444f, 820f)
quadTo(470f, 820f, 494.5f, 820f)
quadTo(519f, 820f, 544f, 820f)
quadTo(598f, 820f, 629f, 820f)
quadTo(660f, 820f, 697f, 820f)
lineTo(697f, 820f)
lineTo(697f, 820f)
quadTo(697f, 820f, 697f, 820f)
quadTo(697f, 820f, 697f, 820f)
lineTo(262f, 820f)
quadTo(262f, 820f, 262f, 820f)
quadTo(262f, 820f, 262f, 820f)
lineTo(262f, 820f)
quadTo(277.67f, 820f, 330.83f, 820f)
quadTo(384f, 820f, 444f, 820f)
close()
}
materialPath(fillAlpha = 0.3f, strokeAlpha = 0.3f) {
moveTo(444f, 350f)
quadTo(384f, 350f, 325f, 369.5f)
quadTo(266f, 389f, 218f, 424f)
lineTo(262f, 820f)
quadTo(262f, 820f, 262f, 820f)
quadTo(262f, 820f, 262f, 820f)
lineTo(698f, 820f)
quadTo(698f, 820f, 698f, 820f)
quadTo(698f, 820f, 698f, 820f)
lineTo(745f, 390f)
lineTo(697f, 390f)
quadTo(659.75f, 390f, 628.88f, 384.5f)
quadTo(598f, 379f, 544f, 364f)
quadTo(519f, 357f, 494.5f, 353.5f)
quadTo(470f, 350f, 444f, 350f)
close()
}
}.build()
return _waterFull!!
}
private var _waterFull: ImageVector? = null
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.ui
import androidx.compose.material3.Icon
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.navigation.NavController
import androidx.navigation.NavDestination.Companion.hierarchy
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.currentBackStackEntryAsState
@Composable
fun MeteroidBottomBar(navController: NavController) {
val screens = listOf(Screen.Drinks, Screen.Users)
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentDestination = navBackStackEntry?.destination
NavigationBar {
for (screen in screens) {
val selected = currentDestination?.hierarchy?.any {
it.route == screen.route
} == true
NavigationBarItem(
label = { Text(screen.label) },
icon = {
Icon(
if (selected) screen.selectedIcon
else screen.icon,
screen.label
)
},
selected = selected,
onClick = {
navController.navigate(screen.route) {
// Pop up to the start destination of the graph to
// avoid building up a large stack of destinations
// on the back stack as users select items
popUpTo(navController.graph.findStartDestination().id) {
saveState = true
}
// Avoid multiple copies of the same destination when
// reselecting the same item
launchSingleTop = true
// Restore state when reselecting a previously selected item
restoreState = true
}
}
)
}
}
}
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.ui
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
@Composable
fun MeteroidRouter(
navController: NavHostController,
modifier: Modifier = Modifier
) {
NavHost(
navController,
modifier = modifier,
startDestination = Screen.Drinks.route,
) {
composable(Screen.Users.route) { Text("Userlist") }
composable(Screen.Drinks.route) { Text("Drinklist") }
}
}
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.ui
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Person
import androidx.compose.material.icons.twotone.Person
import androidx.compose.ui.graphics.vector.ImageVector
import de.chaosdorf.meteroid.icons.MeteroidIcons
import de.chaosdorf.meteroid.icons.outlined.WaterFull
import de.chaosdorf.meteroid.icons.twotone.WaterFull
sealed class Screen(
val label: String,
val route: String,
val icon: ImageVector,
val selectedIcon: ImageVector = icon
) {
object Drinks : Screen(
"Drinks",
"drinks",
MeteroidIcons.Outlined.WaterFull,
MeteroidIcons.TwoTone.WaterFull
)
object Users : Screen(
"Users",
"users",
Icons.Outlined.Person,
Icons.TwoTone.Person
)
}
package de.chaosdorf.meteroid.ui.theme
import androidx.compose.ui.graphics.Color
val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
\ No newline at end of file
/*
* The MIT License (MIT)
*
* Copyright (c) 2013-2023 Chaosdorf e.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package de.chaosdorf.meteroid.ui.theme
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
private val DarkColorScheme = darkColorScheme(
primary = Purple80,
secondary = PurpleGrey80,
tertiary = Pink80
)
private val LightColorScheme = lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)
@Composable
fun MeteroidTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}
MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content
)
}
package de.chaosdorf.meteroid.ui.theme
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
)
\ No newline at end of file
app/src/main/res/mipmap-xxhdpi/ic_launcher.png

9.69 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment