mirror of
https://github.com/Nezumi-2711/PRM392.git
synced 2026-09-22 13:48:29 +00:00
Fix font and improve UI
This commit is contained in:
@@ -58,13 +58,16 @@
|
||||
android:name=".Home"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_home"
|
||||
android:theme="@style/Theme.FoodifyServer.NoActionBar" />
|
||||
android:theme="@style/Theme.FoodifyServer.NoActionBar"
|
||||
/>
|
||||
<activity
|
||||
android:name=".SignIn"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.FoodifyServer.NoActionBar" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.FoodifyServer.NoActionBar" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.waterbase.foodifyServer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -89,6 +90,12 @@ public class BannerActivity extends AppCompatActivity {
|
||||
|
||||
loadListBanner();
|
||||
loadListFood();
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
private void loadListBanner() {
|
||||
@@ -393,4 +400,14 @@ public class BannerActivity extends AppCompatActivity {
|
||||
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
this.finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.waterbase.foodifyServer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -74,6 +75,8 @@ public class FoodList extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_food_list);
|
||||
|
||||
setTitle("Quản lý danh sách thức ăn");
|
||||
|
||||
//Firebase
|
||||
db = FirebaseDatabase.getInstance();
|
||||
foodList = db.getReference("Foods");
|
||||
@@ -158,6 +161,12 @@ public class FoodList extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
alertDialog.show();
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
private void uploadImage() {
|
||||
@@ -392,4 +401,14 @@ public class FoodList extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
this.finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
setContentView(R.layout.activity_home);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar.setTitle("Menu Management");
|
||||
toolbar.setTitle("Quản lý menu");
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
//Init database
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.waterbase.foodifyServer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.waterbase.foodifyServer.Common.Common;
|
||||
@@ -46,5 +49,21 @@ public class OrderDetail extends AppCompatActivity {
|
||||
OrderDetailAdapter adapter = new OrderDetailAdapter(Common.currentRequest.getFoods());
|
||||
adapter.notifyDataSetChanged();
|
||||
lstFoods.setAdapter(adapter);
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
this.finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.waterbase.foodifyServer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -11,6 +12,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
@@ -71,6 +73,12 @@ public class OrderStatus extends AppCompatActivity {
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
loadOrders();
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
private void loadOrders() {
|
||||
@@ -275,4 +283,14 @@ public class OrderStatus extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
this.finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.waterbase.foodifyServer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -41,13 +44,6 @@ public class SendMessage extends AppCompatActivity {
|
||||
btnSend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//Create message
|
||||
// Notification notification = new Notification(edtTitle.getText().toString(), edtMessage.getText().toString());
|
||||
//
|
||||
// Sender toTopic = new Sender();
|
||||
// toTopic.to = new StringBuilder("/topics/").append(Common.topicName).toString();
|
||||
// toTopic.notification = notification;
|
||||
|
||||
Map<String,String> dataSend = new HashMap<>();
|
||||
dataSend.put("title",edtTitle.getText().toString());
|
||||
dataSend.put("message",edtMessage.getText().toString());
|
||||
@@ -68,5 +64,21 @@ public class SendMessage extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
this.finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -20,12 +20,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@color/overlayBackground"
|
||||
android:background="@color/white"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_home"
|
||||
|
||||
app:itemIconTint="@color/white"
|
||||
app:itemTextColor="@color/white"
|
||||
app:itemIconTint="@color/black"
|
||||
app:itemTextColor="@color/black"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/nav_header_height"
|
||||
android:background="@drawable/side_nav_bar"
|
||||
android:background="@color/purple_500"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
@@ -14,11 +14,11 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:contentDescription="@string/nav_header_desc"
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
app:srcCompat="@mipmap/ic_launcher_round" />
|
||||
app:srcCompat="@drawable/avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtFullName"
|
||||
@@ -27,10 +27,4 @@
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
android:text="@string/nav_header_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nav_header_subtitle" />
|
||||
</LinearLayout>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.FoodifyServer" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<style name="Theme.FoodifyServer" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
||||
Reference in New Issue
Block a user