首页合并3.0

master
Annnnnn 3 years ago
parent dcb99cc1b4
commit 3458d9bf93

@ -1,131 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import com.example.leudaemialikeme.CallAlarm;
import com.example.leudaemialikeme.Model.Clock;
import com.example.leudaemialikeme.R;
import java.util.Calendar;
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.list;
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.timeAdapter;
public class AddClock extends BaseActivity implements View.OnClickListener {
private Calendar calendar;
private TextView show_hour;
private TextView show_minute;
private EditText content_name;
private EditText content_dosage;
private Button set;
private Button save;
private ImageView back;
String hourformat;
String minuteformat;
Clock clock = new Clock();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_clock);
show_hour = findViewById(R.id.hour);
show_minute = findViewById(R.id.minute);
content_name = findViewById(R.id.content_name);
content_dosage = findViewById(R.id.content_dosage);
set = findViewById(R.id.set_time);
set.setOnClickListener(this);
save = findViewById(R.id.save);
back = findViewById(R.id.back_list_clock);
back.setImageResource(R.drawable.ic_back);
back.setOnClickListener(this);
save.setOnClickListener(this);
calendar = Calendar.getInstance();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.set_time:
calendar.setTimeInMillis(System.currentTimeMillis());
int mhour = calendar.get(Calendar.HOUR_OF_DAY);
int mminute = calendar.get(Calendar.MINUTE);
new TimePickerDialog(AddClock.this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
//calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);
calendar.set(Calendar.MINUTE, minute);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
hourformat = format(hourOfDay);
minuteformat = format(minute);
Toast.makeText(AddClock.this, "" + hourformat + ":" + minuteformat, Toast.LENGTH_SHORT).show();
show_hour.setText(hourformat);
show_minute.setText(minuteformat);
}
}, mhour, mminute, true).show();
break;
case R.id.save:
Intent intent = new Intent(AddClock.this, CallAlarm.class);
PendingIntent sender = PendingIntent.getBroadcast(
AddClock.this, 0, intent, 0);
AlarmManager am;
am = (AlarmManager) getSystemService(ALARM_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (System.currentTimeMillis()>calendar.getTimeInMillis()+40000){
//加24小时
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis()+86400000, sender);
}else {
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
}
}
clock.setHour(hourformat);
clock.setMinute(minuteformat);
clock.setName("" + content_name.getText().toString());
clock.setDosage("" + content_dosage.getText().toString());
clock.setClockType(Clock.clock_open);
if (clock.getHour()!=null&&clock.getMinute()!=null) {
clock.save();
list.add(clock);
timeAdapter.notifyDataSetChanged();
Log.e("Listnumber======",list.size()+"");
finish();
}else {
Toast.makeText(this, "请选择闹钟时间", Toast.LENGTH_SHORT).show();
}
break;
case R.id.back_list_clock:
finish();
break;
}
}
private String format(int x) {
String s = "" + x;
if (s.length() == 1) {
s = "0" + s;
}
return s;
}
}

@ -1,203 +0,0 @@
package com.example.leudaemialikeme.Activity;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import com.example.leudaemialikeme.Model.Event;
import com.example.leudaemialikeme.R;
import org.litepal.LitePal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
public class AddEventActivity extends BaseActivity {
public static final String EVENT_DAY = "event_day";
public static final String EVENT_MONTH= "event_month";
public static final String EVENT_INFO = "event_info";
public static final String EVENT_PLACE = "event_place";
public static final String EVENT_DOCTOR_NAME = "event_doctor_name";
public static final String EVENT_TIME = "event_time";
public static final String EVENT_CREATE_TIME = "event_create_time";
private TextView event_day,event_month,event_info;
private TextView event_place,event_doctor_name,event_time,event_create_time;
private String show_event_day,show_event_month,show_event_info;
private String show_event_place,show_event_doctor_name,show_event_time,show_event_create_time;
private ImageView delete,save;
private Button add_date,add_time;
private ImageView back;
DateFormat format= DateFormat.getDateTimeInstance();
Calendar calendar= Calendar.getInstance(Locale.CHINA);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_event);
event_day = findViewById(R.id.add_event_day);
event_month = findViewById(R.id.add_event_month);
event_info = findViewById(R.id.add_event_info);
event_place = findViewById(R.id.add_event_place);
event_doctor_name = findViewById(R.id.add_event_doctor_name);
event_time = findViewById(R.id.add_event_time);
event_create_time = findViewById(R.id.show_time);
delete = findViewById(R.id.delete_event);
save = findViewById(R.id.save_event);
add_date = findViewById(R.id.add_date);
add_time = findViewById(R.id.add_time);
back = findViewById(R.id.back_event_list);
Intent intent = getIntent();
show_event_day = intent.getStringExtra(EVENT_DAY);
show_event_month = intent.getStringExtra(EVENT_MONTH);
show_event_info = intent.getStringExtra(EVENT_INFO);
show_event_place = intent.getStringExtra(EVENT_PLACE);
show_event_doctor_name = intent.getStringExtra(EVENT_DOCTOR_NAME);
show_event_time = intent.getStringExtra(EVENT_TIME);
show_event_create_time = intent.getStringExtra(EVENT_CREATE_TIME);
event_day.setText(show_event_day);
event_month.setText(show_event_month);
event_info.setText(show_event_info);
event_place.setText(show_event_place);
event_doctor_name.setText(show_event_doctor_name);
event_time.setText(show_event_time);
event_create_time.setText(show_event_create_time);
//点击事项
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(AddEventActivity.this,EventActivity.class);
startActivity(intent);
}
});
delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String deleteContent=event_info.getText().toString();
LitePal.deleteAll(Event.class,"event_info=?",deleteContent);
finish();
}
});
save.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//创建时间不为空,表明为修改
if(show_event_create_time!=null){
String inputDay = event_day.getText().toString();
String inputMonth = event_month.getText().toString();
String inputInfo = event_info.getText().toString();
String inputPlace = event_place.getText().toString();
String inputName = event_doctor_name.getText().toString();
String inputTime = event_time.getText().toString();
Event event = new Event();
event.setEvent_day(inputDay);
event.setEvent_month(inputMonth);
event.setEvent_info(inputInfo);
event.setEvent_place(inputPlace);
event.setEvent_doctor_name(inputName);
event.setEvent_time(inputTime);
// LitePal.where("ownerNetId = ?", String.valueOf(ownerNetId)).find(Friend.class);
event.updateAll("event_create_time=?",show_event_create_time);
finish();
}else{
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
Date date=new Date(System.currentTimeMillis());
String inputDay = event_day.getText().toString();
String inputMonth = event_month.getText().toString();
String inputInfo = event_info.getText().toString();
String inputPlace = event_place.getText().toString();
String inputName = event_doctor_name.getText().toString();
String inputTime = event_time.getText().toString();
Event event = new Event();
event.setEvent_day(inputDay);
event.setEvent_month(inputMonth);
event.setEvent_info(inputInfo);
event.setEvent_place(inputPlace);
event.setEvent_doctor_name(inputName);
event.setEvent_time(inputTime);
event.setEvent_create_time(simpleDateFormat.format(date));
if(inputInfo.equals(LitePal.find(Event.class,3))){
Toast.makeText(AddEventActivity.this,"该大事记已存在",Toast.LENGTH_LONG).show();
finish();
}
event.save();
Toast.makeText(AddEventActivity.this,"保存成功",Toast.LENGTH_SHORT).show();
finish();//操作完成结束当前活动
}
}
});
//获取选择的月,日
add_date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showDatePickerDialog(AddEventActivity.this, 4, event_month,event_day, calendar);;
}
});
//获取选择的时间
add_time.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showTimePickerDialog(AddEventActivity.this, 4, event_time, calendar);
}
});
}
public static void showTimePickerDialog(Activity activity,int themeResId, final TextView event_time, Calendar calendar) {
new TimePickerDialog( activity,themeResId,
// 绑定监听器
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
// event_time.setText("您选择了:" + hourOfDay + "时" + minute + "分");
event_time.setText(hourOfDay+"时"+minute+"分");
}
}
// 设置初始时间
, calendar.get(Calendar.HOUR_OF_DAY)
, calendar.get(Calendar.MINUTE)
// true表示采用24小时制
,true).show();
}
public static void showDatePickerDialog(Activity activity, int themeResId, final TextView event_month,final TextView event_day, Calendar calendar) {
new DatePickerDialog(activity, themeResId, new DatePickerDialog.OnDateSetListener() {
// 绑定监听器(How the parent is notified that the date is set.)
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
// 此处得到选择的时间,可以进行你想要的操作
// tv.setText("您选择了:" + year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
event_day.setText(String.valueOf(dayOfMonth));
event_month.setText(String.valueOf(monthOfYear+1));
}
}
// 设置初始日期
, calendar.get(Calendar.YEAR)
, calendar.get(Calendar.MONTH)
, calendar.get(Calendar.DAY_OF_MONTH)).show();
}
}

@ -1,33 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.media.MediaPlayer;
import android.os.Bundle;
import com.example.leudaemialikeme.R;
public class AlarmAlert extends BaseActivity {
private MediaPlayer mediaPlayer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int position = getIntent().getIntExtra("position",-1);
mediaPlayer = MediaPlayer.create(this,R.raw.clockmusic2);
mediaPlayer.start();
new AlertDialog.Builder(AlarmAlert.this)
.setIcon(R.drawable.clock)
.setTitle("闹钟响了")
.setCancelable(false)
.setMessage("时间到了!")
.setPositiveButton("关掉"
, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
AlarmAlert.this.finish();
mediaPlayer.stop();
}
}).show();
}
}

@ -1,119 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
public class AnswerActivity extends AppCompatActivity {
private TextView text_answer_cancel;
private TextView text_answer_commit;
private TextView text_question_name;
private EditText edit_answer_detail;
private int qid;
private String qtitle;
@Override
protected void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();
qid = intent.getIntExtra("qid", -1);
qtitle = intent.getStringExtra("qtitle");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_answer);
text_answer_cancel = findViewById(R.id.text_answer_cancel);
text_answer_commit = findViewById(R.id.text_answer_commit);
text_question_name = findViewById(R.id.text_question_name);
edit_answer_detail = findViewById(R.id.text_answer_detail);
text_question_name.setText(qtitle);
text_answer_cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
text_answer_commit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(edit_answer_detail.getText().toString().equals("")){
Toast.makeText(AnswerActivity.this, "请输入回答内容", Toast.LENGTH_SHORT).show();
}else{
AlertDialog.Builder builder = new AlertDialog.Builder(AnswerActivity.this);
builder.setTitle("是否确认提交回答?");
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(AnswerActivity.this, "已取消回答", Toast.LENGTH_SHORT).show();
}
});
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String content = edit_answer_detail.getText().toString();
Map<String, String> params = new HashMap<>();
params.put("answerContent", content);
sendAnswer(params);
}
});
builder.show();
}
}
});
}
private void sendAnswer(final Map params){
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = LoginActivity.SERVER_URL+"/main-servlet?action=sendAnswer&iduser="+ BaseActivity.owner.getNetId()+"&qid="+qid;
OkHttpUtil.asyPost(url, params,new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String jsonStr = response.body().string();
runOnUiThread(new Runnable(){
@Override
public void run() {
if(jsonStr.equals("success")){
Toast.makeText(getApplicationContext(), "回答成功", Toast.LENGTH_SHORT).show();
finish();
}else {
Toast.makeText(getApplicationContext(), "回答失败", Toast.LENGTH_SHORT).show();
}
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
}

@ -1,332 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import com.example.leudaemialikeme.Adapter.CommentAdapter;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.Model.Comment;
import com.example.leudaemialikeme.Model.User;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
public class BlogDetailActivity extends BaseActivity {
TextView bTitleView;
TextView bAuthorNameView;
TextView bContentView;
TextView bViewNumView;
TextView bColNumView;
TextView bComNumView;
EditText comEditView;
TextView comComView;
ImageView detail_to;
ImageView search;
ImageView bColImage;
Blog blog=new Blog();
User author;
List<Comment> commentList=new ArrayList<>();
CommentAdapter commentAdapter=new CommentAdapter();
RecyclerView recyclerView;
LinearLayout detailColView;
private static ViewPager viewPager; //内导航的碎片的容器
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_blogdetail);
Intent intent=getIntent();//新增bid
blog.setBid(Integer.parseInt(intent.getStringExtra("bid")));//新增bid
blog.setBcontent(intent.getStringExtra("bContent"));
blog.setBtittle(intent.getStringExtra("bTitle"));
Log.e("传输后的bid",String.valueOf(blog.getBid()));
blog.setBcollectNum(Integer.parseInt(intent.getStringExtra("bColNum")));
blog.setBbrowse((Integer.parseInt(intent.getStringExtra("bViewNum"))));
blog.setUid(Integer.parseInt(intent.getStringExtra("uid")));
initView();
setData();
initClick();
recyclerView=(RecyclerView)findViewById(R.id.comment_recyclerView);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
commentAdapter=new CommentAdapter();
initComments();
Log.e("commentList",String.valueOf(commentList));
commentAdapter.setMCommentList(commentList);
recyclerView.setAdapter(commentAdapter);
}
private void initComments() {
new Thread(new Runnable() {
@Override
public void run() {
String url=BaseActivity.SERVER_URL+"/comment-servlet?action=getCommentByBid";
Map<String,String> paramMap=new HashMap<String,String>();
paramMap.put("bid",String.valueOf(blog.getBid()));
OkHttpUtil.asyPost(url, paramMap, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr=response.body().string();
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson=new Gson();
Log.e("comment",jsonStr);
Type listType=new TypeToken<List<Comment>>(){}.getType();
commentList = gson.fromJson(jsonStr,listType);
Log.e("onResponse:commentList",String.valueOf(commentList));
bComNumView.setText("("+String.valueOf(commentList.size())+")");
commentAdapter.setMCommentList(commentList);
recyclerView.setAdapter(commentAdapter);
}
});
}
});
}
}).start();
}
private void setBlogAuthorName(String uid){
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = BaseActivity.SERVER_URL + "/main-servlet?action=getUserById";
Map<String,String> paramMap = new HashMap<String,String>();
paramMap.put("uid", String.valueOf(blog.getUid()));
Log.e("设置帖子的作者uid",uid);
OkHttpUtil.asyPost(url, paramMap, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson = new Gson(); // 使用 gson 库解析 JSON 数据
// 创建一个 TypeToken 的匿名子类对象,并调用对象的 getType()方法
// Log.e("Blog's Str",jsonStr);
Type listType = new TypeToken<User>() {}.getType();
author = gson.fromJson(jsonStr, listType);
// bAuthorNameView=findViewById(R.id.author);
bAuthorNameView.setText(author.getUsername());
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
private void initView(){
bTitleView=findViewById(R.id.detail_theme);
bAuthorNameView=findViewById(R.id.author);
bContentView=findViewById(R.id.bContent);
bViewNumView=findViewById(R.id.detail_view_num);
bColNumView=findViewById(R.id.detail_col_num);
bComNumView=findViewById(R.id.comment_num);
comEditView=findViewById(R.id.comment_edit);
comComView=findViewById(R.id.comment_commit);
detail_to=findViewById(R.id.detail_to);
search=findViewById(R.id.detail_to_search);
detailColView=findViewById(R.id.detail_like);
detailColView=findViewById(R.id.detail_col);
bColImage=findViewById(R.id.imageView15);
}
private void setData(){
setBlogAuthorName(String.valueOf(blog.getUid()));
// setBColNumViewImage(blog.getBid(),BaseActivity.owner.getNetId()); 需要传入登录用户的id
setBColNumViewImage(blog.getBid(),BaseActivity.owner.getNetId(),2);
bViewNumView.setText(String.valueOf(blog.getBbrowse()));
bTitleView.setText(blog.getBtittle());
bContentView.setText(blog.getBcontent());
bColNumView.setText(String.valueOf(blog.getBcollectNum()));
}
private void setBColNumViewImage(int bid,int uid,int type){
Map<String,Integer> paramMap=new HashMap<String, Integer>();
paramMap.put("bid",bid);
paramMap.put("uid", uid);
paramMap.put("type",type);
String url_collect=BaseActivity.SERVER_URL+"/collect-servlet?action=JudgeCollect";
new Thread(new Runnable() {
@Override
public void run() {
String jsonStr=OkHttpUtil.synPost(url_collect,paramMap);
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.e("ColNumViewImage-jsonStr",jsonStr);
if(!jsonStr.contains("not")){
bColImage.setImageResource(R.drawable.collect_pick);
bColImage.setTag(R.drawable.collect_pick);
}else{
bColImage.setImageResource(R.drawable.collect);
bColImage.setTag(R.drawable.collect);
}
}
});
System.out.println("更新collect表成功");
}
}).start();
}
private void initClick(){
detail_to.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
finish();
}
});
search.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(BlogDetailActivity.this,BlogSearchActivity.class);
startActivity(intent);
}
});
comComView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
String cont = comEditView.getText().toString();
User user=new User();
user.setIduser(BaseActivity.owner.getNetId());
user.setUsername(BaseActivity.owner.getUsername());
long timeCurrent = System.currentTimeMillis();
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
Timestamp time = Timestamp.valueOf(sdf.format(timeCurrent));
Comment comment=new Comment(blog.getBid(),user.getUsername(),time,user.getIduser(),
cont,2);
Map<String,Comment> paramMap=new HashMap<String,Comment>();
paramMap.put("comment",comment);
String url=BaseActivity.SERVER_URL+"/comment-servlet?action=insertComment";
new Thread(new Runnable() {
@Override
public void run() {
OkHttpUtil.asyPost(url, paramMap, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
// Log.e("提交评论",jsonStr);
runOnUiThread(new Runnable() {
@Override
public void run() {
commentList.add(comment);
commentAdapter.setMCommentList(commentList);
recyclerView.setAdapter(commentAdapter);
comEditView.setText("");
bComNumView.setText("("+String.valueOf(commentList.size())+")");
}
});
}
});
}
}).start();
}
});
detailColView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
Map<String,Integer> paramMap=new HashMap<String, Integer>();
paramMap.put("bid",blog.getBid());
paramMap.put("uid", BaseActivity.owner.getNetId());
paramMap.put("type",2);
String url_collect=BaseActivity.SERVER_URL+"/collect-servlet?action=InsertCollect";
int imageId=getDrawableId(bColImage);
if(imageId==R.drawable.collect) {
bColImage.setImageResource(R.drawable.collect_pick);
bColImage.setTag(R.drawable.collect_pick);
}else {
bColImage.setImageResource(R.drawable.collect);
bColImage.setTag(R.drawable.collect);
}
new Thread(new Runnable() {
@Override
public void run() {
String jsonStr=OkHttpUtil.synPost(url_collect,paramMap);
runOnUiThread(new Runnable() {
@Override
public void run() {
if(jsonStr.contains("insert")){
bColNumView.setText(String.valueOf(Integer.parseInt(bColNumView.getText().toString())+1));
Toast.makeText(BlogDetailActivity.this,
"已收藏",Toast.LENGTH_SHORT).show();
}else{
bColNumView.setText(String.valueOf(Integer.parseInt(bColNumView.getText().toString())-1));
Toast.makeText(BlogDetailActivity.this,
"取消收藏",Toast.LENGTH_SHORT).show();
}
}
});
System.out.println("更新collect表成功");
}
}).start();
}
});
}
private int getDrawableId(ImageView iv) {
return (Integer) iv.getTag();
}
}

@ -1,131 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.leudaemialikeme.R;
public class BlogSearchActivity extends AppCompatActivity {
ImageView back;
EditText blogSearchEdit;
TextView blogSearchCommit;
TextView recView;
TextView foView;
TextView poView;
TextView meView;
TextView stView;
TextView exView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_blog_search);
initView();
initClick();
}
private void initView(){
back = (ImageView)findViewById(R.id.search_back);
blogSearchEdit = (EditText)findViewById(R.id.blog_search_edit);
blogSearchCommit = (TextView) findViewById(R.id.blog_search_commit);
recView=(TextView)findViewById(R.id.recView);
foView=(TextView)findViewById(R.id.foView);
poView=(TextView)findViewById(R.id.poView);
meView=(TextView)findViewById(R.id.meView);
stView=(TextView)findViewById(R.id.stView);
exView=(TextView)findViewById(R.id.exView);
}
private void initClick(){
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
blogSearchCommit.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
String text = blogSearchEdit.getText().toString();
if(text.length() != 0){
Intent intent=new Intent(BlogSearchActivity.this,BlogSearchResultActivity.class);
Log.e("onClick-text",text);
intent.putExtra("text",text);
startActivity(intent);}
else{
Toast.makeText(BlogSearchActivity.this, "请输入搜索的内容", Toast.LENGTH_SHORT).show();
}
}
});
recView.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
skip(recView);
}
});
foView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
skip(foView);
}
});
poView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
skip(poView);
}
});
meView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
skip(meView);
}
});
stView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
skip(stView);
}
});
exView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
skip(exView);
}
});
}
private void skip(TextView view){
String text = view.getText().toString();
Intent intent=new Intent(BlogSearchActivity.this,BlogSearchResultActivity.class);
// Log.e("onClick-text",text);
intent.putExtra("text",text);
startActivity(intent);
}
}

@ -1,29 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import com.example.leudaemialikeme.Model.User;
import com.example.leudaemialikeme.R;
public class MyInfoActivity extends AppCompatActivity {
private User user;
private EditText edit_id;
private EditText edit_username;
private EditText edit_password;
private EditText edit_confirm_password;
private EditText phone;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_info);
Intent intent = getIntent();
user = (User)intent.getSerializableExtra("user");
}
}

