master
PO3FIXWLV 3 years ago
parent b120aba5f8
commit f200b2d584

@ -0,0 +1,10 @@
*.iml
.gradle
/local.properties
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild

@ -0,0 +1,113 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -0,0 +1,7 @@
# Healthy_diet
#### 介绍
健康饮食项目配套代码
#### 软件架构
数据都显示在代码当中,没用到数据库

@ -0,0 +1,29 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.animee.health"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:support-v4:27.1.0'
}

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

@ -0,0 +1,26 @@
package com.animee.health;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.animee.health", appContext.getPackageName());
}
}

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.animee.health">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_icon"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".guide.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeMenuActivity"></activity>
<activity android:name=".food_list.InfoListActivity" />
<activity android:name=".food_grid.FoodGridActivity" />
<activity android:name=".food_grid.FoodDescActivity" />
<activity android:name=".AboutActivity" />
<activity android:name=".guide.GuideActivity"></activity>
</application>
</manifest>

@ -0,0 +1,105 @@
package com.animee.health;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
public class AboutActivity extends AppCompatActivity implements View.OnClickListener{
ViewPager aboutVp;
TextView shareTv;
LinearLayout pointLayout;
List<View>viewList; //ViewPager的数据源
int[]picIds = {R.mipmap.ab1,R.mipmap.ab2,R.mipmap.ab3,R.mipmap.ab4,R.mipmap.ab5};
private AboutAdapter adapter;
List<ImageView>pointList; //存放显示器小点点的集合
@SuppressLint("HandlerLeak")
Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
if (msg.what == 1) {
// 接收到消息之后需要使ViewPager页面向下滑动一页
int currentItem = aboutVp.getCurrentItem();
aboutVp.setCurrentItem(currentItem+1);
handler.sendEmptyMessageDelayed(1,5000);
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
aboutVp = findViewById(R.id.about_vp);
shareTv = findViewById(R.id.about_tv_share);
pointLayout = findViewById(R.id.about_layout_point);
shareTv.setOnClickListener(this);
viewList = new ArrayList<>();
pointList = new ArrayList<>();
// 初始化ViewPager的页面信息
for (int i = 0; i < picIds.length; i++) {
View view = LayoutInflater.from(this).inflate(R.layout.item_aboutvp,null);
ImageView iv = view.findViewById(R.id.item_aboutvp_iv);
iv.setImageResource(picIds[i]);
viewList.add(view);
// 创建指示器内容
ImageView pointIv = new ImageView(this);
// 在代码中设置控件的宽高和外边距等属性
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(0,0,20,0);
// 将布局参数设置给ImageView
pointIv.setLayoutParams(lp);
pointIv.setImageResource(R.mipmap.a2);
pointList.add(pointIv); //添加到集合当中便于统一管理
pointLayout.addView(pointIv); //添加到布局当中显示出来
}
pointList.get(0).setImageResource(R.mipmap.a3); //设置第一个小圆点为选中状态
// 创建适配器对象
adapter = new AboutAdapter(viewList);
// 设置适配器
aboutVp.setAdapter(adapter);
// 发送切换页面消息
handler.sendEmptyMessageDelayed(1,5000);
// 设置ViewPager页面监听器
setVPListener();
}
private void setVPListener() {
/* 设置ViewPager的监听器*/
aboutVp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
for (int i = 0; i < pointList.size(); i++) {
pointList.get(i).setImageResource(R.mipmap.a2);
}
pointList.get(position%pointList.size()).setImageResource(R.mipmap.a3);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@Override
public void onClick(View v) {
// 调用系统自带的分享功能
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
String msg= "健康饮食非常的重要了解饮食各种营养素和热量摄入正确的食物让你变得更健康想要了解更多么快来下载健康饮食app吧~~";
intent.putExtra(Intent.EXTRA_TEXT,msg);
startActivity(Intent.createChooser(intent,"健康饮食分享"));
}
}

@ -0,0 +1,40 @@
package com.animee.health;
import android.support.annotation.NonNull;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
public class AboutAdapter extends PagerAdapter{
List<View>viewList;
public AboutAdapter(List<View> viewList) {
this.viewList = viewList;
}
@Override
public int getCount() {
return Integer.MAX_VALUE;
}
@Override
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
return view == object;
}
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
View view = viewList.get(position%viewList.size());
container.addView(view);
return view;
}
@Override
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
View view = viewList.get(position%viewList.size());
container.removeView(view);
}
}

