Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit 459f258

Browse files
authored
Merge pull request #27 from dedis/refining
Refining
2 parents 5692e20 + 1f750c1 commit 459f258

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2110
-1671
lines changed

.travis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ matrix:
2727
- tns prepare android --release
2828
- tns build android --env.aot --env.uglify --env.snapshot
2929
# Find the previous one, remove, post the new one.
30-
- git branch
31-
- |
32-
if [ $( git branch | grep master ) ]; then
33-
last=`curl -f -s "https://dashboard.applivery.com/api/builds/app/5b4489e0b5676eb6414b0580" -H "Authorization:$APPLIVERY_API_KEY" | jq -r '.response[] | select(.versionName == "From Travis")| select(.so == "android") | ._id' | head`
34-
echo "The last Android build is - $last"
35-
curl -f "https://dashboard.applivery.com/api/builds/$last" -X DELETE -H "Authorization:$APPLIVERY_API_KEY" || true
36-
curl -f "https://dashboard.applivery.com/api/builds" -X POST -H "Authorization:$APPLIVERY_API_KEY" -F app="5b4489e0b5676eb6414b0580" -F versionName="From Travis" -F os="android" -F notes="Built from branch $TRAVIS_BRANCH, commit $TRAVIS_COMMIT." -F package=@"platforms/android/app/build/outputs/apk/debug/app-debug.apk"
37-
fi
30+
# - git branch
31+
# - |
32+
# if [ $( git branch | grep master ) ]; then
33+
# last=`curl -f -s "https://dashboard.applivery.com/api/builds/app/5b4489e0b5676eb6414b0580" -H "Authorization:$APPLIVERY_API_KEY" | jq -r '.response[] | select(.versionName == "From Travis")| select(.so == "android") | ._id' | head`
34+
# echo "The last Android build is - $last"
35+
# curl -f "https://dashboard.applivery.com/api/builds/$last" -X DELETE -H "Authorization:$APPLIVERY_API_KEY" || true
36+
# curl -f "https://dashboard.applivery.com/api/builds" -X POST -H "Authorization:$APPLIVERY_API_KEY" -F app="5b4489e0b5676eb6414b0580" -F versionName="From Travis" -F os="android" -F notes="Built from branch $TRAVIS_BRANCH, commit $TRAVIS_COMMIT." -F package=@"platforms/android/app/build/outputs/apk/debug/app-debug.apk"
37+
# fi
3838

3939
android:
4040
components:

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ link: start-dev
3333
clean:
3434
rm -rf node_modules platforms hooks
3535

36+
# build: start-dev
37+
build:
38+
if [ ! "$$DEDIS_ANDROID_PASS" ]; then echo "Please set DEDIS_ANDROID_PASS"; exit 1; fi
39+
tns build android --key-store-path dedis-development.jks --key-store-password $$DEDIS_ANDROID_PASS \
40+
--key-store-alias popcoins --key-store-alias-password $$DEDIS_ANDROID_PASS --release
41+
echo "Build successful - apk is at platforms/android/app/build/outputs/apk/release/app-release.ap"

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
app-root.js
2+
app-load.js

app/App_Resources/Android/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="__PACKAGE__"
4-
android:versionCode="10303"
5-
android:versionName="1.3.3">
4+
android:versionCode="10400"
5+
android:versionName="1.4.0">
66

77
<supports-screens
88
android:smallScreens="true"

app/App_Resources/Android/src/main/res/values/styles.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<style name="AppTheme" parent="AppThemeBase">
3131
</style>
3232

33-
<!-- theme for action-bar -->
33+
<!-- theme for action-coupon -->
3434
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
3535
<item name="android:background">@color/ns_primary</item>
3636
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>

app/App_Resources/iOS/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.3</string>
18+
<string>1.4</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.3.3</string>
22+
<string>1.4.0</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UILaunchStoryboardName</key>

app/_app-common.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
}
2525

26-
//Action bar
26+
//Action coupon
2727
ActionBar .action-bar-title {
2828
horizontal-align: center;
2929
}
@@ -39,7 +39,7 @@ ActionBar .action-bar-title {
3939
}
4040

