发帖+提问

master
hjw 3 years ago
commit 49effcc8d0

@ -10,7 +10,8 @@
android:supportsRtl="true"
android:name=".Utils.Data"
android:theme="@style/Theme.LeudaemiaLikeMe">
<activity android:name=".Activity.AttentionActivity"></activity>
<activity android:name=".Activity.ChatActivity"></activity>
<activity android:name=".Activity.AttentionActivity" />
<activity android:name=".Activity.HistoryActivity" />
<activity android:name=".Activity.CollectActivity" />
<activity android:name=".Activity.SafetyActivity" />

@ -1,13 +1,13 @@
package com.example.leudaemialikeme.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import com.example.leudaemialikeme.Adapter.AttentionAdapter;
import com.example.leudaemialikeme.Bean.Attention;
import com.example.leudaemialikeme.Model.Attention;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

@ -0,0 +1,16 @@
package com.example.leudaemialikeme.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.example.leudaemialikeme.R;
public class ChatActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
}
}

@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import com.example.leudaemialikeme.Adapter.QuestionAdapter;
import com.example.leudaemialikeme.Bean.Question;
import com.example.leudaemialikeme.Model.Question;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import com.example.leudaemialikeme.Adapter.EventAdapter;
import com.example.leudaemialikeme.Bean.Event;
import com.example.leudaemialikeme.Model.Event;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

@ -14,7 +14,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Bean.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import com.example.leudaemialikeme.Adapter.InfoAdapter;
import java.util.ArrayList;

@ -1,13 +1,13 @@
package com.example.leudaemialikeme.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import com.example.leudaemialikeme.Adapter.MyQuestionAdapter;
import com.example.leudaemialikeme.Bean.MyQuestion;
import com.example.leudaemialikeme.Model.MyQuestion;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

@ -9,7 +9,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Bean.Attention;
import com.example.leudaemialikeme.Model.Attention;
import com.example.leudaemialikeme.R;
import java.util.List;

@ -9,7 +9,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Bean.Collect;
import com.example.leudaemialikeme.Model.Collect;
import com.example.leudaemialikeme.R;
import java.util.List;

@ -8,7 +8,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Bean.Event;
import com.example.leudaemialikeme.Model.Event;
import com.example.leudaemialikeme.R;
import java.util.List;

@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Activity.DetailActivity;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Bean.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import java.util.List;

@ -21,9 +21,6 @@ public class MessagePageFragmentAdapter extends FragmentPagerAdapter {
public Fragment getItem(int position) {
String MessageCategoryTitle = channelList[position];
/* if(position == 0)
{return new PrivateMsgFragment();
}*/
return MessageChannelFragment.newInstance(MessageCategoryTitle);
}

@ -0,0 +1,68 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.Msg;
import com.example.leudaemialikeme.R;
import java.util.List;
public class MsgAdapter extends RecyclerView.Adapter<MsgAdapter.ViewHolder> {
private List<Msg> msgList;
static class ViewHolder extends RecyclerView.ViewHolder{
ImageView portrait;
TextView nickname;
TextView introduction;
LinearLayout linear_msg;
public ViewHolder(View view){
super(view);
portrait = (ImageView)view.findViewById(R.id.img_portrait);
nickname = (TextView)view.findViewById(R.id.text_nickname);
introduction = (TextView)view.findViewById(R.id.text_introduction);
linear_msg = (LinearLayout)view.findViewById(R.id.linear_msg);
}
}
public MsgAdapter(List<Msg> msgList) {
this.msgList = msgList;
}
@NonNull
@Override
public MsgAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.pivate_msg_item,parent,false);
MsgAdapter.ViewHolder holder=new MsgAdapter.ViewHolder(view);
holder.linear_msg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
////////////////////////////////////////////////////
}
});
return holder;
}
@Override
public void onBindViewHolder(@NonNull MsgAdapter.ViewHolder holder, int position) {
Msg msg = msgList.get(position);
holder.portrait.setImageResource(msg.getPortraitID());
holder.introduction.setText(String.valueOf(msg.getIntroduction()));
holder.nickname.setText(msg.getNickname());
}
@Override
public int getItemCount() {
return msgList.size();
}
}

@ -8,7 +8,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Bean.MyQuestion;
import com.example.leudaemialikeme.Model.MyQuestion;
import com.example.leudaemialikeme.R;
import java.util.List;

@ -9,7 +9,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Bean.Question;
import com.example.leudaemialikeme.Model.Question;
import com.example.leudaemialikeme.R;
import java.util.List;

@ -14,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Activity.DetailActivity;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Bean.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import java.util.List;

@ -1,6 +1,10 @@
package com.example.leudaemialikeme.Fragment;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DefaultItemAnimator;
@ -8,18 +12,15 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.leudaemialikeme.Adapter.CollectAdapter;
import com.example.leudaemialikeme.Bean.Collect;
import com.example.leudaemialikeme.Model.Collect;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;
import java.util.List;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the

@ -15,7 +15,7 @@ import com.example.leudaemialikeme.Activity.InfoActivity;
import com.example.leudaemialikeme.Activity.MdctRmdActivity;
import com.example.leudaemialikeme.Activity.SearchActivity;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Bean.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import com.example.leudaemialikeme.Adapter.RecnewsAdapter;
import java.util.ArrayList;

@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Adapter.RecnewsAdapter;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Bean.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import java.util.ArrayList;
import java.util.List;

@ -7,13 +7,21 @@ import android.view.ViewGroup;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Adapter.MsgAdapter;
import com.example.leudaemialikeme.Model.Msg;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;
import java.util.List;
public class MessageChannelFragment extends Fragment {
private static final String ARG_CATEGORY_TITLE = "category_title";
private String messageCategoryTitle = "Default";
private TextView mTitleField;
private List<Msg> msgList = new ArrayList<Msg>();
public MessageChannelFragment() {
// Required empty public constructor
@ -22,7 +30,7 @@ public class MessageChannelFragment extends Fragment {
public static MessageChannelFragment newInstance(String messageCategoryTitle) {
MessageChannelFragment fragment = new MessageChannelFragment();
Bundle args = new Bundle();
args.putString(ARG_CATEGORY_TITLE,messageCategoryTitle);
args.putString(ARG_CATEGORY_TITLE, messageCategoryTitle);
fragment.setArguments(args);
return fragment;
}
@ -30,35 +38,42 @@ public class MessageChannelFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try{
messageCategoryTitle = (String)getArguments().getString(ARG_CATEGORY_TITLE);
}catch (java.lang.NullPointerException e){
try {
messageCategoryTitle = (String) getArguments().getString(ARG_CATEGORY_TITLE);
} catch (java.lang.NullPointerException e) {
System.out.println("TesFragment getArg error!");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Bundle savedInstanceState) {
View view;
if(messageCategoryTitle.equals(" 私信 "))
{
if (messageCategoryTitle.equals(" 私信 ")) {
view = inflater.inflate(R.layout.fragment_private_msg,container,false);
RecyclerView recyclerView = (RecyclerView)view.findViewById(R.id.list_private_msg);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
getMsgList();
MsgAdapter msgAdapter = new MsgAdapter(msgList);
recyclerView.setAdapter(msgAdapter);
} else if (messageCategoryTitle.equals(" 评论 ")) {
view = inflater.inflate(R.layout.fragment_comment, container, false);
} else if (messageCategoryTitle.equals(" 粉丝 ")) {
view = inflater.inflate(R.layout.fragment_fans, container, false);
} else if (messageCategoryTitle.equals(" 赞 ")) {
view = inflater.inflate(R.layout.fragment_nice, container, false);
} else {
view = inflater.inflate(R.layout.fragment_message_channel, container, false);
mTitleField = (TextView) view.findViewById(R.id.messageCategoryTitle);
mTitleField.setText(messageCategoryTitle);
}
else if(messageCategoryTitle.equals(" 评论 ")){
view = inflater.inflate(R.layout.fragment_comment,container,false);
}
else if(messageCategoryTitle.equals(" 粉丝 ")){
view = inflater.inflate(R.layout.fragment_fans,container,false);
}
else if(messageCategoryTitle.equals(" 赞 ")){
view = inflater.inflate(R.layout.fragment_nice,container,false);
}
else{
view = inflater.inflate(R.layout.fragment_message_channel, container, false);
mTitleField = (TextView) view.findViewById(R.id.messageCategoryTitle);
mTitleField.setText(messageCategoryTitle);
}
return view;
}
private void getMsgList(){
Msg msg = new Msg(R.drawable.img_user1, "张三", " ");
msgList.add(msg);
}
}

@ -9,7 +9,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.example.leudaemialikeme.Activity.APNActivity;
import com.example.leudaemialikeme.Activity.AboutActivity;
@ -43,25 +42,6 @@ public class MyFragment extends Fragment {
public MyFragment() {
// Required empty public constructor
}
public static PrivateMsgFragment newInstance(String param1, String param2) {
PrivateMsgFragment fragment = new PrivateMsgFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment MyFragment.
*/
// TODO: Rename and change types and number of parameters
@Override
public void onCreate(Bundle savedInstanceState) {

@ -14,7 +14,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.example.leudaemialikeme.Adapter.CollectAdapter;
import com.example.leudaemialikeme.Bean.Collect;
import com.example.leudaemialikeme.Model.Collect;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

@ -1,123 +1,48 @@
package com.example.leudaemialikeme.Fragment;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.example.leudaemialikeme.R;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link PrivateMsgFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link PrivateMsgFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class PrivateMsgFragment extends Fragment implements ViewPager.OnPageChangeListener {
public class PrivateMsgFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private View view;
private OnFragmentInteractionListener mListener;
public PrivateMsgFragment() {
// Required empty public constructor
}
public static PrivateMsgFragment newInstance(){
PrivateMsgFragment privateMsgFragment = new PrivateMsgFragment();
return privateMsgFragment;
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment PrivateMsgFragment.
*/
// TODO: Rename and change types and number of parameters
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
// return inflater.inflate(R.layout.fragment_private_msg2, container, false);
super.onCreate(savedInstanceState);
View view = inflater.inflate(R.layout.fragment_private_msg,container,false);
return view;
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}

@ -1,4 +1,4 @@
package com.example.leudaemialikeme.Bean;
package com.example.leudaemialikeme.Model;
import java.io.Serializable;

@ -1,4 +1,4 @@
package com.example.leudaemialikeme.Bean;
package com.example.leudaemialikeme.Model;
import java.io.Serializable;

@ -1,4 +1,4 @@
package com.example.leudaemialikeme.Bean;
package com.example.leudaemialikeme.Model;
import java.io.Serializable;

@ -0,0 +1,39 @@
package com.example.leudaemialikeme.Model;
import java.io.Serializable;
public class Msg implements Serializable {
private int portraitID;
private String nickname;
private String introduction;
public Msg(int portraitID, String nickname, String introduction) {
this.portraitID = portraitID;
this.nickname = nickname;
this.introduction = introduction;
}
public void setPortraitID(int portraitID) {
this.portraitID = portraitID;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public int getPortraitID() {
return portraitID;
}
public String getNickname() {
return nickname;
}
public String getIntroduction() {
return introduction;
}
}

@ -1,4 +1,4 @@
package com.example.leudaemialikeme.Bean;
package com.example.leudaemialikeme.Model;
import java.io.Serializable;

@ -1,4 +1,4 @@
package com.example.leudaemialikeme.Bean;
package com.example.leudaemialikeme.Model;
import java.io.Serializable;

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
tools:context=".Activity.ChatActivity"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<ImageButton
android:id="@+id/imageButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/left_back"
android:background="@color/white"/>
<TextView
android:id="@+id/textView16"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textSize="18dp"
android:textColor="#000"
android:text="匿名" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/msg_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/edit_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="type here"
android:maxLength="3"/>
<Button
android:id="@+id/bt_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Send" />
</LinearLayout>
</LinearLayout>

@ -1,130 +1,15 @@
<FrameLayout 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"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leudaemialikeme.Fragment.PrivateMsgFragment">
android:layout_margin="20dp"
android:background="#ffffff">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_private_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="@drawable/img_reminding" />
</LinearLayout>
<LinearLayout
android:layout_width="350dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView29"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="系统通知" />
<TextView
android:id="@+id/textView30"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="恭喜你,验证身份通过,成功加入小白帮....." />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<LinearLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="@drawable/img_helper" />
</LinearLayout>
<LinearLayout
android:layout_width="353dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="小白帮_新人助手" />
<TextView
android:id="@+id/textView31"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hi,你终于来啦,欢迎你加入......" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<LinearLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView34"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="@drawable/img_user1" />
</LinearLayout>
<LinearLayout
android:layout_width="353dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView39"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="匿名用户" />
<TextView
android:id="@+id/textView46"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="你好,我也是刚刚确诊的病人...我能问你几个问题吗?" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>

@ -9,7 +9,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
android:text="" />
<LinearLayout
android:layout_width="match_parent"
@ -88,6 +88,43 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<LinearLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView34"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="@drawable/img_user1" />
</LinearLayout>
<LinearLayout
android:layout_width="353dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textView39"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="匿名用户" />
<TextView
android:id="@+id/textView46"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="你好,我也是刚刚确诊的病人...我能问你几个问题吗?" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<LinearLayout
android:id="@+id/msg_content_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="@drawable/bubble_left"
android:orientation="horizontal">
<TextView
android:id="@+id/textView52"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_margin="10dp"
android:text="TextView" />
</LinearLayout>
<LinearLayout
android:id="@+id/msg_content_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@drawable/bubble_right"
android:orientation="horizontal">
<TextView
android:id="@+id/textView53"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_margin="10dp"
android:text="TextView" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="15dp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/linear_msg">
<LinearLayout
android:layout_width="60dp"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/img_portrait"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="@drawable/img_user1" />
</LinearLayout>
<LinearLayout
android:layout_width="353dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/text_nickname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="--" />
<TextView
android:id="@+id/text_introduction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="" />
</LinearLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Loading…
Cancel
Save