Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CMPT370
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hannah Do (htd345)
CMPT370
Commits
d3627bde
Commit
d3627bde
authored
2 years ago
by
Shaobo Xu (shx863)
Browse files
Options
Downloads
Patches
Plain Diff
Delete viewevent.java
parent
0128bcab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
App/event36/app/src/main/java/com/example/event36/viewevent.java
+0
-104
0 additions, 104 deletions
...nt36/app/src/main/java/com/example/event36/viewevent.java
with
0 additions
and
104 deletions
App/event36/app/src/main/java/com/example/event36/viewevent.java
deleted
100644 → 0
+
0
−
104
View file @
0128bcab
package
com.example.event36
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.core.content.res.ResourcesCompat
;
import
android.app.Application
;
import
android.content.Intent
;
import
android.content.res.Resources
;
import
android.graphics.drawable.Drawable
;
import
android.icu.util.GregorianCalendar
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
viewevent
extends
AppCompatActivity
{
protected
String
name
,
Stringdate
,
startTime
,
endTime
,
location
,
description
,
event
=
"0"
;
protected
String
day
=
""
,
month
=
""
,
year
=
""
;
protected
Button
confirm
,
cancel
;
protected
List
<
String
>
time_list
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_viewevent
);
TextView
tvname
=
findViewById
(
R
.
id
.
event_name
);
TextView
tvdate
=
findViewById
(
R
.
id
.
event_date
);
TextView
tvstartTime
=
findViewById
(
R
.
id
.
event_start_time
);
TextView
tvendTime
=
findViewById
(
R
.
id
.
event_end_time
);
TextView
tvlocation
=
findViewById
(
R
.
id
.
event_location
);
TextView
tvdescription
=
findViewById
(
R
.
id
.
event_description
);
name
=
getIntent
().
getStringExtra
(
"name"
);
Stringdate
=
getIntent
().
getStringExtra
(
"date"
);
startTime
=
getIntent
().
getStringExtra
(
"startTime"
);
endTime
=
getIntent
().
getStringExtra
(
"endTime"
);
location
=
getIntent
().
getStringExtra
(
"location"
);
description
=
getIntent
().
getStringExtra
(
"description"
);
tvname
.
setText
(
name
);
tvdate
.
setText
(
Stringdate
);
tvstartTime
.
setText
(
startTime
);
tvendTime
.
setText
(
endTime
);
tvlocation
.
setText
(
location
);
tvdescription
.
setText
(
description
);
//Add activity for two buttons
confirm
=
(
Button
)
findViewById
(
R
.
id
.
button_confirm
);
cancel
=(
Button
)
findViewById
(
R
.
id
.
button_cancel
);
confirm
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
//time_list=get_date(Stringdate);
Intent
intent
=
new
Intent
(
viewevent
.
this
,
MainActivity
.
class
);
intent
.
putExtra
(
"new_event_name"
,
name
);
intent
.
putExtra
(
"new_year"
,
time_list
.
get
(
2
));
intent
.
putExtra
(
"new_month"
,
time_list
.
get
(
1
));
intent
.
putExtra
(
"new_day"
,
time_list
.
get
(
0
));
intent
.
putExtra
(
"new_location"
,
location
);
intent
.
putExtra
(
"new_description"
,
description
);
intent
.
putExtra
(
"new_event"
,
event
);
startActivity
(
intent
);
}
});
}
//covert date from string to GregorianCalendar
public
List
<
String
>
get_date
(
String
date
){
for
(
int
i
=
0
;
i
<
date
.
length
();
i
++){
char
ch
=
date
.
charAt
(
i
);
year
=
year
+
ch
;
if
(
date
.
charAt
(
i
)==
'/'
&&
i
<=
2
){
day
=
day
+
year
;
year
=
""
;
}
if
(
date
.
charAt
(
i
)==
'/'
&&
i
<=
5
){
month
=
month
+
year
;
year
=
""
;
}
year
=
year
+
ch
;
if
(
Stringdate
.
charAt
(
i
)==
'/'
){
year
=
""
;
}
}
List
<
String
>
dat_l
=
new
ArrayList
<>();
dat_l
.
add
(
day
);
dat_l
.
add
(
month
);
dat_l
.
add
(
year
);
return
dat_l
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment