home and chat personal_activity update frame

ongbodev
ongbo 6 years ago
parent fbd9a5f41c
commit 5b89bc21a5

@ -79,7 +79,15 @@ dependencies {
implementation 'jp.wasabeef:glide-transformations:4.1.0'
compileOnly "jp.co.cyberagent.android:gpuimage:2.0.3"
//
//
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
// implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.Q42:AndroidScrollingImageView:1.3.3'
implementation 'jp.wasabeef:recyclerview-animators:3.0.0'
implementation 'com.jcodecraeer:xrecyclerview:1.6.0'
implementation 'com.loopeer.library:cardstack:1.0.2'
implementation 'com.ramotion.foldingcell:folding-cell:1.2.3'
}

@ -98,9 +98,13 @@ public class ChatContent extends Fragment{
public Fragment getItem(int position) {
switch (position % 3){
case 0:
return RecyclerViewFragment.newInstance();
return RecyclerViewFragment.newInstance(0,appCompatActivity);
case 1:
return RecyclerViewFragment.newInstance(1,appCompatActivity);
case 2:
return DrugFriendsFragment.newInstance(appCompatActivity);
default:
return RecyclerViewFragment.newInstance();
return RecyclerViewFragment.newInstance(1,appCompatActivity);
}
}

@ -0,0 +1,166 @@
package com.example.ChatContentPkg;
import android.content.Context;
import android.graphics.PorterDuff;
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.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.cmknowledgegraph.R;
import com.loopeer.cardstack.CardStackView;
import com.loopeer.cardstack.StackAdapter;
public class DrugFriendsCardAdapter extends StackAdapter<Integer> {
AppCompatActivity appCompatActivity;
public void setAppCompatActivity(AppCompatActivity appCompatActivity) {
this.appCompatActivity = appCompatActivity;
}
public DrugFriendsCardAdapter(Context context) {
super(context);
}
@Override
public void bindView(Integer data, int position, CardStackView.ViewHolder holder) {
if (holder instanceof ColorItemLargeHeaderViewHolder) {
ColorItemLargeHeaderViewHolder h = (ColorItemLargeHeaderViewHolder) holder;
h.onBind(data, position);
}
if (holder instanceof ColorItemWithNoHeaderViewHolder) {
ColorItemWithNoHeaderViewHolder h = (ColorItemWithNoHeaderViewHolder) holder;
h.onBind(data, position);
}
if (holder instanceof ColorItemViewHolder) {
ColorItemViewHolder h = (ColorItemViewHolder) holder;
h.onBind(data, position);
}
}
@Override
protected CardStackView.ViewHolder onCreateView(ViewGroup parent, int viewType) {
View view;
switch (viewType) {
case R.layout.list_card_item_larger_header:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_card_item_larger_header, parent, false);
// view = getLayoutInflater().inflate(R.layout.list_card_item_larger_header, parent, false);
return new ColorItemLargeHeaderViewHolder(view);
case R.layout.list_card_item_with_no_header:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_card_item_with_no_header, parent, false);
// view = getLayoutInflater().inflate(R.layout.list_card_item_with_no_header, parent, false);
return new ColorItemWithNoHeaderViewHolder(view);
default:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_card_item, parent, false);
// view = getLayoutInflater().inflate(R.layout.list_card_item, parent, false);
return new ColorItemViewHolder(view);
}
}
@Override
public int getItemViewType(int position) {
// if (position == 6) {//TODO TEST LARGER ITEM
// return R.layout.list_card_item_larger_header;
// } else if (position == 10) {
// return R.layout.list_card_item_with_no_header;
// }else {
return R.layout.list_card_item;
// }
}
//三种ViewHolder
public class ColorItemViewHolder extends CardStackView.ViewHolder {
View mLayout;
View mContainerContent;
TextView mTextTitle;
public ColorItemViewHolder(View view) {
super(view);
mLayout = view.findViewById(R.id.frame_list_card_item);
mContainerContent = view.findViewById(R.id.container_list_content);
mTextTitle = (TextView) view.findViewById(R.id.text_list_card_title);
}
@Override
public void onItemExpand(boolean b) {
mContainerContent.setVisibility(b ? View.VISIBLE : View.GONE);
}
public void onBind(Integer data, int position) {
mLayout.getBackground().setColorFilter(ContextCompat.getColor(appCompatActivity, data), PorterDuff.Mode.SRC_IN);
mTextTitle.setText("这是分组");
}
}
public class ColorItemWithNoHeaderViewHolder extends CardStackView.ViewHolder {
View mLayout;
TextView mTextTitle;
public ColorItemWithNoHeaderViewHolder(View view) {
super(view);
mLayout = view.findViewById(R.id.frame_list_card_item);
mTextTitle = (TextView) view.findViewById(R.id.text_list_card_title);
}
@Override
public void onItemExpand(boolean b) {
}
public void onBind(Integer data, int position) {
mLayout.getBackground().setColorFilter(ContextCompat.getColor(getContext(), data), PorterDuff.Mode.SRC_IN);
mTextTitle.setText(String.valueOf(position));
}
}
public class ColorItemLargeHeaderViewHolder extends CardStackView.ViewHolder {
View mLayout;
View mContainerContent;
TextView mTextTitle;
public ColorItemLargeHeaderViewHolder(View view) {
super(view);
mLayout = view.findViewById(R.id.frame_list_card_item);
mContainerContent = view.findViewById(R.id.container_list_content);
mTextTitle = (TextView) view.findViewById(R.id.text_list_card_title);
}
@Override
public void onItemExpand(boolean b) {
mContainerContent.setVisibility(b ? View.VISIBLE : View.GONE);
}
@Override
protected void onAnimationStateChange(int state, boolean willBeSelect) {
super.onAnimationStateChange(state, willBeSelect);
if (state == CardStackView.ANIMATION_STATE_START && willBeSelect) {
onItemExpand(true);
}
if (state == CardStackView.ANIMATION_STATE_END && !willBeSelect) {
onItemExpand(false);
}
}
public void onBind(Integer data, int position) {
mLayout.getBackground().setColorFilter(ContextCompat.getColor(getContext(), data), PorterDuff.Mode.SRC_IN);
mTextTitle.setText(String.valueOf(position));
itemView.findViewById(R.id.text_view).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((CardStackView) itemView.getParent()).performItemClick(ColorItemLargeHeaderViewHolder.this);
}
});
}
}
}

