基于你说的房屋租赁APP的设计方案的房源详情页面给出详细设计并以Java语言给出实例代码
房源详情页面设计方案:
-
页面布局:页面分为两部分,上半部分为房源基本信息,下半部分为房源描述和房东信息。
-
上半部分:房源基本信息包括房源名称、房源类型、所在城市、所在区域、租金、面积、房间数量、卫生间数量、厨房、客厅、阳台等基本信息。
-
下半部分:房源描述包括房源的详细描述、配套设施、周边环境等信息。房东信息包括房东的姓名、联系电话、微信号等信息。
Java语言实例代码:
public class HouseDetailActivity extends AppCompatActivity {
private TextView tvName;
private TextView tvType;
private TextView tvCity;
private TextView tvArea;
private TextView tvRent;
private TextView tvAreaSize;
private TextView tvRoomNum;
private TextView tvToiletNum;
private TextView tvKitchen;
private TextView tvLivingRoom;
private TextView tvBalcony;
private TextView tvDescription;
private TextView tvFacilities;
private TextView tvSurroundings;
private TextView tvLandlordName;
private TextView tvLandlordPhone;
private TextView tvLandlordWechat;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_house_detail);
tvName = findViewById(R.id.tv_name);
tvType = findViewById(R.id.tv_type);
tvCity = findViewById(R.id.tv_city);
tvArea = findViewById(R.id.tv_area);
tvRent = findViewById(R.id.tv_rent);
tvAreaSize = findViewById(R.id.tv_area_size);
tvRoomNum = findViewById(R.id.tv_room_num);
tvToiletNum = findViewById(R.id.tv_toilet_num);
tvKitchen = findViewById(R.id.tv_kitchen);
tvLivingRoom = findViewById(R.id.tv_living_room);
tvBalcony = findViewById(R.id.tv_balcony);
tvDescription = findViewById(R.id.tv_description);
tvFacilities = findViewById(R.id.tv_facilities);
tvSurroundings = findViewById(R.id.tv_surroundings);
tvLandlordName = findViewById(R.id.tv_landlord_name);
tvLandlordPhone = findViewById(R.id.tv_landlord_phone);
tvLandlordWechat = findViewById(R.id.tv_landlord_wechat);
// 获取房源信息并显示在页面上
House house = getIntent().getParcelableExtra("house");
if (house != null) {
tvName.setText(house.getName());
tvType.setText(house.getType());
tvCity.setText(house.getCity());
tvArea.setText(house.getArea());
tvRent.setText(house.getRent());
tvAreaSize.setText(house.getAreaSize());
tvRoomNum.setText(house.getRoomNum());
tvToiletNum.setText(house.getToiletNum());
tvKitchen.setText(house.getKitchen());
tvLivingRoom.setText(house.getLivingRoom());
tvBalcony.setText(house.getBalcony());
tvDescription.setText(house.getDescription());
tvFacilities.setText(house.getFacilities());
tvSurroundings.setText(house.getSurroundings());
tvLandlordName.setText(house.getLandlord().getName());
tvLandlordPhone.setText(house.getLandlord().getPhone());
tvLandlordWechat.setText(house.getLandlord().getWechat());
}
}
}
原文地址: https://www.cveoy.top/t/topic/bz8B 著作权归作者所有。请勿转载和采集!