import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
import name.gumartinm.weather.information.R;
-import name.gumartinm.weather.information.fragment.preferences.PreferencesFragment;
public class PreferencesActivity extends AppCompatActivity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ this.setContentView(R.layout.weather_preferences);
+
+ final Toolbar toolbar = (Toolbar) findViewById(R.id.weather_main_toolbar);
+ this.setSupportActionBar(toolbar);
final ActionBar actionBar = this.getSupportActionBar();
- actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setIcon(R.drawable.ic_launcher);
-
- this.getFragmentManager()
- .beginTransaction()
- .replace(android.R.id.content,
- new PreferencesFragment()).commit();
}
@Override
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
import java.text.MessageFormat;
import java.util.Locale;
super.onCreate(savedInstanceState);
this.setContentView(R.layout.weather_specific);
+ final Toolbar toolbar = (Toolbar) findViewById(R.id.weather_main_toolbar);
+ this.setSupportActionBar(toolbar);
+
final ActionBar actionBar = this.getSupportActionBar();
- actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setIcon(R.drawable.ic_launcher);
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2016 Gustavo Martin Morcuende
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/weather_specific"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:orientation="vertical"
+ tools:context="name.gumartinm.weather.information.activity.PreferencesActivity"
+ tools:ignore="MergeRootFrame" >
+
+ <include layout="@layout/weather_general_toolbar"/>
+
+ <fragment
+ android:id="@+id/specific_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ class="name.gumartinm.weather.information.fragment.preferences.PreferencesFragment" />
+
+</LinearLayout>
\ No newline at end of file
tools:context="name.gumartinm.weather.information.activity.SpecificActivity"
tools:ignore="MergeRootFrame" >
+ <include layout="@layout/weather_general_toolbar"/>
<fragment
android:id="@+id/specific_fragment"