@ -0,0 +1,34 @@
package com.animee.health;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import com.animee.health.food_grid.FoodGridActivity;
import com.animee.health.food_list.InfoListActivity;
public class HomeMenuActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_menu);
}
public void onClick(View view) {
Intent intent = new Intent();
switch (view.getId()) {
case R.id.home_btn1:
intent.setClass(HomeMenuActivity.this,InfoListActivity.class);
break;
case R.id.home_btn2:
intent.setClass(HomeMenuActivity.this, FoodGridActivity.class);
break;
case R.id.home_btn3:
intent.setClass(HomeMenuActivity.this, AboutActivity.class);
break;
}
startActivity(intent);
}
}

@ -0,0 +1,52 @@
package com.animee.health.bean;
import java.io.Serializable;
public class FoodBean implements Serializable{
private String title;
private String notmatch;
private String desc;
private int picId;
public FoodBean(String title, String notmatch, String desc, int picId) {
this.title = title;
this.notmatch = notmatch;
this.desc = desc;
this.picId = picId;
}
public FoodBean() {
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNotmatch() {
return notmatch;
}
public void setNotmatch(String notmatch) {
this.notmatch = notmatch;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getPicId() {
return picId;
}
public void setPicId(int picId) {
this.picId = picId;
}
}

@ -0,0 +1,82 @@
package com.animee.health.bean;
import com.animee.health.R;
import com.animee.health.bean.FoodBean;
import java.util.ArrayList;
import java.util.List;
public class FoodUtils {
private static final String[] food = { "猪肉", "猪肝", "猪血", "羊肉", "牛肉", "牛肝", "鹅肉", "兔肉", "狗肉",
"鸭肉", "鸡肉", "驴肉", "鸡蛋", "鲤鱼", "黄鱼", "虾", "虾皮", "螃蟹", "蛤", "鳖肉",
"田螺", "大蒜", "葱", "萝卜", "芹菜", "韭菜", "菠菜", "莴笋", "竹笋", "西红柿", "洋葱",
"醋", "茶", "豆浆", "红糖", "蜂蜜", "牛奶", "白酒", "啤酒" };
private static final String[] food1 = { "黄莲", "荞麦 雀肉 豆芽", "何首乌 地黄 黄豆 海带", "醋 红豆 半夏 南瓜",
"橄榄 板粟 韭菜 ", "鲇鱼 鳗鱼 柿子", "狗肉 鲤鱼 柑橘", "鲤鱼 绿豆", "鳖", "鲤鱼", "金针菇",
"豆浆 兔肉", "甘草 麦冬", "荞麦面 ", "富含维生素C的食物", "红枣 黄豆",
"梨 柿子 茄子 花生仁 石榴 香瓜 芹菜 蜂蜜 西红柿", "芹菜 ", "鸭肉", "香瓜 木耳 牛肉 蚕豆 玉米",
"地黄 何首乌 白术", "枣", "橘子 木耳", "黄瓜 蚬、蛤、蟹", "牛肉", "豆腐 鳝鱼 黄瓜", "蜂蜜",
"糖浆", "白酒", "蜂蜜", "胡萝卜", "酒", "蜂蜜", "竹笋", "皮蛋", "豆腐 韭菜",
"钙片果汁 药物 韭菜 柠檬", "胡萝卜 核桃 啤酒 红薯", "海鲜" };
private static final int[] resId = { R.mipmap.pork, R.mipmap.pigliver, R.mipmap.pigblood,
R.mipmap.lamb, R.mipmap.beef, R.mipmap.beefliver,
R.mipmap.goose, R.mipmap.rabbit, R.mipmap.dog,
R.mipmap.duck, R.mipmap.chicken, R.mipmap.donkey,
R.mipmap.egg, R.mipmap.carp, R.mipmap.yellowfish,
R.mipmap.shrimp, R.mipmap.shrimp2, R.mipmap.crab,
R.mipmap.clam, R.mipmap.turtle, R.mipmap.riversnail,
R.mipmap.garlic, R.mipmap.onion, R.mipmap.radish,
R.mipmap.celery, R.mipmap.leek, R.mipmap.spinach,
R.mipmap.lettuce, R.mipmap.bamboo, R.mipmap.tomato,
R.mipmap.foreignonion, R.mipmap.vinegar, R.mipmap.tea,
R.mipmap.beanmilk, R.mipmap.brownsuger, R.mipmap.honey,
R.mipmap.milk, R.mipmap.whitespirit, R.mipmap.beer };
private static final String [] foodjianjie={"猪肉是目前人们餐桌上最常见的肉类食物之一,猪瘦肉中富含铁,容易被人体吸收,能预防贫血。猪肉味甘咸,性平,有补虚、滋阴、养血、润燥的功效。"
,"猪肝味甘、苦,性温,归肝经。猪肝富含多种营养素,是预防缺血性贫血的首选食品,猪肝中的铁容易被人体吸收,是理想的补肝、明目、养血的食品。"
,"猪血味甘、苦性温有解毒清肠、补血美容的功效。猪血富含维生素B2、维生素C、蛋白质、铁、磷、钙、尼克酸等营养成分。",
"羊肉味甘、性温,具有补虚劳,祛寒冷,温补气血;益肾气,补形衰,开胃健力的功效。用于气血不足、腹部冷痛、体虚怕冷、腰膝酸痛、面黄肌瘦、血气两亏等一切虚状均有补益效果,最适宜冬季食用。",
"牛肉有补中益气,滋养脾胃,强健筋骨,化痰息风,止渴止涎之功效。牛肉富含蛋白质,而脂肪少,氨基酸组成比猪肉更接近人体需要,能提高机体抗病能力。",
"养血,补肝,明目。牛肝中铁质丰富,是补血食品中最常用的食物。"
,"鹅肉含有人体生长发育所必需的各种氨基酸,其组成接近人体所需氨基酸的比例,从生物学价值上来看,鹅肉是是理想的高蛋白、低脂肪、低胆固醇的营养健康食品,其亚麻酸含量超过其它肉类。鹅肉性平、味甘,具有益气补虚,和胃止渴的功效。",
"兔肉质地细嫩,味道鲜美,营养丰富,与猪牛、羊肉相比较,兔肉营养成分独特,具有高铁、高钙、高磷脂和低脂肪、低胆固醇等特点,并且具有很高的消化率(可达85%),食后极易被消化吸收。",
"狗肉温补脾胃、补肾助阳、壮力气、补血脉。狗肉不仅蛋白质含量高,而且蛋白质质量极佳,尤以球蛋白比例大,对增强机体抗病力和细胞活力及器官功能有明显作用。",
"富含蛋白质、脂肪、铁、钾、糖等多种营养成分。其饱和脂肪酸的含量比猪肉、牛肉、羊肉少得多,脂肪酸熔点低,易于消化。所含胆固醇比鱼还要低一些。《本草纲目》记载:鸭肉主大补虚劳,最消毒热,利小便,除水肿,消胀满,利脏腑,退疮肿,定惊痫。",
"鸡肉含丰富蛋白质,种类多,其含量比猪、牛、羊肉都高,而脂肪含量比其它肉类低,且多为不饱和脂肪酸,营养价值高,消化率高,很容易被人体吸收利用,有增强体力、强壮身体的作用。",
"驴肉富含蛋白质,而且含有动物胶、骨胶原、钙、硫等成分,其中含有的高级不饱和脂肪酸,尤其是亚油酸、亚麻酸,对动脉硬化、冠心病、高血压有着良好的保健作用。中医认为:驴肉性味甘凉,有补气养血、滋阴壮阳、安神去烦功效。",
"鸡蛋被认为是营养丰富的食品,含有蛋白质、脂肪、卵黄素、卵磷脂、维生素和铁、钙、钾等人体所需要的矿物质。鸡蛋味甘、性平,具有养心安神、补血、滋阴润燥的功效。",
"鲤鱼的蛋白质不但含量高而且质量也佳人体消化吸收率可达96%并能供给人体必需的氨基酸、矿物质、维生素A和维生素D。鲤鱼味甘、性平具有健脾开胃、消水肿、利小便的作用。",
"黄鱼含有丰富的蛋白质、微量元素和维生素,对人体有很好的补益作用。中医认为,黄鱼有和胃止血、益肾补虚、健脾开胃、安神止痢、益气填精之功效,对贫血、失眠、头晕、食欲不振及妇女产后体虚有良好疗效。",
"虾营养极为丰富含蛋白质是鱼、蛋、奶的几倍到几十倍还含有丰富的钾、碘、镁、磷等矿物质及维生素A、氨茶碱等成分。",
"虾皮中含有丰富的蛋白质和矿物质,尤其是钙的含量极为丰富,是缺钙者补钙的较佳途径之一。",
"螃蟹含有丰富的蛋白质及钙、磷、铁等微量元素,对身体有很好的滋补作用。中医学认为螃蟹性寒、味咸,有清热、散血结、续断伤、理经脉和滋阴等功用;其壳可清热解毒、破淤清积止痛。",
"肉味鲜美、营养丰富,蛋白质含量高,氨基酸的种类组成及配比合理; 脂肪含量低,不饱和脂肪酸较高,易被人体消化吸收。蛤味咸、性寒,有滋阴、利水、化痰、软坚的功效。",
"鳖肉偏于滋阴补肾、补虚。是久病体弱,消瘦无力等人群的食疗佳品。鳖味咸、性平,具有滋阴凉血、平肝益气、散结软坚、消淤等功效。",
"含蛋白质、脂肪、碳水化合物、钙、磷、铁、硫胺素、核黄素、尼克酸、维生素。田螺味咸、性寒,有清热利水、除湿解读的功效。",
"大蒜含有丰富的营养成分,尤其是具有独特生物活性的蒜素等含硫化合物及硒蛋白等功能成分,这些物质具有显著的医用和食用价值。中医理论认为,大蒜生者辛热、熟者甘温,可除寒湿、怯阴邪、下气暖中、消谷化积、破恶血、攻冷积。",
"葱的主要营养成分是蛋白质、糖类、维生素A原(主要在绿色葱叶中含有)、食物纤维以及磷、铁、镁等矿物质等。中医记载:葱能发汗解表,散寒通阳,解毒散凝。主治风寒感冒轻症,痈肿疮毒,痢疾脉微,寒凝腹痛,小便不利等病症。",
"萝卜含有丰富的碳水化合物、纤维素、维生素C及钙、磷、钾、铁等矿物质营养丰富萝卜还有促进新陈代谢增进食欲的作用对于治疗消化不良、胃脘胀满、咳嗽多痰、胸闷气喘、伤风感冒有一定的疗效。",
"芹菜含有蛋白质、脂肪、碳水化合物、纤维素、维生素、矿物质等营养成分。其中维生素B、P的含量较多。矿物质元素钙、磷、铁的含量更是高于一般绿色蔬菜。",
"韭菜性温,味辛,具有补肾起阳作用,且含有大量维生素和粗纤维,能增进胃肠蠕动,治疗便秘。",
"菠菜含水量高90%93%而热量低是镁、铁、钾和维生素A的优质来源也是钙和维生素C的上等来源。所含的磷、锌、叶酸和维生素B6也较为丰富。菠菜中含有的维生素C能够提高铁的吸收率并促进铁与造血的叶酸共同作用有效地预防贫血症。",
"莴苣含蛋白质、脂粉、碳水化合物、钙、磷、铁、胡萝卜素、及维生素B、维生素C、尤其含烟酸较多。莴苣味道清新且略带苦味可刺激消化酶分泌增进食欲。其乳状浆液可增强胃液、消化腺的分泌和胆汁的分泌从而促进消化。",
"具有滋阴凉血、和中润肠、清热化痰、解渴除烦、清热益气、利隔爽胃、利尿通便、解毒透疹、养肝明目、消食的功效,还可开胃健脾,宽肠利膈,通肠排便,开膈豁痰,消油腻,解酒毒。",
"番茄富含维生素C其含有的番茄红素有利尿和抑制细菌生长的作用是优良的抗氧化剂多吃番茄具有抗衰老作用使皮肤保持白皙。西红柿味酸微甘、性平具有生津止渴健胃消食凉血平肝清热解毒降低血压之功效。",
"洋葱所含的微量元素硒是一种很强的抗氧化剂,能清除体内的自由基,增强细胞的活力和代谢能力,具有抗衰老的功效。",
"醋可以开胃,促进唾液和胃液的分泌,帮助消化吸收,使食欲旺盛,消食化积。醋还有很好的抑菌和杀菌作用,能有效预防肠道疾病、流行性感冒和呼吸疾病。",
"茶叶内含化合物500种左右有些是人体必需的营养成分。如维生素类、蛋白质、氨基酸、类脂类、糖类及矿物质元素等对人体有较高营养价值。有些是对人体有保健和药用价值的成分如茶多酚、咖啡碱、脂多糖等常喝茶有利于人体健康。",
"豆浆含有丰富的植物蛋白磷脂维生素B1、B2烟酸和铁、钙等矿物质尤其是钙的含量虽不及豆腐高但比其他任何乳类都丰富。豆浆是防治高血脂、高血压、动脉硬化等疾病的理想食品。",
"红糖中所含有的葡萄糖、果糖等多种单糖和多糖类能量物质,为人体提供能量。",
"蜂蜜含有70%以上的转化糖,能够被人体肠壁细胞直接吸收利用,没有必要经人体消化,经常服用蜂蜜,能帮助消化。",
"牛奶的营养成分很高牛奶中的矿物质种类也非常丰富除了我们所熟知的钙以外磷、铁、锌、铜、锰、钼的含量都很多。牛奶是人体钙的最佳来源而且钙磷比例非常适当利于钙的吸收。牛奶中含组成人体蛋白质的氨基酸有20种其中有8种是人体本身不能合成的为必需氨基酸牛奶是人类最理想的天然食品。",
"白酒主要由水乙醇和少量微量元素组成。夜晚服用少量的白酒,可平缓的促进血液循环,起到催眠作用。饮少量白酒可刺激胃液分泌与唾液分泌,因而起到健胃和止疼痛、利小便及驱虫的作用。白酒味苦、甘、辛,性温,有毒,入心、肝、肺、胃经。",
"啤酒营养丰富,其中含有丰富的氨基酸,是原料大麦含有的蛋白质经过酶的作用分解而产生的。且啤酒中还含有多种维生素。适量饮啤酒有强心、利尿、健胃的功效。"};
public static List<FoodBean> getAllFoodList(){
List<FoodBean>list = new ArrayList<>();
for (int i = 0; i < food.length; i++) {
FoodBean bean = new FoodBean(food[i],food1[i],foodjianjie[i],resId[i]);
list.add(bean);
}
return list;
}
}

@ -0,0 +1,46 @@
package com.animee.health.food_grid;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.animee.health.R;
import com.animee.health.bean.FoodBean;
public class FoodDescActivity extends AppCompatActivity {
TextView titleTv1,titleTv2,descTv,notTv;
ImageView backIv,bigPicIv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_food_desc);
initView();
// 接受上一级页面传来的数据
Intent intent = getIntent();
FoodBean foodBean = (FoodBean) intent.getSerializableExtra("food");
// 设置显示控件
titleTv1.setText(foodBean.getTitle());
titleTv2.setText(foodBean.getTitle());
descTv.setText(foodBean.getDesc());
notTv.setText(foodBean.getNotmatch());
bigPicIv.setImageResource(foodBean.getPicId());
}
private void initView() {
titleTv1 = findViewById(R.id.fooddesc_tv_title1);
titleTv2 = findViewById(R.id.fooddesc_tv_title2);
descTv = findViewById(R.id.fooddesc_tv_desc);
notTv = findViewById(R.id.fooddesc_tv_not);
backIv = findViewById(R.id.fooddesc_iv_back);
bigPicIv = findViewById(R.id.fooddesc_iv_bigpic);
backIv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish(); //销毁当前的activity
}
});
}
}

