From: Gustavo Martin Morcuende Date: Sun, 4 Sep 2016 01:21:38 +0000 (+0200) Subject: Using ToolBar in MapActivity X-Git-Tag: weatherinformation-2.0~11 X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=9e5c74a04cc9a2b18ebf0948018e23bcb5295ba8;p=AndroidWeatherInformation Using ToolBar in MapActivity --- diff --git a/app/src/main/java/name/gumartinm/weather/information/activity/MapActivity.java b/app/src/main/java/name/gumartinm/weather/information/activity/MapActivity.java index 8550807..63ac19a 100644 --- a/app/src/main/java/name/gumartinm/weather/information/activity/MapActivity.java +++ b/app/src/main/java/name/gumartinm/weather/information/activity/MapActivity.java @@ -28,6 +28,7 @@ import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -73,8 +74,10 @@ public class MapActivity extends AppCompatActivity implements super.onCreate(savedInstanceState); this.setContentView(R.layout.weather_map); + 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); diff --git a/app/src/main/res/layout/weather_about.xml b/app/src/main/res/layout/weather_about.xml index 3316c59..a3268e4 100644 --- a/app/src/main/res/layout/weather_about.xml +++ b/app/src/main/res/layout/weather_about.xml @@ -16,11 +16,13 @@ --> + android:layout_height="match_parent" + tools:context="name.gumartinm.weather.information.activity.AboutActivity"> diff --git a/app/src/main/res/layout/weather_map.xml b/app/src/main/res/layout/weather_map.xml index 5b73a6c..a45f5c0 100644 --- a/app/src/main/res/layout/weather_map.xml +++ b/app/src/main/res/layout/weather_map.xml @@ -22,13 +22,13 @@ android:layout_gravity="center" tools:context="name.gumartinm.weather.information.activity.MapActivity" > + + + android:layout_below="@+id/weather_main_toolbar" >