xyt 3 years ago
parent e4090c8532
commit 582ff3b2c9

@ -5,7 +5,7 @@ android {
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.amicool"
minSdkVersion 15
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
@ -25,6 +25,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

@ -2,8 +2,8 @@ package com.example.amicool;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;

@ -8,8 +8,9 @@
android:label=""
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
android:theme="@style/AppTheme">
<activity android:name=".AddActivity"></activity>
<activity android:name=".SearchActivity" />
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -17,7 +18,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"></activity>
<activity android:name=".MainActivity" />
</application>
</manifest>

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

@ -1,67 +1,60 @@
package com.example.amicool;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link ClassifyFragment#newInstance} factory method to
* Use the {@link ClassifyFragment} factory method to
* create an instance of this fragment.
*/
public class ClassifyFragment 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 ClassifyFragment() {
// 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 ContactFragment.
*/
// TODO: Rename and change types and number of parameters
public static ClassifyFragment newInstance(String param1, String param2) {
ClassifyFragment fragment = new ClassifyFragment();
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);
}
}
private List<AlbumInfo> mData = new ArrayList<>();
private View view;
public RecyclerView recycleView;
private AlbumAdapter adapter;
public ClassifyFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_classify, container, false);
view = inflater.inflate(R.layout.fragment_classify, container, false);
recycleView = (RecyclerView)view.findViewById(R.id.babyAlbumlist);
EditText Search = (EditText)view.findViewById(R.id.search_content);
Drawable drawable = getResources().getDrawable(R.drawable.search);
drawable .setBounds(0, 0, 70, 70);//第一个 0 是距左边距离,第二个 0 是距上边距离40 分别是长宽
Search.setCompoundDrawables(drawable , null, null, null);//只放左边
getData();
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
recycleView.setLayoutManager(layoutManager);
adapter = new AlbumAdapter(mData);
recycleView.setAdapter(adapter);
return view;
}
private void getData()
{
AlbumInfo albumInfo = new AlbumInfo("知识"," 历史"," 科学"," 军事"," 宗教"," 地理"," 财经"," LGBTQ"," 文学"," 哲学"," 诗歌");
mData.add(albumInfo);
AlbumInfo albumInfo2 = new AlbumInfo("娱乐明星"," 饭圈"," 男团"," 女团"," cp"," 八卦"," 选秀"," 相声"," 小品"," 演员"," 声优");
mData.add(albumInfo2);
AlbumInfo albumInfo3 = new AlbumInfo("生活" ," 校园"," 情感"," 帅哥"," 美女"," 动物"," 美食"," 职场"," 新闻"," 网站"," 文化");
mData.add(albumInfo3);
}
}

@ -1,10 +1,12 @@
package com.example.amicool;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.HorizontalScrollView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
@ -17,6 +19,7 @@ public class HomepageFragment extends Fragment implements ViewPager.OnPageChange
private static final String ARG_CHANNEL_LIST = "channel_list";
private String TAG = "WechatFragment";
private Button search;
//以下声明 fragment_wechat.xml 对应的控件实例
private View view=null; // 碎片的布局实例
@ -52,6 +55,7 @@ public class HomepageFragment extends Fragment implements ViewPager.OnPageChange
}
});
}
setdrop(view);
return view;
}
@ -108,7 +112,18 @@ public class HomepageFragment extends Fragment implements ViewPager.OnPageChange
}
@Override
public void onPageScrollStateChanged(int i) {
}
public void setdrop(View view) {
this.view = view;
search = view.findViewById(R.id.searchfor);
search.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
//getActivity() 用来获取当前Activity
intent.setClass(getActivity(), SearchActivity.class);
startActivity(intent);
}
});
}
}

