Skip to content

Commit

Permalink
tweaking UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jvde-github committed Jul 31, 2023
1 parent 1bfad26 commit b5ec627
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.jvdegithub.aiscatcher"
minSdk 23
targetSdk 32
versionCode 58
versionName '0.58'
versionCode 60
versionName '0.60'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* AIS-catcher for Android
* Copyright (C) 2022 jvde.github@gmail.com.
* Copyright (C) 2022-2023 jvde.github@gmail.com.
*
* 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 @@
/*
* AIS-catcher for Android
* Copyright (C) 2022 jvde.github@gmail.com.
* Copyright (C) 2022-2023 jvde.github@gmail.com.
*
* 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 @@
/*
* AIS-catcher for Android
* Copyright (C) 2022 jvde.github@gmail.com.
* Copyright (C) 2022-2023 jvde.github@gmail.com.
*
* 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 @@
/*
* AIS-catcher for Android
* Copyright (C) 2022 jvde.github@gmail.com.
* Copyright (C) 2022-2023 jvde.github@gmail.com.
*
* 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/com/jvdegithub/aiscatcher/Settings.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* AIS-catcher for Android
* Copyright (C) 2022 jvde.github@gmail.com.
* Copyright (C) 2022-2023 jvde.github@gmail.com.
*
* 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 @@
/*
* AIS-catcher for Android
* Copyright (C) 2022 jvde.github@gmail.com.
* Copyright (C) 2022-2023 jvde.github@gmail.com.
*
* 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,5 +1,6 @@
package com.jvdegithub.aiscatcher.ui.main;

import android.app.UiModeManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
Expand Down Expand Up @@ -76,8 +77,15 @@ public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
}
});

String url = "http://localhost:" + MainActivity.port + "?welcome=false&android=true";

webView.loadUrl("http://localhost:" + MainActivity.port + "?welcome=false&android=true");
UiModeManager uiManager = (UiModeManager) getContext().getSystemService(Context.UI_MODE_SERVICE);
boolean isDarkMode = (uiManager.getNightMode() == UiModeManager.MODE_NIGHT_YES);

if (isDarkMode) {
url += "&dark_mode=true&map=DarkMatter";
}
webView.loadUrl(url);

return rootView;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/AIS-catcher
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
android:id="@+id/bottombar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/maastrichtblue"
android:background="?attr/colorPrimaryVariant"
app:itemIconTint="@color/white"
app:itemTextColor="@color/white"
app:labelVisibilityMode="labeled"
Expand Down
19 changes: 12 additions & 7 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">

<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryVariant">@color/blue</item>
<item name="colorPrimary">#323232</item>
<item name="colorPrimaryVariant">@color/black</item>
<item name="colorOnPrimary">@color/white</item>

<item name="colorSecondary">@color/maastrichtblue</item>
<item name="colorSecondaryVariant">@color/maastrichtblue</item>
<item name="colorSecondary">#5DD5D5</item>
<item name="colorSecondaryVariant">@color/blue</item>
<item name="colorOnSecondary">@color/white</item>

<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<item name="actionOverflowMenuStyle">@style/Theme.MyApp.PopupOverlay3</item>
<item name="alertDialogTheme">@style/AlertDialogStyle</item>
</style>

<style name="Theme.MyApp.PopupOverlay3" parent="@style/Widget.MaterialComponents.PopupMenu.Overflow">
<item name="android:popupBackground">@color/white</item>
<item name="android:textColor">@color/white</item>
</style>

<style name="Theme.MyApplication.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="AlertDialogStyle" parent="Theme.AppCompat.DayNight.Dialog">
<item name="android:colorAccent">#5DD5D5</item>
</style>

<style name="Theme.MyApplication.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.MyApplication.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="Theme.MyApplication.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark" />
</resources>
3 changes: 0 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,4 @@ It is specifically forbidden to use this software for any illegal purpose whatso
]]>
</string>



<!-- TODO: Remove or change this placeholder text -->
</resources>
5 changes: 2 additions & 3 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">

<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryVariant">@color/blue</item>
<item name="colorPrimaryVariant">@color/maastrichtblue</item>
<item name="colorOnPrimary">@color/white</item>

<item name="colorSecondary">@color/maastrichtblue</item>
<item name="colorSecondaryVariant">@color/maastrichtblue</item>
<item name="colorOnSecondary">@color/white</item>

<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<item name="actionOverflowMenuStyle">@style/Theme.MyApp.PopupOverlay3</item>
</style>

Expand Down

0 comments on commit b5ec627

Please sign in to comment.