Commit 3e0b582b authored by Robert Hitt's avatar Robert Hitt

SettingsActivity now works properly

parent a4afe519
......@@ -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);
}
}
......@@ -13,4 +13,9 @@
app:showAsAction="never"
android:title="Settings"/>
<item
android:id="@+id/action_about"
app:showAsAction="never"
android:title="About"/>
</menu>
<?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
......@@ -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
......@@ -5,14 +5,14 @@
<!-- Strings from PreferenceFragment -->
<string name="title_list_view">List View Preferences</string>
<string name="title_list_view_information">Duration Display</string>
<string name="title_list_view_information">Duration display</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_notifications">Turn off rotation</string>
<string name="title_turn_off_vibrations">Turn off vibrations</string>
<string-array name="entries_list_view_information_preference">
<item>Duration on Open Facilities</item>
<item>Duration on Closed Facilities</item>
<item>Only for open Facilities</item>
<item>Only for closed Facilities</item>
<item>Both</item>
</string-array>
<string-array name="entryvalues_list_view_information_preference">
......
......@@ -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>
......@@ -26,8 +26,8 @@
android:title="@string/title_notification">
<CheckBoxPreference
android:key="turn_off_notifications_preference"
android:title="@string/title_turn_off_notifications" />
android:key="turn_off_vibrations_preference"
android:title="@string/title_turn_off_vibrations" />
</PreferenceCategory>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment