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;
|
||||
|
||||
import android.widget.Button;
|
||||
import android.content.*;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.os.Bundle;
|
||||
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
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
buttonAddCity = (Button) findViewById(R.id.fab);
|
||||
FloatingActionButton buttonAddCity = (FloatingActionButton) findViewById(R.id.fab);
|
||||
buttonAddCity.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
public void onClick(View view)
|
||||
{
|
||||
openAddCityPage();
|
||||
}
|
||||
});
|
||||
@ -27,7 +28,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
public void openAddCityPage()
|
||||
{
|
||||
Intent intent = new Intent(this, AddCity.class);
|
||||
Intent intent = new Intent(MainActivity.this, AddCity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
@ -12,14 +12,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
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>
|
||||
|
||||
<ImageView
|
||||
|
||||
Loading…
Reference in New Issue
Block a user