4141
.fas {
42-
font-family: "FontAwesomeSolid", fa-solid-900;
42+
font-family: "Font Awesome 5 Free", fa-solid-900;
4343
font-weight: 900;
4444
}
4545

@@ -63,7 +63,7 @@ ActionBar .action-bar-title {
6363
}
6464
}
6565

66-
// Action bar
66+
// Action coupon
6767
ActionBar .action-bar-title {
6868
horizontal-align: center;
6969
}

app/app-load.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
const observable_1 = require("tns-core-modules/data/observable");
4+
const frame_1 = require("tns-core-modules/ui/frame");
5+
const Log_1 = require("~/lib/Log");
6+
const observable_array_1 = require("tns-core-modules/data/observable-array");
7+
const Data_1 = require("~/lib/Data");
8+
const app_1 = require("~/app");
9+
let view = undefined;
10+
let actions = new observable_array_1.ObservableArray();
11+
function onLoaded(args) {
12+
view = args.object;
13+
view.bindingContext = observable_1.fromObject({ updateActions: actions });
14+
if (app_1.gData == undefined) {
15+
addAction("Loading data");
16+
return Data_1.Data.load()
17+
.then(d => {
18+
app_1.setGdata(d);
19+
})
20+
.then(() => {
21+
addAction("Loading Badges");
22+
return app_1.gData.loadBadges();
23+
})
24+
.then(() => {
25+
return updateData();
26+
})
27+
.then(() => {
28+
return frame_1.topmost().navigate({
29+
moduleName: "app-tabview"
30+
});
31+
})
32+
.catch(err => {
33+
Log_1.default.catch(err);
34+
});
35+
}
36+
}
37+
exports.onLoaded = onLoaded;
38+
function addAction(str) {
39+
actions.push({ description: str });
40+
}
41+
function updateData() {
42+
addAction("Updating data");
43+
return Promise.resolve();
44+
}

app/app-load.ts

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { NavigatedData, Page, View } from "tns-core-modules/ui/page";
2+
import { fromObject } from "tns-core-modules/data/observable";
3+
import { getFrameById, topmost } from "tns-core-modules/ui/frame";
4+
import Log from "~/lib/Log";
5+
import { ObservableArray } from "tns-core-modules/data/observable-array";
6+
import { Data } from "~/lib/Data";
7+
import { gData, setGdata } from "~/app";
8+
9+
let view = undefined;
10+
let actions = new ObservableArray();
11+
12+
export function onLoaded(args: NavigatedData) {
13+
view = <View>args.object;
14+
view.bindingContext = fromObject({updateActions: actions});
15+
if (gData == undefined) {
16+
addAction("Loading data");
17+
return Data.load()
18+
.then(d => {
19+
setGdata(d);
20+
})
21+
.then(() =>{
22+
addAction("Loading Badges");
23+
return gData.loadBadges()
24+
})
25+
.then(() => {
26+
return updateData();
27+
})
28+
.then(() => {
29+
return topmost().navigate({
30+
moduleName: "app-tabview"
31+
});
32+
})
33+
.catch(err => {
34+
Log.catch(err);
35+
});
36+
}
37+
}
38+
39+
function addAction(str: string) {
40+
actions.push({description: str});
41+
}
42+
43+
function updateData(): Promise<any> {
44+
addAction("Updating data");
45+
return Promise.resolve();
46+
}

app/app-load.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Page class="page"
2+
loaded="onLoaded"
3+
xmlns:nsListView="nativescript-ui-listview"
4+
xmlns="http://www.nativescript.org/tns.xsd">
5+
6+
<nsListView:RadListView items="{{ updateActions }}" id="listView">
7+
<nsListView:RadListView.itemTemplate>
8+
<Label class="list-title" text="{{ description }}" textWrap="true" margin="5"/>
9+
</nsListView:RadListView.itemTemplate>
10+
</nsListView:RadListView>
11+
12+
</Page>

