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