mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 20:00:50 +00:00
Add back button for sign in and sign up screen
This commit is contained in:
@@ -25,8 +25,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Objects.requireNonNull(getSupportActionBar()).hide();
|
||||
|
||||
bottomNavigationView = findViewById(R.id.bottom_nav);
|
||||
viewPager2 = findViewById(R.id.viewPager);
|
||||
viewPagerAdapter = new ViewPagerAdapter(this);
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -15,18 +16,23 @@ import java.util.Objects;
|
||||
public class SignInActivity extends AppCompatActivity {
|
||||
|
||||
TextView signUp_textView;
|
||||
|
||||
ImageView back_image;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_sign_in);
|
||||
|
||||
// calling the action bar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
Objects.requireNonNull(actionBar).setDisplayShowTitleEnabled(false);
|
||||
// showing the back button in action bar
|
||||
Objects.requireNonNull(actionBar).setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
signUp_textView = (TextView) findViewById(R.id.sign_up_textView);
|
||||
|
||||
back_image = (ImageView) findViewById(R.id.back_image);
|
||||
|
||||
back_image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
signUp_textView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -30,9 +31,9 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
textInput_address, textInput_repeatPassword, textInput_firstName, textInput_lastName, textInput_birthDay;
|
||||
final Calendar myCalendar= Calendar.getInstance();
|
||||
EditText editText, edt_birthday;
|
||||
|
||||
TextView signIn_textView;
|
||||
Spinner wardSpinner, districtSpinner;
|
||||
ImageView back_image;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -52,9 +53,14 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
// enabling action bar app icon and behaving it as toggle button
|
||||
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
back_image = (ImageView) findViewById(R.id.back_image);
|
||||
|
||||
back_image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,5 @@ public class SplashScreenActivity extends AppCompatActivity {
|
||||
finish();
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
Objects.requireNonNull(getSupportActionBar()).hide();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user