WIP color fixes

This commit is contained in:
Kevin Hester 2021-05-09 09:02:53 +08:00
parent 18d526166f
commit 59e430d30d
15 changed files with 45 additions and 64 deletions

View file

@ -122,7 +122,7 @@
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View file

@ -279,7 +279,9 @@ class MeshService : Service(), Logging {
@param requireConnected set to false if you are okay with using a partially connected device (i.e. during startup)
*/
private fun sendToRadio(p: ToRadio.Builder, requireConnected: Boolean = true) {
val b = p.build().toByteArray()
val built = p.build()
debug("Sending to radio $built")
val b = built.toByteArray()
if (SoftwareUpdateService.isUpdating)
throw IsUpdatingException()
@ -1793,8 +1795,9 @@ class MeshService : Service(), Logging {
toRemoteExceptions {
// Init from and id
myNodeID?.let { myId ->
if (p.from == DataPacket.ID_LOCAL)
p.from = myId
// we no longer set from, we let the device do it
//if (p.from == DataPacket.ID_LOCAL)
// p.from = myId
if (p.id == 0)
p.id = generatePacketId()

View file

@ -685,10 +685,10 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
gatt?.writeCharacteristic(c) ?: false
}
/* fun asyncWriteReliable(
fun asyncWriteReliable(
c: BluetoothGattCharacteristic,
cb: (Result<Unit>) -> Unit
) = queueWriteCharacteristic(c, CallbackContinuation(cb)) */
) = queueWriteReliable(c, CallbackContinuation(cb))
fun writeReliable(c: BluetoothGattCharacteristic): Unit =
makeSync { queueWriteReliable(c, it) }

View file

@ -14,20 +14,17 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:theme="@style/MyToolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
style="@style/MyToolbar"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -35,7 +32,7 @@
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView5"
android:id="@+id/appIconImageVIew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/application_icon"
@ -57,7 +54,7 @@
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.MaterialToolbar>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.tabs.TabLayout
@ -65,25 +62,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Screen.messages -> MessagesContent()
Screen.settings -> SettingsContent()
Screen.users -> UsersContent()
Screen.channel -> ChannelContent(UIState.getChannel())
Screen.map -> MapContent()
<com.google.android.material.tabs.TabItem
android:icon="@drawable/ic_twotone_message_24"
android:text="Messages"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<com.google.android.material.tabs.TabItem
android:icon="@drawable/ic_twotone_settings_applications_24"
android:text="Settings"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
-->
</com.google.android.material.tabs.TabLayout>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -4,7 +4,7 @@
android:id="@+id/connectStatusImage"
android:contentDescription="@string/connection_status"
android:icon="@drawable/cloud_off"
android:tint="#FFFFFF"
android:tint="@color/colorOnPrimary"
android:title="@string/disconnected"
app:showAsAction="ifRoom" />
<item

View file

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3700B3</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorOnPrimary">#67EA94</color>
<color name="colorPrimary">#141414</color>
<color name="colorMsg">#212121</color>
<color name="colorMyMsg">#212121</color>
<color name="colorDebugBackground">#141414</color>
<color name="colorAdvancedBackground">#141414</color>
<color name="colorIconTint">#FFFFFF</color>
<color name="colorMenuItem">#FFFFFF</color>
<color name="colorToolbar">#000000</color>
</resources>

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3700B3</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorOnPrimary">#FFFFFF</color>
<color name="colorPrimary">#67EA94</color>
<color name="colorPrimaryDark">#67EA94</color>
<color name="colorMsg">#F2F2F2</color>
<color name="colorMyMsg">#EDEAF4</color>
<color name="colorDebugBackground">#FFFFFF</color>
<color name="colorAdvancedBackground">#FFFFFF</color>
<color name="colorIconTint">#000000</color>
<color name="colorMenuItem">#000000</color>
<color name="colorToolbar">#FFFFFF</color>
</resources>

View file

@ -3,14 +3,14 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="actionBarTheme">@style/MyActionBar</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">#FFFFFF</item>
</style>
<style name="AppTheme.NoActionBar" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="android:itemTextAppearance">@style/menu_item_color</item>
</style>
<style name="AppTheme.Spinner">
@ -53,10 +53,19 @@
<item name="cornerSize">50%</item>
</style>
// Toolbar style
<style name="MyToolbar" parent="ThemeOverlay.MaterialComponents.Toolbar.Primary">
<item name="tint">@color/colorToolbar</item>
<item name="colorOnPrimary">@color/colorToolbar</item>
<item name="android:textColor">@color/colorToolbar</item>
<style name="MyThemeOverlay_Toolbar" parent="">
<item name="background">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/colorOnPrimary</item>
<item name="tint">@color/colorOnPrimary</item>
</style>
<style name="MyActionBar" parent="@style/ThemeOverlay.MaterialComponents.ActionBar">
<item name="background">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/colorOnPrimary</item>
</style>
<style name="MyToolbar" parent="Widget.MaterialComponents.Toolbar">
<item name="materialThemeOverlay">@style/MyThemeOverlay_Toolbar</item>
</style>
</resources>