@ -0,0 +1,137 @@
package com.example.ChatContentPkg;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.cmknowledgegraph.R;
import com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator;
import com.loopeer.cardstack.AllMoveDownAnimatorAdapter;
import com.loopeer.cardstack.CardStackView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DrugFriendsFragment extends Fragment implements CardStackView.ItemExpendListener {
public void setAppCompatActivity(AppCompatActivity appCompatActivity) {
this.appCompatActivity = appCompatActivity;
}
AppCompatActivity appCompatActivity;
RecyclerView mRecyclerView;
public static Fragment newInstance(AppCompatActivity appCompatActivity){
DrugFriendsFragment drugFriendsFragment = new DrugFriendsFragment();
drugFriendsFragment.setAppCompatActivity(appCompatActivity);
return drugFriendsFragment;
}
private CardStackView cardStackView;
private RecyclerView recyclerView;
private DrugFriendsCardAdapter drugFriendsCardAdapter;
//
private static Integer[] item = new Integer[]{R.color.color_1,
R.color.color_2,
R.color.color_3,
R.color.color_4,
R.color.color_5,
R.color.color_6,
R.color.color_7,
R.color.color_8,
R.color.color_9,
R.color.color_10,
R.color.color_11,
R.color.color_12,
R.color.color_13,
R.color.color_14,
R.color.color_15,
R.color.color_16,
R.color.color_17,
R.color.color_18,
R.color.color_19,
R.color.color_20,
R.color.color_21,
R.color.color_22,
R.color.color_23,
R.color.color_24,
R.color.color_25,
R.color.color_26};
public int ITEMS = 1;
public List<Object> items = new ArrayList<Object>();
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// View view = inflater.inflate(R.layout.drug_friends,container,false);
View view = inflater.inflate(R.layout.fragment_recyclerview,container,false);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mRecyclerView=view.findViewById(R.id.recyclerView);
// mCardView = view.findViewById();
//需要根据网路请求发送数据来请求一个页可以有多少文章条目而且针对每一个tab都要有不同的显示方式
for (int i=0;i<ITEMS;i++){
items.add(new Object());
}
//设置布局
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
linearLayoutManager.canScrollVertically();
mRecyclerView.setLayoutManager(linearLayoutManager);
mRecyclerView.setHasFixedSize(true);
//设置分割线
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
//设置适配器
RecyclerViewPagerAdapter recyclerViewPagerAdapter = new RecyclerViewPagerAdapter(items,2);
recyclerViewPagerAdapter.setAppCompatActivity(appCompatActivity);
mRecyclerView.setAdapter(recyclerViewPagerAdapter);
// initWight(view);
}
// private void initWight(View view) {
//
//// LinearLayoutManager linearLayoutManager = new LinearLayoutManager(appCompatActivity);
//// linearLayoutManager.canScrollVertically();
//// recyclerView.setLayoutManager(linearLayoutManager);
//
// cardStackView = (CardStackView) view.findViewById(R.id.stackview);
//
// drugFriendsCardAdapter = new DrugFriendsCardAdapter(appCompatActivity);
// drugFriendsCardAdapter.setAppCompatActivity(appCompatActivity);
//
// cardStackView.setAdapter(drugFriendsCardAdapter);
// cardStackView.setItemExpendListener(this);
//// cardStackView.setAnimatorAdapter(new AllMoveDownAnimatorAdapter(cardStackView));
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// drugFriendsCardAdapter.updateData(Arrays.asList(item));
// }
// },200);
// }
@Override
public void onItemExpend(boolean expend) {
}
}

@ -6,6 +6,7 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
@ -18,9 +19,25 @@ import java.util.ArrayList;
import java.util.List;
public class RecyclerViewFragment extends Fragment {
public static Fragment newInstance(){return new RecyclerViewFragment();}
int flag;
AppCompatActivity appCompatActivity;
public void setAppCompatActivity(AppCompatActivity appCompatActivity) {
this.appCompatActivity = appCompatActivity;
}
public void setFlag(int flag) {
this.flag = flag;
}
public static Fragment newInstance(int flag,AppCompatActivity appCompatActivity){
RecyclerViewFragment recyclerViewFragment = new RecyclerViewFragment();
recyclerViewFragment.setFlag(flag);
recyclerViewFragment.setAppCompatActivity(appCompatActivity);
return recyclerViewFragment;
}
final List<Object> items = new ArrayList<>();
static final int ITEMS = 3;
static final int ITEMS = 7;
RecyclerView mRecyclerView;
CardView mCardView;
@ -47,7 +64,12 @@ public class RecyclerViewFragment extends Fragment {
//设置分割线
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
//设置适配器
mRecyclerView.setAdapter(new RecyclerViewPagerAdapter(items));
RecyclerViewPagerAdapter recyclerViewPagerAdapter = new RecyclerViewPagerAdapter(items,flag);
recyclerViewPagerAdapter.setAppCompatActivity(appCompatActivity);
mRecyclerView.setAdapter(recyclerViewPagerAdapter);
}
public void initdata(){

@ -1,19 +1,33 @@
package com.example.ChatContentPkg;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.example.cmknowledgegraph.R;
import com.loopeer.cardstack.CardStackView;
import com.ramotion.foldingcell.FoldingCell;
import java.util.Arrays;
import java.util.List;
public class RecyclerViewPagerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
List<Object> contents;
public RecyclerViewPagerAdapter(List<Object> contents)
int flag;
AppCompatActivity appCompatActivity;
public void setAppCompatActivity(AppCompatActivity appCompatActivity) {
this.appCompatActivity = appCompatActivity;
}
public RecyclerViewPagerAdapter(List<Object> contents, int flag)
{
this.flag = flag;
this.contents = contents;
}
public int getItemCount() {
@ -22,12 +36,89 @@ public class RecyclerViewPagerAdapter extends RecyclerView.Adapter<RecyclerView.
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = null;
view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.content_cardview, parent, false);
switch (flag){
case 0://论坛
view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.internetforumfragment, parent, false);
//
// view = LayoutInflater.from(parent.getContext()).inflate(R.layout.drug_friends,parent,false);
FoldingCell foldingCell = view.findViewById(R.id.folding_cell);
foldingCell.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
foldingCell.toggle(false);
}
});
return new RecyclerView.ViewHolder(view) {
};
case 1://动态
view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.content_cardview, parent, false);
return new RecyclerView.ViewHolder(view) {
};
case 2://好友列表
view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.drug_friends,parent,false);
CardStackView cardStackView = view.findViewById(R.id.stackview);
Integer[] item = new Integer[]{R.color.color_1,
R.color.color_2,
R.color.color_3,
R.color.color_4,
R.color.color_5,
R.color.color_6,
R.color.color_7,
R.color.color_8,
R.color.color_9,
R.color.color_10,
R.color.color_11,
R.color.color_12,
R.color.color_13,
R.color.color_14,
R.color.color_15,
R.color.color_16,
R.color.color_17,
R.color.color_18,
R.color.color_19,
R.color.color_20,
R.color.color_21,
R.color.color_22,
R.color.color_23,
R.color.color_24,
R.color.color_25,
R.color.color_26};
DrugFriendsCardAdapter drugFriendsCardAdapter = new DrugFriendsCardAdapter(parent.getContext());
drugFriendsCardAdapter.setAppCompatActivity(appCompatActivity);
cardStackView.setAdapter(drugFriendsCardAdapter);
cardStackView.setItemExpendListener(new CardStackView.ItemExpendListener() {
@Override
public void onItemExpend(boolean expend) {
}
});
// cardStackView.setAnimatorAdapter(new AllMoveDownAnimatorAdapter(cardStackView));
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
drugFriendsCardAdapter.updateData(Arrays.asList(item));
}
},200);
return new RecyclerView.ViewHolder(view) {
@Override
public String toString() {
return super.toString();
}
};
}
return null;
return new RecyclerView.ViewHolder(view) {
};
}
@Override

@ -0,0 +1,31 @@
package com.example.ChatContentPkg;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.example.cmknowledgegraph.R;
import com.ramotion.foldingcell.FoldingCell;
public class internetforum_fragment extends Fragment {
public static Fragment newInstance(){return new internetforum_fragment();}
FoldingCell foldingCell;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.internetforumfragment, container, false);
foldingCell = view.findViewById(R.id.folding_cell);
foldingCell.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
foldingCell.toggle(false);
}
});
return view;
}
}

@ -1,11 +1,13 @@
package com.example.HomeContent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -13,6 +15,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.dingmouren.layoutmanagergroup.slide.ItemConfig;
@ -20,7 +23,14 @@ import com.dingmouren.layoutmanagergroup.slide.ItemTouchHelperCallback;
import com.dingmouren.layoutmanagergroup.slide.OnSlideListener;
import com.dingmouren.layoutmanagergroup.slide.SlideLayoutManager;
import com.example.cmknowledgegraph.R;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.q42.android.scrollingimageview.ScrollingImageView;
import org.w3c.dom.Text;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
//这个是home的Fragment
@ -32,9 +42,13 @@ public class SlideFragment extends Fragment {
private ItemTouchHelper mItemTouchHelper;
private ItemTouchHelperCallback mItemTouchHelperCallback;
private MyAdapter mAdapter;
private MyAdapterItem myAdapterItem;
private List<SlideBean> mList = new ArrayList<>();
private int mLikeCount = 50;
private int mDislikeCount = 50;
private XRecyclerView xRecyclerView_home;
private ArrayList<TweetsBean> listData;
private int refreshtime = 0;
AppCompatActivity appCompatActivity;//保存最初的主Activity
public AppCompatActivity getAppCompatActivity(){
@ -63,24 +77,78 @@ public class SlideFragment extends Fragment {
}
private void initView(View rootView) {
mRecyclerView = rootView.findViewById(R.id.recycler_view);//加载RecyclerView
mSmileView = rootView.findViewById(R.id.smile_view);//加载表情图片
mSmileView.setLike(mLikeCount);//设置表情喜欢
mSmileView.setDisLike(mDislikeCount);//设置表情不喜欢
mAdapter = new MyAdapter();//增添适配器
mRecyclerView.setAdapter(mAdapter);//设置适配器
addData();//添加数据,向集合中添加数据,也就是说,要从服务器抽取推文数据加载过来
listData = new ArrayList<TweetsBean>();
//最上面的滚动动画
//初始化header
ScrollingImageView scrollingImageView = (ScrollingImageView) rootView.findViewById(R.id.scrolling_background);
scrollingImageView.start();
//表情那一块最热门推送top6
xRecyclerView_home = (XRecyclerView) rootView.findViewById(R.id.home_XRecyclerView);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(appCompatActivity);
//设置垂直布局
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
//给mRecyclerView设置布局
xRecyclerView_home.setLayoutManager(linearLayoutManager);
xRecyclerView_home.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
xRecyclerView_home.setLoadingMoreProgressStyle(ProgressStyle.Pacman);
xRecyclerView_home.setArrowImageView(R.drawable._planet);
//建立header的view
View header = (RelativeLayout)LayoutInflater.from(appCompatActivity).inflate(R.layout.recycleview_header_home,appCompatActivity.findViewById(android.R.id.content),false);
mRecyclerView = header.findViewById(R.id.recycler_view);
mSmileView = header.findViewById(R.id.smile_view);
mSmileView.setLike(mLikeCount);
mSmileView.setDisLike(mDislikeCount);
mAdapter = new MyAdapter();
mRecyclerView.setAdapter(mAdapter);
addData(2);
mItemTouchHelperCallback = new ItemTouchHelperCallback(mRecyclerView.getAdapter(), mList);
mItemTouchHelper = new ItemTouchHelper(mItemTouchHelperCallback);
mSlideLayoutManager = new SlideLayoutManager(mRecyclerView, mItemTouchHelper);
mItemTouchHelper.attachToRecyclerView(mRecyclerView);
mRecyclerView.setLayoutManager(mSlideLayoutManager);
//为外层RecycleView增加嵌套RecycleView,嵌套在header
xRecyclerView_home.addHeaderView(header);
myAdapterItem = new MyAdapterItem(listData);
// for(int i=0;i<15;i++) {
// listData.add("item"+i);
// }
xRecyclerView_home.setAdapter(myAdapterItem);
xRecyclerView_home.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
refreshtime++;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
listData.clear();
addData(0);
myAdapterItem.notifyDataSetChanged();
xRecyclerView_home.refreshComplete();
}
},3000
);
}
@Override
public void onLoadMore() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
addData(0);
myAdapterItem.notifyDataSetChanged();
xRecyclerView_home.loadMoreComplete();
}
},3000);
}
});
}
private void initListener() {
@ -114,7 +182,7 @@ public class SlideFragment extends Fragment {
public void onClear() {
// 一旦几个页面的数据加载完了,就在这里重新加载数据
addData();
addData(1);
}
});
}
@ -122,8 +190,9 @@ public class SlideFragment extends Fragment {
/**
*
*
* 0item 1header 2
*/
private void addData(){
private void addData(int flag){
int[] icons = {R.mipmap.header_icon_1, R.mipmap.header_icon_2, R.mipmap.header_icon_3,
R.mipmap.header_icon_4, R.mipmap.header_icon_1, R.mipmap.header_icon_2};
String[] titles = {"Acknowledging", "Belief", "Confidence", "Dreaming", "Happiness", "Confidence"};
@ -144,16 +213,63 @@ public class SlideFragment extends Fragment {
R.mipmap.img_slide_5,
R.mipmap.img_slide_6
};
if(flag==1||flag==2)
for (int i = 0; i < 6; i++) {
mList.add(new SlideBean(bgs[i],titles[i],icons[i],says[i]));
}
if(flag==0||flag==2)
for(int i=0;i<10;i++){
listData.add(new TweetsBean(bgs[i%6],titles[i%6],icons[i%6],says[i%6]));
}
}
/**
*
*/
class MyAdapterItem extends RecyclerView.Adapter<MyAdapterItem.ViewHolder>{
public ArrayList<TweetsBean> datas = null;
public MyAdapterItem(ArrayList<TweetsBean> datas){
this.datas = datas;
}
@NonNull
@Override
public MyAdapterItem.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(appCompatActivity).inflate(R.layout.item_haha,parent,false);
ViewHolder vh = new ViewHolder(view);
return vh;
}
@Override
public void onBindViewHolder(@NonNull MyAdapterItem.ViewHolder holder, int position) {
Log.i("hah","j"+holder.mTextView);
TweetsBean tweetsBean = datas.get(position);
holder.mTextView.setText(tweetsBean.getUserSay());
holder.tvTitle.setText(tweetsBean.getTitle());
holder.imgBg.setImageResource(tweetsBean.getItemBg());
holder.userIcon.setImageResource(tweetsBean.getUserIcon());
}
@Override
public int getItemCount() {
return datas.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
public TextView mTextView;//文字部分
ImageView imgBg;//背景图片
ImageView userIcon;//读者头像
TextView tvTitle;//推文标题
public ViewHolder(View view){
super(view);
mTextView = (TextView) view.findViewById(R.id.text_item_view);
imgBg = (ImageView) view.findViewById(R.id.img_bg);
userIcon = (ImageView) view.findViewById(R.id.img_user);
tvTitle = (TextView) view.findViewById(R.id.text_item_view);
}
}
}
class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
@Override

@ -0,0 +1,45 @@
package com.example.HomeContent;
public class TweetsBean {
private int mItemBg;
private String mTitle;
private int mUserIcon;
private String mUserSay;
public TweetsBean(int mItemBg, String mTitle, int mUserIcon, String mUserSay){
this.mItemBg = mItemBg;//截取图片
this.mTitle = mTitle;//标题
this.mUserIcon = mUserIcon;
this.mUserSay = mUserSay;//摘要
}
public int getItemBg() {
return mItemBg;
}
public void setItemBg(int mItemBg) {
this.mItemBg = mItemBg;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String mTitle) {
this.mTitle = mTitle;
}
public int getUserIcon() {
return mUserIcon;
}
public void setUserIcon(int mUserIcon) {
this.mUserIcon = mUserIcon;
}
public String getUserSay() {
return mUserSay;
}
public void setUserSay(String mUserSay) {
this.mUserSay = mUserSay;
}
}

@ -15,6 +15,7 @@ import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
@ -32,6 +33,7 @@ public class MenuListFragment extends Fragment {
private ImageView ivMenuUserProfilePhoto;
public AppCompatActivity appCompatActivity;
public TextView textView;
public void setAppCompatActivity(AppCompatActivity appCompatActivity) {
this.appCompatActivity = appCompatActivity;
@ -51,8 +53,6 @@ public class MenuListFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_menu, container,false);
Log.i("view==","=="+view.toString()+"==");
//获取基本的菜单xml
NavigationView linearLayout = (NavigationView) view.findViewById(R.id.vNavigation);
View headview = linearLayout.getHeaderView(0);
@ -63,7 +63,8 @@ public class MenuListFragment extends Fragment {
//获取用户的头像
ivMenuUserProfilePhoto = (ImageView) headview.findViewById(R.id.ivMenuUserProfilePhoto);
Log.i("ismenu---===","====)"+ivMenuUserProfilePhoto.toString());
//获取xml中的用户名id
textView = (TextView) headview.findViewById(R.id.user_name_menu);
NavigationView vNavigation = (NavigationView) view.findViewById(R.id.vNavigation);
//设置某个菜单呗选中
vNavigation.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@ -83,11 +84,17 @@ public class MenuListFragment extends Fragment {
*
* */
Picasso.with(getAppCompatActivity())
.load(R.drawable.draw1)
.load(R.drawable.tiantiansifangmao_09)
// .placeholder(R.drawable.img_circle_placeholder)
.into(ivMenuUserProfilePhoto);
avatarOnclickListener headerListener = new avatarOnclickListener(getAppCompatActivity(),this);
ivMenuUserProfilePhoto.setOnClickListener(headerListener);
//设置用户名
if(User.isLogin()){
textView.setText(User.getUser().getUsername());
}
}

@ -7,9 +7,13 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
@ -35,18 +39,8 @@ import com.example.cmknowledgegraph.R;
import com.hanks.htextview.rainbow.RainbowTextView;
import com.mxn.soul.flowingdrawer_core.ElasticDrawer;
import com.mxn.soul.flowingdrawer_core.FlowingDrawer;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Request;
import com.skyfishjy.library.RippleBackground;
import org.w3c.dom.Text;
import java.util.ArrayList;
import devlight.io.library.ntb.NavigationTabBar;
import jp.wasabeef.glide.transformations.BlurTransformation;
import yalantis.com.sidemenu.interfaces.Resourceble;
import yalantis.com.sidemenu.interfaces.ScreenShotable;
import yalantis.com.sidemenu.util.ViewAnimator;
public class PersonContent extends Fragment {
@ -73,7 +67,7 @@ public class PersonContent extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate( R.layout.activity_personality_center, container, false ); //要加载的layout文件
@ -82,33 +76,35 @@ public class PersonContent extends Fragment {
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// rvFeed = (RecyclerView) appCompatActivity.findViewById(R.id.rvFeed);
// 原来的viewpager
// viewPager = (ViewPager) appCompatActivity.findViewById(R.id.vp_vertical_ntb);
mDrawer = (FlowingDrawer) appCompatActivity.findViewById(R.id.drawerlayout);
mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL);
//设置工具栏
// setupToolbar();
setuptoolbar();
//设置直接页面
// setupFeed();
// setupViewpager();
//设置侧滑菜单
setupMenu();
}
protected void setuptoolbar(){
//分别设置背景和头像
//背景
ImageView blurimageView = (ImageView) appCompatActivity.findViewById(R.id.iv_blur);
// ImageView blurimageView = (ImageView) appCompatActivity.findViewById(R.id.iv_blur);
RippleBackground linearimageView = (RippleBackground) appCompatActivity.findViewById(R.id.linearcontent);
linearimageView.startRippleAnimation();
//头像
ImageView avatarImageView = (ImageView) appCompatActivity.findViewById(R.id.iv_avatar);
int width = blurimageView.getWidth();
Glide.with(appCompatActivity).load(R.drawable.draw7)
.apply(RequestOptions.bitmapTransform(new BlurTransformation(18,3))).into(blurimageView);
// Glide.with(appCompatActivity).load(R.drawable.draw7).override(width,450)
// .into(blurimageView);
Animation anim = AnimationUtils.loadAnimation(appCompatActivity,R.anim.anim_rotate);
anim.setDuration(14000);
avatarImageView.startAnimation(anim);
ImageView drugImageView = (ImageView) appCompatActivity.findViewById(R.id.drug_essays);
//drugessays(像动态一样)
Animation animessays = AnimationUtils.loadAnimation(appCompatActivity,R.anim.anim_drugessays);
animessays.setDuration(12000);
drugImageView.startAnimation(animessays);
Glide.with(appCompatActivity).load(R.drawable.draw6).into(avatarImageView);
//用户名
final TextView rainbowTextView = (TextView) appCompatActivity.findViewById(R.id.user_name_person);
rainbowTextView.setOnClickListener(new View.OnClickListener() {
@ -121,154 +117,6 @@ public class PersonContent extends Fragment {
avatarOnclickListener.setFlowingDrawerl(mDrawer);
avatarImageView.setOnClickListener(avatarOnclickListener);
}
//
//设置没有侧滑之前的状态页面
//在这里将东西其改成几个按钮
// private void setupViewpager(){
// /*
// * 先设置适配器
// * */
// viewPager.setAdapter(new PagerAdapter() {
// //设置菜单栏个数
// @Override
// public int getCount() {
// return 5;
// }
//
// @Override
// public boolean isViewFromObject(final View view, final Object object) {
// return view.equals(object);
// }
// //移除某一个
// @Override
// public void destroyItem(final View container, final int position, final Object object) {
// ((ViewPager) container).removeView((View) object);
// }
// /*
// *这里用来加载视图区,也就是每个菜单的对应的内容
// *但是这里应该针对不同的菜单填选对应不同的内容
// * */
// @Override
// public Object instantiateItem(final ViewGroup container, final int position) {
// //每个position代表一个菜单根据position来设置不同视图
////
// switch (position){
// case 0:
// //饮食爱好
// case 1:
// //日历
// View view = setCanlendar();
// container.addView(view);
// return view;
// case 2:
// //消息通知
// case 3:
// //我的文章
// case 4:
// //养生推荐
//
//
// }
// //这是默认的,不要管,因为上面必须有个返回值
// final View view = LayoutInflater.from(
// appCompatActivity.getBaseContext()).inflate(R.layout.item_vp, null, false);
// final TextView txtPage = (TextView) view.findViewById(R.id.txt_vp_item_page);
// txtPage.setText(String.format("Page #%d", position));
// container.addView(view);
//
// return view;
//
// }
// //设置日历
// public View setCanlendar(){
// final View view = LayoutInflater.from(
// appCompatActivity.getBaseContext()
// ).inflate(R.layout.canlendar_layout, null, false);
// return view;
// }
// //设置饮食爱好
// public View setfoodhobby(){
// return null;
// }
// });
// /*
// * 这里开始设置菜单栏
// * */
// //每个菜单选取了不同的颜色
// final String[] colors = getResources().getStringArray(R.array.vertical_ntb);
// //这里菜单栏选取的是NavigationTabBar
// final NavigationTabBar navigationTabBar = (NavigationTabBar) appCompatActivity.findViewById(R.id.ntb_vertical);
// //这里用来加载每个model可以设置几个菜单
// final ArrayList<NavigationTabBar.Model> models = new ArrayList<>();
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.ic_first),
// Color.parseColor(colors[0]))
// .title("ic_first")
// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
// .build()
// );
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.ic_second),
// Color.parseColor(colors[1]))
// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
// .title("ic_second")
// .build()
// );
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.ic_third),
// Color.parseColor(colors[2]))
// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
// .title("ic_third")
// .build()
// );
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.ic_fourth),
// Color.parseColor(colors[3]))
// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
// .title("ic_fourth")
// .build()
// );
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.ic_fifth),
// Color.parseColor(colors[4]))
// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
// .title("ic_fifth")
// .build()
// );
//// models.add(
//// new NavigationTabBar.Model.Builder(
//// getResources().getDrawable(R.drawable.ic_sixth),
//// Color.parseColor(colors[5]))
//// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
//// .title("ic_sixth")
//// .build()
//// );
//// models.add(
//// new NavigationTabBar.Model.Builder(
//// getResources().getDrawable(R.drawable.ic_seventh),
//// Color.parseColor(colors[6]))
//// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
//// .title("ic_seventh")
//// .build()
//// );
//// models.add(
//// new NavigationTabBar.Model.Builder(
//// getResources().getDrawable(R.drawable.ic_eighth),
//// Color.parseColor(colors[7]))
//// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
//// .title("ic_eighth")
//// .build()
//// );
// //设置菜单
// navigationTabBar.setModels(models);
// //设置每个子菜单对一个的viewpager
// navigationTabBar.setViewPager(viewPager, 0);
// }
//设置菜单
@ -283,19 +131,7 @@ public class PersonContent extends Fragment {
//向activity添加一个布局
}
// mDrawer.setOnDrawerStateChangeListener(new ElasticDrawer.OnDrawerStateChangeListener() {
// @Override
// public void onDrawerStateChange(int oldState, int newState) {
// if (newState == ElasticDrawer.STATE_CLOSED) {
// Log.i("MainActivity", "Drawer STATE_CLOSED");
// }
// }
//
// @Override
// public void onDrawerSlide(float openRatio, int offsetPixels) {
// Log.i("MainActivity", "openRatio=" + openRatio + " ,offsetPixels=" + offsetPixels);
// }
// });
}
//

