@ -1,131 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.leudaemialikeme.CallAlarm;
|
||||
import com.example.leudaemialikeme.Model.Clock;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.list;
|
||||
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.timeAdapter;
|
||||
|
||||
public class AddClock extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private Calendar calendar;
|
||||
private TextView show_hour;
|
||||
private TextView show_minute;
|
||||
private EditText content_name;
|
||||
private EditText content_dosage;
|
||||
private Button set;
|
||||
private Button save;
|
||||
private ImageView back;
|
||||
String hourformat;
|
||||
String minuteformat;
|
||||
Clock clock = new Clock();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add_clock);
|
||||
show_hour = findViewById(R.id.hour);
|
||||
show_minute = findViewById(R.id.minute);
|
||||
content_name = findViewById(R.id.content_name);
|
||||
content_dosage = findViewById(R.id.content_dosage);
|
||||
set = findViewById(R.id.set_time);
|
||||
set.setOnClickListener(this);
|
||||
save = findViewById(R.id.save);
|
||||
back = findViewById(R.id.back_list_clock);
|
||||
back.setImageResource(R.drawable.ic_back);
|
||||
back.setOnClickListener(this);
|
||||
save.setOnClickListener(this);
|
||||
calendar = Calendar.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.set_time:
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
int mhour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int mminute = calendar.get(Calendar.MINUTE);
|
||||
new TimePickerDialog(AddClock.this, new TimePickerDialog.OnTimeSetListener() {
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
|
||||
//calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);
|
||||
calendar.set(Calendar.MINUTE, minute);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
|
||||
hourformat = format(hourOfDay);
|
||||
minuteformat = format(minute);
|
||||
Toast.makeText(AddClock.this, "" + hourformat + ":" + minuteformat, Toast.LENGTH_SHORT).show();
|
||||
show_hour.setText(hourformat);
|
||||
show_minute.setText(minuteformat);
|
||||
|
||||
|
||||
}
|
||||
}, mhour, mminute, true).show();
|
||||
break;
|
||||
case R.id.save:
|
||||
Intent intent = new Intent(AddClock.this, CallAlarm.class);
|
||||
PendingIntent sender = PendingIntent.getBroadcast(
|
||||
AddClock.this, 0, intent, 0);
|
||||
AlarmManager am;
|
||||
am = (AlarmManager) getSystemService(ALARM_SERVICE);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (System.currentTimeMillis()>calendar.getTimeInMillis()+40000){
|
||||
//加24小时
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis()+86400000, sender);
|
||||
}else {
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
|
||||
}
|
||||
}
|
||||
clock.setHour(hourformat);
|
||||
clock.setMinute(minuteformat);
|
||||
clock.setName("" + content_name.getText().toString());
|
||||
clock.setDosage("" + content_dosage.getText().toString());
|
||||
clock.setClockType(Clock.clock_open);
|
||||
if (clock.getHour()!=null&&clock.getMinute()!=null) {
|
||||
clock.save();
|
||||
list.add(clock);
|
||||
timeAdapter.notifyDataSetChanged();
|
||||
Log.e("Listnumber======",list.size()+"");
|
||||
finish();
|
||||
}else {
|
||||
Toast.makeText(this, "请选择闹钟时间", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.back_list_clock:
|
||||
finish();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private String format(int x) {
|
||||
String s = "" + x;
|
||||
if (s.length() == 1) {
|
||||
s = "0" + s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
@ -1,203 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Event;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class AddEventActivity extends BaseActivity {
|
||||
|
||||
public static final String EVENT_DAY = "event_day";
|
||||
public static final String EVENT_MONTH= "event_month";
|
||||
public static final String EVENT_INFO = "event_info";
|
||||
public static final String EVENT_PLACE = "event_place";
|
||||
public static final String EVENT_DOCTOR_NAME = "event_doctor_name";
|
||||
public static final String EVENT_TIME = "event_time";
|
||||
public static final String EVENT_CREATE_TIME = "event_create_time";
|
||||
private TextView event_day,event_month,event_info;
|
||||
private TextView event_place,event_doctor_name,event_time,event_create_time;
|
||||
private String show_event_day,show_event_month,show_event_info;
|
||||
private String show_event_place,show_event_doctor_name,show_event_time,show_event_create_time;
|
||||
private ImageView delete,save;
|
||||
private Button add_date,add_time;
|
||||
private ImageView back;
|
||||
|
||||
DateFormat format= DateFormat.getDateTimeInstance();
|
||||
Calendar calendar= Calendar.getInstance(Locale.CHINA);
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add_event);
|
||||
event_day = findViewById(R.id.add_event_day);
|
||||
event_month = findViewById(R.id.add_event_month);
|
||||
event_info = findViewById(R.id.add_event_info);
|
||||
event_place = findViewById(R.id.add_event_place);
|
||||
event_doctor_name = findViewById(R.id.add_event_doctor_name);
|
||||
event_time = findViewById(R.id.add_event_time);
|
||||
event_create_time = findViewById(R.id.show_time);
|
||||
delete = findViewById(R.id.delete_event);
|
||||
save = findViewById(R.id.save_event);
|
||||
add_date = findViewById(R.id.add_date);
|
||||
add_time = findViewById(R.id.add_time);
|
||||
back = findViewById(R.id.back_event_list);
|
||||
|
||||
Intent intent = getIntent();
|
||||
show_event_day = intent.getStringExtra(EVENT_DAY);
|
||||
show_event_month = intent.getStringExtra(EVENT_MONTH);
|
||||
show_event_info = intent.getStringExtra(EVENT_INFO);
|
||||
show_event_place = intent.getStringExtra(EVENT_PLACE);
|
||||
show_event_doctor_name = intent.getStringExtra(EVENT_DOCTOR_NAME);
|
||||
show_event_time = intent.getStringExtra(EVENT_TIME);
|
||||
show_event_create_time = intent.getStringExtra(EVENT_CREATE_TIME);
|
||||
|
||||
event_day.setText(show_event_day);
|
||||
event_month.setText(show_event_month);
|
||||
event_info.setText(show_event_info);
|
||||
event_place.setText(show_event_place);
|
||||
event_doctor_name.setText(show_event_doctor_name);
|
||||
event_time.setText(show_event_time);
|
||||
event_create_time.setText(show_event_create_time);
|
||||
|
||||
//点击事项
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(AddEventActivity.this,EventActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String deleteContent=event_info.getText().toString();
|
||||
LitePal.deleteAll(Event.class,"event_info=?",deleteContent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
save.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
//创建时间不为空,表明为修改
|
||||
if(show_event_create_time!=null){
|
||||
String inputDay = event_day.getText().toString();
|
||||
String inputMonth = event_month.getText().toString();
|
||||
String inputInfo = event_info.getText().toString();
|
||||
String inputPlace = event_place.getText().toString();
|
||||
String inputName = event_doctor_name.getText().toString();
|
||||
String inputTime = event_time.getText().toString();
|
||||
Event event = new Event();
|
||||
event.setEvent_day(inputDay);
|
||||
event.setEvent_month(inputMonth);
|
||||
event.setEvent_info(inputInfo);
|
||||
event.setEvent_place(inputPlace);
|
||||
event.setEvent_doctor_name(inputName);
|
||||
event.setEvent_time(inputTime);
|
||||
// LitePal.where("ownerNetId = ?", String.valueOf(ownerNetId)).find(Friend.class);
|
||||
event.updateAll("event_create_time=?",show_event_create_time);
|
||||
finish();
|
||||
}else{
|
||||
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
|
||||
Date date=new Date(System.currentTimeMillis());
|
||||
String inputDay = event_day.getText().toString();
|
||||
String inputMonth = event_month.getText().toString();
|
||||
String inputInfo = event_info.getText().toString();
|
||||
String inputPlace = event_place.getText().toString();
|
||||
String inputName = event_doctor_name.getText().toString();
|
||||
String inputTime = event_time.getText().toString();
|
||||
Event event = new Event();
|
||||
event.setEvent_day(inputDay);
|
||||
event.setEvent_month(inputMonth);
|
||||
event.setEvent_info(inputInfo);
|
||||
event.setEvent_place(inputPlace);
|
||||
event.setEvent_doctor_name(inputName);
|
||||
event.setEvent_time(inputTime);
|
||||
event.setEvent_create_time(simpleDateFormat.format(date));
|
||||
if(inputInfo.equals(LitePal.find(Event.class,3))){
|
||||
Toast.makeText(AddEventActivity.this,"该大事记已存在",Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
event.save();
|
||||
Toast.makeText(AddEventActivity.this,"保存成功",Toast.LENGTH_SHORT).show();
|
||||
finish();//操作完成结束当前活动
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//获取选择的月,日
|
||||
add_date.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
showDatePickerDialog(AddEventActivity.this, 4, event_month,event_day, calendar);;
|
||||
}
|
||||
});
|
||||
|
||||
//获取选择的时间
|
||||
add_time.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
showTimePickerDialog(AddEventActivity.this, 4, event_time, calendar);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void showTimePickerDialog(Activity activity,int themeResId, final TextView event_time, Calendar calendar) {
|
||||
new TimePickerDialog( activity,themeResId,
|
||||
// 绑定监听器
|
||||
new TimePickerDialog.OnTimeSetListener() {
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
|
||||
// event_time.setText("您选择了:" + hourOfDay + "时" + minute + "分");
|
||||
event_time.setText(hourOfDay+"时"+minute+"分");
|
||||
}
|
||||
}
|
||||
// 设置初始时间
|
||||
, calendar.get(Calendar.HOUR_OF_DAY)
|
||||
, calendar.get(Calendar.MINUTE)
|
||||
// true表示采用24小时制
|
||||
,true).show();
|
||||
}
|
||||
|
||||
|
||||
public static void showDatePickerDialog(Activity activity, int themeResId, final TextView event_month,final TextView event_day, Calendar calendar) {
|
||||
new DatePickerDialog(activity, themeResId, new DatePickerDialog.OnDateSetListener() {
|
||||
// 绑定监听器(How the parent is notified that the date is set.)
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
|
||||
// 此处得到选择的时间,可以进行你想要的操作
|
||||
// tv.setText("您选择了:" + year + "年" + (monthOfYear + 1) + "月" + dayOfMonth + "日");
|
||||
event_day.setText(String.valueOf(dayOfMonth));
|
||||
event_month.setText(String.valueOf(monthOfYear+1));
|
||||
}
|
||||
}
|
||||
// 设置初始日期
|
||||
, calendar.get(Calendar.YEAR)
|
||||
, calendar.get(Calendar.MONTH)
|
||||
, calendar.get(Calendar.DAY_OF_MONTH)).show();
|
||||
}
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
public class AlarmAlert extends BaseActivity {
|
||||
private MediaPlayer mediaPlayer;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
int position = getIntent().getIntExtra("position",-1);
|
||||
mediaPlayer = MediaPlayer.create(this,R.raw.clockmusic2);
|
||||
mediaPlayer.start();
|
||||
new AlertDialog.Builder(AlarmAlert.this)
|
||||
.setIcon(R.drawable.clock)
|
||||
.setTitle("闹钟响了")
|
||||
.setCancelable(false)
|
||||
.setMessage("时间到了!")
|
||||
.setPositiveButton("关掉"
|
||||
, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
AlarmAlert.this.finish();
|
||||
mediaPlayer.stop();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.OkHttpUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class AnswerActivity extends AppCompatActivity {
|
||||
private TextView text_answer_cancel;
|
||||
private TextView text_answer_commit;
|
||||
private TextView text_question_name;
|
||||
private EditText edit_answer_detail;
|
||||
private int qid;
|
||||
private String qtitle;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Intent intent = getIntent();
|
||||
qid = intent.getIntExtra("qid", -1);
|
||||
qtitle = intent.getStringExtra("qtitle");
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_answer);
|
||||
|
||||
text_answer_cancel = findViewById(R.id.text_answer_cancel);
|
||||
text_answer_commit = findViewById(R.id.text_answer_commit);
|
||||
text_question_name = findViewById(R.id.text_question_name);
|
||||
edit_answer_detail = findViewById(R.id.text_answer_detail);
|
||||
text_question_name.setText(qtitle);
|
||||
|
||||
text_answer_cancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
text_answer_commit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(edit_answer_detail.getText().toString().equals("")){
|
||||
Toast.makeText(AnswerActivity.this, "请输入回答内容", Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(AnswerActivity.this);
|
||||
builder.setTitle("是否确认提交回答?");
|
||||
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Toast.makeText(AnswerActivity.this, "已取消回答", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String content = edit_answer_detail.getText().toString();
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("answerContent", content);
|
||||
sendAnswer(params);
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendAnswer(final Map params){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
String url = LoginActivity.SERVER_URL+"/main-servlet?action=sendAnswer&iduser="+ BaseActivity.owner.getNetId()+"&qid="+qid;
|
||||
OkHttpUtil.asyPost(url, params,new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
final String jsonStr = response.body().string();
|
||||
runOnUiThread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
if(jsonStr.equals("success")){
|
||||
Toast.makeText(getApplicationContext(), "回答成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else {
|
||||
Toast.makeText(getApplicationContext(), "回答失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
@ -1,332 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.example.leudaemialikeme.Adapter.CommentAdapter;
|
||||
import com.example.leudaemialikeme.Model.Blog;
|
||||
import com.example.leudaemialikeme.Model.Comment;
|
||||
import com.example.leudaemialikeme.Model.User;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.OkHttpUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class BlogDetailActivity extends BaseActivity {
|
||||
TextView bTitleView;
|
||||
TextView bAuthorNameView;
|
||||
TextView bContentView;
|
||||
TextView bViewNumView;
|
||||
TextView bColNumView;
|
||||
TextView bComNumView;
|
||||
EditText comEditView;
|
||||
TextView comComView;
|
||||
ImageView detail_to;
|
||||
ImageView search;
|
||||
ImageView bColImage;
|
||||
Blog blog=new Blog();
|
||||
User author;
|
||||
List<Comment> commentList=new ArrayList<>();
|
||||
CommentAdapter commentAdapter=new CommentAdapter();
|
||||
RecyclerView recyclerView;
|
||||
LinearLayout detailColView;
|
||||
|
||||
private static ViewPager viewPager; //内导航的碎片的容器
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_blogdetail);
|
||||
Intent intent=getIntent();//新增bid
|
||||
|
||||
blog.setBid(Integer.parseInt(intent.getStringExtra("bid")));//新增bid
|
||||
blog.setBcontent(intent.getStringExtra("bContent"));
|
||||
blog.setBtittle(intent.getStringExtra("bTitle"));
|
||||
Log.e("传输后的bid",String.valueOf(blog.getBid()));
|
||||
blog.setBcollectNum(Integer.parseInt(intent.getStringExtra("bColNum")));
|
||||
blog.setBbrowse((Integer.parseInt(intent.getStringExtra("bViewNum"))));
|
||||
blog.setUid(Integer.parseInt(intent.getStringExtra("uid")));
|
||||
|
||||
|
||||
initView();
|
||||
setData();
|
||||
initClick();
|
||||
recyclerView=(RecyclerView)findViewById(R.id.comment_recyclerView);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
commentAdapter=new CommentAdapter();
|
||||
initComments();
|
||||
Log.e("commentList",String.valueOf(commentList));
|
||||
commentAdapter.setMCommentList(commentList);
|
||||
recyclerView.setAdapter(commentAdapter);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initComments() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String url=BaseActivity.SERVER_URL+"/comment-servlet?action=getCommentByBid";
|
||||
Map<String,String> paramMap=new HashMap<String,String>();
|
||||
paramMap.put("bid",String.valueOf(blog.getBid()));
|
||||
OkHttpUtil.asyPost(url, paramMap, new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String jsonStr=response.body().string();
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Gson gson=new Gson();
|
||||
Log.e("comment",jsonStr);
|
||||
Type listType=new TypeToken<List<Comment>>(){}.getType();
|
||||
commentList = gson.fromJson(jsonStr,listType);
|
||||
Log.e("onResponse:commentList",String.valueOf(commentList));
|
||||
bComNumView.setText("("+String.valueOf(commentList.size())+")");
|
||||
commentAdapter.setMCommentList(commentList);
|
||||
recyclerView.setAdapter(commentAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void setBlogAuthorName(String uid){
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
String url = BaseActivity.SERVER_URL + "/main-servlet?action=getUserById";
|
||||
Map<String,String> paramMap = new HashMap<String,String>();
|
||||
paramMap.put("uid", String.valueOf(blog.getUid()));
|
||||
Log.e("设置帖子的作者uid",uid);
|
||||
OkHttpUtil.asyPost(url, paramMap, new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String jsonStr = response.body().string();
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Gson gson = new Gson(); // 使用 gson 库解析 JSON 数据
|
||||
// 创建一个 TypeToken 的匿名子类对象,并调用对象的 getType()方法
|
||||
// Log.e("Blog's Str",jsonStr);
|
||||
Type listType = new TypeToken<User>() {}.getType();
|
||||
author = gson.fromJson(jsonStr, listType);
|
||||
// bAuthorNameView=findViewById(R.id.author);
|
||||
bAuthorNameView.setText(author.getUsername());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void initView(){
|
||||
bTitleView=findViewById(R.id.detail_theme);
|
||||
bAuthorNameView=findViewById(R.id.author);
|
||||
bContentView=findViewById(R.id.bContent);
|
||||
bViewNumView=findViewById(R.id.detail_view_num);
|
||||
bColNumView=findViewById(R.id.detail_col_num);
|
||||
bComNumView=findViewById(R.id.comment_num);
|
||||
comEditView=findViewById(R.id.comment_edit);
|
||||
comComView=findViewById(R.id.comment_commit);
|
||||
detail_to=findViewById(R.id.detail_to);
|
||||
search=findViewById(R.id.detail_to_search);
|
||||
detailColView=findViewById(R.id.detail_like);
|
||||
detailColView=findViewById(R.id.detail_col);
|
||||
bColImage=findViewById(R.id.imageView15);
|
||||
}
|
||||
|
||||
private void setData(){
|
||||
setBlogAuthorName(String.valueOf(blog.getUid()));
|
||||
// setBColNumViewImage(blog.getBid(),BaseActivity.owner.getNetId()); 需要传入登录用户的id
|
||||
setBColNumViewImage(blog.getBid(),BaseActivity.owner.getNetId(),2);
|
||||
bViewNumView.setText(String.valueOf(blog.getBbrowse()));
|
||||
bTitleView.setText(blog.getBtittle());
|
||||
bContentView.setText(blog.getBcontent());
|
||||
bColNumView.setText(String.valueOf(blog.getBcollectNum()));
|
||||
}
|
||||
|
||||
private void setBColNumViewImage(int bid,int uid,int type){
|
||||
Map<String,Integer> paramMap=new HashMap<String, Integer>();
|
||||
paramMap.put("bid",bid);
|
||||
paramMap.put("uid", uid);
|
||||
paramMap.put("type",type);
|
||||
String url_collect=BaseActivity.SERVER_URL+"/collect-servlet?action=JudgeCollect";
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String jsonStr=OkHttpUtil.synPost(url_collect,paramMap);
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.e("ColNumViewImage-jsonStr",jsonStr);
|
||||
if(!jsonStr.contains("not")){
|
||||
bColImage.setImageResource(R.drawable.collect_pick);
|
||||
bColImage.setTag(R.drawable.collect_pick);
|
||||
}else{
|
||||
bColImage.setImageResource(R.drawable.collect);
|
||||
bColImage.setTag(R.drawable.collect);
|
||||
}
|
||||
}
|
||||
});
|
||||
System.out.println("更新collect表成功");
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void initClick(){
|
||||
detail_to.setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
search.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent=new Intent(BlogDetailActivity.this,BlogSearchActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
comComView.setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String cont = comEditView.getText().toString();
|
||||
|
||||
User user=new User();
|
||||
user.setIduser(BaseActivity.owner.getNetId());
|
||||
user.setUsername(BaseActivity.owner.getUsername());
|
||||
|
||||
long timeCurrent = System.currentTimeMillis();
|
||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
Timestamp time = Timestamp.valueOf(sdf.format(timeCurrent));
|
||||
Comment comment=new Comment(blog.getBid(),user.getUsername(),time,user.getIduser(),
|
||||
cont,2);
|
||||
Map<String,Comment> paramMap=new HashMap<String,Comment>();
|
||||
paramMap.put("comment",comment);
|
||||
String url=BaseActivity.SERVER_URL+"/comment-servlet?action=insertComment";
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
OkHttpUtil.asyPost(url, paramMap, new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String jsonStr = response.body().string();
|
||||
// Log.e("提交评论",jsonStr);
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
commentList.add(comment);
|
||||
commentAdapter.setMCommentList(commentList);
|
||||
recyclerView.setAdapter(commentAdapter);
|
||||
comEditView.setText("");
|
||||
bComNumView.setText("("+String.valueOf(commentList.size())+")");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
detailColView.setOnClickListener(new View.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Map<String,Integer> paramMap=new HashMap<String, Integer>();
|
||||
paramMap.put("bid",blog.getBid());
|
||||
paramMap.put("uid", BaseActivity.owner.getNetId());
|
||||
paramMap.put("type",2);
|
||||
String url_collect=BaseActivity.SERVER_URL+"/collect-servlet?action=InsertCollect";
|
||||
|
||||
int imageId=getDrawableId(bColImage);
|
||||
if(imageId==R.drawable.collect) {
|
||||
bColImage.setImageResource(R.drawable.collect_pick);
|
||||
bColImage.setTag(R.drawable.collect_pick);
|
||||
}else {
|
||||
bColImage.setImageResource(R.drawable.collect);
|
||||
bColImage.setTag(R.drawable.collect);
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String jsonStr=OkHttpUtil.synPost(url_collect,paramMap);
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(jsonStr.contains("insert")){
|
||||
bColNumView.setText(String.valueOf(Integer.parseInt(bColNumView.getText().toString())+1));
|
||||
Toast.makeText(BlogDetailActivity.this,
|
||||
"已收藏",Toast.LENGTH_SHORT).show();
|
||||
}else{
|
||||
bColNumView.setText(String.valueOf(Integer.parseInt(bColNumView.getText().toString())-1));
|
||||
Toast.makeText(BlogDetailActivity.this,
|
||||
"取消收藏",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
System.out.println("更新collect表成功");
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int getDrawableId(ImageView iv) {
|
||||
return (Integer) iv.getTag();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
public class BlogSearchActivity extends AppCompatActivity {
|
||||
ImageView back;
|
||||
EditText blogSearchEdit;
|
||||
TextView blogSearchCommit;
|
||||
TextView recView;
|
||||
TextView foView;
|
||||
TextView poView;
|
||||
TextView meView;
|
||||
TextView stView;
|
||||
TextView exView;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_blog_search);
|
||||
|
||||
initView();
|
||||
initClick();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initView(){
|
||||
back = (ImageView)findViewById(R.id.search_back);
|
||||
blogSearchEdit = (EditText)findViewById(R.id.blog_search_edit);
|
||||
blogSearchCommit = (TextView) findViewById(R.id.blog_search_commit);
|
||||
recView=(TextView)findViewById(R.id.recView);
|
||||
foView=(TextView)findViewById(R.id.foView);
|
||||
poView=(TextView)findViewById(R.id.poView);
|
||||
meView=(TextView)findViewById(R.id.meView);
|
||||
stView=(TextView)findViewById(R.id.stView);
|
||||
exView=(TextView)findViewById(R.id.exView);
|
||||
}
|
||||
|
||||
private void initClick(){
|
||||
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
blogSearchCommit.setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String text = blogSearchEdit.getText().toString();
|
||||
if(text.length() != 0){
|
||||
Intent intent=new Intent(BlogSearchActivity.this,BlogSearchResultActivity.class);
|
||||
Log.e("onClick-text",text);
|
||||
intent.putExtra("text",text);
|
||||
startActivity(intent);}
|
||||
else{
|
||||
Toast.makeText(BlogSearchActivity.this, "请输入搜索的内容", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
recView.setOnClickListener(new View.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
skip(recView);
|
||||
}
|
||||
});
|
||||
|
||||
foView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
skip(foView);
|
||||
}
|
||||
});
|
||||
|
||||
poView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
skip(poView);
|
||||
}
|
||||
});
|
||||
|
||||
meView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
skip(meView);
|
||||
}
|
||||
});
|
||||
|
||||
stView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
skip(stView);
|
||||
}
|
||||
});
|
||||
|
||||
exView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
skip(exView);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
private void skip(TextView view){
|
||||
String text = view.getText().toString();
|
||||
Intent intent=new Intent(BlogSearchActivity.this,BlogSearchResultActivity.class);
|
||||
// Log.e("onClick-text",text);
|
||||
intent.putExtra("text",text);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.leudaemialikeme.Model.User;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
public class MyInfoActivity extends AppCompatActivity {
|
||||
private User user;
|
||||
private EditText edit_id;
|
||||
private EditText edit_username;
|
||||
private EditText edit_password;
|
||||
private EditText edit_confirm_password;
|
||||
private EditText phone;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_my_info);
|
||||
Intent intent = getIntent();
|
||||
user = (User)intent.getSerializableExtra("user");
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package com.example.leudaemialikeme.Activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
public class RegisterActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_register);
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import com.example.leudaemialikeme.Fragment.APNChannelFragment;
|
||||
|
||||
public class APNPageActivityAdapter extends FragmentPagerAdapter {
|
||||
private String[] channelList;
|
||||
private FragmentManager fm;
|
||||
public APNPageActivityAdapter(@NonNull FragmentManager fm, String[] channelList) {
|
||||
super(fm);
|
||||
this.channelList = channelList;
|
||||
this.fm = fm;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
String APNCategoryTitle = channelList[position];
|
||||
return APNChannelFragment.newInstance(APNCategoryTitle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return channelList.length;
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Blog;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CollectBlogAdapter extends RecyclerView.Adapter<CollectBlogAdapter.ViewHolder>{
|
||||
private List<Blog> collectBlogList;
|
||||
|
||||
//重写构造方法
|
||||
public CollectBlogAdapter(List<Blog> collectBlogList){
|
||||
this.collectBlogList = collectBlogList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return collectBlogList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView blog_title,blog_info,blog_read,blog_time;
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
this.blog_title = itemView.findViewById(R.id.blog_title);
|
||||
this.blog_info = itemView.findViewById(R.id.blog_info);
|
||||
this.blog_read = itemView.findViewById(R.id.blog_read);
|
||||
this.blog_time = itemView.findViewById(R.id.blog_time);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public CollectBlogAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_blog_item,parent,false);
|
||||
CollectBlogAdapter.ViewHolder holder=new CollectBlogAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
Blog blog = collectBlogList.get(position);
|
||||
holder.blog_title.setText(blog.getBtittle());
|
||||
holder.blog_info.setText(blog.getBcontent());
|
||||
holder.blog_read.setText(String.valueOf(blog.getBbrowse()));
|
||||
holder.blog_time.setText(TimeUtil.timeToString(blog.getBtime()));
|
||||
}
|
||||
}
|
||||
|
@ -1,59 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.News;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CollectNewsAdapter extends RecyclerView.Adapter<CollectNewsAdapter.ViewHolder>{
|
||||
private List<News> collectNewsList;
|
||||
|
||||
//重写构造方法
|
||||
public CollectNewsAdapter(List<News> collectNewsList){
|
||||
this.collectNewsList = collectNewsList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return collectNewsList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView news_title,news_info,news_read,news_time;
|
||||
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
this.news_title = (TextView)itemView.findViewById(R.id.News_title);
|
||||
this.news_info = (TextView)itemView.findViewById(R.id.News_info);
|
||||
this.news_read = (TextView)itemView.findViewById(R.id.News_read);
|
||||
this.news_time = (TextView)itemView.findViewById(R.id.News_time);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public CollectNewsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_news_item,parent,false);
|
||||
CollectNewsAdapter.ViewHolder holder=new CollectNewsAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
News news = collectNewsList.get(position);
|
||||
holder.news_title.setText(news.getStittle());
|
||||
holder.news_info.setText(news.getScontent());
|
||||
holder.news_read.setText(String.valueOf(news.getSbrowseNum()));
|
||||
holder.news_time.setText(TimeUtil.timeToString(news.getStime()));
|
||||
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Comment;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CommentAdapter extends RecyclerView.Adapter<CommentAdapter.ViewHolder>{
|
||||
List<Comment> mCommentList;
|
||||
Comment comment;
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
TextView comName;
|
||||
TextView comContent;
|
||||
TextView comTime;
|
||||
public ViewHolder(View view){
|
||||
super(view);
|
||||
comName=(TextView) view.findViewById(R.id.comment_user_name);
|
||||
comContent=(TextView)view.findViewById(R.id.comment_content);
|
||||
comTime=(TextView)view.findViewById(R.id.comment_time);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMCommentList(List<Comment> commentList){
|
||||
mCommentList=commentList;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.comment_item,parent,false);
|
||||
CommentAdapter.ViewHolder holder = new CommentAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull CommentAdapter.ViewHolder holder, int position) {
|
||||
comment=mCommentList.get(position);
|
||||
holder.comName.setText(comment.getUName());
|
||||
holder.comContent.setText(comment.getContent());
|
||||
holder.comTime.setText(String.valueOf(comment.getTime()).substring(0,19));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mCommentList.size();
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Blog;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HistoryBlogAdapter extends RecyclerView.Adapter<HistoryBlogAdapter.ViewHolder>{
|
||||
private List<Blog> historyBlogList;
|
||||
|
||||
//重写构造方法
|
||||
public HistoryBlogAdapter(List<Blog> historyBlogList){
|
||||
this.historyBlogList = historyBlogList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return historyBlogList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView blog_title,blog_info,blog_read,blog_time;
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
this.blog_title = itemView.findViewById(R.id.blog_title);
|
||||
this.blog_info = itemView.findViewById(R.id.blog_info);
|
||||
this.blog_read = itemView.findViewById(R.id.blog_read);
|
||||
this.blog_time = itemView.findViewById(R.id.blog_time);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public HistoryBlogAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_blog_item,parent,false);
|
||||
HistoryBlogAdapter.ViewHolder holder=new HistoryBlogAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
Blog blog = historyBlogList.get(position);
|
||||
holder.blog_title.setText(blog.getBtittle());
|
||||
holder.blog_info.setText(blog.getBcontent());
|
||||
holder.blog_read.setText(String.valueOf(blog.getBbrowse()));
|
||||
holder.blog_time.setText(TimeUtil.timeToString(blog.getBtime()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,57 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.News;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HistoryNewsAdapter extends RecyclerView.Adapter<HistoryNewsAdapter.ViewHolder>{
|
||||
private List<News> historyNewsList;
|
||||
|
||||
//重写构造方法
|
||||
public HistoryNewsAdapter(List<News> historyNewsList){
|
||||
this.historyNewsList = historyNewsList;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return historyNewsList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView news_title,news_info,news_read,news_time;
|
||||
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
this.news_title = (TextView)itemView.findViewById(R.id.News_title);
|
||||
this.news_info = (TextView)itemView.findViewById(R.id.News_info);
|
||||
this.news_read = (TextView)itemView.findViewById(R.id.News_read);
|
||||
this.news_time = (TextView)itemView.findViewById(R.id.News_time);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public HistoryNewsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.collect_news_item,parent,false);
|
||||
HistoryNewsAdapter.ViewHolder holder=new HistoryNewsAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
News news = historyNewsList.get(position);
|
||||
holder.news_title.setText(news.getStittle());
|
||||
holder.news_info.setText(news.getScontent());
|
||||
holder.news_read.setText(String.valueOf(news.getSbrowseNum()));
|
||||
holder.news_time.setText(TimeUtil.timeToString(news.getStime()));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import com.example.leudaemialikeme.Fragment.BlogHistoryFragment;
|
||||
import com.example.leudaemialikeme.Fragment.NewsHistoryFragment;
|
||||
import com.example.leudaemialikeme.Fragment.QuestionHistoryFragment;
|
||||
|
||||
public class HistoryPageFragmentAdapter extends FragmentPagerAdapter {
|
||||
private String[] channelList;
|
||||
private FragmentManager fm;
|
||||
|
||||
public HistoryPageFragmentAdapter(FragmentManager fm, String[] channelList) {
|
||||
super(fm);
|
||||
this.channelList = channelList;
|
||||
this.fm=fm;
|
||||
}
|
||||
@Override
|
||||
public Fragment getItem(int idx) {
|
||||
String collectCategoryTitle = channelList[idx];
|
||||
if(collectCategoryTitle.equals(" 资讯 "))
|
||||
{
|
||||
return NewsHistoryFragment.newInstance(collectCategoryTitle);
|
||||
}
|
||||
else if(collectCategoryTitle.equals(" 问题 ")){
|
||||
return QuestionHistoryFragment.newInstance(collectCategoryTitle);
|
||||
}else{
|
||||
return BlogHistoryFragment.newInstance(collectCategoryTitle);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getCount() {
|
||||
return channelList.length;
|
||||
} }
|
@ -1,91 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Activity.BaseActivity;
|
||||
import com.example.leudaemialikeme.Activity.LoginActivity;
|
||||
import com.example.leudaemialikeme.Activity.QuestionDetailActivity;
|
||||
import com.example.leudaemialikeme.Model.Question;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.OkHttpUtil;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HistoryQuestionAdapter extends RecyclerView.Adapter<HistoryQuestionAdapter.ViewHolder>{
|
||||
private List<Question> historyQuestionList;
|
||||
private Context context;
|
||||
|
||||
//重写构造方法
|
||||
public HistoryQuestionAdapter(List<Question> historyQuestionList, Context context){
|
||||
this.historyQuestionList = historyQuestionList;
|
||||
this.context = context;
|
||||
}
|
||||
public int getItemCount(){
|
||||
return historyQuestionList.size();
|
||||
}
|
||||
//内部类
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView questionTitle,questionInfo,questionRead,questionTime,question_id;
|
||||
public ViewHolder(@NonNull View itemView){
|
||||
super(itemView);
|
||||
this.question_id = itemView.findViewById(R.id.question_id);
|
||||
this.questionTitle = itemView.findViewById(R.id.questionTitle);
|
||||
this.questionInfo = itemView.findViewById(R.id.questionInfo);
|
||||
this.questionRead = itemView.findViewById(R.id.questionRead);
|
||||
this.questionTime = itemView.findViewById(R.id.questionTime);
|
||||
}
|
||||
}
|
||||
//重写 onCreateViewHolder()方法
|
||||
@Override
|
||||
public HistoryQuestionAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.question_item,parent,false);
|
||||
HistoryQuestionAdapter.ViewHolder holder=new HistoryQuestionAdapter.ViewHolder(view);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int qid = Integer.parseInt(holder.question_id.getText().toString());
|
||||
addQuestionBrowse(qid);
|
||||
Intent intent = new Intent(context, QuestionDetailActivity.class);
|
||||
intent.putExtra("qid", qid);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
});
|
||||
return holder;
|
||||
}
|
||||
|
||||
private void addQuestionBrowse(int qid) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
String url = LoginActivity.SERVER_URL+"/main-servlet?action=addQuestionBrowse&qid="+qid+"&iduser="+ BaseActivity.owner.getNetId();
|
||||
OkHttpUtil.synGet(url);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
//重写onBindViewHolder()方法
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder,int position){
|
||||
Question question = historyQuestionList.get(position);
|
||||
holder.question_id.setText(String.valueOf(question.getQid()));
|
||||
holder.questionTitle.setText(question.getQtittle());
|
||||
holder.questionInfo.setText(question.getQcontent());
|
||||
holder.questionRead.setText(String.valueOf(question.getQbrowseNum()));
|
||||
holder.questionTime.setText(TimeUtil.timeToString(question.getQtime()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,72 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Activity.QuestionDetailActivity;
|
||||
import com.example.leudaemialikeme.Model.MyAnswerItemView;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyAnswerAdapter extends RecyclerView.Adapter<MyAnswerAdapter.ViewHolder>{
|
||||
private List<MyAnswerItemView> answerList;
|
||||
private Context context;
|
||||
|
||||
public MyAnswerAdapter(List<MyAnswerItemView> answerList, Context context) {
|
||||
this.answerList = answerList;
|
||||
this.context = context;
|
||||
}
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
private TextView text_answer_qid;
|
||||
private TextView text_my_answer_title;
|
||||
private TextView text_my_answer;
|
||||
private TextView text_answer_time;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
text_answer_qid = itemView.findViewById(R.id.text_answer_qid);
|
||||
text_my_answer_title = itemView.findViewById(R.id.text_my_answer_title);
|
||||
text_my_answer = itemView.findViewById(R.id.text_my_answer);
|
||||
text_answer_time = itemView.findViewById(R.id.text_answer_time);
|
||||
}
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.my_answer_item,parent,false);
|
||||
final MyAnswerAdapter.ViewHolder holder=new MyAnswerAdapter.ViewHolder(view);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(context, QuestionDetailActivity.class);
|
||||
intent.putExtra("qid", Integer.parseInt(holder.text_answer_qid.getText().toString()));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
MyAnswerItemView answer = answerList.get(position);
|
||||
holder.text_answer_qid.setText(String.valueOf(answer.getQid()));
|
||||
holder.text_my_answer_title.setText(answer.getQtitle());
|
||||
holder.text_my_answer.setText(answer.getAcontent());
|
||||
holder.text_answer_time.setText(TimeUtil.timeToString(answer.getAnswerTime()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return answerList.size();
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Blog;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MyBlogAdapter extends RecyclerView.Adapter<MyBlogAdapter.ViewHolder>{
|
||||
List<Blog> blogList = new ArrayList<>();
|
||||
|
||||
public MyBlogAdapter(List<Blog> blogList){
|
||||
this.blogList = blogList;
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
private TextView text_my_blog_id;
|
||||
private TextView text_my_blog_title;
|
||||
private TextView text_my_blog_content;
|
||||
private TextView text_my_blog_browse;
|
||||
private TextView text_my_blog_time;
|
||||
private TextView text_my_blog_flag;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
text_my_blog_id = itemView.findViewById(R.id.text_my_blog_id);
|
||||
text_my_blog_title = itemView.findViewById(R.id.text_my_blog_title);
|
||||
text_my_blog_content = itemView.findViewById(R.id.text_my_blog_content);
|
||||
text_my_blog_browse = itemView.findViewById(R.id.text_my_blog_browse);
|
||||
text_my_blog_time = itemView.findViewById(R.id.text_my_blog_time);
|
||||
text_my_blog_flag = itemView.findViewById(R.id.text_my_blog_flag);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyBlogAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.my_blog_item,parent,false);
|
||||
MyBlogAdapter.ViewHolder holder = new MyBlogAdapter.ViewHolder(view);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//TODO 跳转到帖子的详情页
|
||||
}
|
||||
});
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyBlogAdapter.ViewHolder holder, int position) {
|
||||
Blog blog = blogList.get(position);
|
||||
holder.text_my_blog_id.setText(String.valueOf(blog.getBid()));
|
||||
holder.text_my_blog_title.setText(blog.getBtittle());
|
||||
holder.text_my_blog_content.setText(blog.getBcontent());
|
||||
holder.text_my_blog_browse.setText(String.valueOf(blog.getBbrowse()));
|
||||
holder.text_my_blog_time.setText(TimeUtil.timeToString(blog.getBtime()));
|
||||
if(blog.getFlag()==1)
|
||||
holder.text_my_blog_flag.setText("已审核");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return blogList.size();
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Model.AnswerItemView;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class QuestionDetailAdapter extends RecyclerView.Adapter<QuestionDetailAdapter.ViewHolder>{
|
||||
List<AnswerItemView> answerList = new ArrayList<>();
|
||||
public QuestionDetailAdapter(List<AnswerItemView> answerList){
|
||||
this.answerList = answerList;
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView text_answer_username;
|
||||
private TextView text_answer_content;
|
||||
private TextView text_answer_time;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
text_answer_username = itemView.findViewById(R.id.text_answer_username);
|
||||
text_answer_content = itemView.findViewById(R.id.text_answer_content);
|
||||
text_answer_time = itemView.findViewById(R.id.text_answer_time);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public QuestionDetailAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.answer_item,parent,false);
|
||||
QuestionDetailAdapter.ViewHolder holder = new QuestionDetailAdapter.ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull QuestionDetailAdapter.ViewHolder holder, int position) {
|
||||
AnswerItemView answer = answerList.get(position);
|
||||
holder.text_answer_username.setText(answer.getAnswerAuthor());
|
||||
holder.text_answer_content.setText(answer.getAnswerContent());
|
||||
holder.text_answer_time.setText(TimeUtil.timeToString(answer.getAnswerTime()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return answerList.size();
|
||||
}
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
package com.example.leudaemialikeme.Adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.CallAlarm;
|
||||
import com.example.leudaemialikeme.ClockDetail;
|
||||
import com.example.leudaemialikeme.Model.Clock;
|
||||
import com.example.leudaemialikeme.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import static android.content.Context.ALARM_SERVICE;
|
||||
|
||||
public class TimeAdapter extends RecyclerView.Adapter<TimeAdapter.ViewHolder> {
|
||||
List<Clock> list;
|
||||
LayoutInflater layoutInflater;
|
||||
Context context;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
public static int pos;
|
||||
|
||||
|
||||
|
||||
public TimeAdapter(List<Clock> list, Context context) {
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimeAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
||||
View view = layoutInflater.inflate(R.layout.list_item, null);
|
||||
ViewHolder viewHolder = new ViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@SuppressLint({"ResourceAsColor", "SetTextI18n"})
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final TimeAdapter.ViewHolder viewHolder, final int i) {
|
||||
final Clock clock = list.get(i);
|
||||
System.out.println(i+"闹钟的位置");
|
||||
pos = i;
|
||||
|
||||
Log.e("i=======",i+" "+clock.getClockType());
|
||||
if (clock.getClockType() == Clock.clock_open){
|
||||
viewHolder.aSwitch.setChecked(true);
|
||||
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
}else if (clock.getClockType() == Clock.clock_close){
|
||||
viewHolder.aSwitch.setChecked(false);
|
||||
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
}
|
||||
viewHolder.hour.setText(clock.getHour()+"");
|
||||
viewHolder.minute.setText(clock.getMinute()+"");
|
||||
|
||||
viewHolder.content_name.setText(clock.getName());
|
||||
viewHolder.content_dosage.setText(clock.getDosage());
|
||||
viewHolder.todetail.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Log.e("TODETAIL",clock.getClockType()+"");
|
||||
Intent intent = new Intent(context, ClockDetail.class);
|
||||
intent.putExtra("position", i);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
viewHolder.aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@SuppressLint("ResourceAsColor")
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
clock.setClockType(Clock.clock_open);
|
||||
//clock.updateAll();
|
||||
clock.save();
|
||||
Toast.makeText(context, "开启闹钟", Toast.LENGTH_SHORT).show();
|
||||
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorBlack));
|
||||
Intent intent = new Intent(context, CallAlarm.class);
|
||||
PendingIntent sender = PendingIntent.getBroadcast(
|
||||
context, 0, intent, 0);
|
||||
AlarmManager am;
|
||||
am = (AlarmManager) context.getSystemService(ALARM_SERVICE);
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(clock.getHour()));
|
||||
calendar.set(Calendar.MINUTE, Integer.parseInt(clock.getMinute()));
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
Log.e("TAG",calendar.getTimeInMillis()+"");
|
||||
Log.e("TAG",System.currentTimeMillis()+"");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (System.currentTimeMillis()>calendar.getTimeInMillis()+40000){
|
||||
//加24小时
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis()+86400000, sender);
|
||||
}else {
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
|
||||
}
|
||||
}
|
||||
} else if (!isChecked){
|
||||
clock.setClockType(Clock.clock_close);
|
||||
//clock.updateAll();
|
||||
clock.save();
|
||||
Log.e("status------",clock.getHour()+clock.getMinute()+clock.getMinute()+clock.getClockType()+"");
|
||||
|
||||
Log.e("关闭闹钟",clock.getClockType()+"");
|
||||
Intent intent = new Intent(context, CallAlarm.class);
|
||||
PendingIntent sender=PendingIntent.getBroadcast(
|
||||
context,0, intent, 0);
|
||||
AlarmManager am;
|
||||
am =(AlarmManager)context.getSystemService(ALARM_SERVICE);
|
||||
am.cancel(sender);
|
||||
Toast.makeText(context, "关闭闹钟", Toast.LENGTH_SHORT).show();
|
||||
viewHolder.hour.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.minute.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.net.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.content_name.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
viewHolder.content_dosage.setTextColor(context.getResources().getColor(R.color.colorGray));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView hour;
|
||||
TextView minute;
|
||||
TextView content_name,content_dosage;
|
||||
TextView net;
|
||||
Switch aSwitch;
|
||||
LinearLayout todetail;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
hour = itemView.findViewById(R.id.hour);
|
||||
minute = itemView.findViewById(R.id.minute);
|
||||
net = itemView.findViewById(R.id.net);
|
||||
content_name = itemView.findViewById(R.id.content_name);
|
||||
content_dosage = itemView.findViewById(R.id.content_dosage);
|
||||
aSwitch = itemView.findViewById(R.id.switch_control);
|
||||
todetail = itemView.findViewById(R.id.todetail);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package com.example.leudaemialikeme;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.leudaemialikeme.Activity.AlarmAlert;
|
||||
|
||||
public class CallAlarm extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Intent intent1 = new Intent(context, AlarmAlert.class);
|
||||
Bundle bundle = new Bundle();
|
||||
//String content = intent.getStringExtra("content");
|
||||
//Log.e("content===sadsad",content);
|
||||
bundle.putString("STR_CALLER","");
|
||||
intent1.putExtras(bundle);
|
||||
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent1);
|
||||
}
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
package com.example.leudaemialikeme;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Clock;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.list;
|
||||
import static com.example.leudaemialikeme.Activity.MdctRmdActivity.timeAdapter;
|
||||
|
||||
public class ClockDetail extends Activity implements View.OnClickListener{
|
||||
private Calendar calendar;
|
||||
private TextView show_hour;
|
||||
private TextView show_minute;
|
||||
private EditText content_name;
|
||||
private EditText content_dosage;
|
||||
private ImageView back;
|
||||
private TextView title;
|
||||
private Button set;
|
||||
private Button save;
|
||||
private Button delete;
|
||||
Clock clock;
|
||||
int position;
|
||||
String hourformat;
|
||||
String minuteformat;
|
||||
Context context = ClockDetail.this;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_clock_detail);
|
||||
show_hour = findViewById(R.id.hour);
|
||||
show_minute = findViewById(R.id.minute);
|
||||
content_name = findViewById(R.id.content_name);
|
||||
content_dosage = findViewById(R.id.content_dosage);
|
||||
set = findViewById(R.id.set_time);
|
||||
set.setOnClickListener(this);
|
||||
save = findViewById(R.id.save);
|
||||
save.setOnClickListener(this);
|
||||
delete = findViewById(R.id.delete);
|
||||
delete.setOnClickListener(this);
|
||||
back = findViewById(R.id.back_list_clock);
|
||||
back.setOnClickListener(this);
|
||||
back.setImageResource(R.drawable.ic_back);
|
||||
title = findViewById(R.id.title);
|
||||
title.setText("服药提醒详情");
|
||||
calendar = Calendar.getInstance();
|
||||
initView();
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void initView() {
|
||||
position = getIntent().getIntExtra("position", -1);
|
||||
clock = list.get(position);
|
||||
Log.e("position", position + "");
|
||||
if (clock.getHour() != null && clock.getMinute() != null) {
|
||||
hourformat = formatString(clock.getHour());
|
||||
minuteformat = formatString(clock.getMinute());
|
||||
}
|
||||
content_name.setText(clock.getName());
|
||||
content_dosage.setText(clock.getDosage());
|
||||
show_hour.setText(clock.getHour() + "");
|
||||
show_minute.setText(clock.getMinute() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.set_time:
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
int mhour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int mminute = calendar.get(Calendar.MINUTE);
|
||||
new TimePickerDialog(ClockDetail.this, new TimePickerDialog.OnTimeSetListener() {
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
|
||||
//calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);
|
||||
calendar.set(Calendar.MINUTE, minute);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
hourformat = format(hourOfDay);
|
||||
minuteformat = format(minute);
|
||||
Toast.makeText(ClockDetail.this, "" + hourformat + ":" + minuteformat, Toast.LENGTH_SHORT).show();
|
||||
show_hour.setText(hourformat);
|
||||
show_minute.setText(minuteformat);
|
||||
|
||||
|
||||
}
|
||||
}, mhour, mminute, true).show();
|
||||
break;
|
||||
case R.id.save:
|
||||
clock.setHour(hourformat);
|
||||
clock.setMinute(minuteformat);
|
||||
clock.setName("" + content_name.getText().toString());
|
||||
clock.setDosage("" + content_dosage.getText().toString());
|
||||
clock.setClockType(Clock.clock_open);
|
||||
clock.save();
|
||||
Intent intent = new Intent(ClockDetail.this, CallAlarm.class);
|
||||
// intent.putExtra("content",clock.getContent());
|
||||
//sendBroadcast(intent);
|
||||
PendingIntent sender = PendingIntent.getBroadcast(
|
||||
ClockDetail.this, 0, intent, 0);
|
||||
AlarmManager am;
|
||||
am = (AlarmManager) getSystemService(ALARM_SERVICE);
|
||||
Log.e("gethour",clock.getHour());
|
||||
Log.e("gethour",clock.getMinute());
|
||||
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(clock.getHour()));
|
||||
calendar.set(Calendar.MINUTE, Integer.parseInt(clock.getMinute()));
|
||||
Log.e("TAG",calendar.getTimeInMillis()+"");
|
||||
Log.e("TAG",System.currentTimeMillis()+"");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (System.currentTimeMillis()>calendar.getTimeInMillis()+60000){
|
||||
//加24小时
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis()+86400000, sender);
|
||||
}else {
|
||||
am.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
|
||||
}
|
||||
}
|
||||
|
||||
timeAdapter.notifyDataSetChanged();
|
||||
finish();
|
||||
break;
|
||||
case R.id.delete:
|
||||
clock.delete();
|
||||
timeAdapter.notifyDataSetChanged();
|
||||
Intent intent1 = new Intent(context, CallAlarm.class);
|
||||
PendingIntent sender1=PendingIntent.getBroadcast(
|
||||
context,0, intent1, 0);
|
||||
am =(AlarmManager)context.getSystemService(ALARM_SERVICE);
|
||||
am.cancel(sender1);
|
||||
finish();
|
||||
break;
|
||||
case R.id.back_list_clock:
|
||||
finish();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private String format(int x) {
|
||||
String s = "" + x;
|
||||
if (s.length() == 1) {
|
||||
s = "0" + s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
private String formatString(String x) {
|
||||
String s = x;
|
||||
if (s.length() == 1) {
|
||||
s = "0" + s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
package com.example.leudaemialikeme.Dao;
|
||||
|
||||
import com.example.leudaemialikeme.Model.Friend;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class FriendDao extends BaseDao{
|
||||
|
||||
public ArrayList<Friend> findFriendListByOwnerNetId(int ownerNetId){
|
||||
ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("ownerNetId = ?", String.valueOf(ownerNetId)).find(Friend.class);
|
||||
return friendList;
|
||||
}
|
||||
|
||||
public ArrayList<Friend> findChatFriendList(int ownerNetId){
|
||||
ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("ownerNetId = ? AND isChat = ?", String.valueOf(ownerNetId),"1").find(Friend.class);
|
||||
return friendList;
|
||||
}
|
||||
|
||||
public Friend findByNetId(int netId,int ownerNetId){
|
||||
ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("netId = ? and ownerNetId = ?", String.valueOf(netId),String.valueOf(ownerNetId)).find(Friend.class);
|
||||
if (friendList.size()==0){
|
||||
return null;
|
||||
}
|
||||
return friendList.get(0);
|
||||
}
|
||||
|
||||
public void changeChatStatus(Friend friend, int netId, int ownerNetId){
|
||||
friend.updateAll("netId = ? and ownerNetId = ?",String.valueOf(netId),String.valueOf(ownerNetId));
|
||||
}
|
||||
|
||||
// public ArrayList<Friend> findByKeyword(String keyword,int ownerNetId){
|
||||
// String keywordCop="%"+keyword+"%";
|
||||
// ArrayList<Friend> friends=(ArrayList<Friend>) LitePal.where("name like ? AND isfriend=1 AND ownerNetId=?",keywordCop,String.valueOf(ownerNetId)).find(Friend.class);
|
||||
// return friends;
|
||||
// }
|
||||
|
||||
// public ArrayList<Friend> findNewFriendList(int ownerNetId){
|
||||
// ArrayList<Friend> friendList=(ArrayList<Friend>)LitePal.where("ownerNetId = ? AND isfriend=0", String.valueOf(ownerNetId)).find(Friend.class);
|
||||
// return friendList;
|
||||
// }
|
||||
}
|
@ -1,160 +0,0 @@
|
||||
package com.example.leudaemialikeme.Fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.leudaemialikeme.Activity.BaseActivity;
|
||||
import com.example.leudaemialikeme.Adapter.MyAnswerAdapter;
|
||||
import com.example.leudaemialikeme.Adapter.MyBlogAdapter;
|
||||
import com.example.leudaemialikeme.Model.Blog;
|
||||
import com.example.leudaemialikeme.Model.MyAnswerItemView;
|
||||
import com.example.leudaemialikeme.R;
|
||||
import com.example.leudaemialikeme.Utils.OkHttpUtil;
|
||||
import com.example.leudaemialikeme.Utils.TimeUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class APNChannelFragment extends Fragment {
|
||||
private static final String ARG_CATEGORY_TITLE = "category_title";
|
||||
private String APNCategoryTitle = "Default";
|
||||
private List<MyAnswerItemView> answerList = new ArrayList<>();
|
||||
private List<Blog> blogList = new ArrayList<>();
|
||||
private RecyclerView answerRecyclerview;
|
||||
private RecyclerView blogRecyclerview;
|
||||
public APNChannelFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static APNChannelFragment newInstance(String APNCategoryTitle) {
|
||||
APNChannelFragment fragment = new APNChannelFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_CATEGORY_TITLE, APNCategoryTitle);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
try {
|
||||
APNCategoryTitle = getArguments().getString(ARG_CATEGORY_TITLE);
|
||||
} catch (java.lang.NullPointerException e) {
|
||||
System.out.println("TesFragment getArg error!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view;
|
||||
if (APNCategoryTitle.equals("回答")) {
|
||||
view = inflater.inflate(R.layout.recyclerview, container, false);
|
||||
answerRecyclerview = view.findViewById(R.id.list_community);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
|
||||
answerRecyclerview.setLayoutManager(layoutManager);
|
||||
MyAnswerAdapter adapter = new MyAnswerAdapter(answerList, getContext());
|
||||
answerRecyclerview.setAdapter(adapter);
|
||||
getMyAnswerList();
|
||||
} else if (APNCategoryTitle.equals("帖子")) {
|
||||
view = inflater.inflate(R.layout.recyclerview, container, false);
|
||||
blogRecyclerview = view.findViewById(R.id.list_community);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
|
||||
blogRecyclerview.setLayoutManager(layoutManager);
|
||||
MyBlogAdapter adapter = new MyBlogAdapter(blogList);
|
||||
blogRecyclerview.setAdapter(adapter);
|
||||
getMyBlogList();
|
||||
} else {
|
||||
view = inflater.inflate(R.layout.fragment_a_p_n_channel, container, false);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
private void getMyBlogList() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
String url = BaseActivity.SERVER_URL+"/my-servlet?action=getMyBlogList&iduser="+BaseActivity.owner.getNetId();
|
||||
OkHttpUtil.asyGet(url, new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String jsonStr = response.body().string();
|
||||
Gson gson = new Gson();
|
||||
final List<Blog> blogList = gson.fromJson(jsonStr, new TypeToken<List<Blog>>() {}.getType());
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MyBlogAdapter adapter = new MyBlogAdapter(blogList);
|
||||
blogRecyclerview.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void getMyAnswerList() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
String url = BaseActivity.SERVER_URL+"/my-servlet?action=getMyAnswerList&iduser="+BaseActivity.owner.getNetId();
|
||||
OkHttpUtil.asyGet(url, new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String jsonStr = response.body().string();
|
||||
Gson gson = new Gson();
|
||||
List<Map<String,String>> list = gson.fromJson(jsonStr, new TypeToken<List<Map<String, String>>>() {}.getType());
|
||||
for(int i=0; i<list.size(); i++){
|
||||
Map<String, String> jsonMap = list.get(i);
|
||||
MyAnswerItemView myAnswerItemView = new MyAnswerItemView();
|
||||
myAnswerItemView.setQid(Integer.parseInt(jsonMap.get("qid")));
|
||||
myAnswerItemView.setQtitle(jsonMap.get("qtitle"));
|
||||
myAnswerItemView.setAcontent(jsonMap.get("content"));
|
||||
myAnswerItemView.setAnswerTime(TimeUtil.stringToTime(jsonMap.get("answerTime")));
|
||||
answerList.add(myAnswerItemView);
|
||||
}
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MyAnswerAdapter adapter = new MyAnswerAdapter(answerList, getContext());
|
||||
answerRecyclerview.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class AnswerItemView {
|
||||
private String answerAuthor;
|
||||
private String answerContent;
|
||||
private Timestamp answerTime;
|
||||
|
||||
public AnswerItemView(){
|
||||
|
||||
}
|
||||
|
||||
public AnswerItemView(String answerAuthor, String answerContent, Timestamp answerTime) {
|
||||
this.answerAuthor = answerAuthor;
|
||||
this.answerContent = answerContent;
|
||||
this.answerTime = answerTime;
|
||||
}
|
||||
|
||||
public String getAnswerAuthor() {
|
||||
return answerAuthor;
|
||||
}
|
||||
|
||||
public void setAnswerAuthor(String answerAuthor) {
|
||||
this.answerAuthor = answerAuthor;
|
||||
}
|
||||
|
||||
public String getAnswerContent() {
|
||||
return answerContent;
|
||||
}
|
||||
|
||||
public void setAnswerContent(String answerContent) {
|
||||
this.answerContent = answerContent;
|
||||
}
|
||||
|
||||
public Timestamp getAnswerTime() {
|
||||
return answerTime;
|
||||
}
|
||||
|
||||
public void setAnswerTime(Timestamp answerTime) {
|
||||
this.answerTime = answerTime;
|
||||
}
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class Blog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int bid;
|
||||
private int uid;
|
||||
private String btype;
|
||||
private String btittle;
|
||||
private String bcontent;
|
||||
private Timestamp btime;
|
||||
private int blikeNum;
|
||||
private int bcollectNum;
|
||||
private int bbrowse;
|
||||
private int flag;
|
||||
|
||||
public Blog() {
|
||||
|
||||
}
|
||||
|
||||
public Blog(int bid,int uid,String btype,String btittle,String bcontent,Timestamp btime,int blikeNum,
|
||||
int bcollectNum,int bbrowse,int flag) {
|
||||
this.bid=bid;
|
||||
this.uid=uid;
|
||||
this.btype=btype;
|
||||
this.btittle=btittle;
|
||||
this.bcontent=bcontent;
|
||||
this.btime=btime;
|
||||
this.blikeNum=blikeNum;
|
||||
this.bcollectNum=bcollectNum;
|
||||
this.bbrowse=bbrowse;
|
||||
this.flag=flag;
|
||||
|
||||
}
|
||||
|
||||
public Blog(int uid,String btype,String btittle,String bcontent,Timestamp btime,int blikeNum,
|
||||
int bcollectNum,int bbrowse,int flag) {
|
||||
this.uid=uid;
|
||||
this.btype=btype;
|
||||
this.btittle=btittle;
|
||||
this.bcontent=bcontent;
|
||||
this.btime=btime;
|
||||
this.blikeNum=blikeNum;
|
||||
this.bcollectNum=bcollectNum;
|
||||
this.bbrowse=bbrowse;
|
||||
this.flag=flag;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid=uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setBid(int bid) {
|
||||
this.bid=bid;
|
||||
}
|
||||
|
||||
public int getBid() {
|
||||
return bid;
|
||||
}
|
||||
|
||||
public void setBtype(String btype) {
|
||||
this.btype=btype;
|
||||
}
|
||||
|
||||
public String getBtype() {
|
||||
return btype;
|
||||
}
|
||||
|
||||
public void setBtittle(String btittle) {
|
||||
this.btittle=btittle;
|
||||
}
|
||||
|
||||
public String getBtittle() {
|
||||
return btittle;
|
||||
}
|
||||
|
||||
public void setBcontent(String bcontent) {
|
||||
this.bcontent=bcontent;
|
||||
}
|
||||
|
||||
public String getBcontent() {
|
||||
return bcontent;
|
||||
}
|
||||
|
||||
public Timestamp getBtime() {
|
||||
return btime;
|
||||
}
|
||||
|
||||
public void setBtime(Timestamp btime) {
|
||||
this.btime=btime;
|
||||
}
|
||||
|
||||
public void setBlikeNum(int blikeNum) {
|
||||
this.blikeNum=blikeNum;
|
||||
}
|
||||
|
||||
public int getBlikeNum() {
|
||||
return blikeNum;
|
||||
}
|
||||
|
||||
public void setBcollectNum(int bcollectNum) {
|
||||
this.bcollectNum=bcollectNum;
|
||||
}
|
||||
|
||||
public int getBcollectNum() {
|
||||
return bcollectNum;
|
||||
}
|
||||
|
||||
public void setBbrowse(int bbrowse) {
|
||||
this.bbrowse=bbrowse;
|
||||
}
|
||||
|
||||
public int getBbrowse() {
|
||||
return bbrowse;
|
||||
}
|
||||
|
||||
public int getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(int flag) {
|
||||
this.flag=flag;
|
||||
}
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Browse implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int id;
|
||||
private int uid;
|
||||
private int type;
|
||||
|
||||
public void setId(int id) {
|
||||
this.id=id;
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public void setUid(int uid) {
|
||||
this.uid=uid;
|
||||
}
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
public void setType(int type) {
|
||||
this.type=type;
|
||||
}
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public Browse(int id,int uid,int type) {
|
||||
this.id=id;
|
||||
this.uid=uid;
|
||||
this.type=type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,63 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
public class Clock extends LitePalSupport {
|
||||
public static final int clock_open = 1;
|
||||
public static final int clock_close = 0;
|
||||
|
||||
String hour;
|
||||
String minute;
|
||||
String name;
|
||||
String dosage;
|
||||
int ClockType;
|
||||
|
||||
public Clock(String hour, String minute, String name, String dosage, int clockType) {
|
||||
this.hour = hour;
|
||||
this.minute = minute;
|
||||
this.name = name;
|
||||
this.dosage = dosage;
|
||||
ClockType = clockType;
|
||||
}
|
||||
|
||||
public Clock(){}
|
||||
public String getMinute() {
|
||||
return minute;
|
||||
}
|
||||
|
||||
public String getHour() {
|
||||
return hour;
|
||||
}
|
||||
|
||||
public void setHour(String hour) {
|
||||
this.hour = hour;
|
||||
}
|
||||
|
||||
public void setMinute(String minute) {
|
||||
this.minute = minute;
|
||||
}
|
||||
|
||||
public int getClockType() {
|
||||
return ClockType;
|
||||
}
|
||||
|
||||
public void setClockType(int clockType) {
|
||||
ClockType = clockType;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDosage() {
|
||||
return dosage;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setDosage(String dosage) {
|
||||
this.dosage = dosage;
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class Comment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int cid;
|
||||
private int id;
|
||||
private String uName;
|
||||
private int uid;
|
||||
private String content;
|
||||
private Timestamp time;
|
||||
private int type; //评论1/回答2
|
||||
|
||||
public Comment(){
|
||||
}
|
||||
public Comment(int id,int cid,String name,int uid,String content,Timestamp time,int type){
|
||||
this.id=id;
|
||||
this.cid=cid;
|
||||
this.uName=name;
|
||||
this.uid=uid;
|
||||
this.content=content;
|
||||
this.time=time;
|
||||
this.type=type;
|
||||
}
|
||||
public Comment(int id,String name,Timestamp time,int uid,String content,int type){
|
||||
this.time=time;
|
||||
this.id=id;
|
||||
this.uName=name;
|
||||
this.uid=uid;
|
||||
this.content=content;
|
||||
this.type=type;
|
||||
}
|
||||
public int getId(){
|
||||
return id;
|
||||
}
|
||||
public void setId(int id){
|
||||
this.id=id;
|
||||
}
|
||||
public int getCid(){
|
||||
return cid;
|
||||
}
|
||||
public void setCid(int cid){
|
||||
this.cid=cid;
|
||||
}
|
||||
public String getUName(){
|
||||
return uName;
|
||||
}
|
||||
public void setUName(String name){
|
||||
this.uName=name;
|
||||
}
|
||||
public int getUid(){
|
||||
return uid;
|
||||
}
|
||||
public void setUid(int uid){
|
||||
this.uid=uid;
|
||||
}
|
||||
public String getContent(){
|
||||
return content;
|
||||
}
|
||||
public void setContent(String content){
|
||||
this.content=content;
|
||||
}
|
||||
public Timestamp getTime(){
|
||||
return time;
|
||||
}
|
||||
public void setTime(Timestamp time){
|
||||
this.time=time;
|
||||
}
|
||||
public int getType(){
|
||||
return type;
|
||||
}
|
||||
public void setType(int type){
|
||||
this.type=type;
|
||||
}
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
public class Friend extends LitePalSupport {
|
||||
private int id;
|
||||
private String username;
|
||||
private int netId;
|
||||
private int ownerNetId;
|
||||
private Boolean isChat;
|
||||
|
||||
public Friend(){
|
||||
super();
|
||||
}
|
||||
public Friend(int netId, String username){
|
||||
this.netId = netId;
|
||||
this.username = username;
|
||||
this.isChat=true;
|
||||
}
|
||||
public Friend(int netId, String username, int ownerNetId){
|
||||
this.netId = netId; //聊天人的ID
|
||||
this.username = username; //聊天人的用户名
|
||||
this.ownerNetId = ownerNetId; //本机用户的ID
|
||||
this.isChat=true;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public int getNetId() {
|
||||
return netId;
|
||||
}
|
||||
|
||||
public void setNetId(int netId) {
|
||||
this.netId = netId;
|
||||
}
|
||||
|
||||
public int getOwnerNetId() {
|
||||
return ownerNetId;
|
||||
}
|
||||
|
||||
public void setOwnerNetId(int ownerNetId) {
|
||||
this.ownerNetId = ownerNetId;
|
||||
}
|
||||
|
||||
public Boolean getChat() {
|
||||
return isChat;
|
||||
}
|
||||
|
||||
public void setChat(Boolean chat) {
|
||||
isChat = chat;
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MessageItemView {
|
||||
public Friend friend;
|
||||
public Owner owner;
|
||||
public ArrayList<Message> messages;
|
||||
|
||||
public MessageItemView(Friend friend,Owner owner,ArrayList<Message> messages){
|
||||
this.friend=friend;
|
||||
this.owner=owner;
|
||||
this.messages=messages;
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
package com.example.leudaemialikeme.Model;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class MyAnswerItemView {
|
||||
private int qid;
|
||||
private String qtitle;
|
||||
private String acontent;
|
||||
private Timestamp answerTime;
|
||||
|
||||
public MyAnswerItemView(){
|
||||
|
||||
}
|
||||
|
||||
public MyAnswerItemView(int qid, String qtitle, String acontent, Timestamp answerTime) {
|
||||
this.qid = qid;
|
||||
this.qtitle = qtitle;
|
||||
this.acontent = acontent;
|
||||
this.answerTime = answerTime;
|
||||
}
|
||||
|
||||
public int getQid() {
|
||||
return qid;
|
||||
}
|
||||
|
||||
public void setQid(int qid) {
|
||||
this.qid = qid;
|
||||
}
|
||||
|
||||
public String getQtitle() {
|
||||
return qtitle;
|
||||
}
|
||||
|
||||
public void setQtitle(String qtitle) {
|
||||
this.qtitle = qtitle;
|
||||
}
|
||||
|
||||
public String getAcontent() {
|
||||
return acontent;
|
||||
}
|
||||
|
||||
public void setAcontent(String acontent) {
|
||||
this.acontent = acontent;
|
||||
}
|
||||
|
||||
public Timestamp getAnswerTime() {
|
||||
return answerTime;
|
||||
}
|
||||
|
||||
public void setAnswerTime(Timestamp answerTime) {
|
||||
this.answerTime = answerTime;
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package com.example.leudaemialikeme.Utils;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class TimeUtil {
|
||||
public static String pattern="yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static String timeToString(Timestamp timestamp){
|
||||
SimpleDateFormat format = new SimpleDateFormat(pattern);
|
||||
return format.format(timestamp);
|
||||
}
|
||||
|
||||
public static Timestamp stringToTime(String string){
|
||||
return Timestamp.valueOf(string);
|
||||
}
|
||||
|
||||
public static Date stringToDate(String string) throws ParseException {
|
||||
SimpleDateFormat format=new SimpleDateFormat(pattern);
|
||||
return format.parse(string);
|
||||
}
|
||||
|
||||
public static String dateToString(Date date){
|
||||
SimpleDateFormat format=new SimpleDateFormat(pattern);
|
||||
return format.format(date);
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
</vector>
|
Before Width: | Height: | Size: 209 KiB |
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<gradient
|
||||
|
||||
android:startColor="#fe6969"
|
||||
|
||||
android:centerColor="#fb7a6a"
|
||||
|
||||
android:endColor="#ff976d"
|
||||
|
||||
android:angle="45"
|
||||
|
||||
/>
|
||||
<corners
|
||||
android:radius="15dp"/>
|
||||
|
||||
</shape>
|
Before Width: | Height: | Size: 19 KiB |
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M4,8h4L8,4L4,4v4zM10,20h4v-4h-4v4zM4,20h4v-4L4,16v4zM4,14h4v-4L4,10v4zM10,14h4v-4h-4v4zM16,4v4h4L20,4h-4zM10,8h4L14,4h-4v4zM16,14h4v-4h-4v4zM16,20h4v-4h-4v4z"/>
|
||||
</vector>
|
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 391 B |
Before Width: | Height: | Size: 517 B |
@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ClockDetail">
|
||||
<LinearLayout
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:id="@+id/back_list_clock"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:text="null"
|
||||
android:textSize="39sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/net"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@id/hour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" : "
|
||||
android:textSize="29dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_toRightOf="@id/net"
|
||||
android:id="@+id/minute"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="null"
|
||||
android:textSize="29sp" />
|
||||
<Button
|
||||
android:id="@+id/set_time"
|
||||
android:text="设置时间"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#fff"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="35dp"
|
||||
android:background="@drawable/button_shape"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="药品名称"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="剂量"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content_dosage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/save"
|
||||
android:layout_marginTop="18sp"
|
||||
android:text="保存"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#fff"
|
||||
android:background="@drawable/button_shape"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="35dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
@ -1,225 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.example.leudaemialikeme.Activity.AddEventActivity">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_margin="10dp"
|
||||
android:id="@+id/back_event_list"
|
||||
android:src="@drawable/back"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView16"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textSize="18dp"
|
||||
android:text="添加大事记" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="11"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView52"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="事件" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/add_event_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:text="事件名" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView53"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="地点" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/add_event_place"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:text="地点名" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView54"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="医生" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/add_event_doctor_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:text="医生名" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_event_month"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="月" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView58"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="月" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_event_day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="天" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView61"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="号" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:text="选择日期" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_event_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="8dp"
|
||||
android:text="时间" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:text="选择时间" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:text="显示时间"
|
||||
android:id="@+id/show_time"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="6"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="30dp"
|
||||
android:src="@drawable/delete"
|
||||
android:id="@+id/delete_event"
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/save_event"
|
||||
android:src="@drawable/save"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -1,86 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.example.leudaemialikeme.Activity.SendInvitationActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:text="取消" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:gravity="center"
|
||||
android:textSize="25dp"
|
||||
android:text="回答问题" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_commit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="20dp"
|
||||
android:gravity="center"
|
||||
android:text="提交" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="#efefef"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_question_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="20dp"
|
||||
android:text="问题是什么呢?"
|
||||
android:textColor="#000"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/text_answer_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp"
|
||||
android:ems="10"
|
||||
android:maxLines="4"
|
||||
android:gravity="start"
|
||||
android:layout_margin="10dp"
|
||||
android:hint="分享你的经验,互帮互助,大家一起好起来呀!" />
|
||||
<ImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/img_upload_img"
|
||||
android:layout_margin="10dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,163 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<!--定义一个SearchView-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<SearchView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
</SearchView>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/blog_search_edit"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入搜索内容" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blog_search_commit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:text="搜索"
|
||||
android:textColor="#f47920"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="搜索发现"
|
||||
android:textSize="20dp"
|
||||
android:layout_margin="30dp"
|
||||
android:textColor="#000000"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recView"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:gravity="center"
|
||||
android:text="推荐" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/foView"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:gravity="center"
|
||||
android:text="食疗" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poView"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:gravity="center"
|
||||
android:text="政策" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/meView"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:gravity="center"
|
||||
android:text="药物" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stView"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:gravity="center"
|
||||
android:text="暖心故事" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exView"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_round3_corner"
|
||||
android:textColor="#f47920"
|
||||
android:gravity="center"
|
||||
android:text="专家问答" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<!--定义一个SearchView-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/blog_search_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginBottom="28dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/shape_round_corner"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<SearchView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
</SearchView>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/blog_search_text"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text=""
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blog_result_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:text="取消"
|
||||
android:textColor="#f47920"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/result_recyclerView"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -1,141 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ClockDetail">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:id="@+id/back_list_clock"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="服药提醒详情"
|
||||
android:id="@+id/title"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:text="07"
|
||||
android:textSize="39sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/net"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@id/hour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" : "
|
||||
android:textSize="29dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_toRightOf="@id/net"
|
||||
android:id="@+id/minute"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="59"
|
||||
android:textSize="29sp" />
|
||||
<Button
|
||||
android:id="@+id/set_time"
|
||||
android:text="设置时间"
|
||||
android:background="@drawable/button_shape"
|
||||
android:textColor="#fff"
|
||||
android:textSize="18sp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="35dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="50dp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="药品名称"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="剂量"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content_dosage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/save"
|
||||
android:text="保存"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#fff"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/button_shape"
|
||||
android:layout_marginTop="35dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:layout_marginRight="35dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/delete"
|
||||
android:text="删除"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:layout_marginRight="35dp"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#fff"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/button_shape"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
@ -1,153 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".Activity.MyInfoActivity"
|
||||
android:padding="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="ID:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:text="Name" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="用户名:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:text="Name" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="密码:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName"
|
||||
android:text="Name" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="确认密码" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_confirm_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:text="Name" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="手机号:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:text="Name" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="性别:" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="3" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="男" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButton2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="女" />
|
||||
</RadioGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_commit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="保存" />
|
||||
|
||||
</LinearLayout>
|
@ -1,239 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/background"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/question_back"
|
||||
android:layout_width="47dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="306dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="问题详情"
|
||||
android:textSize="19dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/detail_to_search"
|
||||
android:layout_width="66dp"
|
||||
android:layout_height="match_parent"
|
||||
app:srcCompat="@android:drawable/ic_menu_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_question_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#000"
|
||||
android:text="问题标题"
|
||||
android:textSize="20dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView13"
|
||||
android:layout_width="104dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_weight="1"
|
||||
app:srcCompat="@drawable/person" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_author"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用户名"
|
||||
android:textSize="18dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="管住嘴,迈开腿,多喝水" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_question_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="内容"
|
||||
android:layout_gravity="center"
|
||||
android:paddingTop="15dp"
|
||||
android:layout_margin="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="20dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_invite_to_answer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@mipmap/invite_to_answer" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="邀请回答" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_go_write_answer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@mipmap/go_write_answer" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView52"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="去回答" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_follow_question"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@mipmap/follow_question" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_follow_question"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关注问题" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#ffffff">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="#FFFFFF"
|
||||
android:padding="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView45"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="回答"
|
||||
android:textSize="19dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(0)"
|
||||
android:textSize="17dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView_answer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
@ -1,159 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.example.leudaemialikeme.Activity.RegisterActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/back"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView65"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:textSize="24dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="70dp"
|
||||
android:text="注册" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView33"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="10dp"
|
||||
android:text="用户名:" />
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="10dp"
|
||||
android:id="@+id/register_username"
|
||||
android:text="username"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView34"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="10dp"
|
||||
android:text="密码:" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="10dp"
|
||||
android:text="password"
|
||||
android:id="@+id/register_password"
|
||||
android:ems="10"
|
||||
android:inputType="textPassword"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView63"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="电话号码:" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:id="@+id/register_phone"
|
||||
android:layout_margin="10dp"
|
||||
android:text="phone"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView64"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="性别:" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:id="@+id/register_sex"
|
||||
android:layout_margin="10dp"
|
||||
android:text="sex"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="6"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="20dp"
|
||||
android:text="注册" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,60 +0,0 @@
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="#FFFFFF">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/text_answer_user_image"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/person" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="用户名"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="太棒啦"
|
||||
android:textSize="14dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="210dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="2021-11-06 09:19:54"
|
||||
android:textSize="12dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
@ -1,77 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="#FFFFFF">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/comment_user_image"
|
||||
android:layout_width="104dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/person" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_user_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="亚子读书"
|
||||
android:textSize="15dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="太棒啦"
|
||||
android:textSize="14dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="190dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="2021-11-06 09:19:54"
|
||||
android:textColor="#959191"
|
||||
android:textSize="12dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="#878484" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Fragment.APNChannelFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
|
||||
</FrameLayout>
|
@ -1,23 +0,0 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.leudaemialikeme.Fragment.BlogCollectFragment">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/blogCollectList"
|
||||
android:background="@color/light_grey"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</FrameLayout>
|
@ -1,24 +0,0 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.leudaemialikeme.Fragment.BlogHistoryFragment">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/blogHistoryList"
|
||||
android:background="@color/light_grey"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
@ -1,73 +0,0 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.example.leudaemialikeme.Fragment.HistoryFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="265dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="20">
|
||||
<ImageView
|
||||
android:id="@+id/back_history"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_margin="10dp"
|
||||
android:src="@mipmap/left_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="110dp"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="20dp"
|
||||
android:text="浏览历史"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
<!-- 导航标签,包含一个单选按钮组-->
|
||||
<!-- 任意数量不能显示时的缩略符号 -->
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/hvChannelHistory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toLeftOf="@+id/ivShowChannel"
|
||||
android:scrollbars="none">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rgChannelHistory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" />
|
||||
</HorizontalScrollView>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/vpNewsListHistory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
@ -1,24 +0,0 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.leudaemialikeme.Fragment.NewsHistoryFragment">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/newsHistoryList"
|
||||
android:background="@color/light_grey"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
@ -1,24 +0,0 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.leudaemialikeme.Fragment.QuestionHistoryFragment">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/questionHistoryList"
|
||||
android:background="@color/light_grey"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="334dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background"
|
||||
android:elevation="8dp"
|
||||
android:padding="15dp"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_qid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_answer_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题"
|
||||
android:textSize="15dp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_answer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textSize="11dp"
|
||||
android:text="内容"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginTop="5dp"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_answer_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="xxxx-xx-xx xx:xx:xx"
|
||||
android:textSize="11dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:text="问题详情 " />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/img_go_more" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,73 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="334dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background"
|
||||
android:elevation="8dp"
|
||||
android:padding="15dp"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_blog_id"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_blog_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题"
|
||||
android:textSize="15dp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_blog_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="内容"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_blog_browse"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textSize="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="浏览 "
|
||||
android:textSize="11dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_blog_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="xxxx-xx-xx xx:xx:xx"
|
||||
android:textSize="11dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_my_blog_flag"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:text="未审核"
|
||||
android:textColor="#f30"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 836 B |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 231 B |