February, 2009 > 所有文章列表

好有奧義的介面啊(safari 4) (updated Mar. 10)

In General   February 25, 2009 - 9:47 pm

Picture 5.png

看著這個新介面,不知不覺笑了出來…有人想說說妙在哪裏嗎?:P

==== Mar. 10 更新 ====

其實當初我想笑的主要原因就是那個 tab bar 移到最上方的設計,當然大部份都會一眼看出它跟 google chrome 很像,但如果再看仔細一點就會發現兩者背後的「設計意圖」其實還是不太一樣,展現的企圖心與大膽程度也不相同。

以下圖為例,chrome 的 tab bar 仍然是被一個完整的 window container 所包覆住,並且還是有 title bar 的空間,但 safari 的玩法就大膽許多,它是直接讓 title bar 與 tab bar 合而為一,這裏面值得觀察的地方就很多了,其中之一是:apple 的設計師當時的設計想法是什麼?我打賭背後一定有許多 argument 關於是否該這樣做?

google-chrome-screenshot.jpg

總之這是一個很 controversial 的設計決定,並且在工程上要實作也不見得容易(有誰知道在 cocoa 裏要怎麼讓內建的 NSWindow 長出無限多的 tab bar ?請舉手…)

另外一個觀察則是 safari 的 tab 也可以拖離出來成為一個獨立的 window,但從 windows 的版本來看它似乎並不像 chrome 會讓每個 tab 獨立成為一個 process,在 task manager 裏看到的仍然只有一個 process 在跑,因此這可能代表著只要一個 tab 的內容掛了,就會所有 tabs 一起歡樂大滅絕 XD

關於 safari 4 其實有說不完的觀察、心得與想法,但當時我就在想,只要等的夠久,一定會有熱血青年+有識之士會看出 safari 4 有什麼問題,果然後來被我找到下面這篇,真正是完整寫出我心中的想法,尤其是關於 title bar 與 tab bar 整合的那部份,分析的非常好。

Observations, Complaints, Quibbles, and Suggestions Regarding the Safari 4 Public Beta Released One Week Ago, Roughly in Order of Importance

comments(11) | by admin

NYT 上的 Apple macbook pro 廣告

In General   February 24, 2009 - 10:05 am

Picture 5.png

(按上圖可看錄影畫面)

早上看報紙時不小心看到(實際上它就在頭版最上方,除非瞎了不然應該誰也不會錯過 XD) Apple 的新廣告,這次是主打 17″ macbook pro。

這個廣告很有意思的地方不在於它的呈現手法、版面位置甚至是背後的 campaign strategy, 有趣的地方在於它的『主訴』,完全沒提到 17″ mbp 多亮多快多威 unibody 多堅固或 Jonathan Ive 有多帥,從頭到尾只提一個重點,就是『可用五年的電池』。

注意這裏面有兩個名詞,電池,跟 五年,而 Apple 的重心不是放在強調電池容量有多大,一次可用多久(當然也沒提這電池不能自已拆換將來如果掛了還要付錢送回去請人換),它強調的是這玩意可耐用五年,因此造成的污染比較少,對地球比較好。

也就是說,它已經不是在賣商品,而是在訴求環保這個議題,也因此,花下去大筆的鈔票,其實是在救地球,頓時動機就覺得高尚良善許多,更棒的是,還可以得到一台 laptop,這樣滿足感是不是更高呢?XD

所以這件事的心得是:與其大聲費力叫賣硬把東西塞給客人,不如訴諸情感、經驗,用反向/彎曲的方式間接把客人吸過來,效果可能更好(刷刷刷 筆記筆記)

comments(6) | by admin

Undo/redo for flex textField.

In flex   February 14, 2009 - 5:48 pm

Picture 2.png

(click on the image to see demo video, source won’t be available for that it’s a client project, IP reserved)

As most of you know, undo/redo had long been part of the basic user experience all users would expect for pretty much every apps out there, let alone in a full-fledged RIA these days (hey “rich” ain’t there in RIA for nothing !), but this is not the case for flex/flash apps,

I’ve been wanting this for quite sometime now, to be precise, ever since flex first come out a couple of years ago I’ve been thinking why there’s no undo/redo capability for all the textfield-based component (TextInput, TextArea and RichTextEditor, that is).

and fortunately enough recently a client asked for this feature added to the app I’m working on, so I got a chance to finally have it implemented.

*Basic features include

-built against flash.text.TextField, so all text components in flex framework supported.

-has built-in UndoManager but user could supply custom UndoManager too, as long as it implements IUndoManager. (who doesn’t ?)

-unlimited level of undo and redo

-undo by single character (TextMate any one ? ;-) or a stream of words (a.k.a normal mode)

-correctly handle delete and backspace keys for mac

-support built-in RichTextEditor, hence all text format modifications could be handled too

-handles right-click context menu (”Cut” and “Paste”) in AIR.

-easy to use, var tm:TextManager = new TextManager( tf ); one line of code and it could undo/redo everything.

-support double-byte languages like Chinese, Korean and Japanese (this is not really a feature for that flash player support unicode natively ;-)

*Some of the problems I ran into include

1. there’s no easy way to handle cut and paste short cut keys within browser, cmd-X and cmd-V will be “eaten” by containing browser, under Stand Alone player case, the player shell will eat the event, I know this could be dealt with old-school javascript tricks but I would rather refrain from going that direction because then developers will have to remember adding that piece of junk js to the browser and handle ExternalInterface.

After playing with various keyboard events finally I find a way to handle cut and paste with a combination of key events, all native flash player event hence no js, no interface, no nothing, just drop the swf in there and magic happens.

2. right-click menu
Seems to me there’s NO WAY to handle “Cut” and “Paste” menu command in browser version, and worst yet, there’s no way to disable the menu (in flash player 10 there’s ContextMenu.clipboardMenu = false, but, it’s not applicable to textField, ouch !). I could just have my finger crossed and hope user won’t be using that right click menu.

Good news is it could be handled correctly in AIR, and better yet, the project I’m working on, is an AIR app :)

3. I tried to have it implemented in a strict MVC way, but the traditional textfield in flash player 9 didn’t provide some of the low-level functionalities I need, so a bunch of quick hacks were threw in, but good thing is the new text engine in flash player 10 looks real promising, let alone the Text Layout Framework(TLF), I’m looking forward to work on that sooner than later.

*What’s next ?

Some people asked is it possible to turn this into a full-blown text editor, sure you can, but there’s already Buzzword and Google Docs providing such services, and like a 1000+ editors on the desktop ( TextMate, TextWrangler, Smultron, EmEditor, NotePad++, to name a few), so I don’t really see the value in creating such thing, but I could be wrong, if so, please kindly let me know !

comments(6) | by admin

mobile phone