mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
remove old files
This commit is contained in:
parent
e7705c83ed
commit
e4bbdf1d1e
5 changed files with 0 additions and 224 deletions
|
|
@ -1,17 +0,0 @@
|
||||||
package com.geeksville.mesh.ui
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Track compose screen visibility
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
@Composable
|
|
||||||
fun analyticsScreen(name: String) {
|
|
||||||
onCommit(AppStatus.currentScreen) {
|
|
||||||
GeeksvilleApplication.analytics.sendScreenView(name)
|
|
||||||
|
|
||||||
onDispose {
|
|
||||||
GeeksvilleApplication.analytics.endScreenView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
|
|
@ -1,99 +0,0 @@
|
||||||
package com.geeksville.mesh.ui
|
|
||||||
|
|
||||||
/*
|
|
||||||
@Composable
|
|
||||||
fun AppDrawer(
|
|
||||||
currentScreen: ScreenInfo,
|
|
||||||
closeDrawer: () -> Unit
|
|
||||||
) {
|
|
||||||
Column(modifier = LayoutSize.Fill) {
|
|
||||||
Spacer(LayoutHeight(24.dp))
|
|
||||||
Row(modifier = LayoutPadding(16.dp)) {
|
|
||||||
VectorImage(
|
|
||||||
id = R.drawable.ic_launcher_new_foreground,
|
|
||||||
tint = MaterialTheme.colors.primary
|
|
||||||
)
|
|
||||||
Spacer(LayoutWidth(8.dp))
|
|
||||||
// VectorImage(id = R.drawable.ic_launcher_new_foreground)
|
|
||||||
}
|
|
||||||
Divider(color = Color(0x14333333))
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun ScreenButton(screen: ScreenInfo) {
|
|
||||||
DrawerButton(
|
|
||||||
icon = screen.icon,
|
|
||||||
label = screen.label,
|
|
||||||
isSelected = currentScreen == screen
|
|
||||||
) {
|
|
||||||
navigateTo(screen)
|
|
||||||
closeDrawer()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ScreenButton(Screen.messages)
|
|
||||||
ScreenButton(Screen.users)
|
|
||||||
ScreenButton(Screen.map) // turn off for now
|
|
||||||
ScreenButton(Screen.channel)
|
|
||||||
ScreenButton(Screen.settings)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun DrawerButton(
|
|
||||||
modifier: Modifier = Modifier.None,
|
|
||||||
@DrawableRes icon: Int,
|
|
||||||
label: String,
|
|
||||||
isSelected: Boolean,
|
|
||||||
action: () -> Unit
|
|
||||||
) {
|
|
||||||
val colors = MaterialTheme.colors
|
|
||||||
val textIconColor = if (isSelected) {
|
|
||||||
colors.primary
|
|
||||||
} else {
|
|
||||||
colors.onSurface.copy(alpha = 0.6f)
|
|
||||||
}
|
|
||||||
val backgroundColor = if (isSelected) {
|
|
||||||
colors.primary.copy(alpha = 0.12f)
|
|
||||||
} else {
|
|
||||||
colors.surface
|
|
||||||
}
|
|
||||||
|
|
||||||
Surface(
|
|
||||||
modifier = modifier + LayoutPadding(
|
|
||||||
start = 8.dp,
|
|
||||||
top = 8.dp,
|
|
||||||
end = 8.dp,
|
|
||||||
bottom = 0.dp
|
|
||||||
),
|
|
||||||
color = backgroundColor,
|
|
||||||
shape = RoundedCornerShape(4.dp)
|
|
||||||
) {
|
|
||||||
TextButton(onClick = action) {
|
|
||||||
Row {
|
|
||||||
VectorImage(
|
|
||||||
modifier = LayoutGravity.Center,
|
|
||||||
id = icon,
|
|
||||||
tint = textIconColor
|
|
||||||
)
|
|
||||||
Spacer(LayoutWidth(16.dp))
|
|
||||||
Text(
|
|
||||||
text = label,
|
|
||||||
style = (MaterialTheme.typography).body2.copy(
|
|
||||||
color = textIconColor
|
|
||||||
),
|
|
||||||
modifier = LayoutWidth.Fill
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Preview
|
|
||||||
@Composable
|
|
||||||
fun previewDrawer() {
|
|
||||||
AppDrawer(
|
|
||||||
currentScreen = AppStatus.currentScreen,
|
|
||||||
closeDrawer = { }
|
|
||||||
)
|
|
||||||
} */
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
package com.geeksville.mesh.ui
|
|
||||||
|
|
||||||
/*
|
|
||||||
import androidx.compose.Composable
|
|
||||||
import androidx.ui.foundation.Text
|
|
||||||
import androidx.ui.layout.*
|
|
||||||
import androidx.ui.material.MaterialTheme
|
|
||||||
import androidx.ui.material.ProvideEmphasis
|
|
||||||
import androidx.ui.tooling.preview.Preview
|
|
||||||
import androidx.ui.unit.dp
|
|
||||||
import com.geeksville.mesh.NodeInfo
|
|
||||||
import com.geeksville.mesh.R
|
|
||||||
import com.geeksville.mesh.model.NodeDB
|
|
||||||
import androidx.ui.core.Modifier as Modifier1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun CompassHeading(modifier: Modifier1 = Modifier1.None, node: NodeInfo) {
|
|
||||||
Column {
|
|
||||||
if (node.position != null) {
|
|
||||||
Container(modifier = modifier + LayoutSize(40.dp, 40.dp)) {
|
|
||||||
VectorImage(id = R.drawable.navigation)
|
|
||||||
}
|
|
||||||
} else Container(modifier = modifier + LayoutSize(40.dp, 40.dp)) {
|
|
||||||
VectorImage(id = R.drawable.help)
|
|
||||||
}
|
|
||||||
Text("2.3 km") // always reserve space for the distance even if we aren't showing it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun NodeHeading(node: NodeInfo) {
|
|
||||||
ProvideEmphasis(emphasis = MaterialTheme.emphasisLevels.high) {
|
|
||||||
Text(
|
|
||||||
node.user?.longName ?: "unknown",
|
|
||||||
style = MaterialTheme.typography.subtitle1
|
|
||||||
//modifier = LayoutWidth.Fill
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An info card for a node:
|
|
||||||
*
|
|
||||||
* on left, the icon for the user (or shortname if that is all we have) (this includes user's distance and heading arrow)
|
|
||||||
*
|
|
||||||
* Middle is users fullname
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Composable
|
|
||||||
fun NodeInfoCard(node: NodeInfo) {
|
|
||||||
// Text("Node: ${it.user?.longName}")
|
|
||||||
Row(modifier = LayoutPadding(16.dp)) {
|
|
||||||
UILog.debug("showing NodeInfo $node")
|
|
||||||
|
|
||||||
UserIcon(
|
|
||||||
modifier = LayoutPadding(start = 0.dp, top = 0.dp, end = 0.dp, bottom = 0.dp),
|
|
||||||
user = node
|
|
||||||
)
|
|
||||||
|
|
||||||
NodeHeading(node)
|
|
||||||
|
|
||||||
// FIXME - show compass instead
|
|
||||||
// CompassHeading(node = node)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
package com.geeksville.mesh.ui
|
|
||||||
|
|
||||||
/*
|
|
||||||
import androidx.compose.Composable
|
|
||||||
import androidx.ui.core.Modifier
|
|
||||||
import androidx.ui.foundation.Text
|
|
||||||
import androidx.ui.layout.Column
|
|
||||||
import androidx.ui.layout.LayoutGravity
|
|
||||||
import androidx.ui.layout.LayoutWidth
|
|
||||||
import androidx.ui.material.MaterialTheme
|
|
||||||
import androidx.ui.tooling.preview.Preview
|
|
||||||
import androidx.ui.unit.dp
|
|
||||||
import com.geeksville.mesh.NodeInfo
|
|
||||||
import com.geeksville.mesh.R
|
|
||||||
import com.geeksville.mesh.model.NodeDB
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the user icon for a particular user with distance from the operator and a small pointer
|
|
||||||
* indicating their direction
|
|
||||||
*
|
|
||||||
* This component is fixed width to simplify layouts.
|
|
||||||
*/
|
|
||||||
@Composable
|
|
||||||
fun UserIcon(user: NodeInfo? = null, modifier: Modifier = Modifier.None) {
|
|
||||||
Column(modifier = modifier + LayoutWidth(60.dp)) {
|
|
||||||
VectorImage(
|
|
||||||
id = R.drawable.ic_twotone_person_24,
|
|
||||||
tint = palette.onSecondary,
|
|
||||||
modifier = LayoutGravity.Center
|
|
||||||
)
|
|
||||||
val ourNodeInfo = NodeDB.ourNodeInfo
|
|
||||||
val distance = ourNodeInfo?.distanceStr(user)
|
|
||||||
if (distance != null)
|
|
||||||
Text(distance, modifier = LayoutGravity.Center)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue