issue list filter ui

This commit is contained in:
zhijie 2013-07-19 13:53:16 +08:00
parent 00775b4235
commit b0a0614e18
7 changed files with 90 additions and 166 deletions

View File

@ -10,7 +10,6 @@
2B62D0DF1796498800AC3C19 /* OZLIssueCreateViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0DE1796498800AC3C19 /* OZLIssueCreateViewController.storyboard */; };
2B62D0E1179649A800AC3C19 /* OZLIssueDetailViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0E0179649A800AC3C19 /* OZLIssueDetailViewController.storyboard */; };
2B62D0E31796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0E21796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard */; };
2B62D0E51796A8C800AC3C19 /* OZLIssueFilterViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0E41796A8C800AC3C19 /* OZLIssueFilterViewController.storyboard */; };
2B62D0E81796A8D800AC3C19 /* OZLIssueFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B62D0E71796A8D800AC3C19 /* OZLIssueFilterViewController.m */; };
2B6F382F1797A00A00D06F51 /* MLTableAlertBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B6F38251797A00A00D06F51 /* MLTableAlertBackground.png */; };
2B6F38301797A00A00D06F51 /* MLTableAlertBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B6F38261797A00A00D06F51 /* MLTableAlertBackground@2x.png */; };
@ -76,7 +75,6 @@
2B62D0DE1796498800AC3C19 /* OZLIssueCreateViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLIssueCreateViewController.storyboard; path = ViewControllers/OZLIssueCreateViewController.storyboard; sourceTree = "<group>"; };
2B62D0E0179649A800AC3C19 /* OZLIssueDetailViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLIssueDetailViewController.storyboard; path = ViewControllers/OZLIssueDetailViewController.storyboard; sourceTree = "<group>"; };
2B62D0E21796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLProjectCreateViewController.storyboard; path = ViewControllers/OZLProjectCreateViewController.storyboard; sourceTree = "<group>"; };
2B62D0E41796A8C800AC3C19 /* OZLIssueFilterViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLIssueFilterViewController.storyboard; path = ViewControllers/OZLIssueFilterViewController.storyboard; sourceTree = "<group>"; };
2B62D0E61796A8D800AC3C19 /* OZLIssueFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLIssueFilterViewController.h; path = ViewControllers/OZLIssueFilterViewController.h; sourceTree = "<group>"; };
2B62D0E71796A8D800AC3C19 /* OZLIssueFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLIssueFilterViewController.m; path = ViewControllers/OZLIssueFilterViewController.m; sourceTree = "<group>"; };
2B6F38251797A00A00D06F51 /* MLTableAlertBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MLTableAlertBackground.png; sourceTree = "<group>"; };
@ -273,7 +271,6 @@
2B8A11E017963CE500906D34 /* OZLIssueDetailViewController.h */,
2B8A11E117963CE500906D34 /* OZLIssueDetailViewController.m */,
2B62D0E0179649A800AC3C19 /* OZLIssueDetailViewController.storyboard */,
2B62D0E41796A8C800AC3C19 /* OZLIssueFilterViewController.storyboard */,
2B62D0E61796A8D800AC3C19 /* OZLIssueFilterViewController.h */,
2B62D0E71796A8D800AC3C19 /* OZLIssueFilterViewController.m */,
);
@ -519,7 +516,6 @@
2B62D0DF1796498800AC3C19 /* OZLIssueCreateViewController.storyboard in Resources */,
2B62D0E1179649A800AC3C19 /* OZLIssueDetailViewController.storyboard in Resources */,
2B62D0E31796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard in Resources */,
2B62D0E51796A8C800AC3C19 /* OZLIssueFilterViewController.storyboard in Resources */,
2B6F382F1797A00A00D06F51 /* MLTableAlertBackground.png in Resources */,
2B6F38301797A00A00D06F51 /* MLTableAlertBackground@2x.png in Resources */,
2B6F38311797A00A00D06F51 /* MLTableAlertButton.png in Resources */,

View File

