Compare commits
No commits in common. "8f336520c97b6be4723a8f4097054cb2580243d4" and "6ff8e099eb718ec93ecd7116c1ce2689ac202170" have entirely different histories.
8f336520c9
...
6ff8e099eb
@ -4,11 +4,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
public class AddCity extends AppCompatActivity {
|
||||
|
||||
@ -21,22 +16,5 @@ public class AddCity extends AppCompatActivity {
|
||||
setSupportActionBar(toolbarAddCity);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
Button button = (Button) findViewById(R.id.btnSaveCity);
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
EditText editTextnewCity = (EditText) findViewById(R.id.editTextNewCity);
|
||||
String newCity = (String) editTextnewCity.getText().toString();
|
||||
if(editTextnewCity.length() == 0)
|
||||
{
|
||||
editTextnewCity.setError("Please, enter a city name");
|
||||
}
|
||||
else
|
||||
System.out.println(newCity);
|
||||
//Ajoute la ville a une base de données
|
||||
//Prélève le texte avec le get
|
||||
//S'il est vide on l'alert et on fais rien
|
||||
//Sinon écran d'accueil qui change
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -16,8 +16,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
FloatingActionButton buttonPlus = (FloatingActionButton) findViewById(R.id.plusButton);
|
||||
buttonPlus.setOnClickListener(new View.OnClickListener() {
|
||||
FloatingActionButton buttonAddCity = (FloatingActionButton) findViewById(R.id.fab);
|
||||
buttonAddCity.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view)
|
||||
{
|
||||
|
||||
@ -30,11 +30,11 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/firstAction"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/plusButton"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fab"
|
||||
tools:layout_editor_absoluteX="89dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/plusButton"
|
||||
android:id="@+id/fab"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
android:minHeight="60dp"
|
||||
app:popupTheme="@style/Theme.MyWeather.PopupOverlay" />
|
||||
|
||||
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<Space
|
||||
@ -45,7 +45,7 @@
|
||||
android:layout_height="100dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextNewCity"
|
||||
android:id="@+id/editText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
@ -58,7 +58,7 @@
|
||||
android:layout_height="90dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSaveCity"
|
||||
android:id="@+id/btnSave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user