MainActivity class : make the connection between first and second screen for the moment
This commit is contained in:
parent
61ab159447
commit
1a116d0b26
@ -1,25 +1,26 @@
|
|||||||
package fr.romanet.vj.apps.myweather;
|
package fr.romanet.vj.apps.myweather;
|
||||||
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
|
|
||||||
private Button buttonAddCity;
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
FloatingActionButton buttonAddCity = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
buttonAddCity = (Button) findViewById(R.id.fab);
|
|
||||||
buttonAddCity.setOnClickListener(new View.OnClickListener() {
|
buttonAddCity.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view)
|
||||||
|
{
|
||||||
openAddCityPage();
|
openAddCityPage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -27,7 +28,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
public void openAddCityPage()
|
public void openAddCityPage()
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(this, AddCity.class);
|
Intent intent = new Intent(MainActivity.this, AddCity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -12,14 +12,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/Theme.MyWeather.AppBarOverlay">
|
android:theme="@style/Theme.MyWeather.AppBarOverlay">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="75dp"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:title="MyWeather"
|
|
||||||
app:popupTheme="@style/Theme.MyWeather.PopupOverlay" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user