@ -0,0 +1,74 @@
|
||||
package com.example.amicool;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class AddActivity extends AppCompatActivity {
|
||||
|
||||
TextView note_time; //便签修改时间
|
||||
ImageView note_back; //返回首页
|
||||
EditText note_content; //便签正文
|
||||
EditText note_title;
|
||||
Button issue;
|
||||
SQLiteHelper mSQLiteHelper;
|
||||
String id;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add);
|
||||
note_time = (TextView) findViewById(R.id.tv_time);
|
||||
note_back = (ImageView) findViewById(R.id.note_back);
|
||||
note_content = (EditText) findViewById(R.id.note_content);
|
||||
note_title = (EditText) findViewById(R.id.note_title);
|
||||
issue = (Button) findViewById(R.id.issue);
|
||||
initData();//根据来源决定顶部显示"添加便签"还是"修改便签"
|
||||
/*issue.setOnClickListener(this); //返回首页*/
|
||||
}
|
||||
protected void initData() {
|
||||
mSQLiteHelper = new SQLiteHelper(this); //这一句很关键
|
||||
Intent intent = getIntent();
|
||||
if(intent!= null){
|
||||
id = intent.getStringExtra("id");
|
||||
if (id != null){ //"修改便签",显示原便签内容
|
||||
note_content.setText(intent.getStringExtra("note_content"));
|
||||
note_title.setText(intent.getStringExtra("note_title"));
|
||||
note_time.setText(intent.getStringExtra("time"));
|
||||
note_time.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.note_back: //返回键功能,关闭当前页面
|
||||
finish();
|
||||
break;
|
||||
/*case R.id.issue:
|
||||
String note_content=note_content.getText().toString().trim();
|
||||
String note_title=note_title.getText().toString().trim();
|
||||
//向数据库中添加数据
|
||||
if (note_content.length()>0){
|
||||
if (mSQLiteHelper.insertData(note_content, SQLiteHelper.getTime())){
|
||||
showToast("保存成功");
|
||||
setResult(2); //便于刷新显示
|
||||
finish();
|
||||
}else {
|
||||
showToast("保存失败");
|
||||
}
|
||||
}else {
|
||||
showToast("内容不能为空!");
|
||||
}
|
||||
break;*/
|
||||
}
|
||||
}
|
||||
public void showToast(String message){
|
||||
Toast.makeText(AddActivity.this,message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.example.amicool;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link AddFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class AddFragment extends Fragment {
|
||||
|
||||
// TODO: Rename parameter arguments, choose names that match
|
||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||
private static final String ARG_PARAM1 = "param1";
|
||||
private static final String ARG_PARAM2 = "param2";
|
||||
|
||||
// TODO: Rename and change types of parameters
|
||||
private String mParam1;
|
||||
private String mParam2;
|
||||
|
||||
public AddFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this factory method to create a new instance of
|
||||
* this fragment using the provided parameters.
|
||||
*
|
||||
* @param param1 Parameter 1.
|
||||
* @param param2 Parameter 2.
|
||||
* @return A new instance of fragment AddFragment.
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static AddFragment newInstance(String param1, String param2) {
|
||||
AddFragment fragment = new AddFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString(ARG_PARAM1, param1);
|
||||
args.putString(ARG_PARAM2, param2);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_add, container, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.example.amicool;
|
||||
|
||||
import android.content.Context;
|
||||
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 java.util.List;
|
||||
|
||||
public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder> {
|
||||
private List<AlbumInfo> albumInfoList;
|
||||
private Context context;
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
TextView title;
|
||||
TextView sort0;
|
||||
TextView sort1;
|
||||
TextView sort2;
|
||||
TextView sort3;
|
||||
TextView sort4;
|
||||
TextView sort5;
|
||||
TextView sort6;
|
||||
TextView sort7;
|
||||
TextView sort8;
|
||||
TextView sort9;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
this.title = (TextView)itemView.findViewById(R.id.title);
|
||||
this.sort0 = (TextView) itemView.findViewById(R.id.sort0);
|
||||
this.sort1 = (TextView) itemView.findViewById(R.id.sort1);
|
||||
this.sort2 = (TextView) itemView.findViewById(R.id.sort2);
|
||||
this.sort3 = (TextView) itemView.findViewById(R.id.sort3);
|
||||
this.sort4 = (TextView) itemView.findViewById(R.id.sort4);
|
||||
this.sort5 = (TextView) itemView.findViewById(R.id.sort5);
|
||||
this.sort6 = (TextView) itemView.findViewById(R.id.sort6);
|
||||
this.sort7 = (TextView) itemView.findViewById(R.id.sort7);
|
||||
this.sort8 = (TextView) itemView.findViewById(R.id.sort8);
|
||||
this.sort9 = (TextView) itemView.findViewById(R.id.sort9);
|
||||
}
|
||||
}
|
||||
public AlbumAdapter(List<AlbumInfo> albumInfoList) {
|
||||
this.albumInfoList = albumInfoList;
|
||||
}
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
AlbumInfo album = albumInfoList.get(position);
|
||||
holder.title.setText(album.getTitle());
|
||||
holder.sort0.setText(album.getSort0());
|
||||
holder.sort1.setText(album.getSort1());
|
||||
holder.sort2.setText(album.getSort2());
|
||||
holder.sort3.setText(album.getSort3());
|
||||
holder.sort4.setText(album.getSort4());
|
||||
holder.sort5.setText(album.getSort5());
|
||||
holder.sort6.setText(album.getSort6());
|
||||
holder.sort7.setText(album.getSort7());
|
||||
holder.sort8.setText(album.getSort8());
|
||||
holder.sort9.setText(album.getSort9());
|
||||
Log.e("AlbumAdapter","onBindViewHolder"+position);
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.cardview,parent,false);
|
||||
final ViewHolder holder = new ViewHolder(view);
|
||||
Log.e("AlbumAdapter","onCreateViewHolder");
|
||||
holder.sort0.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort4.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort5.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort6.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort7.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort8.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
holder.sort9.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = holder.getAdapterPosition();
|
||||
showInfo(position, v.getContext(), holder);
|
||||
}
|
||||
});
|
||||
return holder;
|
||||
}
|
||||
private void showInfo(int position, Context context,final ViewHolder holder)
|
||||
{
|
||||
final AlbumInfo data = albumInfoList.get(position);
|
||||
}
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return albumInfoList.size();
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.example.amicool;
|
||||
|
||||
public class AlbumInfo {
|
||||
private String title;
|
||||
private String sort0;
|
||||
private String sort1;
|
||||
private String sort2;
|
||||
private String sort3;
|
||||
private String sort4;
|
||||
private String sort5;
|
||||
private String sort6;
|
||||
private String sort7;
|
||||
private String sort8;
|
||||
private String sort9;
|
||||
|
||||
public AlbumInfo(String title,String sort0, String sort1,String sort2,String sort3,String sort4,
|
||||
String sort5,String sort6,String sort7,String sort8,String sort9){
|
||||
this.title = title;
|
||||
this.sort0=sort0;
|
||||
this.sort1=sort1;
|
||||
this.sort2=sort2;
|
||||
this.sort3=sort3;
|
||||
this.sort4=sort4;
|
||||
this.sort5=sort5;
|
||||
this.sort6=sort6;
|
||||
this.sort7=sort7;
|
||||
this.sort8=sort8;
|
||||
this.sort9=sort9;
|
||||
}
|
||||
|
||||
public String getTitle() { return title; }
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSort0() { return sort0; }
|
||||
|
||||
public void setSort0(String sort0) {
|
||||
this.sort0 = sort0;
|
||||
}
|
||||
|
||||
public String getSort1() { return sort1; }
|
||||
|
||||
public void setSort1(String sort1) {
|
||||
this.sort1 = sort1;
|
||||
}
|
||||
|
||||
public String getSort2() { return sort2; }
|
||||
|
||||
public void setSort2(String sort2) {
|
||||
this.sort2 = sort2;
|
||||
}
|
||||
|
||||
public String getSort3() { return sort3; }
|
||||
|
||||
public void setSort3(String sort3) {
|
||||
this.sort3 = sort3;
|
||||
}
|
||||
|
||||
public String getSort4() { return sort4; }
|
||||
|
||||
public void setSort4(String sort4) {
|
||||
this.sort4 = sort4;
|
||||
}
|
||||
|
||||
public String getSort5() { return sort5; }
|
||||
|
||||
public void setSort5(String sort5) {
|
||||
this.sort5 = sort5;
|
||||
}
|
||||
|
||||
public String getSort6() { return sort6; }
|
||||
|
||||
public void setSort6(String sort6) {
|
||||
this.sort6 = sort6;
|
||||
}
|
||||
|
||||
public String getSort7() { return sort7; }
|
||||
|
||||
public void setSort7(String sort7) {
|
||||
this.sort7 = sort7;
|
||||
}
|
||||
|
||||
public String getSort8() { return sort8; }
|
||||
|
||||
public void setSort8(String sort8) {
|
||||
this.sort8 = sort8;
|
||||
}
|
||||
|
||||
public String getSort9() { return sort9; }
|
||||
|
||||
public void setSort9(String sort9) {
|
||||
this.sort9 = sort9;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.example.amicool;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NoteAdapter extends BaseAdapter {
|
||||
private LayoutInflater layoutInflater;
|
||||
private List<NoteBean> list;//ListView显示的备忘录数据
|
||||
|
||||
public NoteAdapter(Context context, List<NoteBean> list){
|
||||
this.layoutInflater=LayoutInflater.from(context);
|
||||
this.list=list;
|
||||
}
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list==null ? 0 : list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder viewHolder;
|
||||
if (convertView==null){
|
||||
convertView=layoutInflater.inflate(R.layout.note_item_layout,null);
|
||||
viewHolder=new ViewHolder(convertView);
|
||||
convertView.setTag(viewHolder);
|
||||
}else {
|
||||
viewHolder=(ViewHolder) convertView.getTag();
|
||||
}
|
||||
NoteBean noteInfo=(NoteBean) getItem(position);
|
||||
viewHolder.tvNoteoadContent.setText(noteInfo.getNotecontent());
|
||||
viewHolder.tvNotepadTime.setText(noteInfo.getNotepadTime());
|
||||
return convertView;
|
||||
}
|
||||
|
||||
class ViewHolder{
|
||||
TextView tvNoteoadContent;;
|
||||
TextView tvNotepadTime;
|
||||
public ViewHolder(View view){
|
||||
tvNoteoadContent=(TextView) view.findViewById(R.id.item_content);
|
||||
tvNotepadTime=(TextView) view.findViewById(R.id.item_time);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.example.amicool;
|
||||
public class NoteBean {
|
||||
private String id; //记录的id
|
||||
private String notetitle;
|
||||
private String notecontent; //记录的内容
|
||||
private String notepadTime; //保存记录的时间
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getNotetitle() {
|
||||
return notetitle;
|
||||
}
|
||||
public void setNotetitle(String notecontitle) {
|
||||
this.notetitle = notetitle;
|
||||
}
|
||||
public String getNotecontent() {
|
||||
return notecontent;
|
||||
}
|
||||
public void setNotecontent(String notecontent) {
|
||||
this.notecontent = notecontent;
|
||||
}
|
||||
public String getNotepadTime() {
|
||||
return notepadTime;
|
||||
}
|
||||
public void setNotepadTime(String notepadTime) {
|
||||
this.notepadTime = notepadTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.example.amicool;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
class SQLiteHelper extends SQLiteOpenHelper {
|
||||
|
||||
public static final String DATABASE_NAME = "Notepad";//数据库名
|
||||
public static final int DATABASE_VERION = 1; //数据库版本
|
||||
public static final String DATABASE_NOTEPADTB = "Note"; //记事本数据表名
|
||||
|
||||
public static final String NOTEPAD_ID = "id"; //id字段名
|
||||
public static final String NOTEPAD_CONTENT = "content"; //内容字段名
|
||||
public static final String NOTEPAD_NOTETIME = "notetime"; //时间字段名
|
||||
|
||||
//获取当前日期
|
||||
public static final String getTime(){
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
|
||||
Date date = new Date(System.currentTimeMillis());
|
||||
return simpleDateFormat.format(date);
|
||||
}
|
||||
public static final String CREATE_NOTE = "create table " + DATABASE_NOTEPADTB+" ("
|
||||
+ NOTEPAD_ID+" integer primary key autoincrement, "
|
||||
+ NOTEPAD_CONTENT+" text, "
|
||||
+ NOTEPAD_NOTETIME+" text)";
|
||||
|
||||
private SQLiteDatabase sqLiteDatabase;
|
||||
private Context mContext;
|
||||
|
||||
public SQLiteHelper(Context context){
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERION);
|
||||
mContext = context;
|
||||
sqLiteDatabase = this.getWritableDatabase(); //创建数据库
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
db.execSQL(CREATE_NOTE);
|
||||
Toast.makeText(mContext, "Create succeeded", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
|
||||
//添加数据
|
||||
public boolean insertData(String userContent,String userTime){
|
||||
ContentValues contentValues=new ContentValues();
|
||||
contentValues.put(NOTEPAD_CONTENT,userContent);
|
||||
contentValues.put(NOTEPAD_NOTETIME,userTime);
|
||||
return
|
||||
sqLiteDatabase.insert(DATABASE_NOTEPADTB,null,contentValues)>0;
|
||||
}
|
||||
//删除数据
|
||||
public boolean deleteData(String id){
|
||||
String whereClause = NOTEPAD_ID + "=?";
|
||||
String[] whereArgs = new String[]{String.valueOf(id)};
|
||||
return
|
||||
sqLiteDatabase.delete(DATABASE_NOTEPADTB,whereClause,whereArgs)>0;
|
||||
}
|
||||
//修改数据
|
||||
public boolean updateData(String id,String content,String time){
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(NOTEPAD_CONTENT,content);
|
||||
contentValues.put(NOTEPAD_NOTETIME,time);
|
||||
String whereClause = NOTEPAD_ID + "=?";
|
||||
String[] whereArgs = new String[]{String.valueOf(id)};
|
||||
return
|
||||
sqLiteDatabase.update(DATABASE_NOTEPADTB,contentValues,whereClause,whereArgs)>0;
|
||||
}
|
||||
//查询数据
|
||||
public List<NoteBean> query(){
|
||||
List<NoteBean> list = new ArrayList<NoteBean>();
|
||||
Cursor cursor = sqLiteDatabase.query(DATABASE_NOTEPADTB,null,null,null,
|
||||
null,null,NOTEPAD_ID+" desc");//按id降序排序
|
||||
if (cursor.moveToFirst()){
|
||||
do{
|
||||
NoteBean noteInfo=new NoteBean();
|
||||
String id = String.valueOf(cursor.getInt(cursor.getColumnIndex(NOTEPAD_ID)));
|
||||
String content = cursor.getString(cursor.getColumnIndex(NOTEPAD_CONTENT));
|
||||
String time = cursor.getString(cursor.getColumnIndex(NOTEPAD_NOTETIME));
|
||||
noteInfo.setId(id);
|
||||
noteInfo.setNotecontent(content);
|
||||
noteInfo.setNotepadTime(time);
|
||||
list.add(noteInfo);
|
||||
}while(cursor.moveToNext());
|
||||
cursor.close();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 816 B |
After Width: | Height: | Size: 710 B |
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android = "http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:state_pressed = "true"
|
||||
android:drawable = "@drawable/button_pressed" />
|
||||
<item
|
||||
android:state_pressed = "false"
|
||||
android:drawable = "@drawable/button_normal" />
|
||||
</selector>
|
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 430 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 438 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 364 KiB |
After Width: | Height: | Size: 286 KiB |
After Width: | Height: | Size: 527 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 952 B |
Before Width: | Height: | Size: 430 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 883 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 898 KiB |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,83 @@
|
||||
<?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=".AddActivity">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:background="#E9446A">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/note_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingLeft="11dp"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="创建热词"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/issue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="300dp"
|
||||
android:background="#E9446A"
|
||||
android:text="发布"
|
||||
android:textColor="#ffffff">
|
||||
|
||||
</Button>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textColor="#fb7a6a"
|
||||
android:textSize="15sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/note_title"
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#fefefe"
|
||||
android:hint="标题"
|
||||
android:paddingLeft="5dp"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/note_content"
|
||||
android:layout_width="340dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#fefefe"
|
||||
android:hint="热词内容"
|
||||
android:paddingLeft="5dp"
|
||||
android:textColor="@android:color/black" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="#ffffff">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/search_content"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:drawableLeft="@drawable/search"
|
||||
android:hint="搜索...">
|
||||
|
||||
</EditText>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="搜索历史"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/clear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="150dp"
|
||||
android:background="#ffffff"
|
||||
android:text="清空搜索历史"
|
||||
android:textColor="#000000">
|
||||
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/clock" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="999"
|
||||
android:textSize="18dp"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="200dp"
|
||||
android:src="@drawable/exit">
|
||||
</ImageButton>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="冲浪热点"
|
||||
android:textSize="18dp"
|
||||
android:textColor="#000000" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#E5E5E5">
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_weight="2"
|
||||
android:text=" 1"
|
||||
android:textSize="30dp"
|
||||
android:textColor="#FFEB3B" />
|
||||
<Button
|
||||
android:id="@+id/first"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="90dp"
|
||||
android:text="EDG夺冠"
|
||||
android:textColor="#FF5733">
|
||||
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#E5E5E5"
|
||||
android:layout_marginLeft="50dp">
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_weight="2"
|
||||
android:text=" 2"
|
||||
android:textSize="30dp"
|
||||
android:textColor="#FFEB3B" />
|
||||
<Button
|
||||
android:id="@+id/second"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="90dp"
|
||||
android:background="#E5E5E5"
|
||||
android:text="浓硫酸嘴"
|
||||
android:textColor="#FF5733">
|
||||
</Button>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#E5E5E5">
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_weight="2"
|
||||
android:text=" 3"
|
||||
android:textSize="30dp"
|
||||
android:textColor="#FFEB3B" />
|
||||
<Button
|
||||
android:id="@+id/third"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="90dp"
|
||||
android:text="春夏啾冬"
|
||||
android:textColor="#FF5733">
|
||||
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#E5E5E5"
|
||||
android:layout_marginLeft="50dp">
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_weight="2"
|
||||
android:text=" 4"
|
||||
android:textSize="30dp"
|
||||
android:textColor="#FFEB3B" />
|
||||
<Button
|
||||
android:id="@+id/forth"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="90dp"
|
||||
android:background="#E5E5E5"
|
||||
android:text="阿瑟请坐"
|
||||
android:textColor="#FF5733">
|
||||
</Button>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
android:id="@+id/search_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="110dp"
|
||||
android:background="#ffffff"
|
||||
android:text="查看更多"
|
||||
android:textColor="#000000">
|
||||
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -0,0 +1,132 @@
|
||||
<?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"
|
||||
android:layout_margin="5dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:padding="5dp">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="40dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="5dp"
|
||||
android:src="@drawable/fruite"/>
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:id="@+id/title"
|
||||
android:textSize="18dp"
|
||||
android:gravity="center"
|
||||
android:textColor="#000000"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/sort0"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort3"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp">
|
||||
<TextView
|
||||
android:id="@+id/sort4"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort5"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort6"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort7"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp">
|
||||
<TextView
|
||||
android:id="@+id/sort8"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
<TextView
|
||||
android:id="@+id/sort9"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/shape"
|
||||
android:textColor="#000000">
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
@ -0,0 +1,24 @@
|
||||
<?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:theme="@style/Theme.AppCompat.NoActionBar"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="12dp">
|
||||
<TextView
|
||||
android:id="@+id/item_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingExtra="3dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@android:color/black" />
|
||||
<TextView
|
||||
android:id="@+id/item_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#fb7a6a"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="7dp"/>
|
||||
</LinearLayout>
|