@ -0,0 +1,67 @@
|
||||
package com.example.mysoft.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.example.mysoft.R;
|
||||
import com.example.mysoft.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) {
|
||||
convertView = layoutInflater.inflate(R.layout.categoty_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,68 @@
|
||||
package com.example.mysoft.database;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class Database extends SQLiteOpenHelper {
|
||||
public Database(@Nullable Context context) {
|
||||
super(context, "mysoft.db3", null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
//创建用户表
|
||||
String sql = "create table mysoft_user(id integer primary key autoincrement, username varchar(50), password varchar(50),sex varchar(10),city carchar(50))";
|
||||
db.execSQL(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param sqLiteDatabase
|
||||
* @param username
|
||||
* @param password
|
||||
* @param sex
|
||||
* @param city
|
||||
*/
|
||||
public void insertUser(SQLiteDatabase sqLiteDatabase, String username, String password, String sex, String city) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put("username", username);
|
||||
contentValues.put("password", password);
|
||||
contentValues.put("sex", sex);
|
||||
contentValues.put("city", city);
|
||||
sqLiteDatabase.insert("mysoft_user", null, contentValues);
|
||||
sqLiteDatabase.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* @param sqLiteDatabase
|
||||
* @param bundle
|
||||
* @return
|
||||
*/
|
||||
public Bundle queryUserInfo(SQLiteDatabase sqLiteDatabase, Bundle bundle) {
|
||||
String username = bundle.getString("username");
|
||||
Cursor cursor = sqLiteDatabase.rawQuery("select * from mysoft_user where username=?", new String[]{username});
|
||||
if (cursor != null) {
|
||||
while (cursor.moveToNext()) {
|
||||
bundle.putString("sex", cursor.getString(3));
|
||||
bundle.putString("city", cursor.getString(4));
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
sqLiteDatabase.close();
|
||||
return bundle;
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.example.mysoft.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.example.mysoft.R;
|
||||
import com.example.mysoft.adapter.ProductAdapter;
|
||||
import com.example.mysoft.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.chengzi);
|
||||
orangeLine.setOnClickListener(this);
|
||||
youziLine = view.findViewById(R.id.youzi);
|
||||
youziLine.setOnClickListener(this);
|
||||
juziLine = view.findViewById(R.id.juzi);
|
||||
juziLine.setOnClickListener(this);
|
||||
xiguaLine = view.findViewById(R.id.xigua);
|
||||
xiguaLine.setOnClickListener(this);
|
||||
liLine = view.findViewById(R.id.li);
|
||||
liLine.setOnClickListener(this);
|
||||
lemonLine = view.findViewById(R.id.lemon);
|
||||
lemonLine.setOnClickListener(this);
|
||||
mangguoLine = view.findViewById(R.id.mangguo);
|
||||
mangguoLine.setOnClickListener(this);
|
||||
appleLine = view.findViewById(R.id.apple);
|
||||
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.yihep);
|
||||
product.setProductName("益禾烤奶");
|
||||
product.setProductPrice(new BigDecimal("9.9"));
|
||||
Product product1 = new Product();
|
||||
product1.setImageUrlId(R.drawable.hefengp);
|
||||
product1.setProductName("和风奶绿");
|
||||
product1.setProductPrice(new BigDecimal("29.9"));
|
||||
Product product2 = new Product();
|
||||
product2.setImageUrlId(R.drawable.mitaop);
|
||||
product2.setProductName("蜜桃乌龙");
|
||||
product2.setProductPrice(new BigDecimal("19.9"));
|
||||
Product product3 = new Product();
|
||||
product3.setImageUrlId(R.drawable.xiguazhip);
|
||||
product3.setProductName("西瓜汁");
|
||||
product3.setProductPrice(new BigDecimal("19.9"));
|
||||
Product product4 = new Product();
|
||||
product4.setImageUrlId(R.drawable.longzhup);
|
||||
product4.setProductName("泷珠奶茶");
|
||||
product4.setProductPrice(new BigDecimal("49.9"));
|
||||
Product product5 = new Product();
|
||||
product5.setImageUrlId(R.drawable.shaoxiancaop);
|
||||
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.example.mysoft.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.example.mysoft.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.example.mysoft.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.example.mysoft.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;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.mysoft.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.example.mysoft.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;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 1.2 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>
|
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 43 KiB |
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<GridView
|
||||
android:id="@+id/category_detail_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:numColumns="3"
|
||||
android:verticalSpacing="10dp"
|
||||
android:horizontalSpacing="10dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,221 @@
|
||||
<?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: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/chengzi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/yihe" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="益禾烤奶"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/youzi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/hefeng" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="和风奶绿"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/juzi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/mitao" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="蜜桃乌龙"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/xigua"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/xiguazhi" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="西瓜汁"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</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/li"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bingqilin" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="冰淇淋抹茶"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/apple"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/longzhu" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="泷珠奶茶"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lemon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/yibei" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="烧仙草"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mangguo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/hongcha" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="冰淇淋红茶"
|
||||
android:textColor="#696969"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/index_famous"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,118 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/shoppingcart" />
|
||||
|
||||
<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/shuiguo"
|
||||
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="#00000000"
|
||||
android:verticalSpacing="10dp"
|
||||
android:horizontalSpacing="10dp"
|
||||
android:numColumns="2" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,29 @@
|
||||
<?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:id="@+id/activity_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.IndexActivity">
|
||||
|
||||
<!-- <LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="5">
|
||||
|
||||
<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>
|