Skip to content

Commit 61f0d9f

Browse files
author
SpiralArm Consulting Ltd
committed
New UI for Android version
1 parent 0ff5546 commit 61f0d9f

27 files changed

+608
-182
lines changed

Diff for: README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# watchtips
22

3+
## Update Version 2.2
4+
The Watch tips prject has been updated again, the interface has been tidied up and a seperate value for the *tip* cost has been added and displayed.
5+
I have also added a custom 'keypad' rather than using the standard one available for the platform, hopefully the app now looks a bit better than it did, UX/UI design is not my strong point.
6+
7+
But the biggest update is that there is now also an Android version (without Watch support). Doing this has helped a lot as I can use the Flutter Android app for development purposes so that I now have Hot Relad back , developmernt is **good** again ....
8+
9+
I still need to run/build (and fail) with the Flutter tools for iOS and finish with XCode, but general dev is know easier.
10+
11+
12+
313
This is an experiment to see if can use Flutter to build an iOS app with an accompanying watchOS app. My first attempts using the beta product were not successful so the idea was parked.
414
Having now re-visited this I can now get a compiled blank watch app up and running with a Flutter app, so I will, in stages, try and re-create the WatchTips app using Flutter.
515

@@ -28,7 +38,7 @@ My plan is to:
2838
## Flutter Package Project
2939
From the results of this test project, I have started developing a Flutter Package to allow communication between a Flutter iOS app and a watch app. This should allow easier integration with some standard functionality, though it is still a pain ATM as after you add a Watch Kit target to the iOS project as Flutter run/build no longer works. This means all package testing and development then needs to be done via XCode.
3040

