mirror of
https://github.com/Nezumi-2711/PRM392.git
synced 2026-09-22 13:48:29 +00:00
Fix UI, Layout.
This commit is contained in:
@@ -3,20 +3,6 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('C:\\Users\\phanh\\Desktop\\testKeyStore.jks')
|
||||
storePassword '123456'
|
||||
keyAlias 'CBNV'
|
||||
keyPassword '123456'
|
||||
}
|
||||
release {
|
||||
storeFile file('C:\\Users\\phanh\\Desktop\\testKeyStore.jks')
|
||||
storePassword '123456'
|
||||
keyAlias 'CBNV'
|
||||
keyPassword '123456'
|
||||
}
|
||||
}
|
||||
compileSdk 32
|
||||
|
||||
defaultConfig {
|
||||
|
||||
@@ -52,6 +52,12 @@ public class FoodList extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_food_list);
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
//Firebase
|
||||
database = FirebaseDatabase.getInstance();
|
||||
foodList = database.getReference("Foods");
|
||||
@@ -126,12 +132,6 @@ public class FoodList extends AppCompatActivity {
|
||||
});
|
||||
|
||||
setTitle(categoryName);
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
// showing the back button in action bar
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
private void startSearch(CharSequence text) {
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.waterbase.foodify;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Debug;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@@ -102,16 +104,23 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
viewHolder.setItemClickListener(new ItemClickListener() {
|
||||
@Override
|
||||
public void onClick(View view, int position, boolean isLongClick) {
|
||||
//Get Category Id and send to new Activity
|
||||
Intent foodList = new Intent(getBaseContext(), FoodList.class);
|
||||
foodList.putExtra("CategoryId", adapter.getRef(position).getKey());
|
||||
foodList.putExtra("CategoryName", model.getName());
|
||||
startActivity(foodList);
|
||||
|
||||
try {
|
||||
//Get Category Id and send to new Activity
|
||||
Intent foodList = new Intent(getBaseContext(), FoodList.class);
|
||||
foodList.putExtra("CategoryId", adapter.getRef(position).getKey());
|
||||
foodList.putExtra("CategoryName", model.getName());
|
||||
startActivity(foodList);
|
||||
}catch (Exception e){
|
||||
Log.d("ERROR", e.getStackTrace().toString());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
recyler_menu.setAdapter(adapter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.waterbase.foodify.SignIn">
|
||||
tools:context="com.waterbase.foodify.SignIn"
|
||||
style="@style/Theme.MaterialComponents.DayNight.NoActionBar"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Foodify" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<style name="Theme.Foodify" 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