Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
aea535f0
Commit
aea535f0
authored
Jun 30, 2017
by
Mrunzzz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Pickers
parent
6f65f780
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
10 deletions
+60
-10
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragments/AddEventFragment.java
.../ac/iitb/gymkhana/iitbapp/fragments/AddEventFragment.java
+52
-4
app/src/main/res/layout/fragment_add_event.xml
app/src/main/res/layout/fragment_add_event.xml
+8
-6
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragments/AddEventFragment.java
View file @
aea535f0
package
in.ac.iitb.gymkhana.iitbapp.fragments
;
package
in.ac.iitb.gymkhana.iitbapp.fragments
;
import
android.app.DatePickerDialog
;
import
android.app.TimePickerDialog
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.database.Cursor
;
...
@@ -17,11 +19,19 @@ import android.view.View;
...
@@ -17,11 +19,19 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.DatePicker
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.ImageButton
;
import
android.widget.ImageButton
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TimePicker
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
org.w3c.dom.Text
;
import
java.sql.Time
;
import
java.util.Calendar
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
...
@@ -36,10 +46,10 @@ public class AddEventFragment extends Fragment {
...
@@ -36,10 +46,10 @@ public class AddEventFragment extends Fragment {
Button
createEvent
;
Button
createEvent
;
@BindView
(
R
.
id
.
cb_public
)
@BindView
(
R
.
id
.
cb_public
)
CheckBox
publicCheckBox
;
CheckBox
publicCheckBox
;
@BindView
(
R
.
id
.
et
_date
)
@BindView
(
R
.
id
.
tv
_date
)
EditText
date
;
TextView
date
;
@BindView
(
R
.
id
.
et
_time
)
@BindView
(
R
.
id
.
tv
_time
)
EditText
time
;
TextView
time
;
@BindView
(
R
.
id
.
et_venue
)
@BindView
(
R
.
id
.
et_venue
)
EditText
venue
;
EditText
venue
;
@BindView
(
R
.
id
.
et_eventDetails
)
@BindView
(
R
.
id
.
et_eventDetails
)
...
@@ -64,6 +74,44 @@ public class AddEventFragment extends Fragment {
...
@@ -64,6 +74,44 @@ public class AddEventFragment extends Fragment {
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_add_event
,
container
,
false
);
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_add_event
,
container
,
false
);
ButterKnife
.
bind
(
this
,
view
);
ButterKnife
.
bind
(
this
,
view
);
date
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
int
mYear
=
calendar
.
get
(
Calendar
.
YEAR
);
int
mMonth
=
calendar
.
get
(
Calendar
.
MONTH
);
int
mDay
=
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
);
DatePickerDialog
datePickerDialog
=
new
DatePickerDialog
(
getContext
(),
new
DatePickerDialog
.
OnDateSetListener
()
{
@Override
public
void
onDateSet
(
DatePicker
view
,
int
year
,
int
month
,
int
dayOfMonth
)
{
date
.
setText
(
dayOfMonth
+
"/"
+
month
+
"/"
+
year
);
}
}
,
mYear
,
mMonth
,
mDay
);
datePickerDialog
.
show
();
}
});
time
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
int
mHour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
);
int
mMin
=
calendar
.
get
(
Calendar
.
MINUTE
);
TimePickerDialog
timePickerDialog
=
new
TimePickerDialog
(
getContext
(),
new
TimePickerDialog
.
OnTimeSetListener
()
{
@Override
public
void
onTimeSet
(
TimePicker
view
,
int
hourOfDay
,
int
minute
)
{
time
.
setText
(
hourOfDay
+
":"
+
minute
);
}
},
mHour
,
mMin
,
true
);
timePickerDialog
.
show
();
}
});
imageButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
imageButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
...
...
app/src/main/res/layout/fragment_add_event.xml
View file @
aea535f0
...
@@ -41,13 +41,14 @@
...
@@ -41,13 +41,14 @@
android:layout_marginRight=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_height=
"40dp"
>
android:layout_height=
"40dp"
>
<
EditText
<
TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:paddingRight=
"6dp"
android:paddingRight=
"6dp"
android:paddingLeft=
"6dp"
android:paddingLeft=
"6dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/et_date"
android:id=
"@+id/tv_date"
android:hint=
"Date"
/>
android:hint=
" Date "
android:paddingTop=
"8dp"
/>
<View
<View
android:layout_width=
"3dp"
android:layout_width=
"3dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
@@ -55,13 +56,14 @@
...
@@ -55,13 +56,14 @@
android:layout_marginBottom=
"5dp"
android:layout_marginBottom=
"5dp"
android:background=
"@color/common_google_signin_btn_text_dark_disabled"
/>
android:background=
"@color/common_google_signin_btn_text_dark_disabled"
/>
<
EditText
<
TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:paddingRight=
"6dp"
android:paddingRight=
"6dp"
android:paddingLeft=
"6dp"
android:paddingLeft=
"6dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/et_time"
android:id=
"@+id/tv_time"
android:hint=
"Time"
/>
android:hint=
" Time "
android:paddingTop=
"8dp"
/>
<View
<View
android:layout_width=
"3dp"
android:layout_width=
"3dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_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