@ -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 @@
|
||||
/build
|
||||
@ -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,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,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,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>
|
||||
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 535 B |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 306 B |
|
After Width: | Height: | Size: 445 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 58 KiB |