@ -1,255 +0,0 @@
package com.example.leudaemialikeme.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Adapter.QuestionDetailAdapter;
import com.example.leudaemialikeme.Model.AnswerItemView;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
public class QuestionDetailActivity extends AppCompatActivity {
private ImageView question_back;
private ImageView detail_to_search;
private TextView text_question_title;
private TextView text_author;
private TextView text_question_content;
private ImageView img_invite_to_answer;
private ImageView img_go_write_answer;
private ImageView img_follow_question;
private TextView text_follow_question;
private TextView text_answer_num;
private RecyclerView recyclerView_answer;
private List<AnswerItemView> answerList = new ArrayList<>();
private int qid;
private boolean isPause = false;
private int hasFollow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_question_detail);
Intent intent = getIntent();
qid = intent.getIntExtra("qid", -1);
question_back = findViewById(R.id.question_back);
detail_to_search = findViewById(R.id.detail_to_search);
text_question_title = findViewById(R.id.text_question_title);
text_question_content = findViewById(R.id.text_question_content);
text_author = findViewById(R.id.text_author);
img_invite_to_answer = findViewById(R.id.img_invite_to_answer);
img_go_write_answer = findViewById(R.id.img_go_write_answer);
img_follow_question = findViewById(R.id.img_follow_question);
text_follow_question = findViewById(R.id.text_follow_question);
text_answer_num = findViewById(R.id.text_answer_num);
recyclerView_answer = findViewById(R.id.recyclerView_answer);
LinearLayoutManager layoutManager;
layoutManager = new LinearLayoutManager(this);
recyclerView_answer.setLayoutManager(layoutManager);//建立线性布局
QuestionDetailAdapter adapter = new QuestionDetailAdapter(answerList);//创建适配器
recyclerView_answer.setAdapter(adapter);//将视图与适配器连接起来
getQuestionDetail();
//各种组件的动作设置
//返回键
question_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//搜索键
detail_to_search.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//TODO 跳转到搜索页面
}
});
//邀请回答
img_invite_to_answer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//TODO 邀请回答功能待完善,目前不实现
}
});
//写回答
img_go_write_answer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(QuestionDetailActivity.this, AnswerActivity.class);
intent.putExtra("qid",qid);
intent.putExtra("qtitle",text_question_title.getText().toString());
startActivity(intent);
}
});
//关注问题
img_follow_question.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(hasFollow==0){
followQuestion();
}else{
cancelFollowQuestion();
}
}
});
}
private void cancelFollowQuestion() {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = LoginActivity.SERVER_URL+"/main-servlet?action=cancelFollowQuestion&qid="+qid+"&iduser="+BaseActivity.owner.getNetId();
OkHttpUtil.asyGet(url, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String jsonStr = response.body().string();
runOnUiThread(new Runnable(){
@Override
public void run() {
if(jsonStr.equals("success")){
img_follow_question.setImageResource(R.mipmap.follow_question);
text_follow_question.setText("关注问题");
hasFollow=0;
}else{
Toast.makeText(getApplicationContext(), jsonStr,Toast.LENGTH_SHORT).show();
}
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
private void followQuestion() {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = LoginActivity.SERVER_URL+"/main-servlet?action=followQuestion&qid="+qid+"&iduser="+BaseActivity.owner.getNetId();
OkHttpUtil.asyGet(url, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String jsonStr = response.body().string();
runOnUiThread(new Runnable(){
@Override
public void run() {
if(jsonStr.equals("success")){
img_follow_question.setImageResource(R.mipmap.has_follow);
text_follow_question.setText("已关注");
hasFollow=1;
}else{
Toast.makeText(getApplicationContext(), jsonStr,Toast.LENGTH_SHORT).show();
}
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
private void getQuestionDetail() {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = LoginActivity.SERVER_URL+"/main-servlet?action=getQuestionDetail&qid="+qid+"&iduser="+BaseActivity.owner.getNetId();
OkHttpUtil.asyGet(url, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
final Map<String, String> jsonMap = gson.fromJson(jsonStr, new TypeToken<Map<String, String>>() {}.getType());
answerList = gson.fromJson(jsonMap.get("answerList"), new TypeToken<List<AnswerItemView>>() {}.getType());
runOnUiThread(new Runnable(){
@Override
public void run() {
text_question_title.setText(jsonMap.get("qtitle"));
text_question_content.setText(jsonMap.get("qcontent"));
text_author.setText(jsonMap.get("username"));
String num = ""+ answerList.size() +")";
text_answer_num.setText(num);
QuestionDetailAdapter adapter = new QuestionDetailAdapter(answerList);//创建适配器
recyclerView_answer.setAdapter(adapter);//将视图与适配器连接起来
hasFollow = Integer.parseInt(jsonMap.get("hasFollow"));
if(hasFollow==1){
img_follow_question.setImageResource(R.mipmap.has_follow);
text_follow_question.setText("已关注");
}
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
@Override
protected void onPause() {
super.onPause();
isPause = true; //记录页面已经被暂停
}
@Override
protected void onResume() {
super.onResume();
if (isPause){ //判断是否暂停
isPause = false;
getQuestionDetail();
QuestionDetailAdapter adapter = new QuestionDetailAdapter(answerList);//创建适配器
recyclerView_answer.setAdapter(adapter);//将视图与适配器连接起来
}
}
}

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

@ -1,30 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import com.example.leudaemialikeme.Fragment.APNChannelFragment;
public class APNPageActivityAdapter extends FragmentPagerAdapter {
private String[] channelList;
private FragmentManager fm;
public APNPageActivityAdapter(@NonNull FragmentManager fm, String[] channelList) {
super(fm);
this.channelList = channelList;
this.fm = fm;
}
@NonNull
@Override
public Fragment getItem(int position) {
String APNCategoryTitle = channelList[position];
return APNChannelFragment.newInstance(APNCategoryTitle);
}
@Override
public int getCount() {
return channelList.length;
}
}

@ -1,156 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.content.Intent;
import android.util.Log;
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.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.BlogDetailActivity;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BlogAdapter extends RecyclerView.Adapter<BlogAdapter.ViewHolder> {
// private List<Recnews> mRecnewsList;
private List<Blog> mBlogList = new ArrayList<Blog>();
private Blog blog;
// private View view;
// private Context context;
// ViewHolder holder;
static class ViewHolder extends RecyclerView.ViewHolder{
ImageView image;
TextView theme;
TextView intro;
TextView visNum;
TextView time;
LinearLayout linear;
TextView blog_id_view;
TextView blog_likeNum_view;
TextView blog_colNum_view;
TextView blog_uid_view;
TextView blog_content_view;
public ViewHolder(View view){
super(view);
blog_likeNum_view=(TextView)view.findViewById(R.id.likeNum);
blog_colNum_view=(TextView)view.findViewById(R.id.colNum);
blog_id_view=(TextView)view.findViewById(R.id.bid);
blog_uid_view=(TextView)view.findViewById(R.id.uid);
image=(ImageView)view.findViewById(R.id.recNews_image);
theme=(TextView)view.findViewById(R.id.recNews_theme);
intro=(TextView)view.findViewById(R.id.recNews_intro);
visNum=(TextView)view.findViewById(R.id.recNews_visNum);
time=(TextView)view.findViewById(R.id.recNews_time);
linear=(LinearLayout)view.findViewById(R.id.news);
blog_content_view=(TextView)view.findViewById(R.id.content);
}
}
public BlogAdapter(List<Blog> blogList){
mBlogList=blogList;
// Log.e("recAdapter中mBlogList的数据",String.valueOf(blogList));
}
public BlogAdapter(){
}
public void setRecnewsList(List<Blog> blogList){
mBlogList=blogList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.recnews_item,parent,false);
ViewHolder holder=new ViewHolder(view);
// context=parent.getContext();
holder.linear.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UpdateBrowseNum(holder.blog_id_view.getText().toString());
Intent intent=new Intent(view.getContext(), BlogDetailActivity.class);
// intent.putExtra("from",String.valueOf(view.getContext()));
intent.putExtra("bid",holder.blog_id_view.getText().toString());//新增bid
// Log.e("传输前的bid",holder.blog_id_view.getText().toString());
intent.putExtra("type",2);//帖子2
intent.putExtra("bTitle",holder.theme.getText().toString());
intent.putExtra("bContent",holder.blog_content_view.getText().toString());
intent.putExtra("bColNum",holder.blog_colNum_view.getText().toString());
intent.putExtra("bViewNum",String.valueOf(Integer.parseInt(holder.visNum.getText().toString())+1));
intent.putExtra("uid",holder.blog_uid_view.getText().toString());
view.getContext().startActivity(intent);
}
});
return holder;
}
@Override
public void onBindViewHolder(@NonNull BlogAdapter.ViewHolder holder, int position) {
blog=mBlogList.get(position);
// holder.image.setImageResource(R.drawable.rec_news1);
holder.visNum.setText(String.valueOf(blog.getBbrowse()));
holder.intro.setText(blog.getBcontent());
holder.theme.setText(blog.getBtittle());
holder.time.setText(String.valueOf(blog.getBtime()).substring(0,19));
holder.blog_id_view.setText(String.valueOf(blog.getBid()));
holder.blog_colNum_view.setText(String.valueOf(blog.getBcollectNum()));
holder.blog_likeNum_view.setText(String.valueOf(blog.getBlikeNum()));
holder.blog_uid_view.setText(String.valueOf(blog.getUid()));
holder.blog_content_view.setText(blog.getBcontent());
}
@Override
public int getItemCount() {
return mBlogList.size();
}
private void UpdateBrowseNum(String bid){
String url = BaseActivity.SERVER_URL + "/browse-servlet?action=UpdateBrowse";
Map<String,String> paramMap = new HashMap<String,String>();
Log.e("获取浏览量的返回结果","浏览量");
paramMap.put("id", bid);
//登录后需要将uid换为这部分
// paramMap.put("uid", String.valueOf(BaseActivity.owner.getNetId()));
paramMap.put("uid", String.valueOf(BaseActivity.owner.getNetId()));
// 只对帖子进行更新
paramMap.put("type", String.valueOf(2));
new Thread(new Runnable() {
@Override
public void run() {
Log.e("获取浏览量的返回结果uid",String.valueOf(1));
String jsonStr = OkHttpUtil.synPost(url,paramMap);
Log.e("浏览量的返回结果",jsonStr);
// blog.setBbrowse(blog.getBbrowse()+1);
// ((AppCompatActivity) context).runOnUiThread(new Runnable(){
// @Override
// public void run() {
//// holder.visNum.setText(String.valueOf(blog.getBbrowse()));
// }
// });
}
}).start();
}
}

@ -1,56 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.List;
public class CollectBlogAdapter extends RecyclerView.Adapter<CollectBlogAdapter.ViewHolder>{
private List<Blog> collectBlogList;
//重写构造方法
public CollectBlogAdapter(List<Blog> collectBlogList){
this.collectBlogList = collectBlogList;
}
public int getItemCount(){
return collectBlogList.size();
}
//内部类
static class ViewHolder extends RecyclerView.ViewHolder {
TextView blog_title,blog_info,blog_read,blog_time;
public ViewHolder(@NonNull View itemView){
super(itemView);
this.blog_title = itemView.findViewById(R.id.blog_title);
this.blog_info = itemView.findViewById(R.id.blog_info);
this.blog_read = itemView.findViewById(R.id.blog_read);
this.blog_time = itemView.findViewById(R.id.blog_time);
}
}
//重写 onCreateViewHolder()方法
@Override
public CollectBlogAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_blog_item,parent,false);
CollectBlogAdapter.ViewHolder holder=new CollectBlogAdapter.ViewHolder(view);
return holder;
}
//重写onBindViewHolder()方法
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
Blog blog = collectBlogList.get(position);
holder.blog_title.setText(blog.getBtittle());
holder.blog_info.setText(blog.getBcontent());
holder.blog_read.setText(String.valueOf(blog.getBbrowse()));
holder.blog_time.setText(TimeUtil.timeToString(blog.getBtime()));
}
}

@ -1,59 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.News;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import org.w3c.dom.Text;
import java.util.List;
public class CollectNewsAdapter extends RecyclerView.Adapter<CollectNewsAdapter.ViewHolder>{
private List<News> collectNewsList;
//重写构造方法
public CollectNewsAdapter(List<News> collectNewsList){
this.collectNewsList = collectNewsList;
}
public int getItemCount(){
return collectNewsList.size();
}
//内部类
static class ViewHolder extends RecyclerView.ViewHolder {
TextView news_title,news_info,news_read,news_time;
public ViewHolder(@NonNull View itemView){
super(itemView);
this.news_title = (TextView)itemView.findViewById(R.id.News_title);
this.news_info = (TextView)itemView.findViewById(R.id.News_info);
this.news_read = (TextView)itemView.findViewById(R.id.News_read);
this.news_time = (TextView)itemView.findViewById(R.id.News_time);
}
}
//重写 onCreateViewHolder()方法
@Override
public CollectNewsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_news_item,parent,false);
CollectNewsAdapter.ViewHolder holder=new CollectNewsAdapter.ViewHolder(view);
return holder;
}
//重写onBindViewHolder()方法
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
News news = collectNewsList.get(position);
holder.news_title.setText(news.getStittle());
holder.news_info.setText(news.getScontent());
holder.news_read.setText(String.valueOf(news.getSbrowseNum()));
holder.news_time.setText(TimeUtil.timeToString(news.getStime()));
}
}

@ -1,58 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.Comment;
import com.example.leudaemialikeme.R;
import java.util.List;
public class CommentAdapter extends RecyclerView.Adapter<CommentAdapter.ViewHolder>{
List<Comment> mCommentList;
Comment comment;
static class ViewHolder extends RecyclerView.ViewHolder{
TextView comName;
TextView comContent;
TextView comTime;
public ViewHolder(View view){
super(view);
comName=(TextView) view.findViewById(R.id.comment_user_name);
comContent=(TextView)view.findViewById(R.id.comment_content);
comTime=(TextView)view.findViewById(R.id.comment_time);
}
}
public void setMCommentList(List<Comment> commentList){
mCommentList=commentList;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.comment_item,parent,false);
CommentAdapter.ViewHolder holder = new CommentAdapter.ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull CommentAdapter.ViewHolder holder, int position) {
comment=mCommentList.get(position);
holder.comName.setText(comment.getUName());
holder.comContent.setText(comment.getContent());
holder.comTime.setText(String.valueOf(comment.getTime()).substring(0,19));
}
@Override
public int getItemCount() {
return mCommentList.size();
}
}

@ -1,56 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.List;
public class HistoryBlogAdapter extends RecyclerView.Adapter<HistoryBlogAdapter.ViewHolder>{
private List<Blog> historyBlogList;
//重写构造方法
public HistoryBlogAdapter(List<Blog> historyBlogList){
this.historyBlogList = historyBlogList;
}
public int getItemCount(){
return historyBlogList.size();
}
//内部类
static class ViewHolder extends RecyclerView.ViewHolder {
TextView blog_title,blog_info,blog_read,blog_time;
public ViewHolder(@NonNull View itemView){
super(itemView);
this.blog_title = itemView.findViewById(R.id.blog_title);
this.blog_info = itemView.findViewById(R.id.blog_info);
this.blog_read = itemView.findViewById(R.id.blog_read);
this.blog_time = itemView.findViewById(R.id.blog_time);
}
}
//重写 onCreateViewHolder()方法
@Override
public HistoryBlogAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_blog_item,parent,false);
HistoryBlogAdapter.ViewHolder holder=new HistoryBlogAdapter.ViewHolder(view);
return holder;
}
//重写onBindViewHolder()方法
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
Blog blog = historyBlogList.get(position);
holder.blog_title.setText(blog.getBtittle());
holder.blog_info.setText(blog.getBcontent());
holder.blog_read.setText(String.valueOf(blog.getBbrowse()));
holder.blog_time.setText(TimeUtil.timeToString(blog.getBtime()));
}
}

@ -1,57 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.News;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.List;
public class HistoryNewsAdapter extends RecyclerView.Adapter<HistoryNewsAdapter.ViewHolder>{
private List<News> historyNewsList;
//重写构造方法
public HistoryNewsAdapter(List<News> historyNewsList){
this.historyNewsList = historyNewsList;
}
public int getItemCount(){
return historyNewsList.size();
}
//内部类
static class ViewHolder extends RecyclerView.ViewHolder {
TextView news_title,news_info,news_read,news_time;
public ViewHolder(@NonNull View itemView){
super(itemView);
this.news_title = (TextView)itemView.findViewById(R.id.News_title);
this.news_info = (TextView)itemView.findViewById(R.id.News_info);
this.news_read = (TextView)itemView.findViewById(R.id.News_read);
this.news_time = (TextView)itemView.findViewById(R.id.News_time);
}
}
//重写 onCreateViewHolder()方法
@Override
public HistoryNewsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_news_item,parent,false);
HistoryNewsAdapter.ViewHolder holder=new HistoryNewsAdapter.ViewHolder(view);
return holder;
}
//重写onBindViewHolder()方法
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
News news = historyNewsList.get(position);
holder.news_title.setText(news.getStittle());
holder.news_info.setText(news.getScontent());
holder.news_read.setText(String.valueOf(news.getSbrowseNum()));
holder.news_time.setText(TimeUtil.timeToString(news.getStime()));
}
}

@ -1,36 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import com.example.leudaemialikeme.Fragment.BlogHistoryFragment;
import com.example.leudaemialikeme.Fragment.NewsHistoryFragment;
import com.example.leudaemialikeme.Fragment.QuestionHistoryFragment;
public class HistoryPageFragmentAdapter extends FragmentPagerAdapter {
private String[] channelList;
private FragmentManager fm;
public HistoryPageFragmentAdapter(FragmentManager fm, String[] channelList) {
super(fm);
this.channelList = channelList;
this.fm=fm;
}
@Override
public Fragment getItem(int idx) {
String collectCategoryTitle = channelList[idx];
if(collectCategoryTitle.equals(" 资讯 "))
{
return NewsHistoryFragment.newInstance(collectCategoryTitle);
}
else if(collectCategoryTitle.equals(" 问题 ")){
return QuestionHistoryFragment.newInstance(collectCategoryTitle);
}else{
return BlogHistoryFragment.newInstance(collectCategoryTitle);
}
}
@Override
public int getCount() {
return channelList.length;
} }

@ -1,91 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.LoginActivity;
import com.example.leudaemialikeme.Activity.QuestionDetailActivity;
import com.example.leudaemialikeme.Model.Question;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.List;
public class HistoryQuestionAdapter extends RecyclerView.Adapter<HistoryQuestionAdapter.ViewHolder>{
private List<Question> historyQuestionList;
private Context context;
//重写构造方法
public HistoryQuestionAdapter(List<Question> historyQuestionList, Context context){
this.historyQuestionList = historyQuestionList;
this.context = context;
}
public int getItemCount(){
return historyQuestionList.size();
}
//内部类
static class ViewHolder extends RecyclerView.ViewHolder {
private TextView questionTitle,questionInfo,questionRead,questionTime,question_id;
public ViewHolder(@NonNull View itemView){
super(itemView);
this.question_id = itemView.findViewById(R.id.question_id);
this.questionTitle = itemView.findViewById(R.id.questionTitle);
this.questionInfo = itemView.findViewById(R.id.questionInfo);
this.questionRead = itemView.findViewById(R.id.questionRead);
this.questionTime = itemView.findViewById(R.id.questionTime);
}
}
//重写 onCreateViewHolder()方法
@Override
public HistoryQuestionAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.question_item,parent,false);
HistoryQuestionAdapter.ViewHolder holder=new HistoryQuestionAdapter.ViewHolder(view);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int qid = Integer.parseInt(holder.question_id.getText().toString());
addQuestionBrowse(qid);
Intent intent = new Intent(context, QuestionDetailActivity.class);
intent.putExtra("qid", qid);
context.startActivity(intent);
}
});
return holder;
}
private void addQuestionBrowse(int qid) {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = LoginActivity.SERVER_URL+"/main-servlet?action=addQuestionBrowse&qid="+qid+"&iduser="+ BaseActivity.owner.getNetId();
OkHttpUtil.synGet(url);
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
//重写onBindViewHolder()方法
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
Question question = historyQuestionList.get(position);
holder.question_id.setText(String.valueOf(question.getQid()));
holder.questionTitle.setText(question.getQtittle());
holder.questionInfo.setText(question.getQcontent());
holder.questionRead.setText(String.valueOf(question.getQbrowseNum()));
holder.questionTime.setText(TimeUtil.timeToString(question.getQtime()));
}
}

@ -1,72 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Activity.QuestionDetailActivity;
import com.example.leudaemialikeme.Model.MyAnswerItemView;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.List;
public class MyAnswerAdapter extends RecyclerView.Adapter<MyAnswerAdapter.ViewHolder>{
private List<MyAnswerItemView> answerList;
private Context context;
public MyAnswerAdapter(List<MyAnswerItemView> answerList, Context context) {
this.answerList = answerList;
this.context = context;
}
static class ViewHolder extends RecyclerView.ViewHolder{
private TextView text_answer_qid;
private TextView text_my_answer_title;
private TextView text_my_answer;
private TextView text_answer_time;
public ViewHolder(@NonNull View itemView) {
super(itemView);
text_answer_qid = itemView.findViewById(R.id.text_answer_qid);
text_my_answer_title = itemView.findViewById(R.id.text_my_answer_title);
text_my_answer = itemView.findViewById(R.id.text_my_answer);
text_answer_time = itemView.findViewById(R.id.text_answer_time);
}
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.my_answer_item,parent,false);
final MyAnswerAdapter.ViewHolder holder=new MyAnswerAdapter.ViewHolder(view);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, QuestionDetailActivity.class);
intent.putExtra("qid", Integer.parseInt(holder.text_answer_qid.getText().toString()));
context.startActivity(intent);
}
});
return holder;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
MyAnswerItemView answer = answerList.get(position);
holder.text_answer_qid.setText(String.valueOf(answer.getQid()));
holder.text_my_answer_title.setText(answer.getQtitle());
holder.text_my_answer.setText(answer.getAcontent());
holder.text_answer_time.setText(TimeUtil.timeToString(answer.getAnswerTime()));
}
@Override
public int getItemCount() {
return answerList.size();
}
}

@ -1,74 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.ArrayList;
import java.util.List;
public class MyBlogAdapter extends RecyclerView.Adapter<MyBlogAdapter.ViewHolder>{
List<Blog> blogList = new ArrayList<>();
public MyBlogAdapter(List<Blog> blogList){
this.blogList = blogList;
}
static class ViewHolder extends RecyclerView.ViewHolder{
private TextView text_my_blog_id;
private TextView text_my_blog_title;
private TextView text_my_blog_content;
private TextView text_my_blog_browse;
private TextView text_my_blog_time;
private TextView text_my_blog_flag;
public ViewHolder(@NonNull View itemView) {
super(itemView);
text_my_blog_id = itemView.findViewById(R.id.text_my_blog_id);
text_my_blog_title = itemView.findViewById(R.id.text_my_blog_title);
text_my_blog_content = itemView.findViewById(R.id.text_my_blog_content);
text_my_blog_browse = itemView.findViewById(R.id.text_my_blog_browse);
text_my_blog_time = itemView.findViewById(R.id.text_my_blog_time);
text_my_blog_flag = itemView.findViewById(R.id.text_my_blog_flag);
}
}
@NonNull
@Override
public MyBlogAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.my_blog_item,parent,false);
MyBlogAdapter.ViewHolder holder = new MyBlogAdapter.ViewHolder(view);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//TODO 跳转到帖子的详情页
}
});
return holder;
}
@Override
public void onBindViewHolder(@NonNull MyBlogAdapter.ViewHolder holder, int position) {
Blog blog = blogList.get(position);
holder.text_my_blog_id.setText(String.valueOf(blog.getBid()));
holder.text_my_blog_title.setText(blog.getBtittle());
holder.text_my_blog_content.setText(blog.getBcontent());
holder.text_my_blog_browse.setText(String.valueOf(blog.getBbrowse()));
holder.text_my_blog_time.setText(TimeUtil.timeToString(blog.getBtime()));
if(blog.getFlag()==1)
holder.text_my_blog_flag.setText("已审核");
}
@Override
public int getItemCount() {
return blogList.size();
}
}

@ -1,57 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Model.AnswerItemView;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.util.ArrayList;
import java.util.List;
public class QuestionDetailAdapter extends RecyclerView.Adapter<QuestionDetailAdapter.ViewHolder>{
List<AnswerItemView> answerList = new ArrayList<>();
public QuestionDetailAdapter(List<AnswerItemView> answerList){
this.answerList = answerList;
}
static class ViewHolder extends RecyclerView.ViewHolder {
private TextView text_answer_username;
private TextView text_answer_content;
private TextView text_answer_time;
public ViewHolder(@NonNull View itemView) {
super(itemView);
text_answer_username = itemView.findViewById(R.id.text_answer_username);
text_answer_content = itemView.findViewById(R.id.text_answer_content);
text_answer_time = itemView.findViewById(R.id.text_answer_time);
}
}
@NonNull
@Override
public QuestionDetailAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.answer_item,parent,false);
QuestionDetailAdapter.ViewHolder holder = new QuestionDetailAdapter.ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull QuestionDetailAdapter.ViewHolder holder, int position) {
AnswerItemView answer = answerList.get(position);
holder.text_answer_username.setText(answer.getAnswerAuthor());
holder.text_answer_content.setText(answer.getAnswerContent());
holder.text_answer_time.setText(TimeUtil.timeToString(answer.getAnswerTime()));
}
@Override
public int getItemCount() {
return answerList.size();
}
}

@ -1,176 +0,0 @@
package com.example.leudaemialikeme.Adapter;
import android.annotation.SuppressLint;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.CallAlarm;
import com.example.leudaemialikeme.ClockDetail;
import com.example.leudaemialikeme.Model.Clock;
import com.example.leudaemialikeme.R;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import static android.content.Context.ALARM_SERVICE;
public class TimeAdapter extends RecyclerView.Adapter<TimeAdapter.ViewHolder> {
List<Clock> list;
LayoutInflater layoutInflater;
Context context;
Calendar calendar = Calendar.getInstance();
public static int pos;
public TimeAdapter(List<Clock> list, Context context) {
this.list = list;
this.context = context;
layoutInflater = LayoutInflater.from(context);
}
@Override
public TimeAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = layoutInflater.inflate(R.layout.list_item, null);
ViewHolder viewHolder = new ViewHolder(view);
return viewHolder;
}
@SuppressLint({"ResourceAsColor", "SetTextI18n"})
@Override
public void onBindViewHolder(@NonNull final TimeAdapter.ViewHolder viewHolder, final int i) {
final Clock clock = list.get(i);
System.out.println(i+"闹钟的位置");
pos = i;
Log.e("i=======",i+" "+clock.getClockType());
if (clock.getClockType() == Clock.clock_open){
viewHolder.aSwitch.setChecked(true);
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorBlack));
}else if (clock.getClockType() == Clock.clock_close){
viewHolder.aSwitch.setChecked(false);
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorGray));
}
viewHolder.hour.setText(clock.getHour()+"");
viewHolder.minute.setText(clock.getMinute()+"");
viewHolder.content_name.setText(clock.getName());
viewHolder.content_dosage.setText(clock.getDosage());
viewHolder.todetail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.e("TODETAIL",clock.getClockType()+"");
Intent intent = new Intent(context, ClockDetail.class);
intent.putExtra("position", i);
context.startActivity(intent);
}
});
viewHolder.aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@SuppressLint("ResourceAsColor")
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
clock.setClockType(Clock.clock_open);
//clock.updateAll();
clock.save();
Toast.makeText(context, "开启闹钟", Toast.LENGTH_SHORT).show();
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorBlack));
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorBlack));
Intent intent = new Intent(context, CallAlarm.class);
PendingIntent sender = PendingIntent.getBroadcast(
context, 0, intent, 0);
AlarmManager am;
am = (AlarmManager) context.getSystemService(ALARM_SERVICE);
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(clock.getHour()));
calendar.set(Calendar.MINUTE, Integer.parseInt(clock.getMinute()));
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Log.e("TAG",calendar.getTimeInMillis()+"");
Log.e("TAG",System.currentTimeMillis()+"");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (System.currentTimeMillis()>calendar.getTimeInMillis()+40000){
//加24小时
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis()+86400000, sender);
}else {
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
}
}
} else if (!isChecked){
clock.setClockType(Clock.clock_close);
//clock.updateAll();
clock.save();
Log.e("status------",clock.getHour()+clock.getMinute()+clock.getMinute()+clock.getClockType()+"");
Log.e("关闭闹钟",clock.getClockType()+"");
Intent intent = new Intent(context, CallAlarm.class);
PendingIntent sender=PendingIntent.getBroadcast(
context,0, intent, 0);
AlarmManager am;
am =(AlarmManager)context.getSystemService(ALARM_SERVICE);
am.cancel(sender);
Toast.makeText(context, "关闭闹钟", Toast.LENGTH_SHORT).show();
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorGray));
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorGray));
}
}
});
}
@Override
public int getItemCount() {
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
TextView hour;
TextView minute;
TextView content_name,content_dosage;
TextView net;
Switch aSwitch;
LinearLayout todetail;
public ViewHolder(@NonNull View itemView) {
super(itemView);
hour = itemView.findViewById(R.id.hour);
minute = itemView.findViewById(R.id.minute);
net = itemView.findViewById(R.id.net);
content_name = itemView.findViewById(R.id.content_name);
content_dosage = itemView.findViewById(R.id.content_dosage);
aSwitch = itemView.findViewById(R.id.switch_control);
todetail = itemView.findViewById(R.id.todetail);
}
}
}

@ -1,22 +0,0 @@
package com.example.leudaemialikeme;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.example.leudaemialikeme.Activity.AlarmAlert;
public class CallAlarm extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent intent1 = new Intent(context, AlarmAlert.class);
Bundle bundle = new Bundle();
//String content = intent.getStringExtra("content");
//Log.e("content===sadsad",content);
bundle.putString("STR_CALLER","");
intent1.putExtras(bundle);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent1);
}
}

@ -1,174 +0,0 @@
package com.example.leudaemialikeme;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import com.example.leudaemialikeme.Model.Clock;
import java.util.Calendar;
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.list;
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.timeAdapter;
public class ClockDetail extends Activity implements View.OnClickListener{
private Calendar calendar;
private TextView show_hour;
private TextView show_minute;
private EditText content_name;
private EditText content_dosage;
private ImageView back;
private TextView title;
private Button set;
private Button save;
private Button delete;
Clock clock;
int position;
String hourformat;
String minuteformat;
Context context = ClockDetail.this;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_clock_detail);
show_hour = findViewById(R.id.hour);
show_minute = findViewById(R.id.minute);
content_name = findViewById(R.id.content_name);
content_dosage = findViewById(R.id.content_dosage);
set = findViewById(R.id.set_time);
set.setOnClickListener(this);
save = findViewById(R.id.save);
save.setOnClickListener(this);
delete = findViewById(R.id.delete);
delete.setOnClickListener(this);
back = findViewById(R.id.back_list_clock);
back.setOnClickListener(this);
back.setImageResource(R.drawable.ic_back);
title = findViewById(R.id.title);
title.setText("服药提醒详情");
calendar = Calendar.getInstance();
initView();
}
@SuppressLint("SetTextI18n")
private void initView() {
position = getIntent().getIntExtra("position", -1);
clock = list.get(position);
Log.e("position", position + "");
if (clock.getHour() != null && clock.getMinute() != null) {
hourformat = formatString(clock.getHour());
minuteformat = formatString(clock.getMinute());
}
content_name.setText(clock.getName());
content_dosage.setText(clock.getDosage());
show_hour.setText(clock.getHour() + "");
show_minute.setText(clock.getMinute() + "");
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.set_time:
calendar.setTimeInMillis(System.currentTimeMillis());
int mhour = calendar.get(Calendar.HOUR_OF_DAY);
int mminute = calendar.get(Calendar.MINUTE);
new TimePickerDialog(ClockDetail.this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
//calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);
calendar.set(Calendar.MINUTE, minute);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
hourformat = format(hourOfDay);
minuteformat = format(minute);
Toast.makeText(ClockDetail.this, "" + hourformat + ":" + minuteformat, Toast.LENGTH_SHORT).show();
show_hour.setText(hourformat);
show_minute.setText(minuteformat);
}
}, mhour, mminute, true).show();
break;
case R.id.save:
clock.setHour(hourformat);
clock.setMinute(minuteformat);
clock.setName("" + content_name.getText().toString());
clock.setDosage("" + content_dosage.getText().toString());
clock.setClockType(Clock.clock_open);
clock.save();
Intent intent = new Intent(ClockDetail.this, CallAlarm.class);
// intent.putExtra("content",clock.getContent());
//sendBroadcast(intent);
PendingIntent sender = PendingIntent.getBroadcast(
ClockDetail.this, 0, intent, 0);
AlarmManager am;
am = (AlarmManager) getSystemService(ALARM_SERVICE);
Log.e("gethour",clock.getHour());
Log.e("gethour",clock.getMinute());
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(clock.getHour()));
calendar.set(Calendar.MINUTE, Integer.parseInt(clock.getMinute()));
Log.e("TAG",calendar.getTimeInMillis()+"");
Log.e("TAG",System.currentTimeMillis()+"");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (System.currentTimeMillis()>calendar.getTimeInMillis()+60000){
//加24小时
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis()+86400000, sender);
}else {
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
}
}
timeAdapter.notifyDataSetChanged();
finish();
break;
case R.id.delete:
clock.delete();
timeAdapter.notifyDataSetChanged();
Intent intent1 = new Intent(context, CallAlarm.class);
PendingIntent sender1=PendingIntent.getBroadcast(
context,0, intent1, 0);
am =(AlarmManager)context.getSystemService(ALARM_SERVICE);
am.cancel(sender1);
finish();
break;
case R.id.back_list_clock:
finish();
break;
}
}
private String format(int x) {
String s = "" + x;
if (s.length() == 1) {
s = "0" + s;
}
return s;
}
private String formatString(String x) {
String s = x;
if (s.length() == 1) {
s = "0" + s;
}
return s;
}
}