@ -1,5 +1,6 @@
package com.example.cmknowledgegraph;
import android.graphics.Color;
import android.os.Bundle;
@ -24,7 +25,7 @@ public class MainActivity extends AppCompatActivity {
private TextView mTextMessage;
private FragmentTransaction transaction;
private FragmentManager fragmentManager;
BottomNavigationView navView;
public final AppCompatActivity getAppCompatActivity(){
return this;
@ -46,7 +47,7 @@ public class MainActivity extends AppCompatActivity {
* */
switch (item.getItemId()) {
case R.id.home:
SlideFragment slideFragment = new SlideFragment();
SlideFragment slideFragment = new SlideFragment();
slideFragment.setAppCompatActivity(getAppCompatActivity());
transaction.replace(R.id.content,slideFragment); //对应的java class
transaction.commit(); //提交事务
@ -59,6 +60,7 @@ public class MainActivity extends AppCompatActivity {
transaction.commit(); //提交事务
return true;
case R.id.chat:
ChatContent chatContent = new ChatContent();
chatContent.setAppCompatActivity(getAppCompatActivity());
transaction.replace(R.id.content,chatContent);
@ -66,6 +68,7 @@ public class MainActivity extends AppCompatActivity {
transaction.commit();//提交事务
return true;
case R.id.person:
PersonContent personContent = new PersonContent();
personContent.setAppCompatActivity(getAppCompatActivity());
transaction.replace(R.id.content, personContent); //对应的java class
@ -92,7 +95,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setDefaultFragment(); //上面写的那个函数
BottomNavigationView navView = findViewById(R.id.nav_view);
navView = findViewById(R.id.nav_view);
mTextMessage = findViewById(R.id.message);
navView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);

@ -1,178 +0,0 @@
package com.example.cmknowledgegraph;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.example.ChatContentPkg.RecyclerViewFragment;
import com.github.florent37.materialviewpager.MaterialViewPager;
import com.github.florent37.materialviewpager.header.HeaderDesign;
public class tt extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
// Toolbar toolbar = findViewById(R.id.toolbar);
// setSupportActionBar(toolbar);
//
// FloatingActionButton fab = findViewById(R.id.fab);
// fab.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
// .setAction("Action", null).show();
// }
// });
// BoomMenuButton bmb = findViewById(R.id.bmb);
// for (int i=0;i<bmb.getPiecePlaceEnum().pieceNumber();i++){
// SimpleCircleButton.Builder builder = new SimpleCircleButton.Builder()
// .normalImageRes(R.drawable.draw1)//设置点开的图片
// // 设置阴影
//// .shadowEffect(true)
//// .shadowOffsetX(20).shadowOffsetY(0)
//// .shadowRadius(Util.dp2px(20))
//// .shadowCornerRadius(Util.dp2px(20))
//// .shadowColor(Color.parseColor("#ee000000"))
//// 设置图片
//
// .highlightedImageRes(R.drawable.draw3)//点开某个按钮后突变的图片
// .unableImageRes(R.drawable.draw3)//unable时候的图片
// .imageRect(new Rect(Util.dp2px(10), Util.dp2px(10), Util.dp2px(70), Util.dp2px(70)))
// .imagePadding(new Rect(0, 0, 0, 0))
// .buttonCornerRadius(Util.dp2px(20))
//// .unable(true),默认是假的
//// 设置按钮样式
// ;
// bmb.addBuilder(builder);
// }
// final NavigationTabBar navigationTabBar = (NavigationTabBar) findViewById(R.id.ntb);
// final ArrayList<NavigationTabBar.Model> models = new ArrayList<>();
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.draw3),
// Color.parseColor("red")
// ).title("论坛").badgeTitle("NTB").build());
// models.add(
// new NavigationTabBar.Model.Builder(
// getResources().getDrawable(R.drawable.draw1),
// Color.parseColor("blue")
// ).title("drug").badgeTitle("drug").build()
// );
// navigationTabBar.setModels(models);
// ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
// viewPager.setAdapter(new PagerAdapter() {
// @Override
// public int getCount() {
// return 0;
// }
//
// @Override
// public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
// return false;
// }
// });
// navigationTabBar.setViewPager(viewPager,2);
// navigationTabBar.setTitleMode(NavigationTabBar.TitleMode.ACTIVE);
// navigationTabBar.setBadgeGravity(NavigationTabBar.BadgeGravity.BOTTOM);
// navigationTabBar.setBadgePosition(NavigationTabBar.BadgePosition.CENTER);
//
// navigationTabBar.setIsBadged(true);
// navigationTabBar.setIsTitled(true);
// navigationTabBar.setIsTinted(true);
// navigationTabBar.setIsBadgeUseTypeface(true);
// navigationTabBar.setBadgeBgColor(Color.RED);
// navigationTabBar.setBadgeTitleColor(Color.WHITE);
// navigationTabBar.setIsSwiped(true);
// navigationTabBar.setBgColor(Color.BLACK);
// navigationTabBar.setBadgeSize(10);
// navigationTabBar.setTitleSize(10);
// navigationTabBar.setIconSizeFraction((float) 0.5);
//得到MaterviewPager实例
MaterialViewPager materialViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
//为MaterialViewPager添加监听
materialViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {
@Override
public HeaderDesign getHeaderDesign(int page) {
switch (page){
case 0:
return HeaderDesign.fromColorResAndUrl(
R.color.blue,
getResources().getDrawable(R.drawable.draw1).toString()
);
case 1:
return HeaderDesign.fromColorResAndUrl(
R.color.green,
getResources().getDrawable(R.drawable.draw2).toString()
);
case 2:
return HeaderDesign.fromColorResAndUrl(
R.color.cyan,
getResources().getDrawable(R.drawable.draw3).toString()
);
}
return null;
}
});
//设置Toolbar
Toolbar toolbar = materialViewPager.getToolbar();
if(toolbar!=null){
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
}
//为Viewpager设置适配器
ViewPager viewPager = materialViewPager.getViewPager();
viewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
@NonNull
@Override
public Fragment getItem(int position) {
switch (position % 3){
case 0:
return RecyclerViewFragment.newInstance();
default:
return RecyclerViewFragment.newInstance();
}
}
@Override
public int getCount() {
return 3;
}
@Nullable
@Override
public CharSequence getPageTitle(int position) {
switch (position % 3){
case 0:
return "TAP1";
default:
return "TAPN";
}
}
});
materialViewPager.getViewPager().setOffscreenPageLimit(materialViewPager
.getViewPager().getAdapter().getCount());
materialViewPager.getPagerTitleStrip().setViewPager(materialViewPager.getViewPager());
}
}

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="800"
android:fromDegrees="0.0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50.0%"
android:pivotY="50.0%"
android:repeatCount="infinite"
android:toDegrees="-360.0" />
<!-- // 设置动画持续时间-->
<!-- // 设置动画开始时的角度-->
<!-- // 设置动画相对于控件的x坐标的位置-->
<!-- 设置动画相对于控件的y坐标的位置-->
<!-- 设置无线循环-->

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="800"
android:fromDegrees="0.0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50.0%"
android:pivotY="50.0%"
android:repeatCount="infinite"
android:toDegrees="360.0" />
<!-- // 设置动画持续时间-->
<!-- // 设置动画开始时的角度-->
<!-- // 设置动画相对于控件的x坐标的位置-->
<!-- 设置动画相对于控件的y坐标的位置-->
<!-- 设置无线循环-->

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="20dp"/>
<solid android:color="@android:color/holo_blue_bright"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
这是
这是home的类
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
@ -26,7 +26,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
android:background="#c0c0c0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"

@ -9,7 +9,7 @@
android:clipToPadding="true"
app:edPosition="1"
app:edMenuSize="320dp"
app:edMenuBackground="#ddeff3">
app:edMenuBackground="#808069">
<!--content-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
@ -21,81 +21,280 @@
<!-- 主要页面的内容也就是在person直接能看到的-->
<!-- 在这里添加自定义主页面 可支持自定义背景图还有头像然后几个cardview-->
<LinearLayout
<RelativeLayout
android:id="@+id/person_relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
//上面的背景
android:background="@color/white">
<!-- 将整个背景作为背景-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_blur"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:scaleType="fitXY"-->
<!-- app:layout_anchorGravity="center" />-->
<com.skyfishjy.library.RippleBackground
android:id="@+id/linearcontent"
android:layout_width="match_parent"
android:layout_height="450dp"
android:background="@drawable/draw12"
app:rb_color="#808080"
app:rb_duration="6000"
app:rb_radius="60dp"
app:rb_rippleAmount="6"
app:rb_type="strokeRipple"
app:rb_scale="6">
//头像
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/iv_avatar"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_centerInParent="true"
app:civ_border_color="#FF000000"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#423752">
//背景
<ImageView android:id="@+id/iv_blur"
android:layout_width="match_parent"
android:layout_height="410dp"
android:scaleType="fitXY"
android:paddingTop="0dp"/>
app:civ_border_width="2dp" />
//用户名
<LinearLayout
<TextView
android:id="@+id/user_name_person"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/iv_avatar"
android:layout_centerHorizontal="true"
android:layout_marginTop="-30dp"
android:text="未登录"
android:textSize="20sp" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerInParent="true">
//头像
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/iv_avatar"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/draw7"
app:civ_border_width="2dp"
app:civ_border_color="#FF000000"
/>
//用户名
android:layout_alignTop="@+id/user_name_person"
android:layout_marginTop="90dp"
android:layout_marginLeft="20dp"
android:background="@color/colorTransparent">
<ImageView
android:id="@+id/sex_personimg"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/boy"/>
<ImageView
android:id="@+id/age_personimg"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignTop="@+id/sex_personimg"
android:layout_marginTop="40dp"
android:src="@drawable/child"/>
<TextView
android:id="@+id/user_name_person"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="未登录"
android:textSize="20sp"
android:layout_marginTop="30dp"
/>
android:text="16岁"
android:layout_alignLeft="@+id/age_personimg"
android:layout_marginLeft="40dp"
android:layout_alignTop="@+id/sex_persontext"
android:layout_marginTop="44dp"
android:textSize="18dp"
android:id="@+id/age_persontext"/>
<ImageView
android:id="@+id/address_personimg"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignTop="@+id/age_personimg"
android:layout_marginTop="40dp"
android:src="@drawable/region"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/address_personimg"
android:layout_marginLeft="40dp"
android:layout_alignTop="@+id/sex_persontext"
android:layout_marginTop="85dp"
android:textSize="18dp"
android:text="湖南省"
android:id="@+id/address_persontext"/>
</RelativeLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:src="@drawable/draw15"
android:id="@+id/drug_essays"
android:layout_alignLeft="@+id/iv_avatar"
android:layout_marginLeft="210dp"
android:layout_alignTop="@+id/iv_avatar"
android:layout_marginTop="20dp"
</LinearLayout>
/>
</RelativeLayout>
<!--原来的竖向菜单-->
<!-- <LinearLayout-->
<!-- xmlns:android="http://schemas.android.com/apk/res/android"-->
<!-- xmlns:app="http://schemas.android.com/apk/res-auto"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginBottom="50dp"-->
<!-- android:orientation="horizontal"-->
<!-- android:background="#423752">-->
<!-- <devlight.io.library.ntb.NavigationTabBar-->
<!-- app:ntb_title_mode="all"-->
<!-- app:ntb_titled="true"-->
<!-- app:ntb_title_size="14sp"-->
<!-- android:id="@+id/ntb_vertical"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="match_parent"-->
<!-- app:ntb_preview_colors="@array/vertical_ntb"/>-->
<!-- <androidx.viewpager.widget.ViewPager-->
<!-- android:id="@+id/vp_vertical_ntb"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_weight="1"/>-->
</com.skyfishjy.library.RippleBackground>
<ImageView
android:id="@+id/person_gexingqianming"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignBottom="@+id/linearcontent"
android:layout_marginBottom="80dp"
android:layout_marginLeft="15dp"
android:src="@drawable/draw13"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/person_gexingqianming"
android:layout_marginLeft="60dp"
android:layout_alignBottom="@+id/linearcontent"
android:textSize="14dp"
android:layout_marginBottom="86dp"
android:text="改写写什么呢???"/>
<!-- 设置几个选项-->
<androidx.cardview.widget.CardView
android:id="@+id/person_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#d0d0d0"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="-70dp"
app:cardCornerRadius="10dp"
app:cardElevation="20dp"
app:cardMaxElevation="20dp"
android:layout_below="@+id/linearcontent">
<RelativeLayout
android:id="@+id/person_cardview_relativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:id="@+id/person_cardview_relalinearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/diet_hobby"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/mushroom"
app:civ_border_width="0dp" />
<TextView
android:id="@+id/diet_hobby_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="饮食爱好"
android:layout_gravity="center_horizontal"
></TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/person_cardview_relalinearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true"
>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/person_calender"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/origamicoloredpencil06"
app:civ_border_width="0dp"
/>
<TextView
android:id="@+id/person_calender_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="日历"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
<LinearLayout
android:id="@+id/person_cardview_relalinearLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/person_article"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/tuya_pc_icon_09"
app:civ_border_width="0dp"/>
<TextView
android:id="@+id/person_calender_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我的文章"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
<LinearLayout
android:id="@+id/person_cardview_relalinearLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/person_cardview_relalinearLayout1"
android:layout_marginTop="5dp"
android:layout_marginLeft="30dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/person_Healthrecommendation"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/origamicoloredpencil02"
app:civ_border_width="0dp"/>
<TextView
android:id="@+id/person_Healthrecommendation_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="养生推荐"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
<LinearLayout
android:id="@+id/person_cardview_relalinearLayout5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/person_cardview_relalinearLayout2"
android:layout_marginTop="5dp"
android:layout_centerHorizontal="true">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/person_messagenotification"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/tuya_pc_icon_19"
app:civ_border_width="0dp"/>
<TextView
android:id="@+id/person_messagenotification_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="消息通知"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<!-- </LinearLayout>-->
</RelativeLayout>
</LinearLayout>
@ -112,7 +311,7 @@
<FrameLayout
android:id="@+id/id_container_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
</com.mxn.soul.flowingdrawer_core.FlowingMenuLayout>
</com.mxn.soul.flowingdrawer_core.FlowingDrawer>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<com.loopeer.cardstack.CardStackView
android:id="@+id/stackview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:padding="6dp"
xmlns:android="http://schemas.android.com/apk/res/android">
</com.loopeer.cardstack.CardStackView>
<!--这个是药友的总体总体布局局面加入了CardStackView-->
<!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:background="#f0f0f0">-->
<!--</LinearLayout>-->

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--对应于CardView的每个Item-->
<LinearLayout
android:id="@+id/linear_list_card_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:stackHeaderHeight="100dp">
<FrameLayout
android:id="@+id/frame_list_card_item"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@drawable/van">
<TextView
android:id="@+id/text_list_card_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold"
tools:text="12"/>
</FrameLayout>
<LinearLayout
android:id="@+id/container_list_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</LinearLayout>

@ -8,10 +8,10 @@
<com.google.android.material.navigation.NavigationView
android:id="@+id/vNavigation"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#4b405c"
android:background="#808069"
app:headerLayout="@layout/view_global_menu_header"
app:itemIconTint="#8b8b8b"
app:itemTextColor="#666666"

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>

@ -3,20 +3,63 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
xmlns:scrolling_image_view="http://schemas.android.com/apk/res-auto"
android:background="#e0e0e0"
xmlns:blurkit="http://schemas.android.com/apk/res-auto">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/draw7"
/>
<!-- health is running 图标 -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="#808080"
android:id="@+id/scrolling_background_home"
>
<com.q42.android.scrollingimageview.ScrollingImageView
android:id="@+id/scrolling_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#808080"
scrolling_image_view:speed="1dp"
scrolling_image_view:src="@drawable/scrolling_background" />
<com.q42.android.scrollingimageview.ScrollingImageView
android:id="@+id/scrolling_foreground"
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:background="#808080"
scrolling_image_view:speed="2.5dp"
scrolling_image_view:src="@drawable/scrolling_foreground" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:background="#808080"
android:layout_marginTop="40dp"
android:src="@drawable/van"/>
</FrameLayout>
<!-- 喜欢或者不喜欢-->
<com.example.HomeContent.SmileView
android:id="@+id/smile_view"
<com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/home_XRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="wrap_content"
android:layout_below="@id/scrolling_background_home"
android:layout_marginTop="10dp"
>
</com.jcodecraeer.xrecyclerview.XRecyclerView>
<!-- <FrameLayout-->
<!-- android:id="@+id/header_content"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_weight="1"-->
<!-- />-->
</RelativeLayout>

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:folding-cell="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ramotion.foldingcell.FoldingCell
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/folding_cell"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/cardMarginVertical"
android:layout_marginLeft="@dimen/cardMarginHorizontal"
android:layout_marginRight="@dimen/cardMarginHorizontal"
android:layout_marginTop="@dimen/cardMarginVertical"
android:clipChildren="false"
android:clipToPadding="false"
android:elevation="0dp"
folding-cell:animationDuration="1000"
folding-cell:backSideColor="@color/blue"
folding-cell:additionalFlipsCount="15">
<!-- 展开后-->
<FrameLayout
android:id="@+id/cell_content_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_green_dark"
android:visibility="gone">
<!-- 头像-->
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:background="@drawable/van"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:text="这是展开后"/>
<ImageView
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_marginTop="180dp"
android:src="@drawable/draw7"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1300dp"
android:text="这是展开后"/>
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="250dp"-->
<!-- android:text="jkadiekeieii"-->
<!-- android:textColor="@color/white"/>-->
</FrameLayout>
<!-- 展开前-->
<FrameLayout
android:id="@+id/cell_title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:background="@drawable/van"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="90dp"
android:text="这是未展开前"></TextView>
</FrameLayout>
</com.ramotion.foldingcell.FoldingCell>
</LinearLayout>

@ -0,0 +1,96 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="260dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="10dp"
app:cardElevation="5dp"
app:elevation="10dp"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
//文章截取图片
<androidx.cardview.widget.CardView
android:id="@+id/img_bg_Cadview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/rela_bottom"
app:cardCornerRadius="7dp">
<ImageView
android:id="@+id/img_bg"
android:layout_width="200dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="4dp"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:layout_above="@+id/rela_bottom"
/>
</androidx.cardview.widget.CardView>
//文字部分
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="jaja\n这个是文字部分"
android:layout_toRightOf="@+id/img_bg_Cadview"
android:layout_marginBottom="56dp"
android:layout_marginLeft="3dp"
android:textColor="@color/colorPrimaryDark"
android:layout_marginTop="10dp"
/>
//底部头像部分,还有个性签名吧
<RelativeLayout
android:id="@+id/rela_bottom"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
android:background="@android:color/white"
>
<!-- 头像-->
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/img_user"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
app:civ_border_overlay="true"
android:elevation="3dp"
/>
<!-- 标题-->
<TextView
android:id="@+id/text_item_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/darker_gray"
android:textStyle="bold"
android:layout_marginTop="16dp"
android:textSize="30sp"
android:text="Title"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/img_user"
android:layout_marginLeft="10dp"
android:layout_marginRight="16dp"
android:singleLine="true"
/>
<!-- 菜单-->
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#b2b2b2"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="620dp"
android:layout_height="250dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="5dp"
app:cardCornerRadius="10dp"
app:elevation="10dp"
>
<RelativeLayout

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/linear_list_card_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:stackHeaderHeight="90dp">
<FrameLayout
android:id="@+id/frame_list_card_item"
android:layout_width="match_parent"
android:layout_height="120dp"
android:background="@drawable/shape_rectangle_with_radius">
<TextView
android:id="@+id/text_list_card_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginLeft="10dp"
android:textColor="@android:color/white"
android:textSize="40sp"
android:textStyle="bold"
tools:text="12"/>
</FrameLayout>
<LinearLayout
android:id="@+id/container_list_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:text="Every corner must (initially) be provided a corner radius greater than 1, or else no corners are rounded. If you want specific corners to not be rounded, a work-around is to use android:radius to set a default corner radius greater than 1, but then override each and every corner with the values you really want, providing zero (0dp) where you don't want rounded corners."
/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/linear_list_card_item"
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:orientation="vertical"
app:stackHeaderHeight="70dp"
xmlns:tools="http://schemas.android.com/tools">
<FrameLayout
android:id="@+id/frame_list_card_item"
android:layout_width="match_parent"
android:layout_height="120dp"
android:background="@drawable/shape_rectangle_with_radius">
<TextView
android:id="@+id/text_list_card_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="12"
android:textSize="40sp"
android:layout_margin="20dp"
android:textStyle="bold"
android:textColor="@android:color/white"/>
</FrameLayout>
<ScrollView
android:id="@+id/container_list_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="60dp"
android:overScrollMode="never"
android:scrollbars="none"
android:animateLayoutChanges="true">
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:text="kdi"
/>
</ScrollView>
</LinearLayout>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/linear_list_card_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/frame_list_card_item"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/shape_rectangle_with_radius">
<TextView
android:id="@+id/text_list_card_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:textColor="@android:color/white"
android:textSize="40sp"
android:textStyle="bold"
tools:text="12"/>
</FrameLayout>
</LinearLayout>

