Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-22-2011, 07:15 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Location: India
Age: 24
Posts: 1
appod is on a distinguished road
Post Obstruction caused by fingers on iphone

Apple Iphones (and android) have an inherent disadvantage of the scrolling finger itself causing disuption to the view of users. For eg, a user is scrolling through a list of items and reading them simultaneously. If the user scrolls the device with the left hand, scrolling and reading is not as convenient to do as it is with the right hand because the left-hand's finger(s) obstruct the view and as you know, we read most languages from left to right. As a result, the users end up shifting hands or fingers for a convenient view. It's not that big an issue but taking care of it would certainly lead to more convenience. I've uploaded a working solution(two apps) on [github].The idea is to use the accelerometer (and/or other sensors) to improve user's browsing experience by dynamically changing the way information is displayed on finger-based touch screen phones like iPhone. An indentation is provided on the left side which acts as the scrolling space. The app gives an illusion of text "flowing" towards left/right with the device tilt direction like water in a plate. This code can be easily copied into your custom app. Some of the standard functions with changes look like:

Code:
 - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
    UIDeviceOrientation orientSide = [[UIDevice currentDevice] orientation];
    if (orientSide == UIDeviceOrientationLandscapeLeft) orient = 1;
    if (orientSide == UIDeviceOrientationLandscapeRight) orient = 2;
    [self.tableView reloadData];
    return NO;}
This technique prevents the need to watch accelerometer separately, saving a lot of coding . NO is returned to override the landscape mode. Variable 'orientSide' is global and used only to remember the device orientation.

Code:
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifier = @"Cell";
    NSRange range1 = NSMakeRange(0,4);
    NSRange range2 = NSMakeRange(0,3);
    NSRange range3 = NSMakeRange(0,2);
    NSString *list[] = {@"The day the whole world went away",@"Life in a box",@"The vampire",@"Likability",@"Moonlight",@"A prince, not pauper",@"An aneurysm",@"Viva la vida",@"Y so serious??",@"Clocks",@"The day the whole world went away",@"Life in a box",@"The vampire",@"Likability",@"Moonlight",@"A prince, not pauper",@"An aneurysm",@"Viva la vida",@"Y so serious??",@"Clocks",@"The day the whole world went away",@"Life in a box",@"The vampire",@"Likability",@"Moonlight",@"A prince, not pauper",@"An aneurysm",@"Viva la vida",@"Y so serious??",@"Clocks"};
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    
    if (orient == 1){
        cell.textLabel.textAlignment = UITextAlignmentLeft; 
        cell.indentationLevel = 0;
    }
    if (orient == 2){
        /*Since the articles 'A', 'An' and 'The' do not convey any extra information 
        while taking up valuable space, it would be more useful if they were kept within
        the scroll space provided by the indentation and were made less distinct or "black". 
        This can be done by making these articles greyish which will "blend" with the white. 
        I haven't provided this functionality in current application to keep things simple! */
        if([[list[indexPath.row] substringWithRange:range1]isEqualToString: @"The "] || [[list[indexPath.row] substringWithRange:range1]isEqualToString: @"the "])
            cell.indentationLevel = 4; 
        else if([[list[indexPath.row] substringWithRange:range2]isEqualToString: @"An "] || [[list[indexPath.row] substringWithRange:range2]isEqualToString: @"an "])
            cell.indentationLevel = 5;
        else if([[list[indexPath.row] substringWithRange:range3]isEqualToString: @"A "] || [[list[indexPath.row] substringWithRange:range3]isEqualToString: @"a "])
            cell.indentationLevel = 6;
        else cell.indentationLevel = 8;}
        cell.textLabel.text = list[indexPath.row];
    
    return cell;}
As can be seen, this is easy to implement and the code only needs to be copy/pasted in a table view. Install the app available at [github] on an iPhone and just tilt the device to play with this app. but since the application depends on accelerometer inputs, it requires landscape mode overriding. The indentation provides the space to scroll with left hand. It would be much more convenient if additional sensors were used, like proximity sensors on the sides of screen, and the text would be rearranged without having to tilt the phone Hope this code was useful...
appod is offline   Reply With Quote
Reply

Bookmarks

Tags
accelerometer, apple, hand, text, touch

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 328
8 members and 320 guests
chemistry, Dnnake, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:27 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0