@ -1,8 +1,10 @@
package com.example.amicool;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
@ -23,13 +25,12 @@ public class MainActivity extends AppCompatActivity {
//四个 Tab 对应的布局去
private LinearLayout mTabHomepage;
private LinearLayout mTabClassify;
private LinearLayout mTabAdd;
private LinearLayout mTabNews;
private LinearLayout mTabSetting;
private Button mImgAdd;
//四个 Tab 对应的 ImageButton
private ImageButton mImgHomepage;
private ImageButton mImgClassify;
private ImageButton mImgAdd;
private ImageButton mImgNews;
private ImageButton mImgSetting;
@ -48,7 +49,6 @@ public class MainActivity extends AppCompatActivity {
//将四个 Fragment 加入集合中
mFragments.add(new HomepageFragment());
mFragments.add(new ClassifyFragment());
mFragments.add(new AddFragment());
mFragments.add(new NewsFragment());
mFragments.add(new SettingFragment());
}
@ -57,14 +57,20 @@ public class MainActivity extends AppCompatActivity {
private void initViews() {
mTabHomepage = (LinearLayout) findViewById(R.id.id_tab_homepage);
mTabClassify = (LinearLayout) findViewById(R.id.id_tab_classify);
mTabAdd = (LinearLayout) findViewById(R.id.id_tab_add);
mTabNews = (LinearLayout) findViewById(R.id.id_tab_news);
mTabSetting = (LinearLayout) findViewById(R.id.id_tab_setting);
mImgHomepage = (ImageButton) findViewById(R.id.id_tab_homepage_img);
mImgClassify = (ImageButton) findViewById(R.id.id_tab_classify_img);
mImgAdd = (ImageButton) findViewById(R.id.id_tab_add_img);
mImgAdd = (Button) findViewById(R.id.id_tab_add_img);
mImgNews = (ImageButton) findViewById(R.id.id_tab_news_img);
mImgSetting = (ImageButton) findViewById(R.id.id_tab_setting_img);
mImgAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this,AddActivity.class);
startActivityForResult(intent, 1);
}
});
}
//初始化事件
@ -72,11 +78,11 @@ public class MainActivity extends AppCompatActivity {
//设置四个 Tab 的点击事件
mTabHomepage.setOnClickListener(onClickListener);
mTabClassify.setOnClickListener(onClickListener);
mTabAdd.setOnClickListener(onClickListener);
mTabNews.setOnClickListener(onClickListener);
mTabSetting.setOnClickListener(onClickListener);
}
View.OnClickListener onClickListener = new View.OnClickListener() {
public void onClick(View v) {
//先将四个 ImageButton 置为灰色
@ -85,9 +91,8 @@ public class MainActivity extends AppCompatActivity {
switch (v.getId()) {
case R.id.id_tab_homepage: selectTab(0); break;
case R.id.id_tab_classify: selectTab(1); break;
case R.id.id_tab_add: selectTab(2); break;
case R.id.id_tab_news: selectTab(3); break;
case R.id.id_tab_setting: selectTab(4); break;
case R.id.id_tab_news: selectTab(2); break;
case R.id.id_tab_setting: selectTab(3); break;
}
}};
@ -95,7 +100,6 @@ public class MainActivity extends AppCompatActivity {
private void resetImgs() {
mImgHomepage.setImageResource(R.drawable.tab_homepage_normal);
mImgClassify.setImageResource(R.drawable.tab_classify_normal);
mImgAdd.setImageResource(R.drawable.tab_add);
mImgNews.setImageResource(R.drawable.tab_news_normal);
mImgSetting.setImageResource(R.drawable.tab_setting_normal);
}
@ -105,9 +109,8 @@ public class MainActivity extends AppCompatActivity {
switch (i) {
case 0: mImgHomepage.setImageResource(R.drawable.tab_homepage_pressed);break;
case 1: mImgClassify.setImageResource(R.drawable.tab_classify_pressed);break;
case 2: mImgAdd.setImageResource(R.drawable.tab_add);break;
case 3: mImgNews.setImageResource(R.drawable.tab_news_pressed);break;
case 4: mImgSetting.setImageResource(R.drawable.tab_setting_pressed);break;
case 2: mImgNews.setImageResource(R.drawable.tab_news_pressed);break;
case 3: mImgSetting.setImageResource(R.drawable.tab_setting_pressed);break;
}
//设置当前点击的 Tab 所对应的页面

@ -1,5 +1,7 @@
package com.example.amicool;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

@ -1,8 +1,8 @@
package com.example.amicool;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
public class NewsPageFragmentAdapter extends FragmentPagerAdapter {
private String[] channelList; private FragmentManager fm;

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

@ -0,0 +1,36 @@
package com.example.amicool;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
public class SearchActivity extends AppCompatActivity {
private EditText search_content;
private Button clear;
private Button exit;
private Button first,second,third,forth;
private Button searrch_more;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
search_content=(EditText) findViewById(R.id.search_content);
clear = (Button)findViewById(R.id.clear);
exit = (Button) findViewById(R.id.edit);
first = (Button) findViewById(R.id.first);
second = (Button) findViewById(R.id.second);
third = (Button) findViewById(R.id.third);
forth = (Button) findViewById(R.id.forth);
searrch_more = (Button) findViewById(R.id.search_more);
EditText ImageView = (EditText) findViewById(R.id.search_content);
Drawable drawable = getResources().getDrawable(R.drawable.search);
drawable .setBounds(0, 0, 70, 70);//第一个 0 是距左边距离,第二个 0 是距上边距离40 分别是长宽
ImageView.setCompoundDrawables(drawable , null, null, null);//只放左边
}
}

@ -1,9 +1,12 @@
package com.example.amicool;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import androidx.fragment.app.Fragment;
@ -18,12 +21,9 @@ import androidx.fragment.app.Fragment;
public class SettingFragment 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 Button share,edit,con,more;
public SettingFragment() {
@ -42,8 +42,6 @@ public class SettingFragment extends Fragment {
public static SettingFragment newInstance(String param1, String param2) {
SettingFragment fragment = new SettingFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@ -51,16 +49,21 @@ public class SettingFragment extends 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_setting, container, false);
View view=inflater.inflate(R.layout.fragment_setting,container,false);
edit = view.findViewById(R.id.edit);
con = view.findViewById(R.id.con);
more = view.findViewById(R.id.more);
share = view.findViewById(R.id.share);
EditText ImageView =view.findViewById(R.id.search);
Drawable drawable = getResources().getDrawable(R.drawable.search);
drawable .setBounds(0, 0, 70, 70);//第一个 0 是距左边距离,第二个 0 是距上边距离40 分别是长宽
ImageView.setCompoundDrawables(drawable , null, null, null);//只放左边
return view;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<stroke
android:width="1dp"
android:color="#DEA681" />
</shape>
</item>
<item
android:bottom="2dp"
android:top="0dp"
android:left="0dp"
android:right="0dp"
>
<!-- 在实际使用中我发现1dp达不到显示效果而2dp正好可以显示边框 -->
<shape android:shape="rectangle" >
<solid android:color="#ffffff" />
</shape>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<!-- 填充的颜色 -->
<solid android:color="#D86C6B" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="25dip" />
<!-- paddingButton里面的文字与Button边界的间隔 -->
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp"
/>
<!-- corners Button四周为圆角不需要的可以删除此项 -->
<corners android:radius="100dp">
</corners>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 KiB

Binary file not shown.

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>

@ -59,13 +59,12 @@
android:gravity="center"
android:orientation="vertical">
<ImageButton
<Button
android:id="@+id/id_tab_add_img"
android:clickable="false"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/tab_add"
android:background="#00000000"/>
android:background="@drawable/tab_add" />
<TextView
android:layout_width="wrap_content"

@ -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>

@ -5,10 +5,65 @@
android:layout_height="match_parent"
tools:context=".AddFragment">
<!-- TODO: Update blank fragment layout -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#fb7a6a">
<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="#fb7a6a"
android:textColor="#ffffff"
android:text="发布">
</Button>
</RelativeLayout>
<TextView
android:id="@+id/tv_time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
android:layout_height="wrap_content"
android:textSize="15sp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:gravity="center"
android:visibility="gone"
android:textColor="#fb7a6a"/>
<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>
</FrameLayout>

@ -8,6 +8,21 @@
tools:context=".ClassifyFragment">
<!-- TODO: Update blank fragment layout -->
<EditText
android:id="@+id/search_content"
android:layout_width="300dp"
android:layout_height="80dp"
android:layout_marginTop="30dp"
android:layout_marginLeft="30dp"
android:drawableLeft="@drawable/search"
android:hint="搜索...">
</EditText>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/babyAlbumlist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"/>

@ -15,7 +15,6 @@
android:id="@+id/hvChannel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/ivShowChannel"
android:scrollbars="none">
<RadioGroup
@ -28,12 +27,12 @@
</HorizontalScrollView>
<!-- 任意数量不能显示时的缩略符号 -->
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/ivShowChannel"
<Button
android:layout_width="35dp"
android:layout_height="30dp"
android:id="@+id/searchfor"
android:layout_alignParentRight="true"
android:src="@mipmap/channel_down_narrow"
android:background="@drawable/search"
android:scaleType="fitXY" />
</RelativeLayout>
@ -43,4 +42,42 @@
android:layout_height="0dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="70dp"
android:layout_marginLeft="40dp">
<ImageView
android:layout_width="270dp"
android:layout_height="180dp"
android:layout_marginLeft="20dp"
android:src="@drawable/p1">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/touxiang7">
</ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:layout_weight="1"
android:text="2021.11.7"
android:textSize="13dp"
android:textColor="#595959" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>

@ -3,12 +3,320 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="35dp"
android:layout_marginTop="20dp"
android:background="#ffffff"
tools:context=".NewsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageButton
android:id="@+id/id_add__return_img"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:background="#ffffff"
android:layout_weight="1"
android:clickable="false"
android:scaleType="fitCenter"
android:src="@drawable/search" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="可能认识"
android:textColor="#000000"
android:textSize="20dp"/>
<Button
android:id="@+id/more1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="150dp"
android:background="#ffffff"
android:text="查看更多"
android:textColor="#595959">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="75dp"
android:layout_height="75dp"
android:src="@drawable/touxiang1">
</ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="丁浩夏"
android:textColor="#000000"
android:textSize="15dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="四川 成都"
android:textColor="#595959"
android:textSize="10dp"/>
<Button
android:id="@+id/button1"
android:layout_width="40dp"
android:layout_height="20dp"
android:background="@drawable/button_selector"
android:textColor="#595959">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<ImageView
android:layout_width="75dp"
android:layout_height="75dp"
android:src="@drawable/touxiang2">
</ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="李可"
android:layout_gravity="center"
android:textColor="#000000"
android:textSize="15dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="河北 石家庄"
android:textColor="#595959"
android:textSize="10dp"/>
<Button
android:id="@+id/button2"
android:layout_width="40dp"
android:layout_height="20dp"
android:background="@drawable/button_selector"
android:textColor="#595959">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<ImageView
android:layout_width="75dp"
android:layout_height="75dp"
android:src="@drawable/touxiang3">
</ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="王玉云"
android:layout_gravity="center"
android:textColor="#000000"
android:textSize="15dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="四川 成都"
android:textColor="#595959"
android:textSize="10dp"/>
<Button
android:id="@+id/button3"
android:layout_width="40dp"
android:layout_height="20dp"
android:background="@drawable/button_selector"
android:textColor="#595959">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<ImageView
android:layout_width="75dp"
android:layout_height="75dp"
android:src="@drawable/touxiang4">
</ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="董文"
android:layout_gravity="center"
android:textColor="#000000"
android:textSize="15dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="四川 成都"
android:textColor="#595959"
android:textSize="10dp"/>
<Button
android:id="@+id/button4"
android:layout_width="40dp"
android:layout_height="20dp"
android:background="@drawable/button_selector"
android:textColor="#595959">
</Button>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="340dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical">
<TextView
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="好友消息"
android:textColor="#000000"
android:textSize="20dp" />
<LinearLayout
android:layout_width="340dp"
android:layout_height="70dp"
android:layout_marginTop="20dp"
android:background="@drawable/layer_list">
<ImageView
android:layout_marginTop="10dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/touxiang5">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="崔文怡"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="你快去吧,我在小区门口等你"
android:textColor="#595959"
android:textSize="13dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="340dp"
android:layout_height="70dp"
android:background="@drawable/layer_list">
<ImageView
android:layout_marginTop="10dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/touxiang6">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="李瑶"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="那你稍等一会儿,我马上下来"
android:textColor="#595959"
android:textSize="13dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="340dp"
android:layout_height="70dp"
android:background="@drawable/layer_list">
<ImageView
android:layout_marginTop="10dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/touxiang7">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="小华"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:text="你等我几分钟吧"
android:textColor="#595959"
android:textSize="13dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>

@ -7,11 +7,25 @@
tools:context=".SettingFragment">
<!-- TODO: Update blank fragment layout -->
<LinearLayout
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginLeft="350dp">
<ImageButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:src="@drawable/setting"
android:scaleType="fitCenter">
</ImageButton>
</LinearLayout>
<LinearLayout
android:layout_width="100dp"
android:layout_height="200dp"
android:layout_marginLeft="140dp"
android:layout_marginTop="100dp"
android:layout_marginLeft="150dp"
android:layout_marginTop="80dp"
android:orientation="vertical">
@ -46,13 +60,16 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:src="@drawable/content">
</ImageView>
<Button
android:layout_width="wrap_content"
android:id="@+id/edit"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#ffffff"
android:text="内容编辑规范"
android:textColor="#595959">
android:textColor="#000000">
</Button>
</LinearLayout>
<LinearLayout
@ -61,15 +78,97 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:src="@drawable/edit">
</ImageView>
<Button
android:layout_width="wrap_content"
android:id="@+id/con"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#ffffff"
android:text="编辑器使用指南"
android:textColor="#595959">
android:textColor="#000000">
</Button>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="400dp"
android:layout_marginLeft="70dp">
<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"
android:textSize="20dp"/>
<Button
android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:background="#ffffff"
android:text="查看更多"
android:textColor="#000000">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginTop="10dp">
<EditText
android:id="@+id/search"
android:drawableLeft="@drawable/search"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="搜索内容">
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/tupian">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="vertical">
<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="EDG yyds!"
android:textColor="#000000"
android:textSize="20dp"/>
<Button
android:id="@+id/share"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="140dp"
android:background="@drawable/share"
android:textColor="#000000">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>

@ -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>
Loading…
Cancel
Save