app/app-root.ts

-9
This file was deleted.

app/app-root.xml

+1-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
1-
<!--
2-
The TabView component provides a simple way to navigate between different views by
3-
tapping on some of the tabs or by swiping between the views.
4-
Learn more about the TabView component in this documentation article:
5-
http://docs.nativescript.org/cookbook/ui/tab-view
6-
-->
7-
8-
<TabView androidTabsPosition="bottom" selectedIndex="0" androidOffscreenTabLimit="0">
9-
<TabViewItem title="Parties" ios:iconSource="res://tabIcons/search" android:iconSource="res://search">
10-
<Frame defaultPage="pages/parties/parties-page" loaded="onLoaded" unloaded="onUnLoaded"/>
11-
</TabViewItem>
12-
13-
<TabViewItem title="Badges" ios:iconSource="res://tabIcons/browse" android:iconSource="res://browse">
14-
<Frame defaultPage="pages/badges/badges-page" loaded="onLoaded" unloaded="onUnLoaded"/>
15-
</TabViewItem>
16-
17-
<TabViewItem title="Apps" ios:iconSource="res://tabIcons/home" android:iconSource="res://home">
18-
<Frame defaultPage="pages/apps/apps-page" loaded="onLoaded" unloaded="onUnLoaded"/>
19-
<!--<Frame defaultPage="pages/apps/posts/posts-page"></Frame>-->
20-
<!--<Frame defaultPage="pages/apps/coins/coins-page"></Frame>-->
21-
<!--<Frame defaultPage="pages/apps/coupons/coupons-page"></Frame>-->
22-
</TabViewItem>
23-
24-
<TabViewItem title="Admin" ios:iconSource="res://tabIcons/admin" android:iconSource="res://admin">
25-
<Frame defaultPage="pages/admin/admin-page" loaded="onLoaded" unloaded="onUnLoaded" id="frame-admin"/>
26-
</TabViewItem>
27-
</TabView>
1+
<Frame defaultPage="app-load"/>

app/app-tabview.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import {Log} from "~/lib/Log";

app/app-tabview.xml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
The TabView component provides a simple way to navigate between different views by
3+
tapping on some of the tabs or by swiping between the views.
4+
Learn more about the TabView component in this documentation article:
5+
http://docs.nativescript.org/cookbook/ui/tab-view
6+
-->
7+
<Page actionBarHidden="true">
8+
<TabView androidTabsPosition="bottom" androidOffscreenTabLimit="0" selectedIndex="2">
9+
<TabViewItem title="Parties" ios:iconSource="res://tabIcons/search" android:iconSource="res://search">
10+
<Frame defaultPage="pages/parties/parties-page" loaded="onLoaded" unloaded="onUnLoaded"/>
11+
</TabViewItem>
12+
13+
<TabViewItem title="Badges" ios:iconSource="res://tabIcons/browse" android:iconSource="res://browse">
14+
<Frame defaultPage="pages/badges/badges-page" loaded="onLoaded" unloaded="onUnLoaded"/>
15+
</TabViewItem>
16+
17+
<TabViewItem title="Apps" ios:iconSource="res://tabIcons/home" android:iconSource="res://home">
18+
<Frame defaultPage="pages/apps/apps-page" loaded="onLoaded" unloaded="onUnLoaded"/>
19+
<!--<Frame defaultPage="pages/apps/posts/posts-page"></Frame>-->
20+
<!--<Frame defaultPage="pages/apps/coins/coins-page"></Frame>-->
21+
<!--<Frame defaultPage="pages/apps/coupons/coupons-page"></Frame>-->
22+
</TabViewItem>
23+
24+
<TabViewItem title="Admin" ios:iconSource="res://tabIcons/admin" android:iconSource="res://admin">
25+
<Frame defaultPage="pages/admin/admin-page" loaded="onLoaded" unloaded="onUnLoaded" id="frame-admin"/>
26+
</TabViewItem>
27+
</TabView>
28+
</Page>

0 commit comments

Comments
 (0)