From 42da0dd3e6d504f645f7d9c49853a2280a5aa495 Mon Sep 17 00:00:00 2001 From: ionicastefan20 Date: Sun, 30 May 2021 19:00:23 +0300 Subject: [PATCH] Stefan-Theodor Ionica - Curs 3 - Code Challenges --- .../MainActivity.java | 29 +++++--- app/src/main/res/layout/spinner_layout.xml | 13 ++++ .../res/layout/week3_code_challenge_1.xml | 42 ++++++++++++ .../res/layout/week3_code_challenge_2.xml | 68 +++++++++++++++++++ app/src/main/res/values/colors.xml | 2 + app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/strings.xml | 5 ++ 7 files changed, 149 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/layout/spinner_layout.xml create mode 100644 app/src/main/res/layout/week3_code_challenge_1.xml create mode 100644 app/src/main/res/layout/week3_code_challenge_2.xml diff --git a/app/src/main/java/com/magdamiu/androidfundamentalsmai2021/MainActivity.java b/app/src/main/java/com/magdamiu/androidfundamentalsmai2021/MainActivity.java index ab7184b..044fe86 100644 --- a/app/src/main/java/com/magdamiu/androidfundamentalsmai2021/MainActivity.java +++ b/app/src/main/java/com/magdamiu/androidfundamentalsmai2021/MainActivity.java @@ -37,17 +37,24 @@ protected void onCreate(Bundle savedInstanceState) { /*setContentView(R.layout.sample);*/ // setContentView(R.layout.scrollview_sample); // setContentView(R.layout.webview_sample); - setContentView(R.layout.spinner_sample); - - setAndroidVersions(); - initialiseSpinnerAdapter(); - setSpinnerAdapter(); - handlingSpinnerListener(); - - //loadUrl(); - - // initViews(); - displayLogs(); +// setContentView(R.layout.spinner_sample); +// setContentView(R.layout.week3_code_challenge_2); + setContentView(R.layout.week3_code_challenge_1); + + EditText editTextEmail = findViewById(R.id.editTextEmail); + editTextEmail.setError("Fill the input with a valid email address"); + EditText editTextPhone = findViewById(R.id.editTextPhone); + editTextPhone.setError("Fill the input with a valid phone number"); + +// setAndroidVersions(); +// initialiseSpinnerAdapter(); +// setSpinnerAdapter(); +// handlingSpinnerListener(); +// +// //loadUrl(); +// +// // initViews(); +// displayLogs(); } // step 1: data source for our spinner diff --git a/app/src/main/res/layout/spinner_layout.xml b/app/src/main/res/layout/spinner_layout.xml new file mode 100644 index 0000000..a848b56 --- /dev/null +++ b/app/src/main/res/layout/spinner_layout.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/week3_code_challenge_1.xml b/app/src/main/res/layout/week3_code_challenge_1.xml new file mode 100644 index 0000000..aa97584 --- /dev/null +++ b/app/src/main/res/layout/week3_code_challenge_1.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + +