The interface effects implemented in the previous articles do not conform to the HOLO theme of 4.0 and the design specifications recommended by the official team. Thanks to "a piece of ice in the jade pot", I will keep making mistakes, it will mislead you. In the next few articles, I plan to use the HOLO topic to simulate the IMPLEMENTATION OF THE 5.0 interface.
First, let's take a look at the results to be achieved today:
The pop-up interface is similar to the previous one. We will not describe it here. Let's look at the implementation layout file of the main interface:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" > <LinearLayout android:id="@+id/llayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:orientation="vertical" > <include layout="@layout/top1" /> <include layout="@layout/top2" /> </LinearLayout><LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> </LinearLayout></RelativeLayout>
The preceding <include> label introduces external layout and puts it here.
Top1.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <RelativeLayout android:layout_width="wrap_content" android:layout_height="50dp" android:background="@drawable/abc_ab_bottom_solid_dark_holo" android:gravity="center_vertical" > <LinearLayout android:layout_width="wrap_content" android:layout_height="50dp" android:layout_alignParentLeft="true" android:layout_marginLeft="10dp" android:gravity="center" android:orientation="horizontal" > <ImageView android:layout_width="30dp" android:layout_height="30dp" android:src="@drawable/actionbar_icon" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:text="" android:textColor="@color/lightgray" android:textSize="18dp" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="50dp" android:layout_alignParentRight="true" android:gravity="center" android:orientation="horizontal" > <ImageView android:layout_width="30dp" android:layout_height="wrap_content" android:layout_marginRight="20dip" android:src="@drawable/actionbar_search_icon" /> <ImageView android:id="@+id/add" android:layout_width="30dp" android:layout_height="wrap_content" android:layout_marginRight="20dip" android:src="@drawable/actionbar_add_icon" /> <ImageView android:id="@+id/set" android:layout_width="30dp" android:layout_height="wrap_content" android:src="@drawable/actionbar_more_icon" /> </LinearLayout> </RelativeLayout></LinearLayout>
This layout is very simple. It is a relatively layout nested with two linear la S.
Top2.xml
<? Xml version = "1.0" encoding = "UTF-8"?> <LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: layout_width = "match_parent" android: layout_height = "match_parent" android: orientation = "vertical"> <LinearLayout android: id = "@ + id/lllayout" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: background = "# F5F5F5" android: orientation = "horizontal"> <LinearLayout android: layout_width = "match_parent" android: layout_height = "wrap_content" android: layout_weight = "1" android: background = "@ drawable/guide_round" android: gravity = "center" android: orientation = "vertical"> <TextView android: id = "@ + id/liaotian" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: gravity = "center" android: padding = "10dip" android: text = "chat" android: textColor = "@ color/green" android: textSize = "15dip"/> </LinearLayout> <LinearLayout android: layout_width = "match_parent" android: layout_height = "wrap_content" android: layout_weight = "1" android: background = "@ drawable/guide_round" android: clickable = "true" android: gravity = "center" android: orientation = "vertical" android: saveEnabled = "false"> <TextView android: id = "@ + id/faxian" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: gravity = "center" android: padding = "10dip" android: text = "found" android: textColor = "@ color/black" android: textSize = "15dip"/> </LinearLayout> <LinearLayout android: layout_width = "match_parent" android: layout_height = "wrap_content" android: layout_weight = "1" android: background = "@ drawable/guide_round" android: focusable = "false" android: gravity = "center" android: orientation = "vertical"> <TextView android: id = "@ + id/tongxunlu" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: gravity = "center" android: padding = "10dip" android: text = "Address Book" android: textColor = "@ color/black" android: textSize = "15dip"/> </LinearLayout>
Three menus are wrapped in three linear la S.
Finally, paste the content of the manifest File
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.holoweixin" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar" > <activity android:name=".IndexActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MainActivity" android:screenOrientation="portrait"/> </application></manifest>
The fire caught a cold in the past two days. Let's continue today ....
If you have any questions or better methods, please point out that I will improve it again. Thank you.
Source code: http://download.csdn.net/detail/lxq_xsyu/7002611