@ -0,0 +1,47 @@
package com.animee.health.food_grid;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import com.animee.health.R;
import com.animee.health.bean.FoodBean;
import com.animee.health.bean.FoodUtils;
import com.animee.health.food_list.InfoListActivity;
import java.util.List;
public class FoodGridActivity extends AppCompatActivity {
GridView gv;
List<FoodBean>mDatas;
private FoodGridAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_food_grid);
gv = findViewById(R.id.food_grid_gv);
// 数据源
mDatas = FoodUtils.getAllFoodList();
// 创建适配器对象
adapter = new FoodGridAdapter(this, mDatas);
// 设置适配器
gv.setAdapter(adapter);
setListener();
}
private void setListener() {
gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
FoodBean foodBean = mDatas.get(position);
Intent intent = new Intent(FoodGridActivity.this, FoodDescActivity.class);
intent.putExtra("food",foodBean);
startActivity(intent);
}
});
}
}

@ -0,0 +1,66 @@
package com.animee.health.food_grid;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.animee.health.R;
import com.animee.health.bean.FoodBean;
import java.util.List;
public class FoodGridAdapter extends BaseAdapter{
Context context;
List<FoodBean>mDatas;
public FoodGridAdapter(Context context, List<FoodBean> mDatas) {
this.context = context;
this.mDatas = mDatas;
}
@Override
public int getCount() {
return mDatas.size();
}
@Override
public Object getItem(int position) {
return mDatas.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// 1.声明ViewHolder
ViewHolder holder = null;
if (convertView == null) { //2.判断是否有复用的view如果没有就创建
convertView = LayoutInflater.from(context).inflate(R.layout.item_foodgrid,null);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
}
// 获取指定位置的数据
FoodBean foodBean = mDatas.get(position);
holder.iv.setImageResource(foodBean.getPicId());
holder.tv.setText(foodBean.getTitle());
return convertView;
}
class ViewHolder{
ImageView iv;
TextView tv;
public ViewHolder(View view){
iv = view.findViewById(R.id.item_grid_iv);
tv = view.findViewById(R.id.item_grid_tv);
}
}
}

