mirror of
https://github.com/Nezumi-2711/PRM392.git
synced 2026-09-22 13:48:29 +00:00
Fix Layout
This commit is contained in:
@@ -10,7 +10,7 @@ android {
|
||||
minSdk 23
|
||||
targetSdk 30
|
||||
versionCode 1
|
||||
versionName "80.0"
|
||||
versionName "86.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -90,6 +90,8 @@ dependencies {
|
||||
implementation 'com.daimajia.slider:library:1.1.5@aar'
|
||||
implementation "androidx.browser:browser:1.3.0"
|
||||
|
||||
implementation 'com.github.Piashsarker:AndroidAppUpdateLibrary:1.0.4'
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
@@ -11,6 +11,8 @@
|
||||
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@@ -23,6 +25,16 @@
|
||||
android:theme="@style/Theme.Foodify"
|
||||
tools:replace="android:theme"
|
||||
tools:targetApi="31">
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths"/>
|
||||
</provider>
|
||||
|
||||
<receiver android:name=".OTP_Receiver">
|
||||
|
||||
|
||||
@@ -8,11 +8,13 @@ import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.provider.Settings;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -210,10 +212,10 @@ public class Cart extends AppCompatActivity implements RecyclerItemTouchHelperLi
|
||||
}).check();
|
||||
}
|
||||
|
||||
|
||||
setTitle("Giỏ hàng");
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Giỏ hàng</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.waterbase.foodify;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
@@ -47,8 +49,6 @@ public class FavoritesActivity extends AppCompatActivity implements RecyclerItem
|
||||
|
||||
setContentView(R.layout.activity_favorites);
|
||||
|
||||
setTitle("Danh sách yêu thích");
|
||||
|
||||
rootLayout = findViewById(R.id.rootLayout);
|
||||
|
||||
txtEmptyList = findViewById(R.id.txtEmptyList);
|
||||
@@ -67,6 +67,9 @@ public class FavoritesActivity extends AppCompatActivity implements RecyclerItem
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Danh sách yêu thích</font>"));
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.waterbase.foodify;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -142,10 +144,10 @@ public class FoodDetail extends AppCompatActivity implements RatingDialogListene
|
||||
}
|
||||
}
|
||||
|
||||
setTitle("Chi tiết");
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Chi tiết</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -9,8 +9,10 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextWatcher;
|
||||
@@ -183,6 +185,8 @@ public class FoodList extends AppCompatActivity {
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>" + categoryName +"</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.daimajia.slider.library.Animations.DescriptionAnimation;
|
||||
import com.daimajia.slider.library.SliderLayout;
|
||||
import com.daimajia.slider.library.SliderTypes.BaseSliderView;
|
||||
import com.daimajia.slider.library.SliderTypes.TextSliderView;
|
||||
import com.dcastalia.localappupdate.DownloadApk;
|
||||
import com.firebase.ui.database.FirebaseRecyclerAdapter;
|
||||
import com.firebase.ui.database.FirebaseRecyclerOptions;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
@@ -257,8 +258,9 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
agree.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Uri uri = Uri.parse("https://drive.google.com/uc?id=1uDUvpzJt8p96iDNMdNrsR9lqVAT06gqk&export=download");
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||
String url = "https://github.com/Piashsarker/AndroidAppUpdateLibrary/raw/master/app-debug.apk";
|
||||
DownloadApk downloadApk = new DownloadApk(Home.this);
|
||||
downloadApk.startDownloadingApk(url);
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
});
|
||||
@@ -442,7 +444,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
drawerLayout.closeDrawer(GravityCompat.START);
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showSettingDialog() {
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.waterbase.foodify;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.StrictMode;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
@@ -72,8 +74,6 @@ public class OrderDetail extends AppCompatActivity {
|
||||
|
||||
String comment = "";
|
||||
|
||||
setTitle("Thông tin chi tiết đơn hàng");
|
||||
|
||||
StrictMode.ThreadPolicy policy = new
|
||||
StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(policy);
|
||||
@@ -192,6 +192,8 @@ public class OrderDetail extends AppCompatActivity {
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Thông tin chi tiết đơn hàng</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.waterbase.foodify;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@@ -59,9 +61,10 @@ public class OrderStatus extends AppCompatActivity {
|
||||
|
||||
loadOrders(Common.currentUser.getPhone());
|
||||
|
||||
setTitle("Tình trạng đơn hàng");
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Tình trạng đơn hàng</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -6,7 +6,9 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
@@ -34,8 +36,6 @@ public class OrderStatusDetail extends AppCompatActivity {
|
||||
|
||||
String comment = "";
|
||||
|
||||
setTitle("Thông tin chi tiết đơn hàng");
|
||||
|
||||
order_address = findViewById(R.id.order_address);
|
||||
order_total = findViewById(R.id.order_total);
|
||||
order_comment = findViewById(R.id.order_comment);
|
||||
@@ -67,6 +67,8 @@ public class OrderStatusDetail extends AppCompatActivity {
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Thông tin chi tiết đơn hàng</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -8,7 +8,9 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@@ -56,8 +58,6 @@ public class ShowComment extends AppCompatActivity {
|
||||
|
||||
setContentView(R.layout.activity_show_comment);
|
||||
|
||||
setTitle("Bình luận");
|
||||
|
||||
//Firebase
|
||||
database = FirebaseDatabase.getInstance();
|
||||
ratingTbl = database.getReference("Rating");
|
||||
@@ -145,6 +145,8 @@ public class ShowComment extends AppCompatActivity {
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Bình luận</font>"));
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
@@ -1,106 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
app:cardElevation="4dp"
|
||||
>
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/view_background"
|
||||
android:background="@color/bgRowBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bgRowBackground">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete_icon"
|
||||
android:src="@drawable/ic_baseline_delete_24"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
/>
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/ic_baseline_delete_24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_toLeftOf="@id/delete_icon"
|
||||
android:text="Xoá"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/view_foreground"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cart_image"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"/>
|
||||
android:layout_height="70dp"
|
||||
android:layout_margin="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="9"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cart_item_name"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:textAllCaps="true"
|
||||
android:fontFamily="@font/bold"
|
||||
android:text="Food 01"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/cart_item_Price"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:textAllCaps="true"
|
||||
android:fontFamily="@font/italic"
|
||||
android:text="100,000"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:fontFamily="@font/bold"
|
||||
android:gravity="center_vertical|start"
|
||||
android:text="Food 01"
|
||||
android:textAllCaps="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtDiscount"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textAllCaps="true"
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/red"
|
||||
android:text="-50%"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/cart_item_Price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:fontFamily="@font/italic"
|
||||
android:gravity="center_vertical|start"
|
||||
android:text="100,000"
|
||||
android:textAllCaps="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtDiscount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="-50%"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
|
||||
android:id="@+id/btn_quantity"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
app:backGroundColor="@color/white"
|
||||
app:finalNumber="20"
|
||||
app:initialNumber="1"
|
||||
app:textColor="@color/purple_500"
|
||||
app:textSize="6sp"
|
||||
android:layout_gravity="right"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
|
||||
android:id="@+id/btn_quantity"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
app:textSize="6sp"
|
||||
app:textColor="@color/purple_500"
|
||||
app:backGroundColor="@color/white"
|
||||
app:initialNumber="1"
|
||||
app:finalNumber="20"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Foodify" parent="Theme.MaterialComponents.Light.DarkActionBar">
|
||||
<style name="Theme.Foodify" parent="Theme.Material3.Light">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="external_files" path="."/>
|
||||
</paths>
|
||||
Reference in New Issue
Block a user