@ -1,43 +0,0 @@
package com.example.leudaemialikeme.Dao;
import com.example.leudaemialikeme.Model.Friend;
import org.litepal.LitePal;
import java.util.ArrayList;
public class FriendDao extends BaseDao{
public ArrayList<Friend> findFriendListByOwnerNetId(int ownerNetId){
ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("ownerNetId = ?", String.valueOf(ownerNetId)).find(Friend.class);
return friendList;
}
public ArrayList<Friend> findChatFriendList(int ownerNetId){
ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("ownerNetId = ? AND isChat = ?", String.valueOf(ownerNetId),"1").find(Friend.class);
return friendList;
}
public Friend findByNetId(int netId,int ownerNetId){
ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("netId = ? and ownerNetId = ?", String.valueOf(netId),String.valueOf(ownerNetId)).find(Friend.class);
if (friendList.size()==0){
return null;
}
return friendList.get(0);
}
public void changeChatStatus(Friend friend, int netId, int ownerNetId){
friend.updateAll("netId = ? and ownerNetId = ?",String.valueOf(netId),String.valueOf(ownerNetId));
}
// public ArrayList<Friend> findByKeyword(String keyword,int ownerNetId){
// String keywordCop="%"+keyword+"%";
// ArrayList<Friend> friends=(ArrayList<Friend>) LitePal.where("name like ? AND isfriend=1 AND ownerNetId=?",keywordCop,String.valueOf(ownerNetId)).find(Friend.class);
// return friends;
// }
// public ArrayList<Friend> findNewFriendList(int ownerNetId){
// ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("ownerNetId = ? AND isfriend=0", String.valueOf(ownerNetId)).find(Friend.class);
// return friendList;
// }
}

@ -1,160 +0,0 @@
package com.example.leudaemialikeme.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.leudaemialikeme.Activity.BaseActivity;
import com.example.leudaemialikeme.Adapter.MyAnswerAdapter;
import com.example.leudaemialikeme.Adapter.MyBlogAdapter;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.Model.MyAnswerItemView;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.example.leudaemialikeme.Utils.TimeUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
public class APNChannelFragment extends Fragment {
private static final String ARG_CATEGORY_TITLE = "category_title";
private String APNCategoryTitle = "Default";
private List<MyAnswerItemView> answerList = new ArrayList<>();
private List<Blog> blogList = new ArrayList<>();
private RecyclerView answerRecyclerview;
private RecyclerView blogRecyclerview;
public APNChannelFragment() {
// Required empty public constructor
}
public static APNChannelFragment newInstance(String APNCategoryTitle) {
APNChannelFragment fragment = new APNChannelFragment();
Bundle args = new Bundle();
args.putString(ARG_CATEGORY_TITLE, APNCategoryTitle);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
APNCategoryTitle = 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) {
View view;
if (APNCategoryTitle.equals("回答")) {
view = inflater.inflate(R.layout.recyclerview, container, false);
answerRecyclerview = view.findViewById(R.id.list_community);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
answerRecyclerview.setLayoutManager(layoutManager);
MyAnswerAdapter adapter = new MyAnswerAdapter(answerList, getContext());
answerRecyclerview.setAdapter(adapter);
getMyAnswerList();
} else if (APNCategoryTitle.equals("帖子")) {
view = inflater.inflate(R.layout.recyclerview, container, false);
blogRecyclerview = view.findViewById(R.id.list_community);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
blogRecyclerview.setLayoutManager(layoutManager);
MyBlogAdapter adapter = new MyBlogAdapter(blogList);
blogRecyclerview.setAdapter(adapter);
getMyBlogList();
} else {
view = inflater.inflate(R.layout.fragment_a_p_n_channel, container, false);
}
return view;
}
private void getMyBlogList() {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = BaseActivity.SERVER_URL+"/my-servlet?action=getMyBlogList&iduser="+BaseActivity.owner.getNetId();
OkHttpUtil.asyGet(url, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
final List<Blog> blogList = gson.fromJson(jsonStr, new TypeToken<List<Blog>>() {}.getType());
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
MyBlogAdapter adapter = new MyBlogAdapter(blogList);
blogRecyclerview.setAdapter(adapter);
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
private void getMyAnswerList() {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = BaseActivity.SERVER_URL+"/my-servlet?action=getMyAnswerList&iduser="+BaseActivity.owner.getNetId();
OkHttpUtil.asyGet(url, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
List<Map<String,String>> list = gson.fromJson(jsonStr, new TypeToken<List<Map<String, String>>>() {}.getType());
for(int i=0; i<list.size(); i++){
Map<String, String> jsonMap = list.get(i);
MyAnswerItemView myAnswerItemView = new MyAnswerItemView();
myAnswerItemView.setQid(Integer.parseInt(jsonMap.get("qid")));
myAnswerItemView.setQtitle(jsonMap.get("qtitle"));
myAnswerItemView.setAcontent(jsonMap.get("content"));
myAnswerItemView.setAnswerTime(TimeUtil.stringToTime(jsonMap.get("answerTime")));
answerList.add(myAnswerItemView);
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
MyAnswerAdapter adapter = new MyAnswerAdapter(answerList, getContext());
answerRecyclerview.setAdapter(adapter);
}
});
}
});
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
}

@ -1,166 +0,0 @@
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;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.example.leudaemialikeme.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.MainActivity;
import com.example.leudaemialikeme.Adapter.CollectBlogAdapter;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.Model.News;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.example.leudaemialikeme.Utils.TimeUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link BlogCollectFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class BlogCollectFragment extends Fragment {
private static final String ARG_CATEGORY_TITLE = "category_title";
private String collectCategoryTitle = "Default";
private List<Blog> collectList = new ArrayList<>();
private RecyclerView blogCollectrecycleView;
private SwipeRefreshLayout mSwipeRefreshLayout;
public BlogCollectFragment() {
// Required empty public constructor
}
public static BlogCollectFragment newInstance(String collectCategoryTitle) {
Bundle args = new Bundle();
args.putString(ARG_CATEGORY_TITLE, collectCategoryTitle);
BlogCollectFragment fragment = new BlogCollectFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
collectCategoryTitle = (String) getArguments().getString(ARG_CATEGORY_TITLE);
}catch (java.lang.NullPointerException e)
{
System.out.println("TestFragment getArg error!");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_blog_collect, container, false);
getData();//获得数据
blogCollectrecycleView = (RecyclerView) view.findViewById(R.id.blogCollectList);//获得视图
LinearLayoutManager layoutManager;
layoutManager = new LinearLayoutManager(getActivity());
blogCollectrecycleView.setLayoutManager(layoutManager);//建立线性布局
final CollectBlogAdapter adapter = new CollectBlogAdapter(collectList);//创建适配器
blogCollectrecycleView.setItemAnimator(new DefaultItemAnimator());//设置动画效果
blogCollectrecycleView.setAdapter(adapter);
mSwipeRefreshLayout = view.findViewById(R.id.refresh_layout);
// mTextView = view.findViewById(R.id.tv_pull_down_refresh);
handleDownPullUpdate();
return view;
}
private void handleDownPullUpdate() {
mSwipeRefreshLayout.setEnabled(true);
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent,R.color.colorPrimary,R.color.light_grey);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//不再显示提示正在刷新和刷新成功
// mTextView.setText("正在刷新...");
//被刷新时的操作
//更新UI
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//更新成功后设置UI停止更新
// mTextView.setText("刷新成功!!!");
mSwipeRefreshLayout.setRefreshing(false);
}
},3000);
}
});
}
private void getData() {
// Blog collect1 = new Blog(1,1,"2","临时测试博客版","博客内容", TimeUtil.stringToTime("2022-01-07 12:12:12"),1,1,1,0);
// collectList.add(collect1);
// Blog collect2 = new Blog(1,1,"2","临时测试博客版2","博客内容", TimeUtil.stringToTime("2022-01-07 12:12:12"),1,1,5,0);
// collectList.add(collect2);
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = MainActivity.SERVER_URL+"/my-servlet?action=collectBlog&uid="+ BaseActivity.owner.getNetId()+"&type="+2;
Callback callback = new Callback() {
@Override
public void onFailure(Call call, IOException e) {
System.out.println("-----ERROR----");
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
Map<String, String> jsonMap= gson.fromJson(jsonStr, new TypeToken<Map<String, String>>() {}.getType());
final String message=(String) jsonMap.get("message");
if (message.equals("success")) {
List<Blog> blogList = gson.fromJson(jsonMap.get("blogList"), new TypeToken <List<Blog>>(){}.getType());
for(int i=0;i<blogList.size();i++){
Blog startBlog = blogList.get(i);
int bid = startBlog.getBid();
int uid = startBlog.getUid();
String btype = startBlog.getBtype();
String btittle = startBlog.getBtittle();
String bcontent = startBlog.getBcontent();
Timestamp btime = startBlog.getBtime();
int blikeNum = startBlog.getBlikeNum();
int bcollectNum = startBlog.getBcollectNum();
int bbrowse = startBlog.getBbrowse();
int flag = startBlog.getFlag();
Blog endBlog = new Blog(bid,uid,btype,btittle,bcontent,btime,blikeNum,bcollectNum,bbrowse,flag);
collectList.add(endBlog);
}
}
}
};
OkHttpUtil.asyGet(url,callback);
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
}

@ -1,167 +0,0 @@
package com.example.leudaemialikeme.Fragment;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DefaultItemAnimator;
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.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.MainActivity;
import com.example.leudaemialikeme.Adapter.HistoryBlogAdapter;
import com.example.leudaemialikeme.Model.Blog;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.example.leudaemialikeme.Utils.TimeUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link BlogHistoryFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class BlogHistoryFragment extends Fragment {
private static final String ARG_CATEGORY_TITLE = "category_title";
private String collectCategoryTitle = "Default";
private List<Blog> collectList = new ArrayList<>();
private SwipeRefreshLayout mSwipeRefreshLayout;
public BlogHistoryFragment() {
// Required empty public constructor
}
public static BlogHistoryFragment newInstance(String collectCategoryTitle) {
Bundle args = new Bundle();
args.putString(ARG_CATEGORY_TITLE, collectCategoryTitle);
BlogHistoryFragment fragment = new BlogHistoryFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
collectCategoryTitle = (String) getArguments().getString(ARG_CATEGORY_TITLE);
}catch (java.lang.NullPointerException e)
{
System.out.println("TestFragment getArg error!");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_blog_history, container, false);
getData();//获得数据
RecyclerView recycleView = (RecyclerView) view.findViewById(R.id.blogHistoryList);//获得视图
LinearLayoutManager layoutManager;
layoutManager = new LinearLayoutManager(getActivity());
recycleView.setLayoutManager(layoutManager);//建立线性布局
final HistoryBlogAdapter adapter = new HistoryBlogAdapter(collectList);//创建适配器
recycleView.setItemAnimator(new DefaultItemAnimator());//设置动画效果
recycleView.setAdapter(adapter);
mSwipeRefreshLayout = view.findViewById(R.id.refresh_layout);
// mTextView = view.findViewById(R.id.tv_pull_down_refresh);
handleDownPullUpdate();
return view;
}
private void handleDownPullUpdate() {
mSwipeRefreshLayout.setEnabled(true);
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent,R.color.colorPrimary,R.color.light_grey);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//不再显示提示正在刷新和刷新成功
// mTextView.setText("正在刷新...");
//被刷新时的操作
//更新UI
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//更新成功后设置UI停止更新
// mTextView.setText("刷新成功!!!");
mSwipeRefreshLayout.setRefreshing(false);
}
},3000);
}
});
}
private void getData() {
// Blog collect1 = new Blog(1,1,"2","测试博客浏览版","博客内容", TimeUtil.stringToTime("2022-01-07 12:12:12"),1,1,1,0);
// collectList.add(collect1);
// Blog collect2 = new Blog(1,1,"2","测试博客浏览版2","博客内容", TimeUtil.stringToTime("2022-01-07 12:12:12"),1,1,5,0);
// collectList.add(collect2);
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = MainActivity.SERVER_URL+"/my-servlet?action=historyBlog&uid="+ BaseActivity.owner.getNetId()+"&type="+2;
Callback callback = new Callback() {
@Override
public void onFailure(Call call, IOException e) {
System.out.println("-----ERROR----");
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
Map<String, String> jsonMap= gson.fromJson(jsonStr, new TypeToken<Map<String, String>>() {}.getType());
final String message=(String) jsonMap.get("message");
if (message.equals("success")) {
List<Blog> blogList = gson.fromJson(jsonMap.get("blogList"), new TypeToken <List<Blog>>(){}.getType());
for(int i=0;i<blogList.size();i++){
Blog startBlog = blogList.get(i);
int bid = startBlog.getBid();
int uid = startBlog.getUid();
String btype = startBlog.getBtype();
String btittle = startBlog.getBtittle();
String bcontent = startBlog.getBcontent();
Timestamp btime = startBlog.getBtime();
int blikeNum = startBlog.getBlikeNum();
int bcollectNum = startBlog.getBcollectNum();
int bbrowse = startBlog.getBbrowse();
int flag = startBlog.getFlag();
Blog endBlog = new Blog(bid,uid,btype,btittle,bcontent,btime,blikeNum,bcollectNum,bbrowse,flag);
collectList.add(endBlog);
}
}
}
};
OkHttpUtil.asyGet(url,callback);
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
}

@ -1,164 +0,0 @@
package com.example.leudaemialikeme.Fragment;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DefaultItemAnimator;
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.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.MainActivity;
import com.example.leudaemialikeme.Adapter.HistoryNewsAdapter;
import com.example.leudaemialikeme.Model.News;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.example.leudaemialikeme.Utils.TimeUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link NewsHistoryFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class NewsHistoryFragment extends Fragment {
private static final String ARG_CATEGORY_TITLE = "category_title";
private String collectCategoryTitle = "Default";
private List<News> collectList = new ArrayList<>();
private SwipeRefreshLayout mSwipeRefreshLayout;
public NewsHistoryFragment() {
// Required empty public constructor
}
public static NewsHistoryFragment newInstance(String collectCategoryTitle) {
Bundle args = new Bundle();
args.putString(ARG_CATEGORY_TITLE, collectCategoryTitle);
NewsHistoryFragment fragment = new NewsHistoryFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
collectCategoryTitle = (String) getArguments().getString(ARG_CATEGORY_TITLE);
}catch (java.lang.NullPointerException e)
{
System.out.println("TestFragment getArg error!");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_news_history, container, false);
getData();//获得数据
RecyclerView recycleView = (RecyclerView) view.findViewById(R.id.newsHistoryList);//获得视图
LinearLayoutManager layoutManager;
layoutManager = new LinearLayoutManager(getActivity());
recycleView.setLayoutManager(layoutManager);//建立线性布局
final HistoryNewsAdapter adapter = new HistoryNewsAdapter(collectList);//创建适配器
recycleView.setItemAnimator(new DefaultItemAnimator());//设置动画效果
recycleView.setAdapter(adapter);
mSwipeRefreshLayout = view.findViewById(R.id.refresh_layout);
// mTextView = view.findViewById(R.id.tv_pull_down_refresh);
handleDownPullUpdate();
return view;
}
private void handleDownPullUpdate() {
mSwipeRefreshLayout.setEnabled(true);
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent,R.color.colorPrimary,R.color.light_grey);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//不再显示提示正在刷新和刷新成功
// mTextView.setText("正在刷新...");
//被刷新时的操作
//更新UI
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//更新成功后设置UI停止更新
// mTextView.setText("刷新成功!!!");
mSwipeRefreshLayout.setRefreshing(false);
}
},3000);
}
});
}
private void getData(){
// News collect1 = new News(1,1,"1","临时测试浏览记录版","能解决的!", TimeUtil.stringToTime("2022-01-07 12:12:12"),3);
// collectList.add(collect1);
// News collect2 = new News(1,1,"1","临时测试2浏览记录版","能解决的!",TimeUtil.stringToTime("2022-01-07 12:12:12"),5);
// collectList.add(collect2);
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = MainActivity.SERVER_URL+"/my-servlet?action=historyNews&uid="+ BaseActivity.owner.getNetId()+"&type="+1;
Callback callback = new Callback() {
@Override
public void onFailure(Call call, IOException e) {
System.out.println("-----ERROR----");
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
Map<String, String> jsonMap= gson.fromJson(jsonStr, new TypeToken<Map<String, String>>() {}.getType());
final String message=(String) jsonMap.get("message");
if (message.equals("success")) {
List<News> newsList = gson.fromJson(jsonMap.get("newsList"), new TypeToken <List<News>>(){}.getType());
for(int i=0;i<newsList.size();i++){
News startNews = newsList.get(i);
int nid = startNews.getNid();
int sid = startNews.getSid();
String stype = startNews.getStype();
String stittle = startNews.getStittle();
String scontent = startNews.getScontent();
Timestamp stime = startNews.getStime();
int sbrowseNum = startNews.getSbrowseNum();
News endNews = new News(nid,sid,stype,stittle,scontent,stime,sbrowseNum);
collectList.add(endNews);
}
}
}
};
OkHttpUtil.asyGet(url,callback);
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
}

@ -1,163 +0,0 @@
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;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.example.leudaemialikeme.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.MainActivity;
import com.example.leudaemialikeme.Adapter.HistoryQuestionAdapter;
import com.example.leudaemialikeme.Model.Question;
import com.example.leudaemialikeme.R;
import com.example.leudaemialikeme.Utils.OkHttpUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link QuestionHistoryFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class QuestionHistoryFragment extends Fragment {
private static final String ARG_CATEGORY_TITLE = "category_title";
private String collectCategoryTitle = "Default";
private List<Question> questionAllList = new ArrayList<>();
private SwipeRefreshLayout mSwipeRefreshLayout;
private RecyclerView recyclerView;
private boolean isPause = false;
public QuestionHistoryFragment() {
// Required empty public constructor
}
public static QuestionHistoryFragment newInstance(String collectCategoryTitle) {
Bundle args = new Bundle();
args.putString(ARG_CATEGORY_TITLE, collectCategoryTitle);
QuestionHistoryFragment fragment = new QuestionHistoryFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
collectCategoryTitle = (String) getArguments().getString(ARG_CATEGORY_TITLE);
}catch (java.lang.NullPointerException e)
{
System.out.println("TestFragment getArg error!");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_question_history, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.questionHistoryList);//获得视图
LinearLayoutManager layoutManager;
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);//建立线性布局
final HistoryQuestionAdapter adapter = new HistoryQuestionAdapter(questionAllList, getContext());//创建适配器
recyclerView.setItemAnimator(new DefaultItemAnimator());//设置动画效果
recyclerView.setAdapter(adapter);
mSwipeRefreshLayout = view.findViewById(R.id.refresh_layout);
// mTextView = view.findViewById(R.id.tv_pull_down_refresh);
getData();//获得数据
handleDownPullUpdate();
return view;
}
private void handleDownPullUpdate() {
mSwipeRefreshLayout.setEnabled(true);
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent,R.color.colorPrimary,R.color.light_grey);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//不再显示提示正在刷新和刷新成功
// mTextView.setText("正在刷新...");
//被刷新时的操作
//更新UI
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
//更新成功后设置UI停止更新
// mTextView.setText("刷新成功!!!");
mSwipeRefreshLayout.setRefreshing(false);
}
},3000);
}
});
}
private void getData() {
new Thread(new Runnable() {
@Override
public void run() {
try{
String url = MainActivity.SERVER_URL+"/my-servlet?action=historyQuestion&uid="+ BaseActivity.owner.getNetId()+"&type="+3;
Callback callback = new Callback() {
@Override
public void onFailure(Call call, IOException e) {
System.out.println("-----ERROR----");
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String jsonStr = response.body().string();
Gson gson = new Gson();
Map<String, String> jsonMap= gson.fromJson(jsonStr, new TypeToken<Map<String, String>>() {}.getType());
final String message=(String) jsonMap.get("message");
if (message.equals("success")) {
List<Question> questionList = gson.fromJson(jsonMap.get("questionList"), new TypeToken <List<Question>>(){}.getType());
questionAllList = questionList;
HistoryQuestionAdapter adapter = new HistoryQuestionAdapter(questionAllList, getContext());//创建适配器
recyclerView.setAdapter(adapter);
}
}
};
OkHttpUtil.asyGet(url,callback);
}catch (Exception e){
e.printStackTrace();
}
}
}).start();
}
@Override
public void onPause() {
super.onPause();
isPause = true; //记录页面已经被暂停
}
@Override
public void onResume() {
super.onResume();
if (isPause){ //判断是否暂停
isPause = false;
getData();
HistoryQuestionAdapter adapter = new HistoryQuestionAdapter(questionAllList, getContext());//创建适配器
recyclerView.setAdapter(adapter);
}
}
}

@ -1,43 +0,0 @@
package com.example.leudaemialikeme.Model;
import java.sql.Timestamp;
public class AnswerItemView {
private String answerAuthor;
private String answerContent;
private Timestamp answerTime;
public AnswerItemView(){
}
public AnswerItemView(String answerAuthor, String answerContent, Timestamp answerTime) {
this.answerAuthor = answerAuthor;
this.answerContent = answerContent;
this.answerTime = answerTime;
}
public String getAnswerAuthor() {
return answerAuthor;
}
public void setAnswerAuthor(String answerAuthor) {
this.answerAuthor = answerAuthor;
}
public String getAnswerContent() {
return answerContent;
}
public void setAnswerContent(String answerContent) {
this.answerContent = answerContent;
}
public Timestamp getAnswerTime() {
return answerTime;
}
public void setAnswerTime(Timestamp answerTime) {
this.answerTime = answerTime;
}
}

@ -1,131 +0,0 @@
package com.example.leudaemialikeme.Model;
import java.io.Serializable;
import java.sql.Timestamp;
public class Blog implements Serializable {
private static final long serialVersionUID = 1L;
private int bid;
private int uid;
private String btype;
private String btittle;
private String bcontent;
private Timestamp btime;
private int blikeNum;
private int bcollectNum;
private int bbrowse;
private int flag;
public Blog() {
}
public Blog(int bid,int uid,String btype,String btittle,String bcontent,Timestamp btime,int blikeNum,
int bcollectNum,int bbrowse,int flag) {
this.bid=bid;
this.uid=uid;
this.btype=btype;
this.btittle=btittle;
this.bcontent=bcontent;
this.btime=btime;
this.blikeNum=blikeNum;
this.bcollectNum=bcollectNum;
this.bbrowse=bbrowse;
this.flag=flag;
}
public Blog(int uid,String btype,String btittle,String bcontent,Timestamp btime,int blikeNum,
int bcollectNum,int bbrowse,int flag) {
this.uid=uid;
this.btype=btype;
this.btittle=btittle;
this.bcontent=bcontent;
this.btime=btime;
this.blikeNum=blikeNum;
this.bcollectNum=bcollectNum;
this.bbrowse=bbrowse;
this.flag=flag;
}
public void setUid(int uid) {
this.uid=uid;
}
public int getUid() {
return uid;
}
public void setBid(int bid) {
this.bid=bid;
}
public int getBid() {
return bid;
}
public void setBtype(String btype) {
this.btype=btype;
}
public String getBtype() {
return btype;
}
public void setBtittle(String btittle) {
this.btittle=btittle;
}
public String getBtittle() {
return btittle;
}
public void setBcontent(String bcontent) {
this.bcontent=bcontent;
}
public String getBcontent() {
return bcontent;
}
public Timestamp getBtime() {
return btime;
}
public void setBtime(Timestamp btime) {
this.btime=btime;
}
public void setBlikeNum(int blikeNum) {
this.blikeNum=blikeNum;
}
public int getBlikeNum() {
return blikeNum;
}
public void setBcollectNum(int bcollectNum) {
this.bcollectNum=bcollectNum;
}
public int getBcollectNum() {
return bcollectNum;
}
public void setBbrowse(int bbrowse) {
this.bbrowse=bbrowse;
}
public int getBbrowse() {
return bbrowse;
}
public int getFlag() {
return flag;
}
public void setFlag(int flag) {
this.flag=flag;
}
}

