mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Refactor Code
This commit is contained in:
@@ -42,4 +42,8 @@ dependencies {
|
|||||||
implementation 'com.google.android.material:material:1.8.0'
|
implementation 'com.google.android.material:material:1.8.0'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
|
|
||||||
|
implementation 'androidx.viewpager2:viewpager2:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.makeramen:roundedimageview:2.3.0'
|
||||||
}
|
}
|
||||||
@@ -14,29 +14,29 @@
|
|||||||
android:theme="@style/Theme.Foodify"
|
android:theme="@style/Theme.Foodify"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
<activity
|
<activity
|
||||||
android:name=".ResetPasswordActivity"
|
android:name=".Activity.ResetPasswordActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
/>
|
/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".SendEmailActivity"
|
android:name=".Activity.SendEmailActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
/>
|
/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ForgotPasswordActivity"
|
android:name=".Activity.ForgotPasswordActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
/>
|
/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".SignInActivity"
|
android:name=".Activity.SignInActivity"
|
||||||
android:exported="false"/>
|
android:exported="false"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".SignUpActivity"
|
android:name=".Activity.SignUpActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true" />
|
android:noHistory="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SplashScreenActivity"
|
android:name=".Activity.SplashScreenActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".Activity.MainActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ import android.os.Bundle;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import com.capstone.foodify.R;
|
||||||
import com.google.android.material.button.MaterialButton;
|
import com.google.android.material.button.MaterialButton;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
+3
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@@ -8,6 +8,8 @@ import android.annotation.SuppressLint;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import com.capstone.foodify.R;
|
||||||
|
import com.capstone.foodify.ViewPagerAdapter;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
import com.google.android.material.navigation.NavigationBarView;
|
import com.google.android.material.navigation.NavigationBarView;
|
||||||
|
|
||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
@@ -7,6 +7,7 @@ import android.os.Bundle;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import com.capstone.foodify.R;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
public class ResetPasswordActivity extends AppCompatActivity {
|
public class ResetPasswordActivity extends AppCompatActivity {
|
||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
@@ -7,6 +7,7 @@ import android.os.Bundle;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import com.capstone.foodify.R;
|
||||||
import com.google.android.material.button.MaterialButton;
|
import com.google.android.material.button.MaterialButton;
|
||||||
|
|
||||||
public class SendEmailActivity extends AppCompatActivity {
|
public class SendEmailActivity extends AppCompatActivity {
|
||||||
+2
-6
@@ -1,21 +1,17 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.capstone.foodify.R;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class SignInActivity extends AppCompatActivity {
|
public class SignInActivity extends AppCompatActivity {
|
||||||
|
|
||||||
TextView signUp_textView, forgotPassword_textView;
|
TextView signUp_textView, forgotPassword_textView;
|
||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
@@ -21,6 +21,7 @@ import android.widget.Toast;
|
|||||||
import com.capstone.foodify.API.ApiService;
|
import com.capstone.foodify.API.ApiService;
|
||||||
import com.capstone.foodify.DistrictWardResponse.Datas;
|
import com.capstone.foodify.DistrictWardResponse.Datas;
|
||||||
import com.capstone.foodify.DistrictWardResponse.DisctrictWardResponse;
|
import com.capstone.foodify.DistrictWardResponse.DisctrictWardResponse;
|
||||||
|
import com.capstone.foodify.R;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package com.capstone.foodify;
|
package com.capstone.foodify.Activity;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
@@ -7,7 +7,7 @@ import android.content.Intent;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
import java.util.Objects;
|
import com.capstone.foodify.R;
|
||||||
|
|
||||||
public class SplashScreenActivity extends AppCompatActivity {
|
public class SplashScreenActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@@ -3,6 +3,7 @@ package com.capstone.foodify.Fragment;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -10,11 +11,15 @@ import android.view.ViewGroup;
|
|||||||
|
|
||||||
import com.capstone.foodify.R;
|
import com.capstone.foodify.R;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
return inflater.inflate(R.layout.fragment_home, container, false);
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ import android.widget.Button;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.capstone.foodify.R;
|
import com.capstone.foodify.R;
|
||||||
import com.capstone.foodify.SignUpActivity;
|
import com.capstone.foodify.Activity.SignUpActivity;
|
||||||
|
|
||||||
public class ProfileFragment extends Fragment {
|
public class ProfileFragment extends Fragment {
|
||||||
|
|
||||||
@@ -28,7 +28,6 @@ public class ProfileFragment extends Fragment {
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Intent i =new Intent(getActivity(), SignUpActivity.class);
|
Intent i =new Intent(getActivity(), SignUpActivity.class);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
((Activity) getActivity()).overridePendingTransition(0,0);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return rootView;
|
return rootView;
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 7.9 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.6 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.8 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.9 MiB |
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ForgotPasswordActivity">
|
tools:context=".Activity.ForgotPasswordActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/back_image"
|
android:id="@+id/back_image"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context=".MainActivity"
|
tools:context=".Activity.MainActivity"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ResetPasswordActivity">
|
tools:context=".Activity.ResetPasswordActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/close_image"
|
android:id="@+id/close_image"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".SendEmailActivity">
|
tools:context=".Activity.SendEmailActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/close_image"
|
android:id="@+id/close_image"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".SignInActivity">
|
tools:context=".Activity.SignInActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/back_image"
|
android:id="@+id/back_image"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".SignUpActivity">
|
tools:context=".Activity.SignUpActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/back_image"
|
android:id="@+id/back_image"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".SplashScreenActivity">
|
tools:context=".Activity.SplashScreenActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="287dp"
|
android:layout_width="287dp"
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".Fragment.HomeFragment">
|
tools:context=".Fragment.HomeFragment">
|
||||||
|
|
||||||
|
|
||||||
<!-- TODO: Update blank fragment layout -->
|
</LinearLayout>
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/hello_blank_fragment" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/imageSlide"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
app:riv_corner_radius="12dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</com.makeramen.roundedimageview.RoundedImageView>
|
||||||
Reference in New Issue
Block a user