master
yang 3 years ago
parent ae9e93e9a3
commit 1d90fe82db

@ -26,6 +26,9 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
@ -33,6 +36,8 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

@ -6,27 +6,36 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
tools:replace="android:theme"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Chengzi"
tools:replace="android:theme"
tools:targetApi="31">
<activity
android:name=".Adapter"
android:exported="false" />
<activity
android:name=".Product"
android:exported="false" />
<activity
android:name=".reigester"
android:exported="false" />
<activity
android:name=".userinformation"
android:exported="false" />
<activity
android:name=".CategoryActivity"
android:exported="false"/>
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,69 @@
package com.example.chengzi;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.chengzi.R;
import java.util.List;
public class Adapter extends BaseAdapter {
private List<String> productCategory;
private LayoutInflater layoutInflater;
private int selectionPosition = -1;
public Adapter(List<String> productCategory, Context context) {
this.productCategory = productCategory;
this.layoutInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return productCategory.size();
}
@Override
public Object getItem(int position) {
return productCategory.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = layoutInflater.inflate(R.layout.category_title, null);
Log.i("adapts", "getView: " + convertView);
viewHolder.tv = convertView.findViewById(R.id.categor_titles);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.tv.setText(productCategory.get(position));
if (selectionPosition == position) {
viewHolder.tv.setBackgroundColor(Color.YELLOW);
} else {
viewHolder.tv.setBackgroundColor(Color.WHITE);
}
return convertView;
}
public void setSelectedPosition(int position) {
this.selectionPosition = position;
}
class ViewHolder {
TextView tv;
}
}

@ -0,0 +1,228 @@
package com.example.chengzi;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import androidx.annotation.Nullable;
import com.example.chengzi.R;
import com.example.chengzi.Adapter;
import com.example.chengzi.Product;
import com.example.chengzi.SetDetailFragment;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class CategoryActivity extends Activity {
public OnChangeListener onchangedListener;
private List<Product> productList;
private List<String> productCategory = new ArrayList<>();
private ListView titleList;
private Adapter adapter;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_category);
initData();
init();
SetDetailFragment fragment = new SetDetailFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.category_detail, fragment);
transaction.commit();
titleList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
adapter.setSelectedPosition(position);
adapter.notifyDataSetInvalidated();
if (onchangedListener != null) {
onchangedListener.changeText(productList.get(position));
}
}
});
/* titleList.setOnItemClickListener((parent, view, position, id) -> {
adapter.setSelectedPosition(position);
adapter.notifyDataSetInvalidated();
if (onchangedListener != null) {
onchangedListener.changeText(productList.get(position));
}
});
*/
}
public void setOnChangeListener(OnChangeListener onChangeListener) {
this.onchangedListener = onChangeListener;
}
public interface OnChangeListener {
void changeText(Product product);
}
/**
*
*/
private void initData() {
productList = new ArrayList<>();
productCategory.add("文学");
productCategory.add("都市");
productCategory.add("科幻");
productCategory.add("武侠");
productCategory.add("玄幻");
productCategory.add("悬疑");
Product product0 = new Product();
product0.setImageUrlId(R.drawable.huozhe);
product0.setProductName("活 着");
product0.setProductPrice(new BigDecimal("1"));
product0.setImageUrlId2(R.drawable.rensheng);
product0.setProductName2("人生");
product0.setProductPrice2(new BigDecimal("2"));
product0.setImageUrlId3(R.drawable.biancheng);
product0.setProductName3("边城");
product0.setProductPrice3(new BigDecimal("3"));
product0.setImageUrlId4(R.drawable.dumu);
product0.setProductName4("毒木圣经");
product0.setProductPrice4(new BigDecimal("4"));
product0.setImageUrlId5(R.drawable.xiyouji);
product0.setProductName5("西游记");
product0.setProductPrice5(new BigDecimal("5"));
Product product1 = new Product();
product1.setImageUrlId(R.drawable.zhuixu);
product1.setProductName("龙王赘婿");
product1.setProductPrice(new BigDecimal("1"));
product1.setImageUrlId2(R.drawable.xiaohua);
product1.setProductName2("校花的贴身高手");
product1.setProductPrice2(new BigDecimal("2"));
product1.setImageUrlId3(R.drawable.bingwang);
product1.setProductName3("绝世兵王");
product1.setProductPrice3(new BigDecimal("3"));
product1.setImageUrlId4(R.drawable.lenshao);
product1.setProductName4("亿万冷少惹不得");
product1.setProductPrice4(new BigDecimal("4"));
product1.setImageUrlId5(R.drawable.yiyi);
product1.setProductName5("都市开局奖励一亿亿");
product1.setProductPrice5(new BigDecimal("5"));
Product product2 = new Product();
product2.setImageUrlId(R.drawable.santi);
product2.setProductName("三体");
product2.setProductPrice(new BigDecimal("1"));
product2.setImageUrlId2(R.drawable.jiqiren);
product2.setProductName2("机器人短篇合集");
product2.setProductPrice2(new BigDecimal("2"));
product2.setImageUrlId3(R.drawable.shaqiu);
product2.setProductName3("沙丘6圣殿沙丘");
product2.setProductPrice3(new BigDecimal("3"));
product2.setImageUrlId4(R.drawable.xuebeng);
product2.setProductName4("SNOW CRASH");
product2.setProductPrice4(new BigDecimal("4"));
product2.setImageUrlId5(R.drawable.yanjing);
product2.setProductName5("带上她的眼睛");
product2.setProductPrice5(new BigDecimal("5"));
productList.add(product0);
productList.add(product1);
productList.add(product2);
Product product3 = new Product();
product3.setImageUrlId(R.drawable.jl);
product3.setProductName("剑来");
product3.setProductPrice(new BigDecimal("1"));
product3.setImageUrlId2(R.drawable.xzhdx);
product3.setProductName2("雪中悍刀行");
product3.setProductPrice2(new BigDecimal("2"));
product3.setImageUrlId3(R.drawable.sdyxz);
product3.setProductName3("射雕英雄传");
product3.setProductPrice3(new BigDecimal("3"));
product3.setImageUrlId4(R.drawable.tlbb);
product3.setProductName4("天龙八部");
product3.setProductPrice4(new BigDecimal("4"));
product3.setImageUrlId5(R.drawable.yttlj);
product3.setProductName5("倚天屠龙记");
product3.setProductPrice5(new BigDecimal("5"));
Product product4 = new Product();
product4.setImageUrlId(R.drawable.zt);
product4.setProductName("遮天");
product4.setProductPrice(new BigDecimal("1"));
product4.setImageUrlId2(R.drawable.fts);
product4.setProductName2("伏天氏");
product4.setProductPrice2(new BigDecimal("2"));
product4.setImageUrlId3(R.drawable.wmsj);
product4.setProductName3("完美世界");
product4.setProductPrice3(new BigDecimal("3"));
product4.setImageUrlId4(R.drawable.sx);
product4.setProductName4("圣墟");
product4.setProductPrice4(new BigDecimal("4"));
product4.setImageUrlId5(R.drawable.tc);
product4.setProductName5("太初");
product4.setProductPrice5(new BigDecimal("5"));
Product product5 = new Product();
product5.setImageUrlId(R.drawable.xyrxdxs);
product5.setProductName("嫌疑人x的献身");
product5.setProductPrice(new BigDecimal("1"));
product5.setImageUrlId2(R.drawable.fyqm);
product5.setProductName2("法医秦明");
product5.setProductPrice2(new BigDecimal("2"));
product5.setImageUrlId3(R.drawable.tczzfzzy);
product5.setProductName3("天才在左疯子在右");
product5.setProductPrice3(new BigDecimal("3"));
product5.setImageUrlId4(R.drawable.ss);
product5.setProductName4("时生");
product5.setProductPrice4(new BigDecimal("4"));
product5.setImageUrlId5(R.drawable.xlz);
product5.setProductName5("心理罪");
product5.setProductPrice5(new BigDecimal("5"));
productList.add(product3);
productList.add(product4);
productList.add(product5);
}
/**
*
*/
private void init() {
titleList = findViewById(R.id.category_title_list);
adapter = new Adapter(productCategory, CategoryActivity.this);
titleList.setAdapter(adapter);
}
}

@ -0,0 +1,112 @@
package com.example.chengzi;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import java.math.BigDecimal;
public class Product {
public String getProductName() {
return productName;
}
public Integer getImageUrlId() {
return imageUrlId;
}
public void setImageUrlId(Integer imageUrlId) {
this.imageUrlId = imageUrlId;
}
public void setProductName(String productName) {
this.productName = productName;
}
public BigDecimal getProductPrice() {
return productPrice;
}
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
public String getProductName2() {
return productName2;
}
public Integer getImageUrlId2() {
return imageUrlId2;
}
public void setImageUrlId2(Integer imageUrlId2) {
this.imageUrlId2 = imageUrlId2;
}
public void setProductName2(String productName2) {
this.productName2 = productName2;
}
public BigDecimal getProductPrice2() {
return productPrice2;
}
public void setProductPrice2(BigDecimal productPrice2) {
this.productPrice2 = productPrice2;
}
public String getProductName3() {
return productName3;
}
public Integer getImageUrlId3() {
return imageUrlId3;
}
public void setImageUrlId3(Integer imageUrlId3) {
this.imageUrlId3 = imageUrlId3;
}
public void setProductName3(String productName3) {
this.productName3 = productName3;
}
public BigDecimal getProductPrice3() {
return productPrice3;
}
public void setProductPrice3(BigDecimal productPrice3) {
this.productPrice3 = productPrice3;
}
public String getProductName4() {
return productName4;
}
public Integer getImageUrlId4() {
return imageUrlId4;
}
public void setImageUrlId4(Integer imageUrlId4) {
this.imageUrlId4 = imageUrlId4;
}
public void setProductName4(String productName4) {
this.productName4 = productName4;
}
public BigDecimal getProductPrice4() {
return productPrice4;
}
public void setProductPrice4(BigDecimal productPrice4) {
this.productPrice4 = productPrice4;
}
public String getProductName5() {
return productName5;
}
public Integer getImageUrlId5() {
return imageUrlId5;
}
public void setImageUrlId5(Integer imageUrlId5) {
this.imageUrlId5 = imageUrlId5;
}
public void setProductName5(String productName5) {
this.productName5 = productName5;
}
public BigDecimal getProductPrice5() {
return productPrice5;
}
public void setProductPrice5(BigDecimal productPrice5) {
this.productPrice5 = productPrice5;
}
private Integer imageUrlId,imageUrlId2,imageUrlId3,imageUrlId4,imageUrlId5;
private String productName,productName2,productName3,productName4,productName5;
private BigDecimal productPrice,productPrice2,productPrice3,productPrice4,productPrice5;
}

@ -0,0 +1,97 @@
package com.example.chengzi;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.chengzi.R;
import com.example.chengzi.CategoryActivity;
import com.example.chengzi.Product;
import java.util.Objects;
public class SetDetailFragment extends Fragment {
private View view;
private ImageView imageView,imageView2,imageView3,imageView4,imageView5;
private TextView nameText, priceText,nameText2,priceText2,nameText3,priceText3,nameText4,priceText4
,nameText5,priceText5;
@SuppressLint("SetTextI18n")
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.category_detail_content, container, false);
if (view != null) {
init();
}
CategoryActivity categoryActivity = (CategoryActivity) getActivity();
categoryActivity.setOnChangeListener(new CategoryActivity.OnChangeListener() {
@Override
public void changeText(Product product) {
imageView.setBackgroundResource(product.getImageUrlId());
nameText.setText(product.getProductName());
priceText.setText(product.getProductPrice().toString());
imageView2.setBackgroundResource(product.getImageUrlId2());
nameText2.setText(product.getProductName2());
priceText2.setText(product.getProductPrice2().toString());
imageView3.setBackgroundResource(product.getImageUrlId3());
nameText3.setText(product.getProductName3());
priceText3.setText(product.getProductPrice3().toString());
imageView4.setBackgroundResource(product.getImageUrlId4());
nameText4.setText(product.getProductName4());
priceText4.setText(product.getProductPrice4().toString());
imageView5.setBackgroundResource(product.getImageUrlId5());
nameText5.setText(product.getProductName5());
priceText5.setText(product.getProductPrice5().toString());
}
});
/* Objects.requireNonNull(categoryActivity).setOnChangeListener(product -> {
Log.i("sss", "onCreateView: " + product.getProductName());
imageView.setBackgroundResource(product.getImageUrlId());
nameText.setText(product.getProductName());
priceText.setText(product.getProductPrice().toString());
});
*/
return view;
}
/**
*
*/
private void init() {
imageView = view.findViewById(R.id.category_product_image);
nameText = view.findViewById(R.id.category_product_name);
priceText = view.findViewById(R.id.category_product_price);
imageView2 = view.findViewById(R.id.category_product_image2);
nameText2 = view.findViewById(R.id.category_product_name2);
priceText2 = view.findViewById(R.id.category_product_price2);
imageView3 = view.findViewById(R.id.category_product_image3);
nameText3 = view.findViewById(R.id.category_product_name3);
priceText3 = view.findViewById(R.id.category_product_price3);
imageView4 = view.findViewById(R.id.category_product_image4);
nameText4 = view.findViewById(R.id.category_product_name4);
priceText4 = view.findViewById(R.id.category_product_price4);
imageView5 = view.findViewById(R.id.category_product_image5);
nameText5 = view.findViewById(R.id.category_product_name5);
priceText5 = view.findViewById(R.id.category_product_price5);
}
}

@ -26,6 +26,7 @@ public class userinformation extends AppCompatActivity {
TextView name_Text = (TextView) findViewById(R.id.user_name);
TextView sex_Text = (TextView) findViewById(R.id.user_sex);
TextView city_Text = (TextView) findViewById(R.id.user_city);
TextView book = (TextView) findViewById(R.id.book);
name_Text.setText(name);
sex_Text.setText(sex);
city_Text.setText(city);
@ -38,5 +39,14 @@ public class userinformation extends AppCompatActivity {
startActivity(intent);
}
});
Button button2=(Button) findViewById(R.id.book);
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(userinformation.this,CategoryActivity.class);
startActivity(intent);
}
});
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

@ -0,0 +1,165 @@
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:id="@+id/category_product_price"
android:layout_marginTop="2dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_gravity="center_vertical"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
<ImageView
android:layout_width="90dp"
android:layout_height="120dp"
android:id="@+id/category_product_image"/>
<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_marginLeft="10dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_marginTop="25dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:id="@+id/category_product_price2"
android:layout_marginTop="2dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_gravity="center_vertical"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
<ImageView
android:layout_width="90dp"
android:layout_height="120dp"
android:layout_gravity="left"
android:id="@+id/category_product_image2"/>
<TextView
android:id="@+id/category_product_name2"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="2dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_marginTop="25dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:id="@+id/category_product_price3"
android:layout_marginTop="2dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_gravity="center_vertical"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
<ImageView
android:layout_width="90dp"
android:layout_height="120dp"
android:layout_gravity="left"
android:id="@+id/category_product_image3"/>
<TextView
android:id="@+id/category_product_name3"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="2dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_marginTop="25dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:id="@+id/category_product_price4"
android:layout_marginTop="2dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_gravity="center_vertical"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
<ImageView
android:layout_width="90dp"
android:layout_height="120dp"
android:layout_gravity="left"
android:id="@+id/category_product_image4"/>
<TextView
android:id="@+id/category_product_name4"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="2dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_marginTop="25dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:id="@+id/category_product_price5"
android:layout_marginTop="2dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_gravity="center_vertical"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
<ImageView
android:layout_width="90dp"
android:layout_height="120dp"
android:layout_gravity="left"
android:id="@+id/category_product_image5"/>
<TextView
android:id="@+id/category_product_name5"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="2dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,13 @@
<?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">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/categor_titles"
android:gravity="center"
android:text="标题"
android:textSize="18sp"/>
</LinearLayout>

@ -0,0 +1,42 @@
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#afeeee"
android:orientation="horizontal">
<ImageView
android:id="@+id/category_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/arrow_down"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="center"
android:text="小 说 榜 单"
android:textColor="#FFF"
android:textSize="20sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ListView
android:id="@+id/category_title_list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
<FrameLayout
android:id="@+id/category_detail"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context=".SetDetailFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>

@ -133,5 +133,15 @@
android:background="@drawable/button_login"
android:textColor="#FFFFFF"
android:text="返 回 登 录"/>
<Button
android:id="@+id/book"
android:layout_width="250dp"
android:layout_height="50dp"
android:textSize="18sp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="@drawable/button_login"
android:textColor="#FFFFFF"
android:text="书 籍"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/FirstFragment">
<fragment
android:id="@+id/FirstFragment"
android:name="com.example.chengzi.FirstFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment" />
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="com.example.chengzi.SecondFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
</fragment>
</navigation>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
</resources>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">200dp</dimen>
</resources>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
</resources>

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">16dp</dimen>
</resources>

@ -1,3 +1,14 @@
<resources>
<string name="app_name">小橙子</string>
<string name="title_activity_category">CategoryActivity</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="hello_first_fragment">Hello first fragment</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>

@ -13,4 +13,13 @@
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.Chengzi.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Chengzi.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Chengzi.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Loading…
Cancel
Save