@ -1,43 +0,0 @@
package com.example.leudaemialikeme.Model;
import java.io.Serializable;
public class Browse implements Serializable{
private static final long serialVersionUID = 1L;
private int id;
private int uid;
private int type;
public void setId(int id) {
this.id=id;
}
public int getId() {
return id;
}
public void setUid(int uid) {
this.uid=uid;
}
public int getUid() {
return uid;
}
public void setType(int type) {
this.type=type;
}
public int getType() {
return type;
}
public Browse(int id,int uid,int type) {
this.id=id;
this.uid=uid;
this.type=type;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}

@ -1,63 +0,0 @@
package com.example.leudaemialikeme.Model;
import org.litepal.crud.LitePalSupport;
public class Clock extends LitePalSupport {
public static final int clock_open = 1;
public static final int clock_close = 0;
String hour;
String minute;
String name;
String dosage;
int ClockType;
public Clock(String hour, String minute, String name, String dosage, int clockType) {
this.hour = hour;
this.minute = minute;
this.name = name;
this.dosage = dosage;
ClockType = clockType;
}
public Clock(){}
public String getMinute() {
return minute;
}
public String getHour() {
return hour;
}
public void setHour(String hour) {
this.hour = hour;
}
public void setMinute(String minute) {
this.minute = minute;
}
public int getClockType() {
return ClockType;
}
public void setClockType(int clockType) {
ClockType = clockType;
}
public String getName() {
return name;
}
public String getDosage() {
return dosage;
}
public void setName(String name) {
this.name = name;
}
public void setDosage(String dosage) {
this.dosage = dosage;
}
}

@ -1,80 +0,0 @@
package com.example.leudaemialikeme.Model;
import java.io.Serializable;
import java.sql.Timestamp;
public class Comment implements Serializable {
private static final long serialVersionUID = 1L;
private int cid;
private int id;
private String uName;
private int uid;
private String content;
private Timestamp time;
private int type; //评论1/回答2
public Comment(){
}
public Comment(int id,int cid,String name,int uid,String content,Timestamp time,int type){
this.id=id;
this.cid=cid;
this.uName=name;
this.uid=uid;
this.content=content;
this.time=time;
this.type=type;
}
public Comment(int id,String name,Timestamp time,int uid,String content,int type){
this.time=time;
this.id=id;
this.uName=name;
this.uid=uid;
this.content=content;
this.type=type;
}
public int getId(){
return id;
}
public void setId(int id){
this.id=id;
}
public int getCid(){
return cid;
}
public void setCid(int cid){
this.cid=cid;
}
public String getUName(){
return uName;
}
public void setUName(String name){
this.uName=name;
}
public int getUid(){
return uid;
}
public void setUid(int uid){
this.uid=uid;
}
public String getContent(){
return content;
}
public void setContent(String content){
this.content=content;
}
public Timestamp getTime(){
return time;
}
public void setTime(Timestamp time){
this.time=time;
}
public int getType(){
return type;
}
public void setType(int type){
this.type=type;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}

@ -1,66 +0,0 @@
package com.example.leudaemialikeme.Model;
import org.litepal.crud.LitePalSupport;
public class Friend extends LitePalSupport {
private int id;
private String username;
private int netId;
private int ownerNetId;
private Boolean isChat;
public Friend(){
super();
}
public Friend(int netId, String username){
this.netId = netId;
this.username = username;
this.isChat=true;
}
public Friend(int netId, String username, int ownerNetId){
this.netId = netId; //聊天人的ID
this.username = username; //聊天人的用户名
this.ownerNetId = ownerNetId; //本机用户的ID
this.isChat=true;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getNetId() {
return netId;
}
public void setNetId(int netId) {
this.netId = netId;
}
public int getOwnerNetId() {
return ownerNetId;
}
public void setOwnerNetId(int ownerNetId) {
this.ownerNetId = ownerNetId;
}
public Boolean getChat() {
return isChat;
}
public void setChat(Boolean chat) {
isChat = chat;
}
}

@ -1,15 +0,0 @@
package com.example.leudaemialikeme.Model;
import java.util.ArrayList;
public class MessageItemView {
public Friend friend;
public Owner owner;
public ArrayList<Message> messages;
public MessageItemView(Friend friend,Owner owner,ArrayList<Message> messages){
this.friend=friend;
this.owner=owner;
this.messages=messages;
}
}

@ -1,53 +0,0 @@
package com.example.leudaemialikeme.Model;
import java.sql.Timestamp;
public class MyAnswerItemView {
private int qid;
private String qtitle;
private String acontent;
private Timestamp answerTime;
public MyAnswerItemView(){
}
public MyAnswerItemView(int qid, String qtitle, String acontent, Timestamp answerTime) {
this.qid = qid;
this.qtitle = qtitle;
this.acontent = acontent;
this.answerTime = answerTime;
}
public int getQid() {
return qid;
}
public void setQid(int qid) {
this.qid = qid;
}
public String getQtitle() {
return qtitle;
}
public void setQtitle(String qtitle) {
this.qtitle = qtitle;
}
public String getAcontent() {
return acontent;
}
public void setAcontent(String acontent) {
this.acontent = acontent;
}
public Timestamp getAnswerTime() {
return answerTime;
}
public void setAnswerTime(Timestamp answerTime) {
this.answerTime = answerTime;
}
}

@ -1,29 +0,0 @@
package com.example.leudaemialikeme.Utils;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class TimeUtil {
public static String pattern="yyyy-MM-dd HH:mm:ss";
public static String timeToString(Timestamp timestamp){
SimpleDateFormat format = new SimpleDateFormat(pattern);
return format.format(timestamp);
}
public static Timestamp stringToTime(String string){
return Timestamp.valueOf(string);
}
public static Date stringToDate(String string) throws ParseException {
SimpleDateFormat format=new SimpleDateFormat(pattern);
return format.parse(string);
}
public static String dateToString(Date date){
SimpleDateFormat format=new SimpleDateFormat(pattern);
return format.format(date);
}
}

@ -1,54 +0,0 @@
package com.example.leudaemialikeme.service;
import android.util.Log;
import com.example.leudaemialikeme.Dao.FriendDao;
import com.example.leudaemialikeme.Dao.MessageDao;
import com.example.leudaemialikeme.Model.Chat;
import com.example.leudaemialikeme.Model.Friend;
import com.example.leudaemialikeme.Model.Message;
import com.example.leudaemialikeme.Utils.TimeUtil;
import java.sql.Timestamp;
import java.util.ArrayList;
public class ChatService {
private FriendDao friendDao;
private MessageDao messageDao;
public ChatService(){
this.friendDao=new FriendDao();
this.messageDao=new MessageDao();
}
//接收消息后进行发送者的判断,如果该消息不是本地同步的好友发送的,则先将消息保存,然后发送好友同步请求,然后再进行聊天列表的展示
//这里需要先进行未读消息的朋友判断改变isChat状态然后再进行展示
public ArrayList<Chat> findChatList(int ownerNetId){
Log.d("记录","开始获取消息列表");
ArrayList<Friend> isChatFriends = friendDao.findChatFriendList(ownerNetId);
Log.d("chatservice","ischatfriends:"+isChatFriends.size());
ArrayList<Chat> chats = new ArrayList<>();
for (Friend friend : isChatFriends){
Message message = messageDao.findLastMessage(friend.getNetId(),ownerNetId);
Log.d("chatservice","lastmessage:"+message);
Chat chat;
if (message == null){
chat = new Chat(friend.getNetId(),friend.getUsername(),"",1,"" );
}else{
String time= TimeUtil.timeToString(new Timestamp(message.getCreateTime()));
/****/
String lastMessage="";
if (message.getMessageType()==1){
lastMessage=message.getContent();
}else {
lastMessage="[图片]";
}
/****/
chat = new Chat(friend.getNetId(),friend.getUsername(),lastMessage,message.getFlag(),time);
}
chats.add(chat);
}
return chats;
}
}

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#fe6969"
android:centerColor="#fb7a6a"
android:endColor="#ff976d"
android:angle="45"
/>
<corners
android:radius="15dp"/>
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,8h4L8,4L4,4v4zM10,20h4v-4h-4v4zM4,20h4v-4L4,16v4zM4,14h4v-4L4,10v4zM10,14h4v-4h-4v4zM16,4v4h4L20,4h-4zM10,8h4L14,4h-4v4zM16,14h4v-4h-4v4zM16,20h4v-4h-4v4z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 517 B

@ -1,113 +0,0 @@
<?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"
android:orientation="vertical"
tools:context=".ClockDetail">
<LinearLayout
android:layout_marginTop="38dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:id="@+id/back_list_clock"
android:textSize="20sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="null"
android:textSize="39sp" />
<TextView
android:id="@+id/net"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" : "
android:textSize="29dp" />
<TextView
android:layout_toRightOf="@id/net"
android:id="@+id/minute"
android:layout_marginTop="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="null"
android:textSize="29sp" />
<Button
android:id="@+id/set_time"
android:text="设置时间"
android:textStyle="bold"
android:textColor="#fff"
android:layout_alignParentRight="true"
android:layout_marginRight="35dp"
android:background="@drawable/button_shape"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<LinearLayout
android:layout_marginTop="38dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="药品名称"
android:textSize="20sp" />
<EditText
android:id="@+id/content_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="38dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="剂量"
android:textSize="20sp" />
<EditText
android:id="@+id/content_dosage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="@+id/save"
android:layout_marginTop="18sp"
android:text="保存"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#fff"
android:background="@drawable/button_shape"
android:layout_gravity="center"
android:layout_margin="35dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

@ -1,225 +0,0 @@
<?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"
android:orientation="vertical"
tools:context="com.example.leudaemialikeme.Activity.AddEventActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_margin="10dp"
android:id="@+id/back_event_list"
android:src="@drawable/back"/>
<TextView
android:id="@+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="10dp"
android:layout_gravity="center"
android:gravity="center"
android:textSize="18dp"
android:text="添加大事记" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="11"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView52"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="事件" />
<EditText
android:id="@+id/add_event_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="事件名" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView53"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="地点" />
<EditText
android:id="@+id/add_event_place"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="地点名" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView54"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="医生" />
<EditText
android:id="@+id/add_event_doctor_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="医生名" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/add_event_month"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="月" />
<TextView
android:id="@+id/textView58"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="月" />
<TextView
android:id="@+id/add_event_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="天" />
<TextView
android:id="@+id/textView61"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="号" />
<Button
android:id="@+id/add_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="选择日期" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/add_event_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="8dp"
android:text="时间" />
<Button
android:id="@+id/add_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="选择时间" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="显示时间"
android:id="@+id/show_time"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:src="@drawable/delete"
android:id="@+id/delete_event"
/>
<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_margin="30dp"
android:layout_height="wrap_content"
android:id="@+id/save_event"
android:src="@drawable/save"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -1,86 +0,0 @@
<?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"
android:orientation="vertical"
tools:context="com.example.leudaemialikeme.Activity.SendInvitationActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:orientation="horizontal">
<TextView
android:id="@+id/text_answer_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20dp"
android:gravity="center"
android:text="取消" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:gravity="center"
android:textSize="25dp"
android:text="回答问题" />
<TextView
android:id="@+id/text_answer_commit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20dp"
android:gravity="center"
android:text="提交" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#efefef"
android:padding="10dp">
<TextView
android:id="@+id/text_question_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20dp"
android:text="问题是什么呢?"
android:textColor="#000"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/text_answer_detail"
android:layout_width="match_parent"
android:layout_height="280dp"
android:ems="10"
android:maxLines="4"
android:gravity="start"
android:layout_margin="10dp"
android:hint="分享你的经验,互帮互助,大家一起好起来呀!" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/img_upload_img"
android:layout_margin="10dp"
/>
</LinearLayout>
</LinearLayout>

@ -1,163 +0,0 @@
<?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">
<!--定义一个SearchView-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/search_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="28dp"
android:layout_marginLeft="15dp"
android:src="@drawable/back" />
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_round_corner"
android:orientation="horizontal">
<SearchView
android:layout_width="wrap_content"
android:layout_height="match_parent" >
</SearchView>
<EditText
android:id="@+id/blog_search_edit"
android:layout_width="220dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical"
android:hint="请输入搜索内容" />
</LinearLayout>
<TextView
android:id="@+id/blog_search_commit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:textSize="18dp"
android:text="搜索"
android:textColor="#f47920"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="搜索发现"
android:textSize="20dp"
android:layout_margin="30dp"
android:textColor="#000000"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/recView"
android:layout_width="80dp"
android:layout_height="35dp"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:background="@drawable/shape_round_corner"
android:gravity="center"
android:text="推荐" />
<TextView
android:id="@+id/foView"
android:layout_width="80dp"
android:layout_height="35dp"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:background="@drawable/shape_round_corner"
android:gravity="center"
android:text="食疗" />
<TextView
android:id="@+id/poView"
android:layout_width="80dp"
android:layout_height="35dp"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:background="@drawable/shape_round_corner"
android:gravity="center"
android:text="政策" />
<TextView
android:id="@+id/meView"
android:layout_width="80dp"
android:layout_height="35dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:background="@drawable/shape_round_corner"
android:gravity="center"
android:text="药物" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/stView"
android:layout_width="120dp"
android:layout_height="35dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:background="@drawable/shape_round_corner"
android:gravity="center"
android:text="暖心故事" />
<TextView
android:id="@+id/exView"
android:layout_width="120dp"
android:layout_height="35dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:background="@drawable/shape_round3_corner"
android:textColor="#f47920"
android:gravity="center"
android:text="专家问答" />
</LinearLayout>
</LinearLayout>

@ -1,79 +0,0 @@
<?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">
<!--定义一个SearchView-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/blog_search_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="28dp"
android:layout_marginBottom="28dp"
android:layout_marginLeft="15dp"
android:src="@drawable/back" />
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_round_corner"
android:orientation="horizontal">
<SearchView
android:layout_width="wrap_content"
android:layout_height="match_parent" >
</SearchView>
<EditText
android:id="@+id/blog_search_text"
android:layout_width="220dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text=""
android:background="@null"
android:gravity="center_vertical"
/>
</LinearLayout>
<TextView
android:id="@+id/blog_result_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:textSize="18dp"
android:text="取消"
android:textColor="#f47920"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/result_recyclerView"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_margin="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>

@ -1,329 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
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"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="#FFFFFF"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/detail_to"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_gravity="center"
android:src="@drawable/back" />
<TextView
android:id="@+id/textView30"
android:layout_width="306dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="详情"
android:textSize="19dp"
android:textStyle="bold" />
<ImageView
android:id="@+id/detail_to_search"
android:layout_width="66dp"
android:layout_height="match_parent"
app:srcCompat="@android:drawable/ic_menu_search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/detail_theme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="急性白血病经验分享,第一帖"
android:textSize="20dp" />
</LinearLayout>
<!-- <LinearLayout-->
<!-- android:id="@+id/detail_to_answer"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:orientation="horizontal"-->
<!-- android:padding="10dp">-->
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="查看全部回答"-->
<!-- android:textColor="#66c18c"-->
<!-- android:textSize="15dp" />-->
<!-- <ImageView-->
<!-- android:layout_width="24dp"-->
<!-- android:layout_height="13dp"-->
<!-- android:layout_gravity="center"-->
<!-- android:src="@drawable/forwardgreen" />-->
<!-- </LinearLayout>-->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginBottom="10dp"
android:background="#FFFFFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView13"
android:layout_width="104dp"
android:layout_height="40dp"
android:layout_weight="1"
app:srcCompat="@drawable/person" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="病因很重要"
android:textSize="18dp" />
<TextView
android:id="@+id/author_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="管住嘴,迈开腿,多喝水" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/bContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:paddingTop="15dp"
android:text="缘起: 一直以来都有很多人劝我希望我可以把自己的经历写下来,我的医生,我的同学,
我的朋友,他们觉得我的经历很有意义,虽然我自己也认同这一点,一直很难以动笔,原因有二,其一觉得
自己学理工的,对自己的文笔没什么自信。其二过往的经历实在是痛苦,写下来的过程无异于把好不容易重
合的伤疤撕开一次,自己的内心实在是有点胆怯。\n \n一谈谈我对白血病的看法\n
初次知道白血病是通过日本电影《血疑》,我相信和我年纪相当的人很多也都是通过这部电影知道这个疾病,当然我从未想过我
会与此牵扯上关系甚至在自己22岁以后的生命中处处时时需要考虑它对我的影响。我初次得病是1998年在那个年代白血病
的确依旧是一个很恐怖的病,我当初的症状就是四肢布满红色出血点,低烧吵死不退,牙龈出血,记得每次早上起床,嘴里总是
有凝结的血块,那是虽然不懂这是怎么回事,但是总是担心的要命,于是便经常刷牙,希望仅仅是上火所致,也不敢去看医生,
于是就自己买消炎药吃,希望可以平安过去。" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_margin="20dp">
<LinearLayout
android:id="@+id/detail_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:background="@drawable/search_background"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="3dp"
app:srcCompat="@drawable/view" />
<TextView
android:id="@+id/detail_view_num"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="0" />
</LinearLayout>
<LinearLayout
android:id="@+id/detail_col"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/search_background"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView15"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="3dp"
app:srcCompat="@drawable/collect" />
<TextView
android:id="@+id/detail_col_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="0" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="#FFFFFF"
android:padding="20dp">
<TextView
android:id="@+id/textView45"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="评论"
android:textSize="19dp"/>
<TextView
android:id="@+id/comment_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(0)"
android:textSize="17dp" />
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:id="@+id/vpNewsList_detail"
android:layout_width="match_parent"
android:layout_weight="1" >
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/comment_recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="bottom"
android:background="#FFFFFF">
<!-- android:layout_height="wrap_content"-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/shape_round_corner"
android:layout_margin="20dp"
android:layout_weight="1"
>
<ImageView
android:id="@+id/imageView16"
android:layout_width="20dp"
android:layout_height="45dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="20dp"
app:srcCompat="@drawable/write"
android:gravity="center|bottom"/>
<EditText
android:id="@+id/comment_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:hint="写评论"
android:background="#F1EEEE"
android:layout_marginTop="10dp"
android:gravity="center|bottom"/>
<TextView
android:id="@+id/comment_commit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20dp"
android:layout_marginTop="10dp"
android:text="发布"
android:gravity="center|bottom"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

@ -1,141 +0,0 @@
<?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"
android:orientation="vertical"
tools:context=".ClockDetail">
<LinearLayout
android:layout_marginTop="38dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:id="@+id/back_list_clock"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="服药提醒详情"
android:id="@+id/title"
android:textSize="20sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="07"
android:textSize="39sp" />
<TextView
android:id="@+id/net"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" : "
android:textSize="29dp" />
<TextView
android:layout_toRightOf="@id/net"
android:id="@+id/minute"
android:layout_marginTop="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="59"
android:textSize="29sp" />
<Button
android:id="@+id/set_time"
android:text="设置时间"
android:background="@drawable/button_shape"
android:textColor="#fff"
android:textSize="18sp"
android:layout_alignParentRight="true"
android:layout_marginRight="35dp"
android:layout_width="100dp"
android:layout_height="50dp" />
</RelativeLayout>
<LinearLayout
android:layout_marginTop="38dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="药品名称"
android:textSize="20sp" />
<EditText
android:id="@+id/content_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="38dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="剂量"
android:textSize="20sp" />
<EditText
android:id="@+id/content_dosage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:textSize="18dp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="@+id/save"
android:text="保存"
android:textSize="20sp"
android:textColor="#fff"
android:textStyle="bold"
android:background="@drawable/button_shape"
android:layout_marginTop="35dp"
android:layout_gravity="center"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/delete"
android:text="删除"
android:layout_marginTop="15dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:textSize="20sp"
android:textColor="#fff"
android:textStyle="bold"
android:background="@drawable/button_shape"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

@ -1,153 +0,0 @@
<?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"
android:orientation="vertical"
tools:context=".Activity.MyInfoActivity"
android:padding="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="ID:" />
<EditText
android:id="@+id/edit_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:text="Name" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="用户名:" />
<EditText
android:id="@+id/edit_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:text="Name" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="密码:" />
<EditText
android:id="@+id/edit_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="Name" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="确认密码" />
<EditText
android:id="@+id/edit_confirm_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:text="Name" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="手机号:" />
<EditText
android:id="@+id/edit_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:text="Name" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="性别:" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="3" >
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="男" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="女" />
</RadioGroup>
</LinearLayout>
<Button
android:id="@+id/bt_commit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="保存" />
</LinearLayout>

@ -1,239 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#FFFFFF"
android:orientation="vertical"
android:layout_marginBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/question_back"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_gravity="center"
android:src="@drawable/back" />
<TextView
android:layout_width="306dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="问题详情"
android:textSize="19dp"
android:textStyle="bold" />
<ImageView
android:id="@+id/detail_to_search"
android:layout_width="66dp"
android:layout_height="match_parent"
app:srcCompat="@android:drawable/ic_menu_search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/text_question_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000"
android:text="问题标题"
android:textSize="20dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginBottom="10dp"
android:background="#FFFFFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView13"
android:layout_width="104dp"
android:layout_height="40dp"
android:layout_weight="1"
app:srcCompat="@drawable/person" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:layout_marginLeft="5dp">
<TextView
android:id="@+id/text_author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="用户名"
android:textSize="18dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="管住嘴,迈开腿,多喝水" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/text_question_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="内容"
android:layout_gravity="center"
android:paddingTop="15dp"
android:layout_margin="10dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_margin="20dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="@+id/img_invite_to_answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/invite_to_answer" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="邀请回答" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:id="@+id/img_go_write_answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/go_write_answer" />
<TextView
android:id="@+id/textView52"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="去回答" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:id="@+id/img_follow_question"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/follow_question" />
<TextView
android:id="@+id/text_follow_question"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="关注问题" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="#FFFFFF"
android:padding="20dp">
<TextView
android:id="@+id/textView45"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="回答"
android:textSize="19dp"/>
<TextView
android:id="@+id/text_answer_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(0)"
android:textSize="17dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#FFFFFF">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView_answer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

@ -1,159 +0,0 @@
<?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"
android:orientation="vertical"
tools:context="com.example.leudaemialikeme.Activity.RegisterActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:src="@drawable/back"
/>
<TextView
android:id="@+id/textView65"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:textSize="24dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center"
android:layout_marginLeft="70dp"
android:text="注册" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView33"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="10dp"
android:text="用户名:" />
<EditText
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:id="@+id/register_username"
android:text="username"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView34"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="10dp"
android:text="密码:" />
<EditText
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:text="password"
android:id="@+id/register_password"
android:ems="10"
android:inputType="textPassword"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView63"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:text="电话号码:" />
<EditText
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content"
android:textSize="18dp"
android:id="@+id/register_phone"
android:layout_margin="10dp"
android:text="phone"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView64"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:text="性别:" />
<EditText
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content"
android:textSize="18dp"
android:id="@+id/register_sex"
android:layout_margin="10dp"
android:text="sex"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:orientation="vertical">
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="20dp"
android:text="注册" />
</LinearLayout>
</LinearLayout>

@ -1,60 +0,0 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#FFFFFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/text_answer_user_image"
android:layout_width="95dp"
android:layout_height="30dp"
android:layout_weight="1"
android:src="@drawable/person" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/text_answer_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="用户名"
android:textSize="15dp" />
<TextView
android:id="@+id/text_answer_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="太棒啦"
android:textSize="14dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/text_answer_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="210dp"
android:layout_marginTop="15dp"
android:text="2021-11-06 09:19:54"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
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="wrap_content">
<LinearLayout
android:id="@+id/news"
android:layout_width="334dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:layout_marginBottom="6dp"
android:background="@drawable/background"
android:elevation="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="11dp"
tools:ignore="MissingConstraints">
<TextView
android:id="@+id/blog_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="儿童急性B淋巴细胞白血病,除了传统疗法还有哪些前沿治疗方法呢?"
android:textSize="15dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="71dp"
android:orientation="horizontal">
<TextView
android:id="@+id/blog_info"
android:layout_width="200dp"
android:layout_height="56dp"
android:layout_marginTop="14dp"
android:text="急性淋巴细胞白血病ALL是儿童最常见的恶性肿瘤其中约85%为
"
android:textSize="11dp" />
<ImageView
android:id="@+id/recNews_image"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
app:srcCompat="@drawable/rec_news1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/blog_read"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="102"
android:textSize="12dp" />
<TextView
android:id="@+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浏览 "
android:textSize="11dp" />
<TextView
android:id="@+id/blog_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="2021-11-6 09:19:54"
android:textSize="11dp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
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="wrap_content">
<LinearLayout
android:id="@+id/news"
android:layout_width="334dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:layout_marginBottom="6dp"
android:background="@drawable/background"
android:elevation="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="11dp"
tools:ignore="MissingConstraints">
<TextView
android:id="@+id/News_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="儿童急性B淋巴细胞白血病,除了传统疗法还有哪些前沿治疗方法呢?"
android:textSize="15dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="71dp"
android:orientation="horizontal">
<TextView
android:id="@+id/News_info"
android:layout_width="200dp"
android:layout_height="56dp"
android:layout_marginTop="14dp"
android:text="急性淋巴细胞白血病ALL是儿童最常见的恶性肿瘤其中约85%为
"
android:textSize="11dp" />
<ImageView
android:id="@+id/recNews_image"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
app:srcCompat="@drawable/rec_news1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/News_read"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="102"
android:textSize="12dp" />
<TextView
android:id="@+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浏览 "
android:textSize="11dp" />
<TextView
android:id="@+id/News_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="2021-11-6 09:19:54"
android:textSize="11dp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#FFFFFF">
<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"
android:layout_marginLeft="10dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/comment_user_image"
android:layout_width="104dp"
android:layout_height="30dp"
android:layout_weight="1"
android:src="@drawable/person" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/comment_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="亚子读书"
android:textSize="15dp" />
<TextView
android:id="@+id/comment_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="太棒啦"
android:textSize="14dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/comment_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="190dp"
android:layout_marginTop="4dp"
android:text="2021-11-06 09:19:54"
android:textColor="#959191"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1px"
android:layout_gravity="bottom"
android:background="#878484" />
</androidx.cardview.widget.CardView>

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fragment.APNChannelFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>

@ -1,23 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leudaemialikeme.Fragment.BlogCollectFragment">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/blogCollectList"
android:background="@color/light_grey"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>

@ -1,24 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leudaemialikeme.Fragment.BlogHistoryFragment">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/blogHistoryList"
android:background="@color/light_grey"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>

@ -1,73 +0,0 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.leudaemialikeme.Fragment.HistoryFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="265dp"
android:layout_height="match_parent"
android:layout_weight="20">
<ImageView
android:id="@+id/back_history"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_margin="10dp"
android:src="@mipmap/left_back" />
<TextView
android:id="@+id/Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="110dp"
android:layout_gravity="center"
android:textSize="20dp"
android:text="浏览历史"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<!-- 导航标签,包含一个单选按钮组-->
<!-- 任意数量不能显示时的缩略符号 -->
<HorizontalScrollView
android:id="@+id/hvChannelHistory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/ivShowChannel"
android:scrollbars="none">
<RadioGroup
android:id="@+id/rgChannelHistory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</HorizontalScrollView>
</RelativeLayout>
</LinearLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/vpNewsListHistory"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
</LinearLayout>

@ -1,24 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leudaemialikeme.Fragment.NewsHistoryFragment">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/newsHistoryList"
android:background="@color/light_grey"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>

@ -1,24 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leudaemialikeme.Fragment.QuestionHistoryFragment">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/questionHistoryList"
android:background="@color/light_grey"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</FrameLayout>

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="334dp"
android:layout_height="wrap_content"
android:background="@drawable/background"
android:elevation="8dp"
android:padding="15dp"
android:layout_margin="12dp">
<TextView
android:id="@+id/text_answer_qid"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="" />
<TextView
android:id="@+id/text_my_answer_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="标题"
android:textSize="15dp"
android:textStyle="bold"
android:maxLines="2"
android:ellipsize="end"/>
<TextView
android:id="@+id/text_my_answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textSize="11dp"
android:text="内容"
android:maxLines="2"
android:ellipsize="end"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="1"
android:gravity="bottom"
android:layout_marginTop="5dp"
>
<TextView
android:id="@+id/text_answer_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xxxx-xx-xx xx:xx:xx"
android:textSize="11dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="问题详情 " />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/img_go_more" />
</LinearLayout>
</LinearLayout>

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="334dp"
android:layout_height="wrap_content"
android:background="@drawable/background"
android:elevation="8dp"
android:padding="15dp"
android:layout_margin="12dp">
<TextView
android:id="@+id/text_my_blog_id"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="" />
<TextView
android:id="@+id/text_my_blog_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="标题"
android:textSize="15dp"
android:textStyle="bold"
android:maxLines="2"
android:ellipsize="end"/>
<TextView
android:id="@+id/text_my_blog_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="内容"
android:maxLines="2"
android:ellipsize="end"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="1"
android:gravity="bottom"
android:layout_marginTop="5dp">
<TextView
android:id="@+id/text_my_blog_browse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--"
android:textSize="12dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浏览 "
android:textSize="11dp"/>
<TextView
android:id="@+id/text_my_blog_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xxxx-xx-xx xx:xx:xx"
android:textSize="11dp"/>
<TextView
android:id="@+id/text_my_blog_flag"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="未审核"
android:textColor="#f30"/>
</LinearLayout>
</LinearLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Loading…
Cancel
Save