Compare commits
5 Commits
9aaf27e309
...
6ff8e099eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ff8e099eb | ||
|
|
9a92544df0 | ||
|
|
777a5bf959 | ||
|
|
115fe155b6 | ||
|
|
2f85e69b3a |
@ -9,7 +9,11 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MyWeather">
|
||||
<activity android:name=".AddCity"></activity>
|
||||
<!-- Adding an attribute to remove the app bar only in the activity that allows the user to add a city-->
|
||||
<activity android:name=".AddCity"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:theme="@style/Theme.MyWeather.NoActionBar">
|
||||
</activity>
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -1,14 +1,20 @@
|
||||
package fr.romanet.vj.apps.myweather;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class AddCity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.add_city_page);
|
||||
Toolbar toolbarAddCity = (Toolbar) findViewById(R.id.toolbarAddCity);
|
||||
setSupportActionBar(toolbarAddCity);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
}
|
||||
@ -13,18 +13,20 @@
|
||||
android:theme="@style/Theme.MyWeather.AppBarOverlay">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:id="@+id/toolbarAddCity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:title="Add a city"
|
||||
android:minHeight="60dp"
|
||||
app:popupTheme="@style/Theme.MyWeather.PopupOverlay" />
|
||||
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="130dp" />
|
||||
android:layout_height="120dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
@ -40,7 +42,7 @@
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp" />
|
||||
android:layout_height="100dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editText"
|
||||
@ -53,7 +55,7 @@
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp" />
|
||||
android:layout_height="90dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSave"
|
||||
|
||||
@ -1,14 +1,17 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.MyWeather" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/red</item>
|
||||
<item name="colorPrimaryVariant">@color/red</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/red</item>
|
||||
<item name="colorSecondaryVariant">@color/red</item>
|
||||
<item name="colorOnSecondary">@color/white</item>
|
||||
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user