@ -0,0 +1,100 @@
package com.animee.health.food_list;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;
import com.animee.health.R;
import com.animee.health.bean.FoodBean;
import com.animee.health.bean.FoodUtils;
import com.animee.health.food_grid.FoodDescActivity;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.List;
public class InfoListActivity extends AppCompatActivity implements View.OnClickListener{
EditText searchEt;
ImageView searchIv,flushIv;
ListView showLv;
// ListView内部数据源
List<FoodBean>mDatas;
List<FoodBean>allFoodList;
private InfoListAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_info_list);
// 查找控件
initView();
// 2.找到ListView对应的数据源
mDatas = new ArrayList<>();
allFoodList = FoodUtils.getAllFoodList();
mDatas.addAll(allFoodList);
// 3.创建适配器 BaseAdapter的子类
adapter = new InfoListAdapter(this, mDatas);
showLv.setAdapter(adapter); //4.设置适配器
// 设置单向点击监听功能
setListener();
}
private void setListener() {
showLv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
FoodBean foodBean = mDatas.get(position);
Intent intent = new Intent(InfoListActivity.this, FoodDescActivity.class);
intent.putExtra("food",foodBean);
startActivity(intent);
}
});
}
private void initView() {
searchEt = findViewById(R.id.info_et_search);
searchIv = findViewById(R.id.info_iv_search);
flushIv = findViewById(R.id.info_iv_flush);
showLv = findViewById(R.id.infolist_lv);
searchIv.setOnClickListener(this); //添加点击事件的监听器
flushIv.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.info_iv_flush: //刷新点击
searchEt.setText("");
mDatas.clear();
mDatas.addAll(allFoodList);
adapter.notifyDataSetChanged();
break;
case R.id.info_iv_search: //搜索点击
// 1.获取输入内容,判断不为空
String msg = searchEt.getText().toString().trim(); //获取输入信息
if (TextUtils.isEmpty(msg)) {
Toast.makeText(this,"输入内容不能为空!",Toast.LENGTH_SHORT).show();
return;
}
// 判断所有食物列表的标题是否包含输入内容,如果包含,就添加到小集合中
List<FoodBean>list = new ArrayList<>();
for (int i = 0; i < allFoodList.size(); i++) {
String title = allFoodList.get(i).getTitle();
if (title.contains(msg)) {
list.add(allFoodList.get(i));
}
}
mDatas.clear(); // 清空ListView的适配器数据源内容
mDatas.addAll(list); // 添加新的数据到数据源中
adapter.notifyDataSetChanged(); // 提示适配器更新
break;
}
}
}

