parent
360d4520d5
commit
64a919a3f9
@ -0,0 +1,131 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
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,69 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AdapterClock extends BaseAdapter {
|
||||
|
||||
private String[] names={"甘露聚糖肽胶囊","消癌平糖浆"};
|
||||
private String[] time={"每天 8:00 14:00 19:00","每天 8:00 14:00 19:00"};
|
||||
private List<Switch> list_switch;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private TextView tv1,tv2;
|
||||
private Switch aSwitch;
|
||||
|
||||
public AdapterClock(Context context) {
|
||||
mContext=context;
|
||||
list_switch=new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
public Switch getaSwitch(int position){
|
||||
|
||||
return list_switch.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return names.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return names[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
|
||||
view= LayoutInflater.from(mContext).inflate(R.layout.list_item,null);
|
||||
tv1=(TextView)view.findViewById(R.id.md_name);
|
||||
tv2=(TextView)view.findViewById(R.id.md_time);
|
||||
aSwitch=(Switch)view.findViewById(R.id.sw);
|
||||
|
||||
list_switch.add(aSwitch);
|
||||
|
||||
tv1.setText(names[i]);
|
||||
tv2.setText(time[i]);
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
@ -1,60 +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.Collect;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CollectAdapter extends RecyclerView.Adapter<CollectAdapter.ViewHolder>{
|
||||
private List<Collect> collectList;
|
||||
|
||||
//重写构造方法
|
||||
public CollectAdapter(List<Collect> collectList){
|
||||
this.collectList = collectList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return collectList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView collectTitle,collectName,collectContent,collectRead;
|
||||
ImageView collectIcon,collectImg;
|
||||
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
this.collectTitle = (TextView)itemView.findViewById(R.id.collectTitle);
|
||||
this.collectIcon = (ImageView)itemView.findViewById(R.id.collectIcon);
|
||||
this.collectName = (TextView)itemView.findViewById(R.id.collectName);
|
||||
this.collectContent = (TextView)itemView.findViewById(R.id.collectContent);
|
||||
this.collectImg = (ImageView)itemView.findViewById(R.id.collectImg);
|
||||
this.collectRead = (TextView)itemView.findViewById(R.id.collectRead);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public CollectAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_item,parent,false);
|
||||
CollectAdapter.ViewHolder holder=new CollectAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
Collect collect = collectList.get(position);
|
||||
holder.collectTitle.setText(collect.getCollectTitle());
|
||||
holder.collectName.setText(collect.getCollectName());
|
||||
holder.collectContent.setText(collect.getCollectContent());
|
||||
holder.collectRead.setText(collect.getCollectRead());
|
||||
holder.collectIcon.setImageResource(collect.getCollectIconId());
|
||||
holder.collectImg.setImageResource(collect.getCollectImgId());
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
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,54 +1,94 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.Layout;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Activity.AddEventActivity;
|
||||
import com.example.leudaemialikeme.Model.Event;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class EventAdapter extends RecyclerView.Adapter<EventAdapter.ViewHolder>{
|
||||
private List<Event> meventList;
|
||||
// private List<Event> meventList;
|
||||
private List<Map<String,String>> mcontentList;
|
||||
|
||||
//重写构造方法
|
||||
public EventAdapter(List<Event> meventList){
|
||||
this.meventList = meventList;
|
||||
public EventAdapter(List<Map<String,String>> contentList){
|
||||
this.mcontentList = contentList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return meventList.size();
|
||||
return mcontentList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
View eventView;
|
||||
TextView event_day,event_month,event_info,event_time;
|
||||
TextView event_place,event_doctor_name,event_create_time;
|
||||
LinearLayout event_item_layout;
|
||||
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
eventView = itemView;
|
||||
this.event_day = (TextView)itemView.findViewById(R.id.event_day);
|
||||
this.event_month = (TextView)itemView.findViewById(R.id.event_month);
|
||||
this.event_info = (TextView)itemView.findViewById(R.id.event_info);
|
||||
this.event_time = (TextView)itemView.findViewById(R.id.event_time);
|
||||
this.event_place = itemView.findViewById(R.id.event_place);
|
||||
this.event_doctor_name = itemView.findViewById(R.id.event_doctor_name);
|
||||
this.event_create_time = itemView.findViewById(R.id.event_create_time);
|
||||
this.event_item_layout = itemView.findViewById(R.id.event_item_layout);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public EventAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
public EventAdapter.ViewHolder onCreateViewHolder(final ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.event_item,parent,false);
|
||||
EventAdapter.ViewHolder holder=new EventAdapter.ViewHolder(view);
|
||||
// EventAdapter.ViewHolder holder=new EventAdapter.ViewHolder(view);
|
||||
final ViewHolder holder = new ViewHolder(view);
|
||||
holder.eventView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int position = holder.getAdapterPosition();
|
||||
String event_day = mcontentList.get(position).get("event_day");
|
||||
String event_month = mcontentList.get(position).get("event_month");
|
||||
String event_info = mcontentList.get(position).get("event_info");
|
||||
String event_place = mcontentList.get(position).get("event_place");
|
||||
String event_doctor_name = mcontentList.get(position).get("event_doctor_name");
|
||||
String event_time = mcontentList.get(position).get("event_time");
|
||||
String event_create_time = mcontentList.get(position).get("event_create_time");
|
||||
Intent intent = new Intent(parent.getContext(), AddEventActivity.class);
|
||||
intent.putExtra(AddEventActivity.EVENT_DAY,event_day);
|
||||
intent.putExtra(AddEventActivity.EVENT_MONTH,event_month);
|
||||
intent.putExtra(AddEventActivity.EVENT_INFO,event_info);
|
||||
intent.putExtra(AddEventActivity.EVENT_PLACE,event_place);
|
||||
intent.putExtra(AddEventActivity.EVENT_DOCTOR_NAME,event_doctor_name);
|
||||
intent.putExtra(AddEventActivity.EVENT_TIME,event_time);
|
||||
intent.putExtra(AddEventActivity.EVENT_CREATE_TIME,event_create_time);
|
||||
parent.getContext().startActivity(intent);
|
||||
}
|
||||
});
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
Event event = meventList.get(position);
|
||||
holder.event_day.setText(event.getEvent_day());
|
||||
holder.event_month.setText(event.getEvent_month());
|
||||
holder.event_info.setText(event.getEvent_info());
|
||||
holder.event_time.setText(event.getEvent_time());
|
||||
holder.event_day.setText(mcontentList.get(position).get("event_day"));
|
||||
holder.event_month.setText(mcontentList.get(position).get("event_month"));
|
||||
holder.event_info.setText(mcontentList.get(position).get("event_info"));
|
||||
holder.event_time.setText(mcontentList.get(position).get("event_time"));
|
||||
holder.event_place.setText(mcontentList.get(position).get("event_place"));
|
||||
holder.event_doctor_name.setText(mcontentList.get(position).get("event_doctor_name"));
|
||||
holder.event_create_time.setText(mcontentList.get(position).get("event_create_time"));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,57 @@
|
||||
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()));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
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;
|
||||
} }
|
@ -0,0 +1,56 @@
|
||||
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.Question;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HistoryQuestionAdapter extends RecyclerView.Adapter<HistoryQuestionAdapter.ViewHolder>{
|
||||
private List<Question> historyQuestionList;
|
||||
|
||||
//重写构造方法
|
||||
public HistoryQuestionAdapter(List<Question> historyQuestionList){
|
||||
this.historyQuestionList = historyQuestionList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return historyQuestionList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView questionTitle,questionInfo,questionRead,questionTime;
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
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);
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
Question question = historyQuestionList.get(position);
|
||||
holder.questionTitle.setText(question.getQtittle());
|
||||
holder.questionInfo.setText(question.getQcontent());
|
||||
holder.questionRead.setText(String.valueOf(question.getQbrowseNum()));
|
||||
holder.questionTime.setText(TimeUtil.timeToString(question.getQtime()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,176 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,123 @@
|
||||
package com.example.leudaemialikeme.Fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.leudaemialikeme.Adapter.HistoryPageFragmentAdapter;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
|
||||
|
||||
public class HistoryFragment extends Fragment implements ViewPager.OnPageChangeListener{
|
||||
// private static final String ARG_CHANNEL_LIST = "channel_list";
|
||||
private View view=null; // 碎片的布局实例
|
||||
private ViewPager viewPager; //内导航的碎片的容器
|
||||
private RadioGroup rgChannelCollect=null; // 内导航由单选按钮组构成
|
||||
private HorizontalScrollView hvChannelCollect=null; //单选按钮组可滚动动
|
||||
private String[] channelList = {" 资讯 "," 问题 "," 帖子 "
|
||||
}; //默认的内导航栏目
|
||||
private HistoryPageFragmentAdapter adapter; //viewPager 的适配器
|
||||
private TextView Name;
|
||||
private String title;
|
||||
|
||||
public HistoryFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public HistoryFragment(String title){
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
if(view==null){
|
||||
view=inflater.inflate(R.layout.fragment_history, container, false);
|
||||
viewPager=(ViewPager)view.findViewById(R.id.vpNewsListHistory);
|
||||
initViewPager(); //设置 ViewPager
|
||||
|
||||
rgChannelCollect=(RadioGroup)view.findViewById(R.id.rgChannelHistory);
|
||||
hvChannelCollect=(HorizontalScrollView)view.findViewById(R.id.hvChannelHistory);
|
||||
initTab(inflater);
|
||||
|
||||
Name = (TextView)view.findViewById(R.id.Name);
|
||||
Name.setText(title);
|
||||
rgChannelCollect.setOnCheckedChangeListener(
|
||||
new RadioGroup.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
viewPager.setCurrentItem(checkedId);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initTab(LayoutInflater inflater) {//初始化上面的
|
||||
for(int i=0;i<channelList.length;i++){
|
||||
RadioButton rb=(RadioButton)inflater.inflate(R.layout.invitation_tab_rb,null);
|
||||
rb.setId(i);
|
||||
rb.setText(channelList[i]);
|
||||
RadioGroup.LayoutParams params = new
|
||||
RadioGroup.LayoutParams(RadioGroup.LayoutParams.WRAP_CONTENT,
|
||||
RadioGroup.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
rgChannelCollect.addView(rb,params);
|
||||
}
|
||||
rgChannelCollect.check(0);
|
||||
}
|
||||
|
||||
private void initViewPager() { //初始化ViewPager
|
||||
FragmentManager fragmentManager = super.getActivity().getSupportFragmentManager();
|
||||
// adapter=new MessagePageFragmentAdapter(fragmentManager, channelList);
|
||||
adapter=new HistoryPageFragmentAdapter(fragmentManager, channelList);
|
||||
//参数 channelList 将被适配器用来在动态切换碎片的时候实时创建碎片 //设置 ViewPager 的适配器
|
||||
viewPager.setAdapter(adapter);
|
||||
viewPager.setOffscreenPageLimit(2);
|
||||
//设置显示第 1 个碎片
|
||||
viewPager.setCurrentItem(0);//这里设置显示第一个碎片
|
||||
//设置 ViewPager 的切换监听
|
||||
viewPager.addOnPageChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
setTab(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
private void setTab(int idx){
|
||||
RadioButton rb=(RadioButton)rgChannelCollect.getChildAt(idx);
|
||||
rb.setChecked(true);
|
||||
int left=rb.getLeft();
|
||||
int width=rb.getMeasuredWidth();
|
||||
DisplayMetrics metrics=new DisplayMetrics();
|
||||
super.getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
int screenWidth=metrics.widthPixels;
|
||||
int len=left+width/2-screenWidth/2;
|
||||
hvChannelCollect.smoothScrollTo(len,0);
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
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 int getBid() {
|
||||
return bid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public String getBtype() {
|
||||
return btype;
|
||||
}
|
||||
|
||||
public String getBtittle() {
|
||||
return btittle;
|
||||
}
|
||||
|
||||
public String getBcontent() {
|
||||
return bcontent;
|
||||
}
|
||||
|
||||
public Timestamp getBtime() {
|
||||
return btime;
|
||||
}
|
||||
|
||||
public int getBlikeNum() {
|
||||
return blikeNum;
|
||||
}
|
||||
|
||||
public int getBcollectNum() {
|
||||
return bcollectNum;
|
||||
}
|
||||
|
||||
public int getBbrowse() {
|
||||
return bbrowse;
|
||||
}
|
||||
|
||||
public int getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setBid(int bid) {
|
||||
this.bid = bid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public void setBtype(String btype) {
|
||||
this.btype = btype;
|
||||
}
|
||||
|
||||
public void setBtittle(String btittle) {
|
||||
this.btittle = btittle;
|
||||
}
|
||||
|
||||
public void setBcontent(String bcontent) {
|
||||
this.bcontent = bcontent;
|
||||
}
|
||||
|
||||
public void setBtime(Timestamp btime) {
|
||||
this.btime = btime;
|
||||
}
|
||||
|
||||
public void setBlikeNum(int blikeNum) {
|
||||
this.blikeNum = blikeNum;
|
||||
}
|
||||
|
||||
public void setBcollectNum(int bcollectNum) {
|
||||
this.bcollectNum = bcollectNum;
|
||||
}
|
||||
|
||||
public void setBbrowse(int bbrowse) {
|
||||
this.bbrowse = bbrowse;
|
||||
}
|
||||
|
||||
public void setFlag(int flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
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,72 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Collect implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String collectTitle;
|
||||
private int collectIconId;
|
||||
private String collectName;
|
||||
private String collectContent;
|
||||
private int collectImgId;
|
||||
private String collectRead;
|
||||
|
||||
public Collect(String collectTitle, int collectIconId, String collectName,
|
||||
String collectContent, int collectImgId, String collectRead){
|
||||
this.collectTitle = collectTitle;
|
||||
this.collectIconId = collectIconId;
|
||||
this.collectName = collectName;
|
||||
this.collectContent = collectContent;
|
||||
this.collectRead = collectRead;
|
||||
this.collectImgId = collectImgId;
|
||||
}
|
||||
|
||||
public String getCollectTitle() {
|
||||
return collectTitle;
|
||||
}
|
||||
|
||||
public void setCollectTitle(String collectTitle) {
|
||||
this.collectTitle = collectTitle;
|
||||
}
|
||||
|
||||
public int getCollectIconId() {
|
||||
return collectIconId;
|
||||
}
|
||||
|
||||
public void setCollectIconId(int collectIconId) {
|
||||
this.collectIconId = collectIconId;
|
||||
}
|
||||
|
||||
public String getCollectName() {
|
||||
return collectName;
|
||||
}
|
||||
|
||||
public void setCollectName(String collectName) {
|
||||
this.collectName = collectName;
|
||||
}
|
||||
|
||||
public String getCollectContent() {
|
||||
return collectContent;
|
||||
}
|
||||
|
||||
public void setCollectContent(String collectContent) {
|
||||
this.collectContent = collectContent;
|
||||
}
|
||||
|
||||
public int getCollectImgId() {
|
||||
return collectImgId;
|
||||
}
|
||||
|
||||
public void setCollectImgId(int collectImgId) {
|
||||
this.collectImgId = collectImgId;
|
||||
}
|
||||
|
||||
public String getCollectRead() {
|
||||
return collectRead;
|
||||
}
|
||||
|
||||
public void setCollectRead(String collectRead) {
|
||||
this.collectRead = collectRead;
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class News implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int nid;
|
||||
private int sid;
|
||||
private String stype;
|
||||
private String stittle;
|
||||
private String scontent;
|
||||
private Timestamp stime;
|
||||
private int sbrowseNum;
|
||||
|
||||
public News(){
|
||||
|
||||
}
|
||||
public News(int nid, int sid, String stype, String stittle, String scontent, Timestamp stime, int sbrowseNum) {
|
||||
this.nid = nid;
|
||||
this.sid = sid;
|
||||
this.stype = stype;
|
||||
this.stittle = stittle;
|
||||
this.scontent = scontent;
|
||||
this.stime = stime;
|
||||
this.sbrowseNum = sbrowseNum;
|
||||
}
|
||||
|
||||
|
||||
public int getNid() {
|
||||
return nid;
|
||||
}
|
||||
|
||||
public int getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public String getStype() {
|
||||
return stype;
|
||||
}
|
||||
|
||||
public String getStittle() {
|
||||
return stittle;
|
||||
}
|
||||
|
||||
public String getScontent() {
|
||||
return scontent;
|
||||
}
|
||||
|
||||
public int getSbrowseNum() {
|
||||
return sbrowseNum;
|
||||
}
|
||||
|
||||
public Timestamp getStime() {
|
||||
return stime;
|
||||
}
|
||||
|
||||
public void setNid(int nid) {
|
||||
this.nid = nid;
|
||||
}
|
||||
|
||||
public void setSid(int sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public void setStype(String stype) {
|
||||
this.stype = stype;
|
||||
}
|
||||
|
||||
public void setStittle(String stittle) {
|
||||
this.stittle = stittle;
|
||||
}
|
||||
|
||||
public void setScontent(String scontent) {
|
||||
this.scontent = scontent;
|
||||
}
|
||||
|
||||
public void setStime(Timestamp stime) {
|
||||
this.stime = stime;
|
||||
}
|
||||
|
||||
public void setSbrowseNum(int sbrowseNum) {
|
||||
this.sbrowseNum = sbrowseNum;
|
||||
}
|
||||
}
|
@ -1,41 +1,111 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class Question implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//声明所有变量
|
||||
private String questionInfo;
|
||||
private String questionRead;
|
||||
private String questionTime;
|
||||
|
||||
public Question(String questionInfo,String questionRead,String questionTime){
|
||||
this. questionInfo = questionInfo;
|
||||
this.questionRead = questionRead;
|
||||
this.questionTime = questionTime;
|
||||
private int qid;
|
||||
private int uid;
|
||||
private String qtittle;
|
||||
private String qcontent;
|
||||
private Timestamp qtime;
|
||||
private int qfollowNum;
|
||||
private int qanswerNum;
|
||||
private int qbrowseNum;
|
||||
private int flag;
|
||||
|
||||
public Question(){}
|
||||
|
||||
public Question(String qtittle,String qcontent, int qfollowNum, Timestamp qtime) {
|
||||
this.qtittle = qtittle;
|
||||
this.qcontent = qcontent;
|
||||
this.qtime = qtime;
|
||||
this.qfollowNum = qfollowNum;
|
||||
}
|
||||
|
||||
public Question(int qid, int uid, String qtittle, String qcontent, Timestamp qtime, int qfollowNum, int qanswerNum, int qbrowseNum, int flag) {
|
||||
this.qid = qid;
|
||||
this.uid = uid;
|
||||
this.qtittle = qtittle;
|
||||
this.qcontent = qcontent;
|
||||
this.qtime = qtime;
|
||||
this.qfollowNum = qfollowNum;
|
||||
this.qanswerNum = qanswerNum;
|
||||
this.qbrowseNum = qbrowseNum;
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public int getQid() {
|
||||
return qid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public String getQtittle() {
|
||||
return qtittle;
|
||||
}
|
||||
|
||||
public String getQcontent() {
|
||||
return qcontent;
|
||||
}
|
||||
|
||||
public Timestamp getQtime() {
|
||||
return qtime;
|
||||
}
|
||||
|
||||
public int getQfollowNum() {
|
||||
return qfollowNum;
|
||||
}
|
||||
|
||||
public int getQanswerNum() {
|
||||
return qanswerNum;
|
||||
}
|
||||
|
||||
public int getQbrowseNum() {
|
||||
return qbrowseNum;
|
||||
}
|
||||
|
||||
public int getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setQid(int qid) {
|
||||
this.qid = qid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public void setQtittle(String qtittle) {
|
||||
this.qtittle = qtittle;
|
||||
}
|
||||
|
||||
public String getQuestionInfo() {
|
||||
return questionInfo;
|
||||
public void setQcontent(String qcontent) {
|
||||
this.qcontent = qcontent;
|
||||
}
|
||||
|
||||
public void setQuestionInfo(String questionInfo) {
|
||||
this.questionInfo = questionInfo;
|
||||
public void setQtime(Timestamp qtime) {
|
||||
this.qtime = qtime;
|
||||
}
|
||||
|
||||
public String getQuestionRead() {
|
||||
return questionRead;
|
||||
public void setQfollowNum(int qfollowNum) {
|
||||
this.qfollowNum = qfollowNum;
|
||||
}
|
||||
|
||||
public void setQuestionRead(String questionRead) {
|
||||
this.questionRead = questionRead;
|
||||
public void setQanswerNum(int qanswerNum) {
|
||||
this.qanswerNum = qanswerNum;
|
||||
}
|
||||
|
||||
public String getQuestionTime() {
|
||||
return questionTime;
|
||||
public void setQbrowseNum(int qbrowseNum) {
|
||||
this.qbrowseNum = qbrowseNum;
|
||||
}
|
||||
|
||||
public void setQuestionTime(String questionTime) {
|
||||
this.questionTime = questionTime;
|
||||
public void setFlag(int flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
<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>
|
After Width: | Height: | Size: 209 KiB |
@ -0,0 +1,19 @@
|
||||
<?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>
|
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,9 @@
|
||||
<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>
|
@ -0,0 +1,9 @@
|
||||
<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>
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 517 B |
@ -0,0 +1,113 @@
|
||||
<?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>
|
@ -0,0 +1,225 @@
|
||||
<?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>
|
@ -0,0 +1,141 @@
|
||||
<?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,80 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/collectTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_weight="3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:id="@+id/collectIcon"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/collectName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="14dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16dp"
|
||||
android:id="@+id/collectContent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/collectImg"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/collectRead"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
@ -0,0 +1,24 @@
|
||||
<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>
|
@ -0,0 +1,73 @@
|
||||
<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/img_go_answer_return" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="20"
|
||||
android:gravity="center"
|
||||
android:textSize="20dp" />
|
||||
|
||||
|
||||
</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>
|
@ -0,0 +1,24 @@
|
||||
<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>
|
@ -0,0 +1,24 @@
|
||||
<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,40 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/todetail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="18dp"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="60dp"
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:text="07"
|
||||
android:textSize="38sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/net"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_toRightOf="@id/hour"
|
||||
android:text=" : "
|
||||
android:textSize="28sp" />
|
||||
<TextView
|
||||
android:layout_toRightOf="@id/net"
|
||||
android:id="@+id/minute"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:textStyle="bold"
|
||||
android:text="28"
|
||||
android:textSize="38sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/md_name"
|
||||
android:id="@+id/content_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="甘露聚糖肽胶囊"
|
||||
android:textSize="16dp" />
|
||||
|
||||
android:layout_below="@+id/time"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="药品名"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:textSize="18sp" />
|
||||
<TextView
|
||||
android:id="@+id/md_time"
|
||||
android:id="@+id/content_dosage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="每天 8:00 14:00 19:00" />
|
||||
</LinearLayout>
|
||||
|
||||
<Switch
|
||||
android:id="@+id/sw"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="60dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:padding="10dp"
|
||||
android:layout_alignParentRight="true"/>
|
||||
android:layout_below="@+id/time"
|
||||
android:layout_toRightOf="@id/content_name"
|
||||
android:text="剂量"
|
||||
android:textColor="@color/colorBlack"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch_control"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginRight="15dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="#B6B5B5" />
|
||||
|
||||
</LinearLayout>
|
||||
|
Binary file not shown.
Loading…
Reference in new issue