日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
AndroidUI設(shè)計(jì)模板Dashboard及ActionBar的應(yīng)用

【譯文】Action Bar及Dashboard能在大多數(shù)Android程序項(xiàng)目中為用戶提供界面設(shè)計(jì)圖案。

創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供雄縣網(wǎng)站建設(shè)、雄縣做網(wǎng)站、雄縣網(wǎng)站設(shè)計(jì)、雄縣網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、雄縣企業(yè)網(wǎng)站模板建站服務(wù),十載雄縣做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

Dashboard項(xiàng)目組已經(jīng)開始著手于一個(gè)項(xiàng)目,以幫助開發(fā)者們更快地使他們的項(xiàng)目步入軌道。這一項(xiàng)目的目的是將可在不同UI模板上使用的代碼收集并整合起來。我以Google IO會議上的Android應(yīng)用程序?yàn)榛A(chǔ),去掉冗余的代碼,以使這些精簡過的好用的部分更易于理解。

我在做的項(xiàng)目可以在下面的谷歌代碼網(wǎng)站中找到.

目前該項(xiàng)目只進(jìn)行一項(xiàng)工作,其成果將同時(shí)作用于Dashboard及Action bar。

實(shí)施指南

讓所有的Android應(yīng)用程序都能同時(shí)支持縱向及橫向顯示模式,這一點(diǎn)非常重要。盡管許多布局方案在編輯正確的前提下,都可以自動實(shí)現(xiàn)對縱向、橫向顯示模式的支持,但Dashboard所制作的布局還做不到這一點(diǎn)。為了保證這兩種模式下都具備充足的可用空間,我們需要編寫兩個(gè)單獨(dú)的布局XMLs。只要我們將相同的布局XML文件放入正確的文件夾并提交給Android系統(tǒng),系統(tǒng)框架將在運(yùn)行時(shí)自動選擇合適的顯示方式。

支持不同方向下的不同布局的構(gòu)架范例

縱向布局XML代碼

 
 
 
 
  1. dashboard.xml:  
  2.  
  3.  
  4.  
  5.  
  6.     android:id="@+id/home_root" 
  7.     android:orientation="vertical" 
  8.     android:layout_width="fill_parent" 
  9.     android:layout_height="fill_parent"> 
  10.  
  11.      
  12.         
  13.             android:contentDescription="@string/description_logo" 
  14.             android:src="@drawable/title_logo" /> 
  15.  
  16.          
  17.  
  18.          
  19.         
  20.             android:id="@+id/btn_title_refresh" 
  21.             android:contentDescription="@string/description_refresh" 
  22.             android:src="@drawable/ic_title_refresh" 
  23.             android:onClick="onActionBarButtonClick" /> 
  24.         
  25.             android:id="@+id/title_refresh_progress" 
  26.             android:visibility="gone" /> 
  27.  
  28.          
  29.         
  30.             android:contentDescription="@string/description_search" 
  31.             android:src="@drawable/ic_title_search" 
  32.             android:onClick="onActionBarButtonClick" /> 
  33.      
  34.  
  35.     
  36.         android:orientation="vertical" 
  37.         android:layout_width="fill_parent" 
  38.         android:layout_height="wrap_content" 
  39.         android:layout_weight="1" 
  40.         android:padding="6dip"> 
  41.         
  42.             android:orientation="horizontal" 
  43.             android:layout_width="fill_parent" 
  44.             android:layout_height="wrap_content" 
  45.             android:layout_weight="1"> 
  46.             
  47.                 style="@style/HomeButton" 
  48.                 android:onClick="onActionOneClick" 
  49.                 android:text="@string/dashboard_action" 
  50.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  51.             
  52.                 style="@style/HomeButton" 
  53.                 android:onClick="onActionTwoClick" 
  54.                 android:text="@string/dashboard_action" 
  55.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  56.          
  57.  
  58.         
  59.             android:orientation="horizontal" 
  60.             android:layout_width="fill_parent" 
  61.             android:layout_height="wrap_content" 
  62.             android:layout_weight="1"> 
  63.             
  64.                 style="@style/HomeButton" 
  65.                 android:onClick="onActionThreeClick" 
  66.                 android:text="@string/dashboard_action" 
  67.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  68.             
  69.                 style="@style/HomeButton" 
  70.                 android:onClick="onActionFourClick" 
  71.                 android:text="@string/dashboard_action" 
  72.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  73.          
  74.  
  75.         
  76.             android:orientation="horizontal" 
  77.             android:layout_width="fill_parent" 
  78.             android:layout_height="wrap_content" 
  79.             android:layout_weight="1"> 
  80.             
  81.                 style="@style/HomeButton" 
  82.                 android:onClick="onActionFiveClick" 
  83.                 android:text="@string/dashboard_action" 
  84.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  85.             
  86.                 style="@style/HomeButton" 
  87.                 android:onClick="onActionSixClick" 
  88.                 android:text="@string/dashboard_action" 
  89.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  90.  
  91.          
  92.      
  93.  
  94.     
  95.         android:id="@+id/now_playing_loading" 
  96.         android:layout_width="fill_parent" 
  97.         android:layout_height="@dimen/now_playing_height" 
  98.         android:orientation="horizontal" 
  99.         android:background="#eee" 
  100.         android:gravity="center"> 
  101.         
  102.             style="?android:attr/progressBarStyleSmall" 
  103.             android:layout_width="wrap_content" 
  104.             android:layout_height="wrap_content" 
  105.             android:paddingRight="6dip" 
  106.             android:indeterminate="true"/> 
  107.         
  108.             android:layout_width="wrap_content" 
  109.             android:layout_height="wrap_content" 
  110.             android:textSize="@dimen/text_size_small" 
  111.             android:text="@string/now_playing_loading"/> 
  112.      
  113.  
  114.  