@ -0,0 +1,64 @@
package com.animee.health.food_list;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.animee.health.R;
import com.animee.health.bean.FoodBean;
import java.util.List;
public class InfoListAdapter extends BaseAdapter{
Context context;
List<FoodBean>mDatas;
public InfoListAdapter(Context context, List<FoodBean> mDatas) {
this.context = context;
this.mDatas = mDatas;
}
// 决定了ListView列表展示的行数
@Override
public int getCount() {
return mDatas.size();
}
//返回指定位置对应的数据
@Override
public Object getItem(int position) {
return mDatas.get(position);
}
// 返回指定位置所对应的id
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.item_infolist_lv,null); //将布局转换成view对象的方法
holder=new ViewHolder(convertView);
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
}
// 加载控件显示的内容
// 获取集合指定位置的数据
FoodBean foodBean = mDatas.get(position);
holder.titleTv.setText(foodBean.getTitle());
holder.notTv.setText("不可匹配:"+foodBean.getNotmatch());
holder.iv.setImageResource(foodBean.getPicId());
return convertView;
}
class ViewHolder{
ImageView iv;
TextView titleTv,notTv;
public ViewHolder(View view){
iv = view.findViewById(R.id.item_info_iv);
titleTv = view.findViewById(R.id.item_info_tv_title);
notTv = view.findViewById(R.id.item_info_tv_notmatch);
}
}
}

