Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CarRental_Christopher_Foster
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
christopher.foster
CarRental_Christopher_Foster
Commits
d013ac11
Commit
d013ac11
authored
May 15, 2020
by
christopher.foster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reviews can now be left for the audi
parent
7f3cc3eb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
1 deletion
+122
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
Carlist.java
app/src/main/java/com/example/assignment/Carlist.java
+5
-0
audiReview.java
app/src/main/java/com/example/assignment/audiReview.java
+59
-0
activity_audi_review.xml
app/src/main/res/layout/activity_audi_review.xml
+55
-0
activity_carlist.xml
app/src/main/res/layout/activity_carlist.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
d013ac11
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".returnCar"
></activity>
<activity
android:name=
".audiReview"
></activity>
<activity
android:name=
".returnCar"
/>
<activity
android:name=
".orderDetails"
/>
<activity
android:name=
".orderDetails"
/>
<activity
android:name=
".carPurchase"
/>
<activity
android:name=
".carPurchase"
/>
<activity
android:name=
".Carlist"
/>
<activity
android:name=
".Carlist"
/>
...
...
app/src/main/java/com/example/assignment/Carlist.java
View file @
d013ac11
...
@@ -23,4 +23,9 @@ public class Carlist extends AppCompatActivity {
...
@@ -23,4 +23,9 @@ public class Carlist extends AppCompatActivity {
Intent
I
=
new
Intent
(
this
,
returnCar
.
class
);
Intent
I
=
new
Intent
(
this
,
returnCar
.
class
);
startActivity
(
I
);
startActivity
(
I
);
}
}
public
void
reviewAudi
(
View
v
)
{
Intent
I
=
new
Intent
(
this
,
audiReview
.
class
);
startActivity
(
I
);
}
}
}
app/src/main/java/com/example/assignment/audiReview.java
0 → 100644
View file @
d013ac11
package
com
.
example
.
assignment
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.util.Scanner
;
public
class
audiReview
extends
AppCompatActivity
{
File
review
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_review
);
review
=
new
File
(
getApplicationContext
().
getFilesDir
(),
"audiReview.txt"
);
}
public
void
addReview
(
View
v
)
{
String
leaveReview
=
((
EditText
)
findViewById
(
R
.
id
.
audiReview
)).
getText
().
toString
();
try
{
FileWriter
stream
=
new
FileWriter
(
review
,
true
);
stream
.
append
(
"- "
+
leaveReview
+
"\n"
);
stream
.
close
();
Toast
.
makeText
(
getApplicationContext
(),
"You have successfully left a review"
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
e
.
toString
(),
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
displayReview
(
View
v
)
{
try
{
Scanner
read
=
new
Scanner
(
review
);
String
s
=
""
;
while
(
read
.
hasNextLine
())
{
s
=
s
+
"\n"
+
read
.
nextLine
();
}
((
TextView
)
(
findViewById
(
R
.
id
.
display
))).
setText
(
s
);
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
e
.
toString
(),
Toast
.
LENGTH_LONG
).
show
();
}
}
}
app/src/main/res/layout/activity_audi_review.xml
0 → 100644
View file @
d013ac11
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".audiReview"
>
<Button
android:id=
"@+id/button2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:layout_marginEnd=
"40dp"
android:layout_marginRight=
"40dp"
android:onClick=
"addReview"
android:text=
"Add Review"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<Button
android:id=
"@+id/button3"
android:layout_width=
"382dp"
android:layout_height=
"55dp"
android:layout_marginTop=
"7dp"
android:layout_marginEnd=
"15dp"
android:layout_marginRight=
"15dp"
android:onClick=
"displayReview"
android:text=
"Display"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button2"
/>
<TextView
android:id=
"@+id/display"
android:layout_width=
"372dp"
android:layout_height=
"563dp"
android:layout_marginTop=
"24dp"
android:layout_marginEnd=
"19dp"
android:layout_marginRight=
"19dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button3"
/>
<EditText
android:id=
"@+id/audiReview"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"24dp"
android:layout_marginLeft=
"24dp"
android:layout_marginTop=
"5dp"
android:ems=
"10"
android:gravity=
"start|top"
android:inputType=
"textMultiLine"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_carlist.xml
View file @
d013ac11
...
@@ -293,6 +293,7 @@ air conditioning, ABS brakes, 2 people "
...
@@ -293,6 +293,7 @@ air conditioning, ABS brakes, 2 people "
android:layout_marginStart=
"2dp"
android:layout_marginStart=
"2dp"
android:layout_marginLeft=
"2dp"
android:layout_marginLeft=
"2dp"
android:layout_marginTop=
"7dp"
android:layout_marginTop=
"7dp"
android:onClick=
"reviewAudi"
android:text=
"Review"
android:text=
"Review"
android:textSize=
"11sp"
android:textSize=
"11sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment