diff --git a/app/src/main/java/leszcz_team/wulkanowy/activity/main/MainActivity.java b/app/src/main/java/leszcz_team/wulkanowy/activity/main/MainActivity.java index 247ed8c2..5ee15a53 100644 --- a/app/src/main/java/leszcz_team/wulkanowy/activity/main/MainActivity.java +++ b/app/src/main/java/leszcz_team/wulkanowy/activity/main/MainActivity.java @@ -1,15 +1,45 @@ package leszcz_team.wulkanowy.activity.main; import android.app.Activity; +import android.app.AlertDialog; +import android.content.DialogInterface; import android.os.Bundle; +import android.widget.ArrayAdapter; +import android.widget.AutoCompleteTextView; import leszcz_team.wulkanowy.R; public class MainActivity extends Activity { + private static final String[] COUNTRIES = new String[] { + "Jarosławski", "Przeworski" + }; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + + new AlertDialog.Builder(this) + .setTitle(R.string.warning_label) + .setMessage(R.string.warning_text) + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) {} + }) + .setIcon(android.R.drawable.ic_dialog_alert) + .show(); + + autoComplete(); + + } + + private void autoComplete(){ + + ArrayAdapter adapter = new ArrayAdapter(this, + android.R.layout.simple_dropdown_item_1line, COUNTRIES); + AutoCompleteTextView textView = (AutoCompleteTextView) + findViewById(R.id.county_text); + textView.setAdapter(adapter); + } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index cd2f89a8..7a8b3b5b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -9,18 +9,33 @@ tools:layout_editor_absoluteX="0dp"> + + + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.241" /> - - + app:layout_constraintVertical_bias="0.391" />