@ -0,0 +1,93 @@
package com.animee.health.guide;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.animee.health.HomeMenuActivity;
import com.animee.health.R;
import java.util.ArrayList;
import java.util.List;
public class GuideActivity extends AppCompatActivity implements View.OnClickListener{
ViewPager guideVp;
TextView tv1,tv2,tv3;
Button guideBtn;
List<View>viewList; //ViewPager的数据源
List<TextView>numList; //表示页码的集合
int resId[] = {R.mipmap.pic1,R.mipmap.pic2,R.mipmap.pic3}; //所显示的图片资源数组
private GuideAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_guide);
guideVp = findViewById(R.id.guide_vp);
tv1 = findViewById(R.id.guide_tv1);
tv2 = findViewById(R.id.guide_tv2);
tv3 = findViewById(R.id.guide_tv3);
guideBtn = findViewById(R.id.guide_btn);
guideBtn.setOnClickListener(this); //设置按钮的监听器
viewList = new ArrayList<>();
numList = new ArrayList<>();
numList.add(tv1);
numList.add(tv2);
numList.add(tv3);
// 初始化ViewPager的页面资源
for (int i = 0; i < resId.length; i++) {
View view = LayoutInflater.from(this).inflate(R.layout.item_guide1,null);
view.setBackgroundResource(resId[i]);
viewList.add(view);
}
// 创建适配器对象
adapter = new GuideAdapter(viewList);
// 设置适配器
guideVp.setAdapter(adapter);
tv1.setTextColor(Color.RED);
// 设置ViewPager的监听
setVPListener();
}
private void setVPListener() {
guideVp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
for (int i = 0; i < numList.size(); i++) {
numList.get(i).setTextColor(Color.WHITE);
}
numList.get(position).setTextColor(Color.RED);
// 在进入到第三个页面时,立即进入的按钮就显示出来,否则不显示
if (position == 2) {
guideBtn.setVisibility(View.VISIBLE);
}else {
guideBtn.setVisibility(View.INVISIBLE);
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.guide_btn:
Intent intent = new Intent(GuideActivity.this, HomeMenuActivity.class);
startActivity(intent);
finish();
break;
}
}
}

