Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mytfg
mytfg-vplan-app
Commits
b66767c2
Commit
b66767c2
authored
Dec 28, 2016
by
Lennart Bader
Browse files
Added plan options menu
parent
791f7ce7
Changes
13
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/de/mytfg/apps/vplan/fragments/PlanFragment.java
View file @
b66767c2
...
...
@@ -6,6 +6,8 @@ import android.support.design.widget.TabLayout;
import
android.support.v4.app.Fragment
;
import
android.support.v4.view.ViewPager
;
import
android.view.LayoutInflater
;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -47,9 +49,18 @@ public class PlanFragment extends Fragment {
today
=
new
PlanLogic
(
todayPlan
);
tomorrow
=
new
PlanLogic
(
tomorrowPlan
);
setHasOptionsMenu
(
true
);
return
view
;
}
@Override
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
menu
.
clear
();
inflater
.
inflate
(
R
.
menu
.
plan_details_menu
,
menu
);
super
.
onCreateOptionsMenu
(
menu
,
inflater
);
}
@Override
public
void
onResume
()
{
super
.
onResume
();
...
...
app/src/main/java/de/mytfg/apps/vplan/logic/PlanLogic.java
View file @
b66767c2
...
...
@@ -88,10 +88,14 @@ public class PlanLogic implements FragmentHolderLogic {
}
adapter
.
notifyDataSetChanged
();
TabLayout
tabLayout
=
((
MainActivity
)
context
).
getToolbarManager
().
getTabs
();
TabLayout
.
Tab
tab
;
if
(
this
.
plan
.
getDay
().
equals
(
"today"
))
{
tabLayout
.
getTabAt
(
0
)
.
setText
(
plan
.
getDayString
())
;
tab
=
tabLayout
.
getTabAt
(
0
);
}
else
{
tabLayout
.
getTabAt
(
1
).
setText
(
plan
.
getDayString
());
tab
=
tabLayout
.
getTabAt
(
1
);
}
if
(
tab
!=
null
)
{
tab
.
setText
(
plan
.
getDayString
());
}
}
}
app/src/main/res/drawable-hdpi/ic_show_absent.png
0 → 100644
View file @
b66767c2
440 Bytes
app/src/main/res/drawable-hdpi/ic_show_marquee.png
0 → 100644
View file @
b66767c2
727 Bytes
app/src/main/res/drawable-mdpi/ic_show_absent.png
0 → 100644
View file @
b66767c2
320 Bytes
app/src/main/res/drawable-mdpi/ic_show_marquee.png
0 → 100644
View file @
b66767c2
436 Bytes
app/src/main/res/drawable-xhdpi/ic_show_absent.png
0 → 100644
View file @
b66767c2
595 Bytes
app/src/main/res/drawable-xhdpi/ic_show_marquee.png
0 → 100644
View file @
b66767c2
1.01 KB
app/src/main/res/drawable-xxhdpi/ic_show_absent.png
0 → 100644
View file @
b66767c2
969 Bytes
app/src/main/res/drawable-xxhdpi/ic_show_marquee.png
0 → 100644
View file @
b66767c2
1.72 KB
app/src/main/res/menu/plan_details_menu.xml
0 → 100644
View file @
b66767c2
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<item
android:id=
"@+id/show_absent"
android:icon=
"@drawable/ic_show_absent"
android:title=
"@string/plan_show_absent"
app:showAsAction=
"ifRoom"
/>
<item
android:id=
"@+id/show_marquee"
android:icon=
"@drawable/ic_show_marquee"
android:title=
"@string/plan_show_marquee"
app:showAsAction=
"ifRoom"
/>
</menu>
\ No newline at end of file
app/src/main/res/values-de/strings.xml
View file @
b66767c2
...
...
@@ -51,6 +51,8 @@
<string
name=
"plan_header"
>
Plan:
</string>
<string
name=
"subst_header"
>
Vertretung:
</string>
<string
name=
"comment_header"
>
Bemerkung:
</string>
<string
name=
"plan_show_marquee"
>
Mitteilungen anzeigen
</string>
<string
name=
"plan_show_absent"
>
Abwesende Lehrer anzeigen
</string>
<!-- ACCOUNT -->
<string
name=
"account_info"
>
Sie sind angemeldet.
</string>
...
...
app/src/main/res/values/strings.xml
View file @
b66767c2
...
...
@@ -31,6 +31,8 @@
<string
name=
"plan_header"
>
Plan:
</string>
<string
name=
"subst_header"
>
Substitution:
</string>
<string
name=
"comment_header"
>
Comment:
</string>
<string
name=
"plan_show_marquee"
>
Show announcements
</string>
<string
name=
"plan_show_absent"
>
Show absent teachers
</string>
<!-- API CODES -->
<string
name=
"api_offline"
>
No Internet connection
</string>
...
...
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