Fixed back on home
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -22,6 +23,7 @@ public class HomeActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_home);
|
||||
|
||||
ImageView vec_back = findViewById(R.id.homeBackButton);
|
||||
BottomNavigationView bottomNavigationView = findViewById(R.id.homeBottomView);
|
||||
bottomNavigationView.setOnNavigationItemSelectedListener(
|
||||
new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
@@ -50,6 +52,11 @@ public class HomeActivity extends AppCompatActivity {
|
||||
if (user != null)
|
||||
userGreeting.setText("Welcome " + user + "!");
|
||||
|
||||
vec_back.setOnClickListener(view -> {
|
||||
Intent newScreen = new Intent(getApplicationContext(), LoginActivity.class);
|
||||
startActivity(newScreen);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Predict extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_predict);
|
||||
|
||||
vec_back = findViewById(R.id.imageView2);
|
||||
vec_back = findViewById(R.id.predictBackButton);
|
||||
edi_station = findViewById(R.id.editTextText);
|
||||
edi_weather = findViewById(R.id.editTextText2);
|
||||
btn_pred = findViewById(R.id.button4);
|
||||
@@ -41,12 +41,9 @@ public class Predict extends AppCompatActivity {
|
||||
txt_station = findViewById(R.id.textView4);
|
||||
txt_pred_time = findViewById(R.id.predicted_time);
|
||||
|
||||
vec_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent newScreen = new Intent(getApplicationContext(), HomeActivity.class);
|
||||
startActivity(newScreen);
|
||||
}
|
||||
vec_back.setOnClickListener(view -> {
|
||||
Intent newScreen = new Intent(getApplicationContext(), HomeActivity.class);
|
||||
startActivity(newScreen);
|
||||
});
|
||||
|
||||
btn_pred.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@@ -29,19 +29,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/homeToolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/material_dynamic_primary60"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
<ImageView
|
||||
android:id="@+id/homeBackButton"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navigationIcon="@drawable/baseline_arrow_back_ios"
|
||||
app:title="Home"
|
||||
app:titleCentered="true" />
|
||||
app:srcCompat="@drawable/_vector" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userGreeting"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
tools:context=".Predict">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:id="@+id/predictBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="25dp"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
app:titleCentered="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:id="@+id/predictBackButton"
|
||||
android:layout_width="159dp"
|
||||
android:layout_height="104dp"
|
||||
android:layout_marginTop="100dp"
|
||||
@@ -50,10 +50,10 @@
|
||||
android:drawablePadding="16dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
app:layout_constraintEnd_toEndOf="@+id/imageView2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/predictBackButton"
|
||||
app:layout_constraintHorizontal_bias="0.483"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageView2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
||||
app:layout_constraintStart_toStartOf="@+id/predictBackButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/predictBackButton" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextText3"
|
||||
|
||||
Reference in New Issue
Block a user