瀏覽模式XML代碼

 
 
 
 
  1. dashboard.xml:  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.     android:id="@+id/home_root" 
  8.     android:orientation="vertical" 
  9.     android:layout_width="fill_parent" 
  10.     android:layout_height="fill_parent"> 
  11.  
  12.  
  13.      
  14.         
  15.             android:src="@drawable/title_logo" /> 
  16.  
  17.  
  18.          
  19.  
  20.  
  21.          
  22.         
  23.             android:id="@+id/btn_title_refresh" 
  24.             android:src="@drawable/ic_title_refresh" 
  25.             android:onClick="onActionBarButtonClick" /> 
  26.         
  27.             android:id="@+id/title_refresh_progress" 
  28.             android:visibility="gone" /> 
  29.  
  30.  
  31.          
  32.         
  33.             android:src="@drawable/ic_title_search" 
  34.             android:onClick="onActionBarButtonClick" /> 
  35.      
  36.  
  37.  
  38.     
  39.         android:orientation="vertical" 
  40.         android:layout_width="fill_parent" 
  41.         android:layout_height="wrap_content" 
  42.         android:layout_weight="1" 
  43.         android:padding="6dip"> 
  44.         
  45.             android:orientation="horizontal" 
  46.             android:layout_width="fill_parent" 
  47.             android:layout_height="wrap_content" 
  48.             android:layout_weight="1"> 
  49.             
  50.                 style="@style/HomeButton" 
  51.                 android:onClick="onActionOneClick" 
  52.                 android:text="@string/dashboard_action" 
  53.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  54.             
  55.                 style="@style/HomeButton" 
  56.                 android:onClick="onActionTwoClick" 
  57.                 android:text="@string/dashboard_action" 
  58.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  59.             
  60.                 style="@style/HomeButton" 
  61.                 android:onClick="onActionThreeClick" 
  62.                 android:text="@string/dashboard_action" 
  63.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  64.          
  65.       
  66.         
  67.             android:orientation="horizontal" 
  68.             android:layout_width="fill_parent" 
  69.             android:layout_height="wrap_content" 
  70.             android:layout_weight="1"> 
  71.             
  72.                 style="@style/HomeButton" 
  73.                 android:onClick="onActionFourClick" 
  74.                 android:text="@string/dashboard_action" 
  75.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  76.             
  77.                 style="@style/HomeButton" 
  78.                 android:onClick="onActionFiveClick" 
  79.                 android:text="@string/dashboard_action" 
  80.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  81.             
  82.                 style="@style/HomeButton" 
  83.                 android:onClick="onActionSixClick" 
  84.                 android:text="@string/dashboard_action" 
  85.                 android:drawableTop="@drawable/dashboard_button_selector"/> 
  86.          
  87.      
  88.  
  89.  

其它實(shí)用項(xiàng)目

在Android系統(tǒng)中另有許多實(shí)用項(xiàng)目,以使開發(fā)者可以很容易地獲取兼容性許可。

iosched - Google IO app by Google

這個(gè)項(xiàng)目試圖提供一個(gè)在應(yīng)用程序上實(shí)現(xiàn)Dashboard及Action bar用戶設(shè)計(jì)模塊的完整范例,這是個(gè)相當(dāng)大的工程。有鑒于此,如果你只需要兼容Dashboard或Action bar工具的設(shè)計(jì)成果,我建議你使用android-ui-patterns(android用戶模塊工具)。

GreenDroid library

源自網(wǎng)絡(luò)的項(xiàng)目目標(biāo)列表

◆避免在重復(fù)拷貝相同的代碼上浪費(fèi)時(shí)間

◆嘗試使Android上的不同應(yīng)用程序更加相似

◆幫助開發(fā)者構(gòu)建功能強(qiáng)大的應(yīng)用程序

◆充分利用Android系統(tǒng)框架的功能

◆盡可能多地使用XML

原文地址

【譯稿,非經(jīng)授權(quán)謝絕轉(zhuǎn)載,合作媒體轉(zhuǎn)載請注明原文出處、作者及譯稿和譯者!】


新聞標(biāo)題:AndroidUI設(shè)計(jì)模板Dashboard及ActionBar的應(yīng)用
文章URL:http://m.5511xx.com/article/coeoohs.html