forked from hzuapps/android-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...ain/java/edu/hzuapps/androidworks/homeworks/com1314080901128/Com1314080901128Message.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.edu.hzu.liaotian; | ||
|
||
import java.io.Serializable; | ||
|
||
public class Message { | ||
private String from_username; | ||
private Long create_time; | ||
private String text; | ||
public String getFrom_username() { | ||
return from_username; | ||
} | ||
|
||
public Long getCreate_time() { | ||
return create_time; | ||
} | ||
public void setCreate_time(Long create_time) { | ||
this.create_time = create_time; | ||
} | ||
public String getText() { | ||
return text; | ||
} | ||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
|
||
public void setFrom_username(String from_username) { | ||
this.from_username = from_username; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingBottom="@dimen/activity_vertical_margin" | ||
android:paddingLeft="@dimen/activity_horizontal_margin" | ||
android:paddingRight="@dimen/activity_horizontal_margin" | ||
android:paddingTop="@dimen/activity_vertical_margin" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
tools:context="com.edu.hzu.liaotian.MainActivity" | ||
tools:showIn="@layout/activity_main"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" /> | ||
</RelativeLayout> |
60 changes: 60 additions & 0 deletions
60
app/src/main/res/layout/list_message_item_left_com1314080901128.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
|
||
android:padding="6dp"> | ||
|
||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:gravity="center_horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/tv_sendtime" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textColor="#8B8B8B" | ||
android:textSize="12sp" | ||
android:text="15:03:15"/> | ||
</LinearLayout> | ||
|
||
|
||
<RelativeLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content"> | ||
android:layout_marginTop="5dp" > | ||
|
||
<ImageView | ||
android:id="@+id/iv_userhead" | ||
android:layout_width="40dp" | ||
android:layout_height="40dp" | ||
android:background="@drawable/head_portrait_a" | ||
android:focusable="false" | ||
android:layout_alignParentLeft="true" | ||
android:layout_alignParentTop="true" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_username" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginBottom="5dp" | ||
android:textColor="#8B8B8B" | ||
android:layout_toRightOf="@id/iv_userhead" | ||
android:text="name"/> | ||
|
||
<TextView | ||
android:id="@+id/tv_chatcontent" | ||
android:layout_toRightOf="@id/iv_userhead" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginRight="40dp" | ||
android:layout_below="@id/tv_username" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:background="@drawable/message_text_background_a"/> | ||
</RelativeLayout> | ||
|
||
</LinearLayout> |
61 changes: 61 additions & 0 deletions
61
app/src/main/res/layout/list_message_item_right_com1314080901128.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
|
||
android:padding="6dp"> | ||
|
||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:gravity="center_horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/tv_sendtime" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textColor="#8B8B8B" | ||
android:textSize="12sp" | ||
android:text="15:03:15"/> | ||
</LinearLayout> | ||
|
||
|
||
<RelativeLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="5dp" > | ||
|
||
<ImageView | ||
android:id="@+id/iv_userhead" | ||
android:layout_width="40dp" | ||
android:layout_height="40dp" | ||
android:background="@drawable/head_portrait_b" | ||
android:focusable="false" | ||
android:layout_alignParentRight="true" | ||
android:layout_alignParentTop="true" /> | ||
|
||
<TextView | ||
android:id="@+id/tv_username" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginRight="10dp" | ||
android:layout_marginBottom="5dp" | ||
android:textColor="#8B8B8B" | ||
android:layout_toLeftOf="@id/iv_userhead" | ||
android:text="name"/> | ||
|
||
<TextView | ||
android:id="@+id/tv_chatcontent" | ||
android:layout_toLeftOf="@id/iv_userhead" | ||
android:layout_marginRight="10dp" | ||
android:layout_marginLeft="40dp" | ||
android:layout_below="@id/tv_username" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
|
||
android:background="@drawable/message_text_background_b"/> | ||
</RelativeLayout> | ||
|
||
</LinearLayout> |