Merge branch 'develop' into zhaolizhi
This commit is contained in:
@@ -55,8 +55,6 @@ dependencies {
|
||||
implementation project(':todaystepcounterlib')
|
||||
//打分ui
|
||||
compile 'com.github.CB-ysx:CBRatingBar:3.0.1'
|
||||
// //蛛网
|
||||
// implementation 'me.panpf:spider-web-score-view:1.0.1'
|
||||
//折线
|
||||
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
|
||||
//searchview
|
||||
@@ -66,4 +64,9 @@ dependencies {
|
||||
//recycler and card
|
||||
implementation 'com.android.support:recyclerview-v7:26.1.0'
|
||||
implementation 'com.android.support:cardview-v7:26.1.0'
|
||||
//混合式recyclerview
|
||||
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
|
||||
//翻页view
|
||||
compile 'com.github.czy1121:turncardlistview:1.0.0'
|
||||
|
||||
}
|
||||
|
||||
@@ -17,9 +17,11 @@
|
||||
|
||||
<!-- 相机权限 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
@@ -42,7 +44,9 @@
|
||||
<receiver
|
||||
android:name=".step.StepStarter"
|
||||
android:enabled="true"
|
||||
android:exported="true"></receiver>
|
||||
android:exported="true" />
|
||||
|
||||
<activity android:name=".modules.addinformation.AddActivity"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -8,7 +8,7 @@ import android.support.v4.app.FragmentPagerAdapter;
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.modules.viewpagerfragments.customization.CustomizationFragment;
|
||||
import com.example.ninefourone.nutritionmaster.modules.viewpagerfragments.bodyinformation.BodyInformationFragment;
|
||||
import com.example.ninefourone.nutritionmaster.modules.viewpagerfragments.page3.Page3;
|
||||
import com.example.ninefourone.nutritionmaster.modules.viewpagerfragments.recommend.RecommendFragment;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ public class HomePagerAdapter extends FragmentPagerAdapter {
|
||||
fragments[position] = BodyInformationFragment.getInstance();
|
||||
break;
|
||||
case 2:
|
||||
fragments[position] = Page3.getInstance();
|
||||
fragments[position] = RecommendFragment.getInstance();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.example.ninefourone.nutritionmaster.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.bean.RecommendFood;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/9/3.
|
||||
*/
|
||||
|
||||
public class RecommendAdapter extends BaseMultiItemQuickAdapter<RecommendFood, BaseViewHolder> {
|
||||
private int[] indexs = new int[]{0, 1, 1, 2};
|
||||
|
||||
/**
|
||||
* Same as QuickAdapter#QuickAdapter(Context,int) but with
|
||||
* some initialization data.
|
||||
*
|
||||
* @param data A new list is created out of this one to avoid mutable list
|
||||
*/
|
||||
public RecommendAdapter(List<RecommendFood> data) {
|
||||
super(data);
|
||||
addItemType(RecommendFood.TYPE_BIG, R.layout.recommend_item_big);
|
||||
addItemType(RecommendFood.TYPE_DETAIL, R.layout.recommend_item_detail);
|
||||
addItemType(RecommendFood.TYPE_MIDDLE, R.layout.recommend_item_middle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RecommendFood item) {
|
||||
switch (item.getItemType()) {
|
||||
case RecommendFood.TYPE_BIG:
|
||||
helper.setImageResource(R.id.recommend_item_imageview, R.drawable.food_test);
|
||||
helper.setText(R.id.recommend_item_title, "红烧肉");
|
||||
break;
|
||||
case RecommendFood.TYPE_DETAIL:
|
||||
helper.setImageResource(R.id.recommend_item_imageview, R.drawable.food_test);
|
||||
helper.setText(R.id.recommend_item_title, item.getTitle());
|
||||
helper.setText(R.id.recommend_item_description, item.getDescription());
|
||||
break;
|
||||
case RecommendFood.TYPE_MIDDLE:
|
||||
helper.setImageResource(R.id.recommend_item_imageview, R.drawable.food_test);
|
||||
helper.setText(R.id.recommend_item_title, "红烧");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadMoreComplete() {
|
||||
super.loadMoreComplete();
|
||||
for (int i = 0; i < 5; i++) {
|
||||
RecommendFood recommendFood = new RecommendFood(1, "烧肉", "好吃", indexs[i % 4]);
|
||||
getData().add(recommendFood);
|
||||
}
|
||||
// notifyDataSetChanged();
|
||||
// Logger.d("加载成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadMoreEnd() {
|
||||
super.loadMoreEnd();
|
||||
// Logger.d("数据没了");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadMoreFail() {
|
||||
super.loadMoreFail();
|
||||
// Logger.d("加载失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.example.ninefourone.nutritionmaster.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/9/3.
|
||||
*/
|
||||
|
||||
public class RecommendFood implements MultiItemEntity {
|
||||
|
||||
//三种view
|
||||
public static final int TYPE_BIG = 0;
|
||||
public static final int TYPE_MIDDLE = 1;
|
||||
public static final int TYPE_DETAIL = 2;
|
||||
|
||||
private int picture;
|
||||
private String title;
|
||||
private String description;
|
||||
private int type;
|
||||
|
||||
public RecommendFood(int picture, String title, String description, int type) {
|
||||
this.picture = picture;
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.type = type;
|
||||
if (type > 2) {
|
||||
Logger.e("混合recycler type不对");
|
||||
}
|
||||
}
|
||||
|
||||
public int getPicture() {
|
||||
return picture;
|
||||
}
|
||||
|
||||
public void setPicture(int picture) {
|
||||
this.picture = picture;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.ToxicBakery.viewpager.transforms.CubeOutTransformer;
|
||||
@@ -19,6 +20,7 @@ import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.adapter.HomePagerAdapter;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseActivity;
|
||||
import com.example.ninefourone.nutritionmaster.camera.FoodMaterialCamera;
|
||||
import com.example.ninefourone.nutritionmaster.modules.addinformation.AddActivity;
|
||||
import com.example.ninefourone.nutritionmaster.ui.NoScrollViewPager;
|
||||
import com.example.ninefourone.nutritionmaster.utils.MessageUtils;
|
||||
import com.example.ninefourone.nutritionmaster.utils.PermissionUtils;
|
||||
@@ -81,6 +83,8 @@ public class MainActivity extends BaseActivity {
|
||||
BoomMenuButton boomMenuButton;
|
||||
@BindView(R.id.spider_view)
|
||||
RadarChart spiderView;
|
||||
@BindView(R.id.add_information_button)
|
||||
ImageView addInformationButton;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -166,13 +170,11 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
|
||||
//mDrawer.openMenu();
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
@OnClick(R.id.navigation_layout)
|
||||
public void onViewClicked() {
|
||||
mDrawer.openMenu();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -305,4 +307,17 @@ public class MainActivity extends BaseActivity {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
MessageUtils.MakeToast("权限赋予成功");
|
||||
}
|
||||
|
||||
@OnClick({R.id.navigation_layout, R.id.add_information_button})
|
||||
public void onViewClicked(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.navigation_layout:
|
||||
mDrawer.openMenu();
|
||||
break;
|
||||
case R.id.add_information_button:
|
||||
Intent intent = new Intent(MainActivity.this, AddActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.example.ninefourone.nutritionmaster.modules.addinformation;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.utils.ConstantUtils;
|
||||
import com.example.ninefourone.nutritionmaster.utils.MessageUtils;
|
||||
import com.github.czy1121.view.TurnCardListView;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
public class AddActivity extends AppCompatActivity {
|
||||
|
||||
@BindView(R.id.card_list)
|
||||
TurnCardListView cardList;
|
||||
@BindView(R.id.bottom_content)
|
||||
RelativeLayout bottomContent;
|
||||
@BindView(R.id.back_button)
|
||||
ImageView backButton;
|
||||
@BindView(R.id.result_layout)
|
||||
CardView resultLayout;
|
||||
|
||||
|
||||
// private int[] colors = {0xff3F51B5, 0xff673AB7, 0xff006064, 0xffC51162, 0xffFFEB3B, 0xff795548, 0xff9E9E9E};
|
||||
private int[] colors = {0xffdef6f9, 0xffd6eeec, 0xffB2EBF2, 0xffB2DFDB, 0xff8ed0ca, 0xff80CBC4, 0xff4DB6AC, 0xff3c948b};
|
||||
private Button[] firstButtons = new Button[ConstantUtils.questionList.length];
|
||||
private Button[] secondButtons = new Button[ConstantUtils.questionList.length];
|
||||
private Button[] thirdButtons = new Button[ConstantUtils.questionList.length];
|
||||
private TextView[] titleViews = new TextView[ConstantUtils.questionList.length];
|
||||
|
||||
private Button[][] buttonList;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
//设置全屏
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add);
|
||||
ButterKnife.bind(this);
|
||||
buttonList = new Button[][]{
|
||||
firstButtons,
|
||||
secondButtons,
|
||||
thirdButtons
|
||||
};
|
||||
initAddView();
|
||||
}
|
||||
|
||||
private void initAddView() {
|
||||
BaseAdapter adapter = new BaseAdapter() {
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return colors.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final int position, View child, ViewGroup parent) {
|
||||
|
||||
child = LayoutInflater.from(parent.getContext()).inflate(R.layout.add_item, parent, false);
|
||||
child.findViewById(R.id.image).setBackgroundColor(colors[position]);
|
||||
titleViews[position] = child.findViewById(R.id.title_view);
|
||||
titleViews[position].setText(ConstantUtils.questionList[position]);
|
||||
|
||||
firstButtons[position] = child.findViewById(R.id.choose_first);
|
||||
firstButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
|
||||
|
||||
secondButtons[position] = child.findViewById(R.id.choose_second);
|
||||
secondButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
|
||||
|
||||
thirdButtons[position] = child.findViewById(R.id.choose_third);
|
||||
thirdButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
|
||||
|
||||
if (position != ConstantUtils.questionList.length - 1) {
|
||||
firstButtons[position].setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
firstButtons[position].setBackgroundColor(colors[position] - 60);
|
||||
secondButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
thirdButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
cardList.turnTo(position + 1);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
firstButtons[position].setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
resultLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
secondButtons[position].setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
firstButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
thirdButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
secondButtons[position].setBackgroundColor(colors[position] - 60);
|
||||
cardList.turnTo(position + 1);
|
||||
}
|
||||
});
|
||||
thirdButtons[position].setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
firstButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
secondButtons[position].setBackgroundColor(colors[position] + 30);
|
||||
thirdButtons[position].setBackgroundColor(colors[position] - 60);
|
||||
cardList.turnTo(position + 1);
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < ConstantUtils.answerList[position].length; i++) {
|
||||
buttonList[i][position].setText(ConstantUtils.answerList[position][i]);
|
||||
buttonList[i][position].setVisibility(View.VISIBLE);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
cardList.setAdapter(adapter);
|
||||
cardList.setOnTurnListener(new TurnCardListView.OnTurnListener() {
|
||||
@Override
|
||||
public void onTurned(int position) {
|
||||
bottomContent.setBackgroundColor(colors[position] - 60);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@OnClick(R.id.back_button)
|
||||
public void onViewClicked() {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.example.ninefourone.nutritionmaster.modules.viewpagerfragments.page3;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseFragment;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/8/26.
|
||||
*/
|
||||
|
||||
public class Page3 extends BaseFragment {
|
||||
@Override
|
||||
public int getLayoutResId() {
|
||||
return R.layout.page_3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Bundle state) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static BaseFragment getInstance() {
|
||||
return new Page3();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.example.ninefourone.nutritionmaster.modules.viewpagerfragments.recommend;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.ninefourone.nutritionmaster.R;
|
||||
import com.example.ninefourone.nutritionmaster.adapter.RecommendAdapter;
|
||||
import com.example.ninefourone.nutritionmaster.base.BaseFragment;
|
||||
import com.example.ninefourone.nutritionmaster.bean.RecommendFood;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2018/8/26.
|
||||
*/
|
||||
|
||||
public class RecommendFragment extends BaseFragment {
|
||||
@BindView(R.id.recycler_view)
|
||||
RecyclerView recyclerView;
|
||||
Unbinder unbinder;
|
||||
|
||||
private RecommendAdapter adapter;
|
||||
private ArrayList<RecommendFood> datas = new ArrayList<>();
|
||||
private GridLayoutManager manager;
|
||||
private int[] indexs = new int[]{0, 1, 1, 2};
|
||||
|
||||
@Override
|
||||
public int getLayoutResId() {
|
||||
return R.layout.normal_recommend_fragment_layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Bundle state) {
|
||||
loadData();
|
||||
initRecyclerView();
|
||||
}
|
||||
|
||||
|
||||
public static BaseFragment getInstance() {
|
||||
return new RecommendFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化recyclerview
|
||||
*/
|
||||
@Override
|
||||
protected void initRecyclerView() {
|
||||
adapter = new RecommendAdapter(datas);
|
||||
adapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
||||
adapter.isFirstOnly(false);
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
recyclerView.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adapter.loadMoreComplete();
|
||||
// Logger.d("开始加载");
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}, recyclerView);
|
||||
adapter.disableLoadMoreIfNotFullPage();
|
||||
adapter.setEnableLoadMore(true);
|
||||
adapter.setHeaderView(LayoutInflater.from(getContext()).
|
||||
inflate(R.layout.recommend_head, (ViewGroup) recyclerView.getParent(), false));
|
||||
recyclerView.setNestedScrollingEnabled(false);
|
||||
manager = new GridLayoutManager(getContext(), 2);
|
||||
adapter.setHeaderViewAsFlow(false);
|
||||
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
if (position == 0) {
|
||||
return 2;
|
||||
} else {
|
||||
if (adapter.getItemViewType(position) == RecommendFood.TYPE_BIG ||
|
||||
adapter.getItemViewType(position) == RecommendFood.TYPE_DETAIL) {
|
||||
// Logger.d(manager.getSpanCount());
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
recyclerView.setLayoutManager(manager);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载数据
|
||||
*/
|
||||
@Override
|
||||
protected void loadData() {
|
||||
super.loadData();
|
||||
for (int i = 0; i < 11; i++) {
|
||||
RecommendFood recommendFood = new RecommendFood(1, "烧肉", "好吃", indexs[i % 4]);
|
||||
datas.add(recommendFood);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数据是否加载完了(服务器没了)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isDataOverCount() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,27 @@ public class ConstantUtils {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String[] questionList = new String[]{
|
||||
"现在先去找个镜子吧" +
|
||||
"\n下面会用到哦",
|
||||
"你舌苔的颜色",
|
||||
"舌底经络颜色",
|
||||
"口腔整体情况",
|
||||
"整体生活精神状况",
|
||||
"性格特点",
|
||||
"食物温度偏向",
|
||||
"揭晓结果"
|
||||
};
|
||||
|
||||
public static String[][] answerList = new String[][]{
|
||||
{"开始吧"},
|
||||
{"偏暗红", "偏白", "淡红"},
|
||||
{"暗红", "细红", "不明显"},
|
||||
{"口舌干燥", "口黏苔腻", "还算正常"},
|
||||
{"沉寂易疲劳", "精力充沛"},
|
||||
{"内向", "开朗"},
|
||||
{"烫的", "冷的", "没有特别喜欢的"},
|
||||
{"查看"}
|
||||
};
|
||||
}
|
||||
|
||||
4
app/src/main/res/drawable/ic_back_button.xml
Normal file
4
app/src/main/res/drawable/ic_back_button.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#2c2c2c" android:pathData="M228.9,535.7l238.5,238.5a51.2,51.2 0,0 1,-72.4 72.4L69.1,520.8a51.1,51.1 0,0 1,-9.7 -13.5,51.2 51.2,0 0,1 6.8,-64.1l325.8,-325.8A51.2,51.2 0,1 1,464.4 189.8L220.9,433.3H888.8a51.2,51.2 0,0 1,0 102.4H228.9z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/ic_data_add.xml
Normal file
5
app/src/main/res/drawable/ic_data_add.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#ffffff" android:pathData="M512,967.1A455.1,455.1 0,1 0,512 56.9a455.1,455.1 0,0 0,0 910.2zM512,1024A512,512 0,1 1,512 0a512,512 0,0 1,0 1024z"/>
|
||||
<path android:fillColor="#ffffff" android:pathData="M712.2,606.7c-69.3,-16.3 -104.8,-55.1 -110.9,-63.2 -6.1,-8.2 -6.1,-18.4 -6.1,-30.6 0,-4.1 2,-10.2 4.1,-14.2l2,-4.1c2,-4.1 10.1,-24.5 16.3,-36.8 0,-2 4,-8.2 8.1,-12.2 6.1,-4.1 12.2,-10.2 22.4,-22.4 16.3,-24.5 8.2,-46.9 -6.1,-57.1v-4c8.1,-22.5 12.2,-48.9 10.2,-81.6 -2.1,-34.7 -34.7,-87.7 -118.3,-87.7 -83.6,0 -116.2,51 -118.2,87.7 -2,32.6 2,59.1 10.2,79.5V364.1c-14.3,12.3 -20.5,34.7 -6.1,59.2 8.1,12.2 16.3,18.3 22.4,22.4 4.1,4.1 8.2,10.2 8.2,12.2 6.1,12.3 14.3,30.6 16.3,36.8l2,4c2,6.1 4,10.2 4,14.2 0,10.2 0,22.5 -6.1,30.7 -6.1,8.1 -40.8,46.9 -110.1,63.1 -61.2,14.3 -100.7,49.3 -100.7,129.8 0,4.1 4.1,10.2 10.2,10.2h533.7c4,0 10.2,-4.1 10.2,-10.2 0,-84.5 -34.7,-115.5 -97.8,-129.7z"/>
|
||||
</vector>
|
||||
BIN
app/src/main/res/drawable/recommend_bg.jpg
Normal file
BIN
app/src/main/res/drawable/recommend_bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
BIN
app/src/main/res/drawable/result_bg.png
Normal file
BIN
app/src/main/res/drawable/result_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 171 KiB |
211
app/src/main/res/layout/activity_add.xml
Normal file
211
app/src/main/res/layout/activity_add.xml
Normal file
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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:id="@+id/bottom_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#b0ce93"
|
||||
tools:context="com.example.ninefourone.nutritionmaster.modules.addinformation.AddActivity">
|
||||
|
||||
|
||||
<com.github.czy1121.view.TurnCardListView
|
||||
android:id="@+id/card_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</com.github.czy1121.view.TurnCardListView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:src="@drawable/ic_back_button" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/result_layout"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="450dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/result_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.github.siyamed.shapeimageview.CircularImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
tools:src="@drawable/test_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
android:textStyle="bold"
|
||||
tools:text="淤血质" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_gravity="center"
|
||||
app:cardBackgroundColor="#95def4">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="常见表现"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:textSize="8sp"
|
||||
tools:text="平素面色晦暗,皮肤偏暗或色素沉着,容易出现瘀斑,易患疼痛,口唇暗淡或紫,舌质暗有点、片状瘀斑,舌下静脉曲张。眼眶暗黑,鼻部暗滞,发易脱落,皮肤发干,或有出血倾向、吐血,女性多见痛经、闭经、或经血中多有血块,或经色紫黑有块。" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="特点"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:textSize="8sp"
|
||||
tools:text="瘀血质的人,血行不畅,临床常呈现肤色晦暗、色素沉着、瘀斑、性格抑郁、健忘,舌质紫黯或有瘀点、舌下络脉紫黯或增粗,脉涩。易患痛证、血证、症瘕等。" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="心理特征"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:textSize="8sp"
|
||||
tools:text="性情急躁,心情易烦,健忘。" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="注意事项"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:textSize="8sp"
|
||||
tools:text="瘀血质气机失调,血行不畅,应慎食雪糕、冰淇淋、冰冻饮料等寒凉之品,以免影响气血运行。保持心情舒畅,是淤血质调理的重要环节" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -18,16 +18,13 @@
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<FrameLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@@ -196,6 +193,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/information_layout"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
@@ -230,6 +228,15 @@
|
||||
android:layout_marginEnd="10dp"
|
||||
android:alpha="0.2"
|
||||
android:src="@drawable/icon_black" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/add_information_button"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@drawable/ic_data_add" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
67
app/src/main/res/layout/add_item.xml
Normal file
67
app/src/main/res/layout/add_item.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView 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="300dp"
|
||||
android:layout_height="450dp"
|
||||
android:layout_gravity="center"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:layout_margin="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="17sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/choose_first"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="测试"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone">
|
||||
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
android:id="@+id/choose_second"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="测试"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone">
|
||||
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
android:id="@+id/choose_third"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="测试"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone">
|
||||
|
||||
</Button>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_height="130dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/body_bg" />
|
||||
|
||||
|
||||
12
app/src/main/res/layout/normal_recommend_fragment_layout.xml
Normal file
12
app/src/main/res/layout/normal_recommend_fragment_layout.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/colorControlNormal">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="page3" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
8
app/src/main/res/layout/recommend_head.xml
Normal file
8
app/src/main/res/layout/recommend_head.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="135dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/recommend_bg">
|
||||
|
||||
</ImageView>
|
||||
43
app/src/main/res/layout/recommend_item_big.xml
Normal file
43
app/src/main/res/layout/recommend_item_big.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView 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="@dimen/recommend_item_big_height"
|
||||
android:layout_margin="@dimen/recommend_margin"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recommend_item_imageview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="3"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/food_test" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recommend_item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="红烧肉" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
56
app/src/main/res/layout/recommend_item_detail.xml
Normal file
56
app/src/main/res/layout/recommend_item_detail.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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="@dimen/recommend_item_default_hight"
|
||||
android:layout_margin="@dimen/recommend_margin"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="@dimen/recommend_item_default_hight"
|
||||
android:layout_height="@dimen/recommend_item_default_hight"
|
||||
android:layout_marginRight="5dp"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recommend_item_imageview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/food_test" />
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="15dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingTop="15dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recommend_item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="红烧肉" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recommend_item_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="10sp"
|
||||
tools:text="红烧肉是最美味的菜了!超级好吃!" />
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
44
app/src/main/res/layout/recommend_item_middle.xml
Normal file
44
app/src/main/res/layout/recommend_item_middle.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView 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="160dp"
|
||||
android:layout_height="@dimen/recommend_item_default_hight"
|
||||
android:layout_margin="@dimen/recommend_margin"
|
||||
android:layout_weight="1"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recommend_item_imageview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="3"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@drawable/food_test" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recommend_item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="红烧肉" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
@@ -3,6 +3,6 @@
|
||||
<string-array name="sections">
|
||||
<item>一周定制</item>
|
||||
<item>今日信息</item>
|
||||
<item>page3</item>
|
||||
<item>推荐菜谱</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -12,7 +12,7 @@
|
||||
<dimen name="bt_height">36dp</dimen>
|
||||
|
||||
|
||||
<dimen name="infor_layout_height">120dp</dimen>
|
||||
<dimen name="infor_layout_height">110dp</dimen>
|
||||
<dimen name="infor_image_height">35dp</dimen>
|
||||
<dimen name="infor_chart_height">90dp</dimen>
|
||||
<dimen name="infor_chart_width">200dp</dimen>
|
||||
@@ -20,5 +20,9 @@
|
||||
|
||||
<dimen name="icon_size">20dp</dimen>
|
||||
|
||||
<dimen name="recommend_item_default_hight">100dp</dimen>
|
||||
<dimen name="recommend_item_big_height">180dp</dimen>
|
||||
<dimen name="recommend_margin">5dp</dimen>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user