信息界面前端初步完成

master
Toyga 4 years ago
parent 3129d3bf5a
commit 55fd98e2fa

@ -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.Attention;
import com.example.leudaemialikeme.Model.Attention;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

@ -6,9 +6,8 @@ import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import com.example.leudaemialikeme.Adapter.EventAdapter;
import com.example.leudaemialikeme.Adapter.QuestionAdapter;
import com.example.leudaemialikeme.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.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.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import com.example.leudaemialikeme.Adapter.InfoAdapter;
import java.util.ArrayList;

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

@ -9,8 +9,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Attention;
import com.example.leudaemialikeme.Collect;
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.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.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.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import java.util.List;

@ -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();
}
}

@ -3,13 +3,12 @@ package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.MyQuestion;
import com.example.leudaemialikeme.Model.MyQuestion;
import com.example.leudaemialikeme.R;
import java.util.List;

@ -3,14 +3,13 @@ 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.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.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import java.util.List;

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

@ -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.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.Recnews;
import com.example.leudaemialikeme.Model.Recnews;
import java.util.ArrayList;
import java.util.List;

@ -1,7 +1,5 @@
package com.example.leudaemialikeme.Fragment;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
@ -16,7 +14,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.example.leudaemialikeme.Adapter.CollectAdapter;
import com.example.leudaemialikeme.Collect;
import com.example.leudaemialikeme.Model.Collect;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;

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

@ -1,4 +1,4 @@
package com.example.leudaemialikeme;
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;
package com.example.leudaemialikeme.Model;
import java.io.Serializable;

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

@ -5,126 +5,9 @@
android:layout_height="match_parent"
tools:context="com.example.leudaemialikeme.Fragment.PrivateMsgFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="" />
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_private_msg"
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>
android:layout_height="match_parent" />
</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,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="你好,我也是刚刚确诊的病人...我能问你几个问题吗343u853827847584957475943754" />
</LinearLayout>
</LinearLayout>
Loading…
Cancel
Save