@ -0,0 +1,40 @@
package com.animee.health.guide;
import android.support.annotation.NonNull;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
public class GuideAdapter extends PagerAdapter{
List<View>viewList;
public GuideAdapter(List<View> viewList) {
this.viewList = viewList;
}
@Override
public int getCount() {
return viewList.size();
}
@Override
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
return view == object;
}
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
View view = viewList.get(position);
container.addView(view);
return view;
}
@Override
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
View view = viewList.get(position);
container.removeView(view);
}
}

@ -0,0 +1,57 @@
package com.animee.health.guide;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import com.animee.health.HomeMenuActivity;
import com.animee.health.R;
public class MainActivity extends AppCompatActivity {
TextView tv;
int time = 5;
SharedPreferences preferences; //存储键值对数据
private SharedPreferences.Editor editor;
@SuppressLint("HandlerLeak")
Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
if (msg.what==1) {
time--;
if (time ==0) {
// 跳转页面
Intent intent = new Intent();
boolean isfirst = preferences.getBoolean("isfirst", true);
if (isfirst) {
intent.setClass(MainActivity.this,GuideActivity.class);
editor.putBoolean("isfirst",false); //写入不是第一次进入的纪录
editor.commit(); // 提交本次修改纪录
}else {
intent.setClass(MainActivity.this,HomeMenuActivity.class);
}
startActivity(intent);
finish();
}else {
tv.setText(time+"");
handler.sendEmptyMessageDelayed(1,1000);
}
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv = findViewById(R.id.main_tv);
preferences = getSharedPreferences("health_pref",MODE_PRIVATE);
editor = preferences.edit(); //写入数据的对象
handler.sendEmptyMessageDelayed(1,1000);
}
}

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp"></corners>
<stroke android:width="2dp" android:color="@color/white"></stroke>
</shape>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="20dp"/>
<stroke android:width="2dp" android:color="#B0E0E6"/>
<solid android:color="#FCE6C9"/>
</shape>

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".AboutActivity">
<android.support.v4.view.ViewPager
android:id="@+id/about_vp"
android:layout_width="match_parent"
android:layout_height="230dp">
</android.support.v4.view.ViewPager>
<LinearLayout
android:id="@+id/about_layout_point"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
</LinearLayout>
<TextView
android:id="@+id/about_tv_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="当前版本: v1.0"
android:drawableLeft="@mipmap/icon_door"
android:gravity="center_vertical"
android:textSize="18sp"
android:textStyle="bold"
android:drawablePadding="20dp"
android:padding="10dp"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/>
<TextView
android:id="@+id/about_tv_tel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="联系电话: 0731-8888888"
android:gravity="center_vertical"
android:textSize="18sp"
android:textStyle="bold"
android:padding="10dp"
android:drawableLeft="@mipmap/icon_phone"
android:drawablePadding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/>
<TextView
android:id="@+id/about_tv_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="地址: 湖南省常德市武陵区湖南文理学院"
android:gravity="center_vertical"
android:textSize="18sp"
android:textStyle="bold"
android:padding="10dp"
android:drawableLeft="@mipmap/icon_world"
android:drawablePadding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000000"/>
<TextView
android:id="@+id/about_tv_share"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="分享软件"
android:gravity="center_vertical"
android:textSize="18sp"
android:textStyle="bold"
android:padding="10dp"
android:drawableLeft="@mipmap/icon_flash"
android:drawablePadding="20dp"/>
</LinearLayout>

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/fooddesc_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:background="@mipmap/search_background"
android:layout_width="match_parent"
android:layout_height="60dp">
<ImageView
android:id="@+id/fooddesc_iv_back"
android:layout_width="80dp"
android:layout_height="40dp"
android:src="@mipmap/btn_back"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/fooddesc_tv_title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="牛肉"
android:textSize="22sp"
android:textStyle="bold"
android:textColor="@color/white"/>
</RelativeLayout>
<ImageView
android:id="@+id/fooddesc_iv_bigpic"
android:layout_width="match_parent"
android:layout_height="280dp"
android:src="@mipmap/beef"
android:layout_margin="20sp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/fooddesc_tv_title2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="牛肉"
android:textColor="@color/colorPrimary"
android:textStyle="bold"
android:layout_gravity="center"
android:textSize="20sp"/>
<TextView
android:id="@+id/fooddesc_tv_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1111"
android:layout_margin="20dp"
android:textSize="16sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@mipmap/food_info_middle_background"
android:text="不宜同食的食物列表"
android:padding="10dp"
android:textSize="16sp"
android:textColor="@color/white"
android:textStyle="bold"/>
<TextView
android:id="@+id/fooddesc_tv_not"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="田螺,韭菜"
android:layout_marginLeft="20dp"
android:textSize="16sp"/>
</LinearLayout>
</ScrollView>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".food_grid.FoodGridActivity">
<RelativeLayout
android:id="@+id/food_grid_layout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@mipmap/search_background">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="健康饮食"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="@color/white"/>
</RelativeLayout>
<GridView
android:id="@+id/food_grid_gv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="2">
</GridView>
</LinearLayout>

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/guide_vp"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
<LinearLayout
android:id="@+id/guide_layout"
android:orientation="horizontal"
android:layout_marginBottom="20dp"
android:layout_alignParentBottom="true"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/guide_tv1"
android:text="1"
android:textStyle="bold|italic"
android:textSize="20sp"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/guide_tv2"
android:text="2"
android:textStyle="bold|italic"
android:textSize="20sp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_width="wrap_content"
android:textColor="@color/white"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/guide_tv3"
android:text="3"
android:textStyle="bold|italic"
android:textSize="20sp"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<Button
android:id="@+id/guide_btn"
android:layout_width="200dp"
android:layout_height="70dp"
android:layout_above="@id/guide_layout"
android:layout_centerHorizontal="true"
android:background="@mipmap/search_background"
android:text="立即进入"
android:textColor="@color/white"
android:textSize="30sp"
android:textStyle="bold"
android:layout_marginBottom="40dp"
android:visibility="invisible"/>
</RelativeLayout>

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeMenuActivity"
android:background="@mipmap/home_page"
android:orientation="vertical"
android:padding="20dp">
<Button
android:id="@+id/home_btn1"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@mipmap/btn_food_list"
android:layout_marginTop="180dp"
android:onClick="onClick"/>
<Button
android:id="@+id/home_btn2"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@mipmap/btn_food_nutriction"
android:layout_marginTop="40dp"
android:onClick="onClick"/>
<Button
android:id="@+id/home_btn3"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@mipmap/btn_food_about"
android:layout_marginTop="40dp"
android:onClick="onClick"/>
</LinearLayout>

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".food_list.InfoListActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:padding="10dp"
android:background="@mipmap/search_background">
<ImageView
android:id="@+id/info_iv_flush"
android:layout_width="wrap_content"
android:src="@mipmap/clear_btn"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/info_iv_search"
android:src="@mipmap/search_btn"
android:layout_toLeftOf="@id/info_iv_flush"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/info_et_search"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/info_iv_search"
android:paddingLeft="20dp"
android:background="@drawable/info_et_bg"
android:layout_centerVertical="true"
android:textColor="@color/white"/>
</RelativeLayout>
<ListView
android:id="@+id/infolist_lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/dividerColor"
android:dividerHeight="1dp"></ListView>
</LinearLayout>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/home">
<TextView
android:id="@+id/main_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="30dp"
android:text="5"
android:textSize="30sp"
android:textStyle="bold"
/>
</RelativeLayout>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="230dp">
<ImageView
android:id="@+id/item_aboutvp_iv"
android:layout_width="match_parent"
android:layout_height="230dp"
android:src="@mipmap/ab1"
android:scaleType="centerCrop"/>
</RelativeLayout>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp"
android:background="@drawable/item_gridbg">
<ImageView
android:id="@+id/item_grid_iv"
android:layout_width="match_parent"
android:layout_height="140dp"
android:src="@mipmap/beef"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/item_grid_tv"
android:text="牛肉"
android:textStyle="bold"
android:layout_below="@id/item_grid_iv"
android:layout_centerHorizontal="true"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="@mipmap/pic1">
</RelativeLayout>

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:padding="10dp">
<ImageView
android:id="@+id/item_info_iv"
android:layout_width="120dp"
android:layout_height="80dp"
android:src="@mipmap/beanmilk"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/item_info_tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/item_info_iv"
android:layout_marginTop="10dp"
android:text="牛奶"
android:layout_marginLeft="10dp"
android:textStyle="bold"
android:textSize="20sp"/>
<TextView
android:id="@+id/item_info_tv_notmatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/item_info_tv_title"
android:layout_alignBottom="@id/item_info_iv"
android:text="巧克力"/>
<ImageView
android:id="@+id/item_info_iv_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/expand"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save