@ -116,6 +116,7 @@
doneCount ++;
if (doneCount == 4) {
[_HUD hide:YES];
doneCount = 0;
}
}];
@ -128,6 +129,7 @@
doneCount ++;
if (doneCount == 4) {
[_HUD hide:YES];
doneCount = 0;
}
}];
[OZLNetwork getPriorityListWithParams:nil andBlock:^(NSArray *result, NSError *error) {
@ -139,6 +141,7 @@
doneCount ++;
if (doneCount == 4) {
[_HUD hide:YES];
doneCount = 0;
}
}];
[OZLNetwork getUserListWithParams:nil andBlock:^(NSArray *result, NSError *error) {
@ -150,6 +153,7 @@
doneCount ++;
if (doneCount == 4) {
[_HUD hide:YES];
doneCount = 0;
}
}];
}
@ -341,12 +345,12 @@
}
}
[self.tableView reloadData];
}
#pragma mark -
#pragma mark delegate of textfield inputview
#pragma mark data picker value changed
-(void)datePickerValueChanged:(id)sender
{

View File

@ -8,8 +8,12 @@
#import "OZLIssueFilterViewController.h"
@interface OZLIssueFilterViewController ()
@interface OZLIssueFilterViewController () {
NSArray* _cellArray;
NSArray* _headerArray;
int _checkedCell[3];
}
@end
@implementation OZLIssueFilterViewController
@ -27,11 +31,30 @@
{
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
UIBarButtonItem* cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel:)];
[self.navigationItem setLeftBarButtonItem:cancelBtn];
UIBarButtonItem* saveBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSave:)];
[self.navigationItem setRightBarButtonItem:saveBtn];
_cellArray = @[
@[@"Assigned to me",@"Open",@"Reported by me"],
@[@"Id", @"Tracker", @"Status", @"Priority", @"Category", @"Asssigned to", @"Fixed Version", @"Start Date", @"Due Date", @"Estimated Date", @"Done", @"Updated on"],
@[@"Ascending", @"Descending"]];
_headerArray = @[@"Filter by", @"Sort by", @""];
_checkedCell[0] = 0;
_checkedCell[1] = 0;
_checkedCell[2] = 0;
}
-(void) onCancel:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
-(void) onSave:(id) sender
{
}
- (void)didReceiveMemoryWarning
@ -44,78 +67,43 @@
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 0;
return _cellArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return 0;
return [[_cellArray objectAtIndex:section] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
static NSString *CellIdentifier = @"OZLIssueFilterViewControllerCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier ];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
if (_checkedCell[indexPath.section] == indexPath.row ) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.textLabel.text = [[_cellArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
-(NSString*) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
// Return NO if you do not want the specified item to be editable.
return YES;
return [_headerArray objectAtIndex:section];
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
_checkedCell[indexPath.section] = indexPath.row;
[self.tableView reloadData];
}
@end

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="11G63" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="FDq-Gc-7oy">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
</dependencies>
<scenes>
<!--Table View Controller-->
<scene sceneID="dst-4x-xj4">
<objects>
<tableViewController id="FDq-Gc-7oy" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="singleLineEtched" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="xPs-Tk-Pes">
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<sections>
<tableViewSection headerTitle="Filter by" id="tvE-Df-yno">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="Zdv-GK-W98">
<rect key="frame" x="0.0" y="46" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="1" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="Zhk-nD-FvL">
<rect key="frame" x="0.0" y="91" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="5Em-A7-gNM">
<rect key="frame" x="0.0" y="135" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Filter by" id="oa3-r2-aE4">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="Pjv-oQ-aD7">
<rect key="frame" x="0.0" y="226" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="1" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="SZB-QB-U1E">
<rect key="frame" x="0.0" y="271" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="0qh-y8-zpT">
<rect key="frame" x="0.0" y="315" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="FDq-Gc-7oy" id="87R-ad-RoU"/>
<outlet property="delegate" destination="FDq-Gc-7oy" id="iER-Vf-Npm"/>
</connections>
</tableView>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9rI-8Y-7n8" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="247" y="7"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View File

@ -33,4 +33,6 @@
@property (weak, nonatomic) IBOutlet UITableView *issuesTableview;
@property (nonatomic,strong) OZLModelProject* projectData;
- (IBAction)onNewIssue:(id)sender;
- (IBAction)onSortSetting:(id)sender;
@end

View File

@ -34,6 +34,7 @@
#import "OZLProjectDetailViewController.h"
#import "OZLIssueDetailViewController.h"
#import "OZLIssueCreateViewController.h"
#import "OZLIssueFilterViewController.h"
#import "OZLSingleton.h"
@ -71,11 +72,14 @@
[self.view addSubview:_HUD];
_HUD.labelText = @"Loading...";
[self reloadData];
[[OZLSingleton sharedInstance] setLastProjectID:_projectData.index];
}
-(void) viewWillAppear:(BOOL)animated
{
[self reloadData];
}
-(void) reloadData
{
if (_projectData == nil) {
@ -108,8 +112,8 @@
- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(preloadLeft) object:nil];
[self performSelector:@selector(preloadLeft) withObject:nil afterDelay:0.3];
// [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(preloadLeft) object:nil];
// [self performSelector:@selector(preloadLeft) withObject:nil afterDelay:0.3];
}
@ -256,4 +260,9 @@
//[self.navigationController presentModalViewController:creator animated:YES];
[self.navigationController pushViewController:creator animated:YES];
}
- (IBAction)onSortSetting:(id)sender {
OZLIssueFilterViewController* filter = [[OZLIssueFilterViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.navigationController pushViewController:filter animated:YES];
}
@end

View File

@ -74,6 +74,12 @@
<reference key="IBUIToolbar" ref="366696023"/>
<int key="IBUISystemItemIdentifier">4</int>
</object>
<object class="IBUIBarButtonItem" id="917877130">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIStyle">1</int>
<reference key="IBUIToolbar" ref="366696023"/>
<int key="IBUISystemItemIdentifier">10</int>
</object>
</array>
</object>
</array>
@ -153,6 +159,14 @@
</object>
<int key="connectionID">11</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">onSortSetting:</string>
<reference key="source" ref="917877130"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">14</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -187,6 +201,7 @@
<reference key="object" ref="366696023"/>
<array class="NSMutableArray" key="children">
<reference ref="512025889"/>
<reference ref="917877130"/>
</array>
<reference key="parent" ref="191373211"/>
</object>
@ -200,6 +215,11 @@
<reference key="object" ref="593675336"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="917877130"/>
<reference key="parent" ref="366696023"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@ -208,6 +228,7 @@
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -216,7 +237,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">12</int>
<int key="maxID">14</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>