This commit is contained in:
Yegor Vialov 2020-04-11 16:55:50 +00:00
parent 5f23e108a1
commit fba4017819
7 changed files with 40 additions and 38 deletions

View File

@ -149,7 +149,7 @@ EventBus eventBus = new EventBus();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
const String appName = "HA Client";
const appVersionNumber = "0.8.2";
const appVersionNumber = "0.8.3";
const appVersionAdd = "";
const appVersion = "$appVersionNumber$appVersionAdd";

View File

@ -14,7 +14,7 @@ class StartupUserMessagesManager {
bool _supportAppDevelopmentMessageShown;
bool _whatsNewMessageShown;
static final _supportAppDevelopmentMessageKey = "user-message-shown-support-development_3";
static final _whatsNewMessageKey = "user-message-shown-whats-new-887";
static final _whatsNewMessageKey = "user-message-shown-whats-new-888";
void checkMessagesToShow() async {
SharedPreferences prefs = await SharedPreferences.getInstance();

View File

@ -84,17 +84,17 @@ class HAClientTheme {
return darkTheme;
break;
case AppTheme.defaultTheme:
return lightTheme;
return defaultTheme;
break;
case AppTheme.haTheme:
return lightTheme;
return homeAssistantTheme;
break;
default:
return lightTheme;
return defaultTheme;
}
}
final ThemeData lightTheme = ThemeData.from(
final ThemeData defaultTheme = ThemeData.from(
colorScheme: ColorScheme(
primary: Color.fromRGBO(112, 154, 193, 1),
primaryVariant: Color.fromRGBO(68, 115, 158, 1),
@ -125,6 +125,37 @@ class HAClientTheme {
)
);
final ThemeData homeAssistantTheme = ThemeData.from(
colorScheme: ColorScheme(
primary: Color.fromRGBO(2, 165, 238, 1),
primaryVariant: Color.fromRGBO(68, 115, 158, 1),
secondary: Color.fromRGBO(253, 216, 53, 1),
secondaryVariant: Color.fromRGBO(222, 181, 2, 1),
background: Color.fromRGBO(250, 250, 250, 1),
surface: Colors.white,
error: Colors.red,
onPrimary: Colors.white,
onSecondary: Colors.black87,
onBackground: Colors.black87,
onSurface: Colors.black87,
onError: Colors.white,
brightness: Brightness.light
),
textTheme: ThemeData.light().textTheme.copyWith(
display1: textTheme.display1.copyWith(color: Colors.black54),
display2: textTheme.display2.copyWith(color: Colors.redAccent),
headline: textTheme.headline.copyWith(color: Colors.black87),
title: textTheme.title.copyWith(color: Colors.black87),
subhead: textTheme.subhead.copyWith(color: Colors.black54),
body1: textTheme.body1.copyWith(color: Colors.black87),
body2: textTheme.body2.copyWith(color: Colors.black87),
subtitle: textTheme.subtitle.copyWith(color: Colors.black45),
caption: textTheme.caption.copyWith(color: Colors.black45),
overline: textTheme.overline.copyWith(color: Colors.black26),
button: textTheme.button.copyWith(color: Colors.white),
)
);
final ThemeData darkTheme = ThemeData.from(
colorScheme: ColorScheme(
primary: Color.fromRGBO(112, 154, 193, 1),

View File

@ -18,8 +18,6 @@ class _ConnectionSettingsPageState extends State<ConnectionSettingsPage> {
String _newSocketProtocol = "wss";
String _longLivedToken = "";
String _newLongLivedToken = "";
bool _useLovelace = true;
bool _newUseLovelace = true;
String oauthUrl;
bool useOAuth = false;
@ -55,11 +53,6 @@ class _ConnectionSettingsPageState extends State<ConnectionSettingsPage> {
_hassioDomain = _newHassioDomain = prefs.getString("hassio-domain")?? "";
_hassioPort = _newHassioPort = prefs.getString("hassio-port") ?? "";
_socketProtocol = _newSocketProtocol = prefs.getString("hassio-protocol") ?? 'wss';
try {
_useLovelace = _newUseLovelace = prefs.getBool("use-lovelace") ?? true;
} catch (e) {
_useLovelace = _newUseLovelace = true;
}
});
}
@ -68,7 +61,6 @@ class _ConnectionSettingsPageState extends State<ConnectionSettingsPage> {
(_newHassioPort != _hassioPort) ||
(_newHassioDomain != _hassioDomain) ||
(_newSocketProtocol != _socketProtocol) ||
(_newUseLovelace != _useLovelace) ||
(_newLongLivedToken != _longLivedToken));
}
@ -103,7 +95,6 @@ class _ConnectionSettingsPageState extends State<ConnectionSettingsPage> {
prefs.setString("hassio-port", _newHassioPort);
prefs.setString("hassio-protocol", _newSocketProtocol);
prefs.setString("hassio-res-protocol", _newSocketProtocol == "wss" ? "https" : "http");
prefs.setBool("use-lovelace", _newUseLovelace);
}
@override
@ -151,26 +142,6 @@ class _ConnectionSettingsPageState extends State<ConnectionSettingsPage> {
"Try ports 80 and 443 if default is not working and you don't know why.",
style: Theme.of(context).textTheme.caption,
),
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
"UI",
style: Theme.of(context).textTheme.headline,
),
),
new Row(
children: [
Text("Use Lovelace UI"),
Switch(
value: _newUseLovelace,
onChanged: (value) {
setState(() {
_newUseLovelace = value;
});
},
)
],
),
Text(
"Authentication settings",
style: Theme.of(context).textTheme.headline,

View File

@ -52,7 +52,7 @@ class _LookAndFeelSettingsPageState extends State<LookAndFeelSettingsPage> {
scrollDirection: Axis.vertical,
padding: const EdgeInsets.all(20.0),
children: <Widget>[
Text("Application scheme:", style: Theme.of(context).textTheme.body2),
Text("Application theme:", style: Theme.of(context).textTheme.body2),
Container(height: Sizes.rowPadding),
DropdownButton<AppTheme>(
value: _currentTheme,

View File

@ -24,7 +24,7 @@ class _WhatsNewPageState extends State<WhatsNewPage> {
error = "";
});
http.Response response;
response = await http.get("http://ha-client.app/service/whats_new_0.8.2.md");
response = await http.get("http://ha-client.app/service/whats_new_0.8.3.md");
if (response.statusCode == 200) {
setState(() {
data = response.body;

View File

@ -1,7 +1,7 @@
name: hass_client
description: Home Assistant Android Client
version: 0.8.2+887
version: 0.8.3+888
environment: