master
viola 2 years ago
parent 95cef870f6
commit 45a59feab1

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

@ -11,7 +11,7 @@ import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.orangesale.cn.activity.CategoryActivity;
import com.orangesale.cn.activity.IndexActivity;
import com.orangesale.cn.activity.RegisterActivity;
import com.orangesale.cn.dataoperation.OrangeDatabase;
@ -36,7 +36,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
case R.id.login:
//注册时,我们引入了数据库,登录这里可以通过数据库进行验证,验证跳转到首页,不通过进行提示
if (validateLogin()) {
Intent intent1 = new Intent(MainActivity.this, CategoryActivity.class);
Intent intent1 = new Intent(MainActivity.this, IndexActivity.class);
Bundle bundle = new Bundle();
OrangeDatabase orangeDatabase = new OrangeDatabase(MainActivity.this);
bundle.putString("username", usernameText.getText().toString());
@ -70,7 +70,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
String password = paswdEdit.getText().toString();
OrangeDatabase orangeDatabase = new OrangeDatabase(MainActivity.this);
SQLiteDatabase sqLiteDatabase = orangeDatabase.getReadableDatabase();
Cursor cursor = sqLiteDatabase.rawQuery("select * from user where username=? and password=?", new String[]{username, password});
Cursor cursor = sqLiteDatabase.rawQuery("select * from orange_user where username=? and password=?", new String[]{username, password});
if (cursor.getCount() > 0) {
return true;
}

@ -13,6 +13,7 @@ import com.orangesale.cn.adapter.Adapter;
import com.orangesale.cn.entity.Product;
import com.orangesale.cn.fragment.SetDetailFragment;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -58,30 +59,24 @@ public class CategoryActivity extends Activity {
*/
private void initData() {
productList = new ArrayList<>();
productCategory.add("葡萄");
productCategory.add("青枣");
productCategory.add("西瓜");
productCategory.add("草莓");
productCategory.add("橘子");
productCategory.add("橙子");
productCategory.add("柚子");
Product product = new Product();
product.setImageUrlId(R.drawable.putao);
product.setProductName("葡萄");
product.setProductPrice("¥9.9/斤");
product.setImageUrlId(R.drawable.arrow_down);
product.setProductName("橘子");
product.setProductPrice(new BigDecimal("9.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.qingzao);
product1.setProductName("青枣");
product1.setProductPrice("¥6.9/斤");
product1.setImageUrlId(R.drawable.orange);
product1.setProductName("橙子");
product1.setProductPrice(new BigDecimal("29.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.xigua);
product2.setProductName("西瓜");
product2.setProductPrice("¥3.5/斤");
Product product3 = new Product();
product3.setImageUrlId(R.drawable.caomei);
product3.setProductName("草莓");
product3.setProductPrice("¥19.9/斤");
product2.setImageUrlId(R.drawable.arrow_left);
product2.setProductName("柚子");
product2.setProductPrice(new BigDecimal("19.9"));
productList.add(product);
productList.add(product1);
productList.add(product2);
productList.add(product3);
}
/**

@ -0,0 +1,120 @@
package com.orangesale.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.orangesale.cn.R;
import com.orangesale.cn.fragment.IndexFragment;
import com.orangesale.cn.fragment.PearsonFragment;
import com.orangesale.cn.fragment.ProductFragment;
import com.orangesale.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();
}
}

@ -128,7 +128,7 @@ public class RegisterActivity extends AppCompatActivity implements View.OnClickL
OrangeDatabase orangeDatabase = new OrangeDatabase(RegisterActivity.this);
SQLiteDatabase sqLiteDatabase = orangeDatabase.getWritableDatabase();
insertData(sqLiteDatabase, bundle);
Intent intent = new Intent(RegisterActivity.this, UserActivity.class);
Intent intent = new Intent(RegisterActivity.this, IndexActivity.class);
intent.putExtras(bundle);
startActivity(intent);
} else {
@ -162,8 +162,7 @@ public class RegisterActivity extends AppCompatActivity implements View.OnClickL
contentValues.put("password", bundle.getString("password"));
contentValues.put("sex", bundle.getString("sex"));
contentValues.put("city", bundle.getString("city"));
sqLiteDatabase.insert("user", null, contentValues);
sqLiteDatabase.insert("orange_user", null, contentValues);
sqLiteDatabase.close();
}
}

@ -0,0 +1,69 @@
package com.orangesale.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.orangesale.cn.R;
import com.orangesale.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.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;
}
}

@ -11,13 +11,13 @@ import androidx.annotation.Nullable;
public class OrangeDatabase extends SQLiteOpenHelper {
public OrangeDatabase(@Nullable Context context) {
super(context, "0317shiyan.db", null, 1);
super(context, "orange", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
//创建用户表
String sql = "create table user(id integer primary key autoincrement, username varchar(50), password varchar(50),sex varchar(10),city carchar(50))";
String sql = "create table orange_user(id integer primary key autoincrement, username varchar(50), password varchar(50),sex varchar(10),city carchar(50))";
db.execSQL(sql);
}
@ -41,7 +41,7 @@ public class OrangeDatabase extends SQLiteOpenHelper {
contentValues.put("password", password);
contentValues.put("sex", sex);
contentValues.put("city", city);
sqLiteDatabase.insert("user", null, contentValues);
sqLiteDatabase.insert("orange_user", null, contentValues);
sqLiteDatabase.close();
}
@ -54,7 +54,7 @@ public class OrangeDatabase extends SQLiteOpenHelper {
*/
public Bundle queryUserInfo(SQLiteDatabase sqLiteDatabase, Bundle bundle) {
String username = bundle.getString("username");
Cursor cursor = sqLiteDatabase.rawQuery("select * from user where username=?", new String[]{username});
Cursor cursor = sqLiteDatabase.rawQuery("select * from orange_user where username=?", new String[]{username});
if (cursor != null) {
while (cursor.moveToNext()) {
bundle.putString("sex", cursor.getString(3));

@ -1,5 +1,7 @@
package com.orangesale.cn.entity;
import java.math.BigDecimal;
public class Product {
public String getProductName() {
@ -10,11 +12,11 @@ public class Product {
this.productName = productName;
}
public String getProductPrice() {
public BigDecimal getProductPrice() {
return productPrice;
}
public void setProductPrice(String productPrice) {
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
@ -28,5 +30,14 @@ public class Product {
private Integer imageUrlId;
private String productName;
private String productPrice;
private BigDecimal productPrice;
@Override
public String toString() {
return "Product{" +
"imageUrlId=" + imageUrlId +
", productName='" + productName + '\'' +
", productPrice=" + productPrice +
'}';
}
}

@ -0,0 +1,109 @@
package com.orangesale.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.orangesale.cn.R;
import com.orangesale.cn.adapter.ProductAdapter;
import com.orangesale.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 ningmengLine, youziLine, juziLine, xiguaLine, liLine, appleLine, putaoLine, 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);
juziLine = view.findViewById(R.id.juzi);
juziLine.setOnClickListener(this);
youziLine = view.findViewById(R.id.youzi);
youziLine.setOnClickListener(this);
ningmengLine = view.findViewById(R.id.ningmeng);
ningmengLine.setOnClickListener(this);
xiguaLine = view.findViewById(R.id.xigua);
xiguaLine.setOnClickListener(this);
liLine = view.findViewById(R.id.li);
liLine.setOnClickListener(this);
putaoLine = view.findViewById(R.id.putao);
putaoLine.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.juzip);
product.setProductName("橘子");
product.setProductPrice(new BigDecimal("9.9"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.orange);
product1.setProductName("橙子");
product1.setProductPrice(new BigDecimal("29.9"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.youzip);
product2.setProductName("柚子");
product2.setProductPrice(new BigDecimal("19.9"));
Product product3 = new Product();
product3.setImageUrlId(R.drawable.xiguap);
product3.setProductName("西瓜");
product3.setProductPrice(new BigDecimal("19.9"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.applep);
product4.setProductName("苹果");
product4.setProductPrice(new BigDecimal("49.9"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.lemonp);
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.orangesale.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.orangesale.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.orangesale.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.orangesale.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;
}
}

@ -0,0 +1,21 @@
package com.orangesale.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.orangesale.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: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#F0A732" android:state_selected="true" />
<item android:color="#CFCFCF" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 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=".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,49 +2,31 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
android:background="#fff"
android:orientation="vertical">
<ImageView
android:id="@+id/category_product_image"
android:layout_width="90dp"
android:layout_height="90dp" />
<LinearLayout
android:layout_width="150dp"
android:layout_height="90dp"
android:orientation="vertical">
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:textColor="#050505"
android:textSize="30sp" />
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="90dp">
<ImageView
android:src="@drawable/shoppingcar"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="bottom"/>
</LinearLayout>
android:layout_width="wrap_content"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
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:textColor="#050505"
android:textSize="16sp" />
<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" />
</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/juzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ju" />
<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/youzi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/you" />
<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/ningmeng"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ning" />
<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/xigua"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/xi" />
<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
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="50dp"
android:layout_height="50dp"
android:src="@drawable/xiang" />
<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/apple"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ping" />
<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/putao"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/pu" />
<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/mangguo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/mang" />
<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,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="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/home" />
<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="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/thing" />
<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="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:src="@drawable/car" />
<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="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:src="@drawable/icon" />
<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>

@ -1,14 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/rightlist"
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#c4c4c4"
android:dividerHeight="1dp">
</ListView>
</LinearLayout>
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>

@ -18,7 +18,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="40dp"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
@ -219,7 +219,7 @@
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="18sp"
android:layout_marginTop="150dp"
android:layout_marginTop="50dp"
android:text="退出登录"
android:textColor="#FFFFFF"
android:layout_gravity="center"

@ -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="#E8E8E8"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:numColumns="2" />
</LinearLayout>
</LinearLayout>

@ -5,6 +5,7 @@
android:orientation="vertical"
android:background="#E8E8E8">
<!--APPLogo及名字-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -20,7 +21,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:textSize="22sp"
android:textColor="#000000"
android:textStyle="italic"
android:text="注册界面" />
@ -42,7 +43,7 @@
<EditText
android:id="@+id/reg_username"
android:layout_width="290dp"
android:layout_height="50dp"
android:layout_height="60dp"
android:textAlignment="center"
android:maxLength="10"
android:maxLines="1"
@ -64,7 +65,7 @@
<EditText
android:id="@+id/reg_password"
android:layout_width="290dp"
android:layout_height="50dp"
android:layout_height="60dp"
android:inputType="textPassword"
android:textAlignment="center"
android:maxLength="16"
@ -83,11 +84,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/surepassword" />
android:src="@drawable/sure_apssword" />
<EditText
android:id="@+id/reg_sure_password"
android:layout_width="290dp"
android:layout_height="50dp"
android:layout_height="60dp"
android:inputType="textPassword"
android:textAlignment="center"
android:maxLength="16"
@ -106,7 +107,7 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="@drawable/sex"/>
android:src="@drawable/sex" />
<RadioGroup
android:id="@+id/sex"
android:layout_width="270dp"
@ -143,11 +144,11 @@
<TextView
android:id="@+id/reg_province"
android:layout_width="290dp"
android:layout_height="50dp"
android:layout_height="60dp"
android:gravity="center"
android:maxLength="20"
android:maxLines="1"
android:drawableRight="@drawable/down"
android:drawableRight="@drawable/arrow_down"
android:hint="地址选择" />
</LinearLayout>

Loading…
Cancel
Save