Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show Ticket List.

  • Loading branch information...
commit 75c5a422e3b08802f21331069135fab3892ea0b4 1 parent 29de0c6
@meqif authored
View
87 Resources/ui/common/TicketList.js
@@ -0,0 +1,87 @@
+function TicketList() {
+ var _ = require('/lib/underscore'),
+ dummyInfo = require('/ui/dummyInfo');
+
+ var self = Ti.UI.createScrollView({
+ layout: 'vertical',
+ height: Ti.UI.FILL,
+ width: Ti.UI.FILL
+ });
+
+ var activity = _.extend(dummyInfo.activityBasic, dummyInfo.activityExtended);
+
+ var makeActivityItem = function(activity){
+ var itemHeight = '36dip';
+
+ var rowItem = Ti.UI.createView({
+ width: Ti.UI.FILL,
+ // height: itemHeight,
+ top: '1px',
+ backgroundColor: '#FFF'
+ });
+
+ var favoriteIconWrapper = Ti.UI.createView({
+ // width: itemHeight,
+ // height: itemHeight,
+ left: 0
+ });
+ rowItem.add(favoriteIconWrapper);
+
+ var favoriteIcon = Ti.UI.createImageView({
+ left: 0,
+ // height: '36px',
+ // width: '36px',
+ image: '/icons/guimaraes48-red.png'
+ });
+ favoriteIconWrapper.add(favoriteIcon);
+
+ var desc = Ti.UI.createView({
+ layout: 'vertical'
+ });
+ rowItem.add(desc);
+
+ var dateLabel = Ti.UI.createLabel({
+ left: itemHeight,
+ // TODO: Remove this helper "activity.id" prefix
+ text: activity.date,
+ font: { fontSize: '12sp' },
+ color: '#666',
+ textAlign: 'left',
+ top:0,
+ ellipsize: true,
+ wordWrap: false
+ });
+ desc.add(dateLabel);
+
+ var titleLabel = Ti.UI.createLabel({
+ left: itemHeight,
+ text: activity.title,
+ font: { fontSize: '18sp', fontWeight: 'bold' },
+ color: '#000',
+ textAlign: 'left',
+ ellipsize: true,
+ wordWrap: false
+ });
+ desc.add(titleLabel);
+
+ return rowItem;
+ };
+
+ var item = makeActivityItem(activity);
+ item.addEventListener('click', function() {
+ var TicketView = require('/ui/common/TicketView'),
+ ActionBarWindow = require('/ui/handheld/android/ActionBarWindow'),
+ theme = require('/ui/handheld/android/theme');
+ var ticketWindow = new ActionBarWindow({}, {
+ title: 'Ticket',
+ theme: theme
+ });
+ ticketWindow.add(new TicketView(activity));
+ ticketWindow.open();
+ });
+ self.add(item);
+
+ return self;
+}
+
+module.exports = TicketList;
View
4 Resources/ui/common/TicketView.js
@@ -1,4 +1,4 @@
-function TicketView() {
+function TicketView(activity) {
var _ = require('/lib/underscore'),
dummyInfo = require('/ui/dummyInfo');
@@ -10,7 +10,7 @@ function TicketView() {
var margin = '8dp';
- var activity = _.extend(dummyInfo.activityBasic, dummyInfo.activityExtended);
+ // var activity = _.extend(dummyInfo.activityBasic, dummyInfo.activityExtended);
var header = Ti.UI.createView({
layout: 'vertical',
View
11 Resources/ui/handheld/android/ApplicationWindow.js
@@ -67,7 +67,16 @@ function ApplicationWindow() {
});
mapWindow.add(mapScreen);
mapWindow.open();
- break;
+ break;
+ case 'personal':
+ var TicketList = require('/ui/common/TicketList');
+ var ticketWindow = new ActionBarWindow({}, {
+ title: 'Ticket',
+ theme: theme
+ });
+ ticketWindow.add(new TicketList());
+ ticketWindow.open();
+ break;
default:
alert(e.title + " selected");
break;
Please sign in to comment.
Something went wrong with that request. Please try again.