Skip to content

Commit

Permalink
First Release Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhENC committed Dec 6, 2022
1 parent f60ea09 commit b40a602
Show file tree
Hide file tree
Showing 21 changed files with 304 additions and 227 deletions.
35 changes: 21 additions & 14 deletions home/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Filter"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".FlashSaleScreen"
android:exported="true">
Expand Down Expand Up @@ -93,98 +100,98 @@
/>
</activity>
<activity
android:name=".MainMenu"
android:name=".MacDinhMember"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".member1"
android:name=".MainActivity"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".member2"
android:name=".MainMenu"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ProductCollection"
android:name=".member1"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ProductDetails"
android:name=".member2"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".scan1"
android:name=".ProductCollection"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Sort"
android:name=".ProductDetails"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ThanhToan"
android:name=".scan1"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ThanhToanPre"
android:name=".ThanhToan"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".ThongBao"
android:name=".ThanhToanPre"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".TrangChu"
android:name=".ThongBao"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".voucher_main"
android:name=".TrangChu"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".Wishlist"
android:name=".voucher_main"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".MainActivity"
android:name=".Wishlist"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.k20411group03.DisplayHelper;
import com.k20411group03.home.ProductDetails;
import com.k20411group03.home.R;
import com.k20411group03.models.Item;
Expand Down Expand Up @@ -51,8 +52,8 @@ public void onBindViewHolder(@NonNull ItemHolder holder, int position) {

holder.imv_Thumb.setImageBitmap(convertByteArrayToBitmap(item.getProductImage()));
holder.txt_ItemName.setText(item.getProductName());
holder.txt_price.setText(String.valueOf(item.getProductSalePrice()));
holder.txt_originalPrice.setText(String.valueOf(item.getProductPrice()));
holder.txt_price.setText(DisplayHelper.formatPrice(item.getProductPrice()));
holder.txt_originalPrice.setText(DisplayHelper.formatPrice(item.getProductPrice()));
holder.layout_item.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
67 changes: 43 additions & 24 deletions home/app/src/main/java/com/k20411group03/home/ActivitySearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,49 @@ protected void onCreate(Bundle savedInstanceState) {
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_cart:
// Intent intentCart = new Intent(ActivitySearch.this, MainActivity.class);
// startActivity(intentCart);
// break;
// case R.id.action_menu:
// Intent intentMenu = new Intent(ActivitySearch.this, MainMenu.class);
// startActivity(intentMenu);
// break;
// }

// return super.onOptionsItemSelected(item);
// }
//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(ActivitySearch.this, ActivitySearch.class);
startActivity(intentSearch);
break;
case R.id.action_cart:
Intent intentCart = new Intent(ActivitySearch.this, MainActivity.class);
startActivity(intentCart);
break;
case R.id.action_BoSuuTap:
Intent intentBoSuuTap = new Intent(ActivitySearch.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(ActivitySearch.this, ProductCollection.class);
intentSanPhamMoi.putExtra("screenTitle", "Hàng mới về");
startActivity(intentSanPhamMoi);
break;
case R.id.action_Flashsale:
Intent intentFlashsale = new Intent(ActivitySearch.this, FlashSaleScreen.class);
startActivity(intentFlashsale);
break;
case R.id.action_SanPham:
Intent intentSanPham = new Intent(ActivitySearch.this, ProductCollection.class);
intentSanPham.putExtra("screenTitle", "Sản phẩm");
startActivity(intentSanPham);
break;
}

return super.onOptionsItemSelected(item);
}

private void addEvents() {

Expand Down
86 changes: 51 additions & 35 deletions home/app/src/main/java/com/k20411group03/home/DieuKienVoucher.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ protected void onCreate(Bundle savedInstanceState) {
binding = ActivityDieuKienVoucherBinding.inflate(getLayoutInflater());
//setContentView(R.layout.activity_chi_tiet_voucher);

// //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);

setContentView(binding.getRoot());
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Expand All @@ -40,34 +40,50 @@ protected void onCreate(Bundle savedInstanceState) {
addEvent();
}

// //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(DieuKienVoucher.this, ActivitySearch.class);
// startActivity(intentSearch);
// break;
// case R.id.action_cart:
// Intent intentCart = new Intent(DieuKienVoucher.this, MainActivity.class);
// startActivity(intentCart);
// break;
// case R.id.action_menu:
// Intent intentMenu = new Intent(DieuKienVoucher.this, MainMenu.class);
// startActivity(intentMenu);
// break;
// }

// return super.onOptionsItemSelected(item);
// }
//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(this, ActivitySearch.class);
startActivity(intentSearch);
break;
case R.id.action_cart:
Intent intentCart = new Intent(this, MainActivity.class);
startActivity(intentCart);
break;
case R.id.action_BoSuuTap:
Intent intentBoSuuTap = new Intent(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(this, ProductCollection.class);
intentSanPhamMoi.putExtra("screenTitle", "Hàng mới về");
startActivity(intentSanPhamMoi);
break;
case R.id.action_Flashsale:
Intent intentFlashsale = new Intent(this, FlashSaleScreen.class);
startActivity(intentFlashsale);
break;
case R.id.action_SanPham:
Intent intentSanPham = new Intent(this, ProductCollection.class);
intentSanPham.putExtra("screenTitle", "Sản phẩm");
startActivity(intentSanPham);
break;
}

return super.onOptionsItemSelected(item);
}


private void loadData() {
//hinh voucher
Expand Down
39 changes: 39 additions & 0 deletions home/app/src/main/java/com/k20411group03/home/Filter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.k20411group03.home;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.k20411group03.home.databinding.ActivityFilterBinding;

public class Filter extends AppCompatActivity {

ActivityFilterBinding binding;
Intent intent;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_sort);

binding = ActivityFilterBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());

addEvents();
}

private void addEvents() {
binding.btnFilterConfirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
intent = new Intent(Filter.this, ProductCollection.class);
startActivity(intent);
}
});
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@
import com.k20411group03.home.databinding.ActivityProductCollectionBinding;
import com.k20411group03.models.ProductModel;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProductCollection extends AppCompatActivity {

Expand Down Expand Up @@ -116,6 +108,14 @@ public void onClick(View v) {
}
});

//Nút lọc
binding.imvSort.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(ProductCollection.this, Filter.class);
}
});

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 b40a602

Please sign in to comment.