| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:twitterservice="services.twitterservice.*" |
| viewActivate="refresh()"> |
| |
| <fx:Script> |
| <![CDATA[ |
| import com.adobe.serializers.utility.TypeUtility; |
| protected function getUserInfo(screen_name:String):void |
| { |
| getUserInfoResult.token = twitterService.getUserInfo(screen_name); |
| } |
| |
| protected function getTweets(q:String, result_type:String):void |
| { |
| getTweetsResult.token = twitterService.getTweets(q, result_type); |
| } |
| |
| public function refresh(): void { |
| getUserInfo(String(data)); |
| getTweets("from:" + String(data), "recent"); |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Declarations> |
| <s:CallResponder id="getUserInfoResult"/> |
| <twitterservice:TwitterService id="twitterService"/> |
| <s:CallResponder id="getTweetsResult"/> |
| <!-- Place non-visual elements (e.g., services, value objects) here --> |
| </fx:Declarations> |
| <s:navigationContent> |
| <s:Image width="43" height="43" source="{getUserInfoResult.lastResult.profile_image_url}"/> |
| </s:navigationContent> |
| <s:titleContent> |
| <s:Label color="#FFFFFF" fontWeight="bold" text="{data}"/> |
| </s:titleContent> |
| <s:Label x="10" y="10" fontWeight="bold" text="Location"/> |
| <s:Label y="10" left="82" right="10" maxDisplayedLines="1" text="{getUserInfoResult.lastResult.location}"/> |
| <s:Label x="10" y="33" fontWeight="bold" text="Website"/> |
| <s:Label y="33" left="82" right="10" maxDisplayedLines="1" text="{getUserInfoResult.lastResult.url}"/> |
| <s:List id="list" x="0" y="56" width="320" height="443" borderVisible="true" labelField="text"> |
| <s:AsyncListView list="{TypeUtility.convertToCollection(getTweetsResult.lastResult.results)}"/> |
| <s:itemRenderer> |
| <fx:Component> |
| <s:IconItemRenderer labelField="" messageField="text" verticalAlign="top"/> |
| </fx:Component> |
| </s:itemRenderer> |
| </s:List> |
| </s:View> |