31-
I have got message working from an iOS app to the watch via the plugin, this can be seen working in a[video here](https://butterfly-mobile.uk/flutter-and-apple-watch).
41+
I have got messaging working from an iOS app to the watch via the plugin, this can be seen working in a[video here](https://butterfly-mobile.uk/flutter-and-apple-watch).
3242

3343

3444

Diff for: android/.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>android</name>
4+
<comment>Project android created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16+
</natures>
17+
</projectDescription>

Diff for: android/.settings/org.eclipse.buildship.core.prefs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=
2+
eclipse.preferences.version=1

Diff for: android/app/.classpath

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>

Diff for: android/app/.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>app</name>
4+
<comment>Project app created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22+
</natures>
23+
</projectDescription>
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=..
2+
eclipse.preferences.version=1

Diff for: android/app/build.gradle

+16-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ if (flutterVersionName == null) {
2424
apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

27+
def keystoreProperties = new Properties()
28+
def keystorePropertiesFile = rootProject.file('key.properties')
29+
if (keystorePropertiesFile.exists()) {
30+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
31+
}
32+
2733
android {
2834
compileSdkVersion 27
2935

@@ -33,19 +39,25 @@ android {
3339

3440
defaultConfig {
3541
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36-
applicationId "com.example.watchtips"
42+
applicationId "uk.spiralarm.tipcalculator"
3743
minSdkVersion 16
3844
targetSdkVersion 27
3945
versionCode flutterVersionCode.toInteger()
4046
versionName flutterVersionName
4147
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
4248
}
4349

50+
signingConfigs {
51+
release {
52+
keyAlias keystoreProperties['keyAlias']
53+
keyPassword keystoreProperties['keyPassword']
54+
storeFile file(keystoreProperties['storeFile'])
55+
storePassword keystoreProperties['storePassword']
56+
}
57+
}
4458
buildTypes {
4559
release {
46-
// TODO: Add your own signing config for the release build.
47-
// Signing with the debug keys for now, so `flutter run --release` works.
48-
signingConfig signingConfigs.debug
60+
signingConfig signingConfigs.release
4961
}
5062
}
5163
}

Diff for: android/app/src/main/AndroidManifest.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<!-- The INTERNET permission is required for development. Specifically,
55
flutter needs it to communicate with the running application
66
to allow setting breakpoints, to provide hot reload, etc.
7-
-->
7+
88
<uses-permission android:name="android.permission.INTERNET"/>
9+
-->
910

1011
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
1112
calls FlutterMain.startInitialization(this); in its onCreate method.
@@ -14,7 +15,7 @@
1415
FlutterApplication and put your custom class here. -->
1516
<application
1617
android:name="io.flutter.app.FlutterApplication"
17-
android:label="watchtips"
18+
android:label="Watch Tips"
1819
android:icon="@mipmap/ic_launcher">
1920
<activity
2021
android:name=".MainActivity"

Diff for: android/app/src/main/java/com/example/watchtips/MainActivity.java

+29
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,40 @@
33
import android.os.Bundle;
44
import io.flutter.app.FlutterActivity;
55
import io.flutter.plugins.GeneratedPluginRegistrant;
6+
import io.flutter.plugin.common.MethodCall;
7+
import io.flutter.plugin.common.MethodChannel;
8+
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
9+
import io.flutter.plugin.common.MethodChannel.Result;
10+
import android.content.res.Resources;
11+
import android.os.LocaleList;
12+
import java.util.*;
13+
614

715
public class MainActivity extends FlutterActivity {
816
@Override
917
protected void onCreate(Bundle savedInstanceState) {
1018
super.onCreate(savedInstanceState);
1119
GeneratedPluginRegistrant.registerWith(this);
20+
new MethodChannel(getFlutterView(), "uk.spiralarm.watchtips/tipinfo").setMethodCallHandler(
21+
new MethodCallHandler() {
22+
@Override
23+
public void onMethodCall(MethodCall call, Result result) {
24+
if (call.method.equals("preferredLanguages")) {
25+
result.success(getPreferredLanguages());
26+
} else {
27+
result.notImplemented();
28+
}
29+
}
30+
});
31+
}
32+
33+
private List<String> getPreferredLanguages() {
34+
LocaleList list = Resources.getSystem().getConfiguration().getLocales().getAdjustedDefault();
35+
List<String> result = new ArrayList<String>();
36+
for(int i=0; i<list.size(); i++){
37+
result.add(list.get(i).toString());
38+
}
39+
return result;
1240
}
41+
1342
}

Diff for: android/app/src/main/res/drawable/launch_background.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<item android:drawable="@android:color/white" />
55

66
<!-- You can insert your own image assets here -->
7-
<!-- <item>
7+
<item>
88
<bitmap
99
android:gravity="center"
1010
android:src="@mipmap/launch_image" />
11-
</item> -->
11+
</item>
1212
</layer-list>

Diff for: android/app/src/main/res/mipmap-hdpi/ic_launcher.png

1.65 KB
Loading
6.2 KB
Loading

Diff for: android/app/src/main/res/mipmap-mdpi/ic_launcher.png

1019 Bytes
Loading
4.79 KB
Loading
2.15 KB
Loading
9.86 KB
Loading
3.59 KB
Loading
14 KB
Loading
4.7 KB
Loading
21.9 KB
Loading

Diff for: lib/colors.dart

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import 'package:flutter/material.dart';
22

33
/// This defines the colours used in the app
4-
const appPrimaryColor = Color(0xFFE6E6E6); //Color(0xFF000000);
5-
const appScaffoldColor = Color(0xFFE6E6E6); //Color(0xFF000000);
6-
const appPrimaryTextColor = Color(0xFF0D5FFF);
7-
const appTextColor = Color(0xFF333333); //Color(0xFFFECC66);
4+
const appPrimaryColor = Color(0xFF000000);//Color(0xFFE6E6E6);
5+
const appScaffoldColor = Color(0xFF000000);//Color(0xFFE6E6E6);
6+
const accentTextColor = Color(0xFFFC6666);
7+
const appPrimaryTextColor = Color(0xFFFFFFFF);
8+
const appTextColor = Colors.grey;//Color(0xFF333333); //Color(0xFFFECC66);
9+
const appButtonColor = Color(0xFF7F7F7F);
10+
const appPrimaryButtonColor = Colors.orange;

0 commit comments

Comments
 (0)