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
2c66ae4e
Commit
2c66ae4e
authored
Jun 02, 2017
by
Sajal Narang
Committed by
GitHub
Jun 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from Mrunzzz/myBranch, close #7
CalendarView added
parents
a4cbc7b8
e689b050
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
9 deletions
+104
-9
.idea/modules.xml
.idea/modules.xml
+1
-0
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragments/CalendarFragment.java
.../ac/iitb/gymkhana/iitbapp/fragments/CalendarFragment.java
+33
-2
app/src/main/res/drawable/round_text_box.xml
app/src/main/res/drawable/round_text_box.xml
+10
-0
app/src/main/res/layout/fragment_calendar.xml
app/src/main/res/layout/fragment_calendar.xml
+36
-6
app/src/main/res/values-v21/styles.xml
app/src/main/res/values-v21/styles.xml
+11
-0
app/src/main/res/values/colors.xml
app/src/main/res/values/colors.xml
+1
-0
app/src/main/res/values/styles.xml
app/src/main/res/values/styles.xml
+12
-1
No files found.
.idea/modules.xml
View file @
2c66ae4e
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<component
name=
"ProjectModuleManager"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/IITB-App.iml"
filepath=
"$PROJECT_DIR$/IITB-App.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/IITB-App.iml"
filepath=
"$PROJECT_DIR$/IITB-App.iml"
/>
<module
fileurl=
"file://D:\IITB-App\IITBApp.iml"
filepath=
"D:\IITB-App\IITBApp.iml"
/>
<module
fileurl=
"file://D:\IITB-App\IITBApp.iml"
filepath=
"D:\IITB-App\IITBApp.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/app/app.iml"
filepath=
"$PROJECT_DIR$/app/app.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/app/app.iml"
filepath=
"$PROJECT_DIR$/app/app.iml"
/>
</modules>
</modules>
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragments/CalendarFragment.java
View file @
2c66ae4e
package
in.ac.iitb.gymkhana.iitbapp.fragments
;
package
in.ac.iitb.gymkhana.iitbapp.fragments
;
import
android.graphics.Color
;
import
android.graphics.drawable.GradientDrawable
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.CalendarView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
import
in.ac.iitb.gymkhana.iitbapp.R
;
...
@@ -14,7 +19,8 @@ import in.ac.iitb.gymkhana.iitbapp.R;
...
@@ -14,7 +19,8 @@ import in.ac.iitb.gymkhana.iitbapp.R;
*/
*/
public
class
CalendarFragment
extends
Fragment
{
public
class
CalendarFragment
extends
Fragment
{
private
View
view
;
private
Toast
toast
;
public
CalendarFragment
()
{
public
CalendarFragment
()
{
// Required empty public constructor
// Required empty public constructor
}
}
...
@@ -24,7 +30,32 @@ public class CalendarFragment extends Fragment {
...
@@ -24,7 +30,32 @@ public class CalendarFragment extends Fragment {
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
Bundle
savedInstanceState
)
{
// Inflate the layout for this fragment
// Inflate the layout for this fragment
return
inflater
.
inflate
(
R
.
layout
.
fragment_calendar
,
container
,
false
);
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_calendar
,
container
,
false
);
final
CalendarView
simpleCalendarView
=
(
CalendarView
)
view
.
findViewById
(
R
.
id
.
simpleCalendarView
);
// get the reference of CalendarView
simpleCalendarView
.
setFirstDayOfWeek
(
1
);
// set Sunday as the first day of the week
simpleCalendarView
.
setWeekNumberColor
(
getResources
().
getColor
(
R
.
color
.
colorCalendarWeek
));
//setWeekNumberColor
simpleCalendarView
.
setOnDateChangeListener
(
new
CalendarView
.
OnDateChangeListener
()
{
@Override
public
void
onSelectedDayChange
(
CalendarView
view
,
int
year
,
int
month
,
int
dayOfMonth
)
{
if
(
toast
!=
null
)
{
toast
.
cancel
();
}
toast
=
Toast
.
makeText
(
getContext
(),
"Date: ("
+
dayOfMonth
+
"/"
+(
month
+
1
)+
"/"
+
year
+
")"
,
Toast
.
LENGTH_LONG
);
toast
.
show
();
}
});
return
view
;
}
}
}
}
app/src/main/res/drawable/round_text_box.xml
0 → 100644
View file @
2c66ae4e
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<shape
android:shape=
"rectangle"
>
<corners
android:radius=
"50dip"
/>
<stroke
android:width=
"0dip"
android:color=
"#667162"
/>
<gradient
android:angle=
"-90"
android:startColor=
"#FFEA00"
android:endColor=
"#FFEA00"
/>
</shape>
</item>
</selector>
\ No newline at end of file
app/src/main/res/layout/fragment_calendar.xml
View file @
2c66ae4e
<
Fram
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Relativ
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
"in.ac.iitb.gymkhana.iitbapp.fragments.CalendarFragment"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:theme=
"@style/CalendarTheme"
android:background=
"#E0E0E0"
>
<!-- TODO: Update blank fragment layout -->
<!-- TODO: Update blank fragment layout -->
<
Text
View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"60dp"
android:text=
"@string/hello_blank_fragment"
/>
android:background=
"#00BCD4"
/>
<CalendarView
android:id=
"@+id/simpleCalendarView"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:focusedMonthDateColor=
"#000000"
android:unfocusedMonthDateColor=
"#FFFFFF"
android:maxDate=
"01/01/2019"
android:minDate=
"01/01/2017"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@android:color/darker_gray"
android:layout_marginTop=
"19.5dp"
android:layout_marginBottom=
"19.5dp"
android:layout_below=
"@id/simpleCalendarView"
/>
<TextView
android:layout_width=
"120dp"
android:layout_centerHorizontal=
"true"
android:layout_height=
"40dp"
android:text=
"# Events Today"
android:gravity=
"center"
android:layout_below=
"@id/simpleCalendarView"
android:background=
"@drawable/round_text_box"
/>
</
Fram
eLayout>
</
Relativ
eLayout>
app/src/main/res/values-v21/styles.xml
View file @
2c66ae4e
...
@@ -4,4 +4,15 @@
...
@@ -4,4 +4,15 @@
<item
name=
"windowNoTitle"
>
true
</item>
<item
name=
"windowNoTitle"
>
true
</item>
<item
name=
"android:statusBarColor"
>
@android:color/transparent
</item>
<item
name=
"android:statusBarColor"
>
@android:color/transparent
</item>
</style>
</style>
<style
name=
"CalendarTheme"
parent=
"@style/AppTheme.NoActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
#FFEB3B
</item>
<item
name=
"android:colorBackground"
>
?attr/colorButtonNormal
</item>
<item
name=
"android:textColorPrimaryInverse"
>
@android:color/darker_gray
</item>
<item
name=
"android:windowBackground"
>
?android:attr/colorButtonNormal
</item>
</style>
</resources>
</resources>
app/src/main/res/values/colors.xml
View file @
2c66ae4e
...
@@ -3,4 +3,5 @@
...
@@ -3,4 +3,5 @@
<color
name=
"colorPrimary"
>
#3F51B5
</color>
<color
name=
"colorPrimary"
>
#3F51B5
</color>
<color
name=
"colorPrimaryDark"
>
#303F9F
</color>
<color
name=
"colorPrimaryDark"
>
#303F9F
</color>
<color
name=
"colorAccent"
>
#FF4081
</color>
<color
name=
"colorAccent"
>
#FF4081
</color>
<color
name=
"colorCalendarWeek"
>
#000000
</color>
</resources>
</resources>
app/src/main/res/values/styles.xml
View file @
2c66ae4e
<resources>
<resources
xmlns:tools=
"http://schemas.android.com/tools"
>
<!-- Base application theme. -->
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
...
@@ -14,4 +14,15 @@
...
@@ -14,4 +14,15 @@
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<style
name=
"AppTheme.AppBarOverlay"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<style
name=
"AppTheme.PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
<style
name=
"AppTheme.PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
<style
name=
"CalendarTheme"
parent=
"@style/AppTheme.NoActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
#FFEA00
</item>
<item
name=
"android:colorBackground"
>
@android:color/darker_gray
</item>
<item
name=
"android:textColorPrimaryInverse"
>
@android:color/darker_gray
</item>
<item
name=
"android:windowBackground"
>
@android:color/darker_gray
</item>
</style>
</resources>
</resources>
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