Skip to content

Commit

Permalink
update giao diện
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhENC committed Dec 6, 2022
1 parent 9d89166 commit f60ea09
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 239 deletions.
29 changes: 3 additions & 26 deletions home/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand All @@ -12,15 +12,13 @@
android:supportsRtl="true"
android:theme="@style/Theme.Home"
tools:targetApi="31">

<activity
android:name=".ActivitySearch"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".DangKy"
android:exported="true"
Expand All @@ -29,7 +27,6 @@
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".DangNhap"
android:exported="true"
Expand All @@ -38,7 +35,6 @@
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".dangnhap1"
android:exported="true"
Expand All @@ -47,39 +43,34 @@
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".DanhMuc"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".DiaChiNhanHang"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".DieuKienVoucher"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".FlashSaleScreen"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".homescreen"
android:exported="true"
Expand All @@ -92,7 +83,6 @@
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".homescreen2"
android:exported="true"
Expand All @@ -102,111 +92,97 @@
android:value=""
/>
</activity>

<activity
android:name=".MainMenu"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".member1"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".member2"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".ProductCollection"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".ProductDetails"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".scan1"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".Sort"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".ThanhToan"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".ThanhToanPre"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".ThongBao"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".TrangChu"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".voucher_main"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".Wishlist"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>

<activity
android:name=".MainActivity"
android:exported="true">
Expand All @@ -215,4 +191,5 @@
android:value="" />
</activity>
</application>
</manifest>

</manifest>
10 changes: 10 additions & 0 deletions home/app/src/main/java/com/k20411group03/home/ActivitySearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ protected void onCreate(Bundle savedInstanceState) {
// }

private void addEvents() {

//Nút back
binding.imvBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//end activity
finish();
}
});

binding.imvSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down
69 changes: 62 additions & 7 deletions home/app/src/main/java/com/k20411group03/home/DanhMuc.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ protected void onCreate(Bundle savedInstanceState) {
binding = ActivityDanhMucBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());

// //Custom action bar
// ActionBar actionBar = getSupportActionBar();
// actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
// actionBar.setDisplayShowCustomEnabled(true);
// actionBar.setCustomView(R.layout.custom_action_bar);
// actionBar.setDisplayUseLogoEnabled(true);
// actionBar.setDisplayShowHomeEnabled(true);
//Custom action bar
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(R.layout.custom_action_bar);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);

cateID = getIntent().getStringExtra("Cate");

Expand All @@ -60,6 +60,53 @@ protected void onCreate(Bundle savedInstanceState) {
loadData();
addEvents();
}
//Thêm action
@Override
public boolean onCreateOptionsMenu(Menu menu) {

getMenuInflater().inflate(R.menu.main, menu);
return super.onCreateOptionsMenu(menu);
}

//Sự kiện action bar
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
Intent intentSearch = new Intent(DanhMuc.this, ActivitySearch.class);
startActivity(intentSearch);
break;
case R.id.action_cart:
Intent intentCart = new Intent(DanhMuc.this, MainActivity.class);
startActivity(intentCart);
break;
case R.id.action_BoSuuTap:
Intent intentBoSuuTap = new Intent(DanhMuc.this, ProductCollection.class);
intentBoSuuTap.putExtra("screenTitle", "Bộ sưu tập mới");
startActivity(intentBoSuuTap);
break;
case R.id.action_HangMoiVe:
Intent intentSanPhamMoi = new Intent(DanhMuc.this, ProductCollection.class);
intentSanPhamMoi.putExtra("screenTitle", "Hàng mới về");
startActivity(intentSanPhamMoi);
break;
case R.id.action_Flashsale:
Intent intentFlashsale = new Intent(DanhMuc.this, FlashSaleScreen.class);
startActivity(intentFlashsale);
break;
case R.id.action_SanPham:
Intent intentSanPham = new Intent(DanhMuc.this, ProductCollection.class);
intentSanPham.putExtra("screenTitle", "Sản phẩm");
startActivity(intentSanPham);
break;
}



return super.onOptionsItemSelected(item);
}


private void loadData(){
ArrayList<ProductModel> products = new ArrayList<>();
db = openOrCreateDatabase(Utils.DB_NAME, MODE_PRIVATE, null);
Expand Down Expand Up @@ -134,6 +181,14 @@ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
}
});

//back button
binding.imvBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});

//Click vào sản phẩm
binding.gvItem.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
startActivity(intent);
}
});

//nút back
binding.imvBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.view.MenuItem;
import android.view.View;

import com.k20411group03.CartValue;
import com.k20411group03.DisplayHelper;
import com.k20411group03.Utils;
import com.k20411group03.adapters.ProductInCartAdapter;
Expand Down Expand Up @@ -128,6 +129,14 @@ private void loadData() {

private void addEvents() {

//back button
binding.imvBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});

binding.txtThanhtoan.setText(String.valueOf(DisplayHelper.getValue(binding.txtSum.getText().toString()) -
DisplayHelper.getValue(binding.txtGiatriCoupon.getText().toString())));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) {


private void addEvents() {

//nút back
binding.imvBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});

binding.lvProductCollection.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Expand Down
Loading

0 comments on commit f60ea09

Please sign in to comment.