@ -0,0 +1,34 @@
<RelativeLayout android:layout_width="match_parent"
android:layout_height="280dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_below="@+id/scrolling_background_home"
android:layout_marginTop="3dp"
android:background="@android:color/white"
xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="7dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
app:cardBackgroundColor="#e0e0e0">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<!-- 喜欢或者不喜欢-->
<com.example.HomeContent.SmileView
android:id="@+id/smile_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="-41dp"/>
</androidx.cardview.widget.CardView>
</RelativeLayout>

@ -3,23 +3,20 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:clickable="true">
android:clickable="true"
android:layout_marginTop="40dp">
<LinearLayout
android:id="@+id/vGlobalMenuHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- 头像-->
<!-- <ImageView-->
<!-- android:id="@+id/ivMenuUserProfilePhoto"-->
<!-- android:layout_width="@dimen/global_menu_avatar_size"-->
<!-- android:layout_height="@dimen/global_menu_avatar_size"-->
<!-- android:layout_margin="12dp" />-->
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ivMenuUserProfilePhoto"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/draw1"
android:src="@drawable/tiantiansifangmao_09"
app:civ_border_width="2dp"
app:civ_border_color="#FF000000"
/>
@ -30,7 +27,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="mxn"
android:text="未登录"
android:textColor="#2d5d82"
android:textSize="16sp"
android:textStyle="bold" />
@ -42,5 +39,5 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="#dddddd" />
android:background="#808073" />
</FrameLayout>

@ -3,22 +3,22 @@
<item
android:id="@+id/home"
android:icon="@drawable/ic_home_black_24dp"
android:icon="@drawable/tuya_pc_icon_12"
android:title="Home" />
<item
android:id="@+id/search"
android:icon="@drawable/ic_dashboard_black_24dp"
android:icon="@drawable/origamicoloredpencil37"
android:title="Search" />
<item
android:id="@+id/chat"
android:icon="@drawable/ic_notifications_black_24dp"
android:icon="@drawable/tuya_pc_icon_20"
android:title="Chat" />
<item
android:id="@+id/person"
android:icon="@drawable/person"
android:icon="@drawable/tuya_pc_icon_21"
android:title="Per" />
</menu>

@ -2,35 +2,37 @@
<group android:id="@+id/menu_group_1">
<item
android:id="@+id/menu_feed"
android:icon="@drawable/ic_global_menu_feed"
android:icon="@drawable/red_hearts_01"
android:title="我的收藏" />
<item
android:id="@+id/menu_direct"
android:icon="@drawable/ic_global_menu_direct"
android:icon="@drawable/crayoncute_driver"
android:title="浏览记录" />
<item
android:id="@+id/menu_news"
android:icon="@drawable/ic_global_menu_news"
android:icon="@drawable/handy_icon_08"
android:title="个人信息" />
<item
android:id="@+id/menu_popular"
android:icon="@drawable/ic_global_menu_popular"
android:icon="@drawable/origami_colored_pencil_30"
android:title="账号与安全" />
<item
android:id="@+id/menu_photos_nearby"
android:icon="@drawable/ic_global_menu_nearby"
android:icon="@drawable/crayoncute_movies"
android:title="产品反馈" />
<item
android:id="@+id/menu_photo_you_liked"
android:icon="@drawable/ic_global_menu_likes"
android:icon="@drawable/handy_icon_06"
android:title="版本" />
</group>
<group android:id="@+id/menu_group_2">
<item
android:id="@+id/menu_settings"
android:icon="@drawable/handy_icon_13"
android:title="Settings" />
<item
android:id="@+id/menu_about"
android:icon="@drawable/tiantiansifangmao_04"
android:title="About" />
</group>
</menu>

@ -15,6 +15,33 @@
<color name="text_like_counter">#2b5a83</color>
<color name="paint_color">#dddddd</color>
<color name="color_1">#EF9A9A</color>
<color name="color_2">#E53935</color>
<color name="color_3">#F8BBD0</color>
<color name="color_4">#D81B60</color>
<color name="color_5">#880E4F</color>
<color name="color_6">#CE93D8</color>
<color name="color_7">#8E24AA</color>
<color name="color_8">#4A148C</color>
<color name="color_9">#B39DDB</color>
<color name="color_10">#673AB7</color>
<color name="color_11">#311B92</color>
<color name="color_12">#3D5AFE</color>
<color name="color_13">#29B6F6</color>
<color name="color_14">#26C6DA</color>
<color name="color_15">#26A69A</color>
<color name="color_16">#4CAF50</color>
<color name="color_17">#8BC34A</color>
<color name="color_18">#CDDC39</color>
<color name="color_19">#FFEB3B</color>
<color name="color_20">#FFC107</color>
<color name="color_21">#FF9800</color>
<color name="color_22">#FF5722</color>
<color name="color_23">#795548</color>
<color name="color_24">#9E9E9E</color>
<color name="color_25">#607D8B</color>
<color name="color_26">#000000</color>
<!--真毒home的设置-->
<!-- <color name="colorAccent">#FF4081</color>-->
<color name="colorYellow">#FFFF33</color>

Loading…
Cancel
Save