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
SRCT
whats-open-android
Commits
3e0b582b
Commit
3e0b582b
authored
Feb 07, 2017
by
Robert Hitt
Browse files
SettingsActivity now works properly
parent
a4afe519
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/srct/whatsopen/views/activities/SettingsActivity.java
View file @
3e0b582b
...
...
@@ -17,11 +17,9 @@ public class SettingsActivity extends AppCompatActivity {
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_
main
);
setContentView
(
R
.
layout
.
activity_
settings
);
// Configure toolbar
Toolbar
toolbar
=
ButterKnife
.
findById
(
this
,
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
configureToolbar
();
getSupportFragmentManager
().
beginTransaction
()
.
replace
(
R
.
id
.
activity_settings
,
new
SettingsFragment
())
...
...
@@ -31,7 +29,8 @@ public class SettingsActivity extends AppCompatActivity {
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
getMenuInflater
().
inflate
(
R
.
menu
.
menu_main
,
menu
);
getMenuInflater
().
inflate
(
R
.
menu
.
menu_settings
,
menu
);
return
true
;
}
...
...
@@ -45,5 +44,16 @@ public class SettingsActivity extends AppCompatActivity {
return
super
.
onOptionsItemSelected
(
item
);
}
}
private
void
configureToolbar
()
{
Toolbar
toolbar
=
ButterKnife
.
findById
(
this
,
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
getSupportActionBar
().
setTitle
(
"Settings"
);
// Display back button
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
true
);
getSupportActionBar
().
setDisplayShowHomeEnabled
(
true
);
}
}
app/src/main/res/menu/menu_detail.xml
View file @
3e0b582b
...
...
@@ -13,4 +13,9 @@
app:showAsAction=
"never"
android:title=
"Settings"
/>
<item
android:id=
"@+id/action_about"
app:showAsAction=
"never"
android:title=
"About"
/>
</menu>
app/src/main/res/menu/menu_settings.xml
0 → 100644
View file @
3e0b582b
<?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/action_settings"
app:showAsAction=
"never"
android:title=
"About"
/>
</menu>
\ No newline at end of file
app/src/main/res/values-v21/styles.xml
View file @
3e0b582b
...
...
@@ -9,6 +9,7 @@
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"android:colorControlHighlight"
>
@color/tabButtonPressed
</item>
<item
name=
"android:homeAsUpIndicator"
>
@drawable/ic_arrow_back_white
</item>
<item
name=
"preferenceTheme"
>
@style/PreferenceThemeOverlay
</item>
</style>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
3e0b582b
...
...
@@ -5,14 +5,14 @@
<!-- Strings from PreferenceFragment -->
<string
name=
"title_list_view"
>
List View Preferences
</string>
<string
name=
"title_list_view_information"
>
Duration
D
isplay
</string>
<string
name=
"title_list_view_information"
>
Duration
d
isplay
</string>
<string
name=
"title_rotation"
>
Rotation Preferences
</string>
<string
name=
"title_turn_off_rotation"
>
Turn off rotation
</string>
<string
name=
"title_notification"
>
Notification Preferences
</string>
<string
name=
"title_turn_off_
notific
ations"
>
Turn off
rot
ation
</string>
<string
name=
"title_turn_off_
vibr
ations"
>
Turn off
vibr
ation
s
</string>
<string-array
name=
"entries_list_view_information_preference"
>
<item>
Duration on O
pen Facilities
</item>
<item>
Duration on C
losed Facilities
</item>
<item>
Only for o
pen Facilities
</item>
<item>
Only for c
losed Facilities
</item>
<item>
Both
</item>
</string-array>
<string-array
name=
"entryvalues_list_view_information_preference"
>
...
...
app/src/main/res/values/styles.xml
View file @
3e0b582b
...
...
@@ -7,6 +7,7 @@
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"android:homeAsUpIndicator"
>
@drawable/ic_arrow_back_white
</item>
<item
name=
"preferenceTheme"
>
@style/PreferenceThemeOverlay
</item>
</style>
</resources>
app/src/main/res/xml/settings.xml
View file @
3e0b582b
...
...
@@ -26,8 +26,8 @@
android:title=
"@string/title_notification"
>
<CheckBoxPreference
android:key=
"turn_off_
notific
ations_preference"
android:title=
"@string/title_turn_off_
notific
ations"
/>
android:key=
"turn_off_
vibr
ations_preference"
android:title=
"@string/title_turn_off_
vibr
ations"
/>
</PreferenceCategory>
...
...
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