diff --git a/apk/MyVehicles.apk b/apk/MyVehicles.apk
index 0f738a5..a13f33a 100644
Binary files a/apk/MyVehicles.apk and b/apk/MyVehicles.apk differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d604d9b..2ee0c18 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -9,10 +9,14 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
+
+ android:theme="@style/AppTheme.NoActionBar" />
adapterView, View view, int i, long l) {
+ Vehicle selectedVehicle = (Vehicle) adapterView.getItemAtPosition(i);
+ Intent intent = new Intent(Cars.this.getActivity(), VehicleDetails.class);
+ intent.putExtra("registration",selectedVehicle.getRegistration());
+ intent.putExtra("type",1);
+ startActivity(intent);
+ }
+ });
+
return view;
}
diff --git a/app/src/main/java/com/carlostojal/myvehicles/Motorcycles.java b/app/src/main/java/com/carlostojal/myvehicles/Motorcycles.java
index fe58318..e173b22 100644
--- a/app/src/main/java/com/carlostojal/myvehicles/Motorcycles.java
+++ b/app/src/main/java/com/carlostojal/myvehicles/Motorcycles.java
@@ -15,6 +15,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
@@ -49,6 +50,17 @@ public void onClick(View view) {
}
});
+ motorcycleList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ Vehicle selectedVehicle = (Vehicle) adapterView.getItemAtPosition(i);
+ Intent intent = new Intent(Motorcycles.this.getActivity(), VehicleDetails.class);
+ intent.putExtra("registration",selectedVehicle.getRegistration());
+ intent.putExtra("type",2);
+ startActivity(intent);
+ }
+ });
+
return view;
}
diff --git a/app/src/main/java/com/carlostojal/myvehicles/Other.java b/app/src/main/java/com/carlostojal/myvehicles/Other.java
index 14af072..67343ed 100644
--- a/app/src/main/java/com/carlostojal/myvehicles/Other.java
+++ b/app/src/main/java/com/carlostojal/myvehicles/Other.java
@@ -17,6 +17,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
@@ -51,6 +52,17 @@ public void onClick(View view) {
}
});
+ otherList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ Vehicle selectedVehicle = (Vehicle) adapterView.getItemAtPosition(i);
+ Intent intent = new Intent(Other.this.getActivity(), VehicleDetails.class);
+ intent.putExtra("registration",selectedVehicle.getRegistration());
+ intent.putExtra("type",3);
+ startActivity(intent);
+ }
+ });
+
return view;
}
diff --git a/app/src/main/java/com/carlostojal/myvehicles/VehicleDetails.java b/app/src/main/java/com/carlostojal/myvehicles/VehicleDetails.java
new file mode 100644
index 0000000..db1a3b2
--- /dev/null
+++ b/app/src/main/java/com/carlostojal/myvehicles/VehicleDetails.java
@@ -0,0 +1,68 @@
+package com.carlostojal.myvehicles;
+
+//
+// Copyright © Carlos Tojal (carlostojal)
+// VehicleDetails.java
+// MyVehicles
+// github.com/carlostojal/MyVehicles
+//
+
+import android.os.Bundle;
+
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.android.material.snackbar.Snackbar;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import android.view.View;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+public class VehicleDetails extends AppCompatActivity {
+
+ ArrayList vehicles;
+ Vehicle vehicle;
+ VehicleManager vehicleManager;
+
+ TextView brand;
+ TextView model;
+ TextView displacement;
+ TextView year;
+ TextView registration;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_vehicle_details);
+
+ brand = (TextView) findViewById(R.id.brand_value_details);
+ model = (TextView) findViewById(R.id.model_value_details);
+ displacement = (TextView) findViewById(R.id.displacement_value_details);
+ year = (TextView) findViewById(R.id.year_value_details);
+ registration = (TextView) findViewById(R.id.registration_value_details);
+
+ vehicleManager = new VehicleManager();
+
+ Bundle extras = getIntent().getExtras();
+ String searchedRegistration = extras.getString("registration");
+ int searchedType = extras.getInt("type");
+ vehicles = vehicleManager.loadVehicles(getApplicationContext(),searchedType);
+ for(int i=0;i
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_other.xml b/app/src/main/res/layout/fragment_other.xml
index 27a02f4..a557cef 100644
--- a/app/src/main/res/layout/fragment_other.xml
+++ b/app/src/main/res/layout/fragment_other.xml
@@ -25,7 +25,7 @@
android:id="@+id/other_list"
android:layout_width="0dp"
android:layout_height="0dp"
- android:layout_marginTop="16dp"
+ android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2ddbd8a..76a8c59 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -5,8 +5,16 @@
Add Vehicle
AddCar
Brand (obligatory):
+ Brand:
Model (obligatory):
+ Model:
Displacement:
Year:
Registration (obligatory):
+ Registration
+ Insurances
+ inspections
+ Taxes
+ Revisions
+ VehicleDetails