master
86157 2 years ago
parent 22129f04ca
commit b3039df4db

@ -19,6 +19,7 @@
<activity android:name="com.yemamacake.cn.activity.UserActivity"></activity>
<activity android:name="com.yemamacake.cn.activity.RegisterActivity" />
<activity android:name="com.yemamacake.cn.activity.CategoryActivity"/>
<activity android:name=".activity.IndexActivity"/>
</application>
</manifest>

@ -0,0 +1,121 @@
package com.yemamacake.cn.activity;
import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.yemamacake.cn.fragment.IndexFragment;
import com.yemamacake.cn.fragment.PearsonFragment;
import com.yemamacake.cn.fragment.ProductFragment;
import com.yemamacake.cn.fragment.ShoppingCartFragment;
public class IndexActivity extends Activity implements View.OnClickListener {
private IndexFragment indexFragment;
private ProductFragment productFragment;
private ShoppingCartFragment shoppingCartFragment;
private PearsonFragment pearsonFragment;
private LinearLayout indexLine, productLine, shoppingCartLine, pearsonLine;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
initIndexFragment();
}
/**
*
*/
private void init() {
indexLine = findViewById(R.id.content_index);
indexLine.setOnClickListener(this);
productLine = findViewById(R.id.content_product);
productLine.setOnClickListener(this);
shoppingCartLine = findViewById(R.id.content_cart);
shoppingCartLine.setOnClickListener(this);
pearsonLine = findViewById(R.id.content_pearson);
pearsonLine.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.content_index:
initIndexFragment();
break;
case R.id.content_product:
initproductFragment();
break;
case R.id.content_cart:
initshoppingCartFragment();
break;
case R.id.content_pearson:
initpearsonFragment();
break;
}
}
/**
* Fragment
*/
private void initIndexFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (indexFragment == null) {
indexFragment = new IndexFragment();
}
transaction.replace(R.id.main_content, indexFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initproductFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (productFragment == null) {
productFragment = new ProductFragment();
}
transaction.replace(R.id.main_content, productFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initshoppingCartFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (shoppingCartFragment == null) {
shoppingCartFragment = new ShoppingCartFragment();
}
transaction.replace(R.id.main_content, shoppingCartFragment);
transaction.commit();
}
/**
* Fragment
*/
private void initpearsonFragment() {
//开启事务fragment的控制是由事务来实现的
FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (pearsonFragment == null) {
Intent intent = IndexActivity.this.getIntent();
Bundle bundle = intent.getExtras();
pearsonFragment = new PearsonFragment();
pearsonFragment.setArguments(bundle);
}
transaction.replace(R.id.main_content, pearsonFragment);
transaction.commit();
}
}

@ -110,7 +110,6 @@ public class RegisterActivity extends AppCompatActivity implements View.OnCli
*
*/
public void validateRegister() {
Intent intent = new Intent(RegisterActivity.this, UserActivity.class);
String username = usernameEdit.getText().toString();
String password = passwordEdit.getText().toString();
String surePassword = surePasswordEdit.getText().toString();
@ -128,6 +127,9 @@ public class RegisterActivity extends AppCompatActivity implements View.OnCli
MamacakeUser mamacakeUser = new MamacakeUser(RegisterActivity.this);
SQLiteDatabase sqLiteDatabase = mamacakeUser.getWritableDatabase();
insertData(sqLiteDatabase,bundle);
Intent intent = new Intent(RegisterActivity.this, IndexActivity.class);
intent.putExtras(bundle);
startActivity(intent);
intent.putExtras(bundle);
startActivity(intent);
} else {

@ -0,0 +1,69 @@
package com.yemamacake.cn.adapter;
import android.content.Context;
import android.util.Log;
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.yemamacake.cn.R;
import com.yemamacake.cn.entity.Product;
import java.util.List;
public class ProductAdapter extends BaseAdapter {
private List<Product> productList;
private LayoutInflater layoutInflater;
public ProductAdapter(Context context, List<Product> productList) {
this.productList = productList;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return productList.size();
}
@Override
public Object getItem(int position) {
return productList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
Log.i("aa", "getView: "+"aa");
convertView = layoutInflater.inflate(R.layout.category_detail_content, null);
viewHolder = new ViewHolder();
viewHolder.productImage = convertView.findViewById(R.id.category_product_image);
viewHolder.productName = convertView.findViewById(R.id.category_product_name);
viewHolder.productPrice = convertView.findViewById(R.id.category_product_price);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
Product product = productList.get(position);
Log.i("product", "getView: "+product.toString());
if (product != null) {
viewHolder.productImage.setBackgroundResource(product.getImageUrlId());
viewHolder.productName.setText(product.getProductName());
viewHolder.productPrice.setText(String.valueOf(product.getProductPrice()));
}
return convertView;
}
class ViewHolder {
ImageView productImage;
TextView productName, productPrice;
}
}

@ -0,0 +1,110 @@
package com.yemamacake.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
import com.yemamacake.cn.adapter.ProductAdapter;
import com.yemamacake.cn.entity.Product;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class IndexFragment extends Fragment implements View.OnClickListener {
private SearchView searchView;
private LinearLayout orangeLine, youziLine, juziLine, xiguaLine, liLine, appleLine, lemonLine, mangguoLine;
private GridView gridView;
private List<Product> productList;
private ProductAdapter productAdapter;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_index, container, false);
init(view);
return view;
}
/**
*
*/
private void init(View view) {
searchView = view.findViewById(R.id.searchView);
searchView.setOnClickListener(this);
orangeLine = view.findViewById(R.id.breakfast);
orangeLine.setOnClickListener(this);
youziLine = view.findViewById(R.id.);
youziLine.setOnClickListener(this);
juziLine = view.findViewById(R.id.western_cake);
juziLine.setOnClickListener(this);
xiguaLine = view.findViewById(R.id.chinese_tradional_cake);
xiguaLine.setOnClickListener(this);
liLine = view.findViewById(R.id.chinese_newcake);
liLine.setOnClickListener(this);
lemonLine = view.findViewById(R.id.breakbread);
lemonLine.setOnClickListener(this);
mangguoLine = view.findViewById(R.id.fruit_tea);
mangguoLine.setOnClickListener(this);
appleLine = view.findViewById(R.id.birthcake);
appleLine.setOnClickListener(this);
gridView = view.findViewById(R.id.index_famous_gridview);
initData();
productAdapter = new ProductAdapter(getActivity(), productList);
gridView.setAdapter(productAdapter);
}
@Override
public void onClick(View v) {
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
Product product = new Product();
product.setImageUrlId(R.drawable.strawberrybread);
product.setProductName("草莓蛋糕");
product.setProductPrice(new BigDecimal("29.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.sweet);
product1.setProductName("马卡龙");
product1.setProductPrice(new BigDecimal("39.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.hongdoubread);
product2.setProductName("红的吐司");
product2.setProductPrice(new BigDecimal("9.9"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.mochabread);
product3.setProductName("抹茶吐司");
product3.setProductPrice(new BigDecimal("12.9"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.rousongbread);
product4.setProductName("肉松小贝");
product4.setProductPrice(new BigDecimal("49.9"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.user_cake);
product5.setProductName("慕斯卷");
product5.setProductPrice(new BigDecimal("9.9"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
productList.add(product4);
productList.add(product5);
}
}

@ -0,0 +1,64 @@
package com.yemamacake.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
public class PearsonFragment extends Fragment implements View.OnClickListener {
private ImageView userIconImage;
private TextView usernameText, userSexText, userCityText;
private LinearLayout usernameLine, userSexline, userCityLine, userPayLine, userSettingLine, userGeneralLine;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_user, container, false);
init(view);
return view;
}
/**
*
*/
private void init(View view) {
userIconImage = view.findViewById(R.id.user_icon);
usernameText = view.findViewById(R.id.user_username);
userSexText = view.findViewById(R.id.user_sex);
userCityText = view.findViewById(R.id.user_city);
usernameLine = view.findViewById(R.id.user_username_line);
userSexline = view.findViewById(R.id.user_sex_line);
userCityLine = view.findViewById(R.id.user_city_line);
userPayLine = view.findViewById(R.id.user_pay);
userSettingLine = view.findViewById(R.id.user_setting);
userGeneralLine = view.findViewById(R.id.user_general);
setData();
}
/**
*
*/
private void setData() {
Bundle bundle = getArguments();
usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
userSexText.setText(String.format("性别:%s", bundle.getString("sex")));
userCityText.setText(String.format("城市:%s", bundle.getString("city")));
}
@Override
public void onClick(View v) {
}
}

@ -0,0 +1,21 @@
package com.yemamacake.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
public class ProductFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_product, container, false);
return view;
}
}

@ -50,7 +50,6 @@ public class SetDetailFragment extends Fragment {
imageView = view.findViewById(R.id.category_product_image);
nameText = view.findViewById(R.id.category_product_name);
priceText = view.findViewById(R.id.category_product_price);
produceText= view.findViewById(R.id.category_product_introduce);
}
}

@ -0,0 +1,21 @@
package com.yemamacake.cn.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.yemamacake.cn.R;
public class ShoppingCartFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.content_shopping, container, false);
return view;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 连框颜色值 -->
<item>
<shape>
<solid android:color="#dddddd" />
</shape>
</item>
<!-- 主体背景颜色值 -->
<item android:bottom="1dp"> <!--设置只有底部有边框-->
<shape>
<solid android:color="#ffffff" />
<corners android:radius="10dp"></corners>
</shape>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

@ -1,18 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.MainActivity">
android:orientation="vertical"
tools:context=".activity.IndexActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5">
</androidx.constraintlayout.widget.ConstraintLayout>
<include layout="@layout/content_user"/>
</LinearLayout>-->
<FrameLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp">
<!--底部导航-->
<include layout="@layout/content_nav" />
</LinearLayout>
</LinearLayout>

@ -2,41 +2,31 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical">
<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/category_product_image"
android:layout_gravity="center"
/>
android:layout_width="100dp"
android:layout_marginTop="5dp"
android:layout_height="100dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:layout_marginTop="2dp"
android:textColor="#050505"
android:textSize="16sp"
android:id="@+id/category_product_name"
android:textSize="16sp" />
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="#FFA500"
android:id="@+id/category_product_introduce"
android:textSize="14sp"/>
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"
android:id="@+id/category_product_price"
/>
android:textSize="16sp" />
</LinearLayout>

@ -0,0 +1,229 @@
<?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:background="#E8E8E8"
android:orientation="vertical">
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/index_menu"
android:focusable="false"
android:iconifiedByDefault="false"
android:queryHint="请输入搜索内容" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginTop="20dp"
android:layout_marginRight="1dp"
android:background="@drawable/index_menu"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/breakfast"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="69dp"
android:layout_height="82dp"
android:adjustViewBounds="true"
android:maxWidth="50dp"
android:maxHeight="50dp"
android:src="@drawable/breakfast" />
<TextView
android:layout_width="101dp"
android:layout_height="56dp"
android:layout_marginTop="5dp"
android:text="活力早餐"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/下午茶点"
android:layout_width="32dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="75dp"
android:layout_height="77dp"
android:adjustViewBounds="true"
android:maxWidth="50dp"
android:maxHeight="50dp"
android:src="@drawable/xiawu" />
<TextView
android:layout_width="98dp"
android:layout_height="61dp"
android:layout_marginTop="5dp"
android:text="下午茶点"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/western_cake"
android:layout_width="33dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
tools:ignore="InvalidId">
<ImageView
android:layout_width="104dp"
android:layout_height="80dp"
android:src="@drawable/paofu" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:text="西式蛋糕"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/chinese_tradional_cake"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="82dp"
android:src="@drawable/taosu" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="中式传统糕点"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/chinese_newcake"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="77dp"
android:layout_height="102dp"
android:src="@drawable/lvdou" />
<TextView
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginTop="5dp"
android:text="中式创新糕点"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/breakbread"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="79dp"
android:layout_height="117dp"
android:src="@drawable/naiyoubread" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="吐司餐包"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/fruit_tea"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="72dp"
android:layout_height="119dp"
android:src="@drawable/peachtea" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="鲜果茶饮"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/birthcake"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="89dp"
android:layout_height="107dp"
android:src="@drawable/birthcake" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="生日蛋糕"
android:textColor="#696969"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include layout="@layout/index_famous"/>
</LinearLayout>

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!--首页-->
<LinearLayout
android:id="@+id/content_index"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/index" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="首页"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
<!--间隔线-->
<ImageView
android:layout_width="1dp"
android:layout_height="70dp"
android:background="#CFCFCF" />
<!--商品-->
<LinearLayout
android:id="@+id/content_product"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/product" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="商品"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
<!--间隔线-->
<ImageView
android:layout_width="1dp"
android:layout_height="70dp"
android:background="#CFCFCF" />
<!--购物车-->
<LinearLayout
android:id="@+id/content_cart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="2dp"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="center"
android:src="@drawable/shopping" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="购物车"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
<!--间隔线-->
<ImageView
android:layout_width="1dp"
android:layout_height="70dp"
android:background="#CFCFCF" />
<!--个人-->
<LinearLayout
android:id="@+id/content_pearson"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="2dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/pearson" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="我"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="product" />
</LinearLayout>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="shop" />
</LinearLayout>

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="vertical">
<!--热门商品-->
<LinearLayout
android:id="@+id/index_famous_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#FFF"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:drawableLeft="@drawable/famous_cake"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="热门商品"
android:textColor="#000"
android:textSize="18sp" />
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:src="@drawable/arrow_right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
<GridView
android:id="@+id/index_famous_gridview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#E8E8E8"
android:verticalSpacing="20dp"
android:horizontalSpacing="10dp"
android:numColumns="2" />
</LinearLayout>
</LinearLayout>

Binary file not shown.
Loading…
Cancel
Save