diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 26d3352..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index fb7f4a8..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 5cd135a..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index 0380d8d..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 4700283..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index 797acea..0000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 02a3d89..beb8280 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,9 +1,13 @@
+<<<<<<< HEAD
+=======
+
+>>>>>>> curs3_cc1
>>>>>> curs3_cc1
public class MainActivity extends AppCompatActivity {
private static final String ANDROID_URL = "https://developer.android.com/";
+ private EditText phone;
+ private EditText email;
private EditText editTextName;
private Button buttonDisplayGreetings;
private TextView textViewGreetings;
+<<<<<<< HEAD
private WebView webView;
@@ -30,10 +38,17 @@ public class MainActivity extends AppCompatActivity {
private List androidVersions;
private ArrayAdapter spinnerAdapter;
+=======
+ private WebView webView;
+ private Spinner spinnerAndroidVersions;
+ private List androidVersions;
+ private ArrayAdapter spinnerAdapter;
+>>>>>>> curs3_cc1
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*setContentView(R.layout.activity_main);*/
+<<<<<<< HEAD
/*setContentView(R.layout.sample);*/
// setContentView(R.layout.scrollview_sample);
// setContentView(R.layout.webview_sample);
@@ -47,8 +62,57 @@ protected void onCreate(Bundle savedInstanceState) {
//loadUrl();
// initViews();
+=======
+// setContentView(R.layout.web_view_sample);
+// load_url();
+ setContentView(R.layout.spinner_sample);
+ setAndroidVersions();
+// initViews();
+ initializeSpinnerAdapter();
+ setSpinnerAdapter();
+>>>>>>> curs3_cc1
displayLogs();
}
+ // step 1: data source for our spinner
+ private void setAndroidVersions() {
+ androidVersions = new ArrayList<>();
+ androidVersions.add("cupcake");
+ androidVersions.add("eclair");
+ androidVersions.add("donut");
+ androidVersions.add("pie");
+ }
+
+ private void initializeSpinnerAdapter() {
+ spinnerAdapter = new ArrayAdapter<>(MainActivity.this,
+ android.R.layout.simple_spinner_item,
+ androidVersions);
+ }
+
+ private void setSpinnerAdapter() {
+ spinnerAndroidVersions = findViewById(R.id.spinnerAndroidVersions);
+ spinnerAndroidVersions.setAdapter(spinnerAdapter);
+ }
+
+ private void handlingSpinnerListener() {
+ spinnerAndroidVersions.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int i, long l) {
+ String selectedAndroidVersion = androidVersions.get(i);
+ Toast.makeText(MainActivity.this, selectedAndroidVersion, Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+ }
+
+ private void load_url() {
+ webView = findViewById(R.id.webViewSample);
+ webView.getSettings().setJavaScriptEnabled(true);
+ webView.loadUrl(getString(R.string.ANDROID_URL));
+ }
// step 1: data source for our spinner
private void setAndroidVersions() {
@@ -128,4 +192,26 @@ public void displayGreetingsOnClick(View view) {
Toast.makeText(MainActivity.this, getString(R.string.error_insert_name), Toast.LENGTH_LONG).show();
}
}
+
+ boolean isPhoneNumber(String phoneNumber) {
+ return Patterns.PHONE.matcher(phoneNumber).matches();
+ }
+
+ boolean isEmail(String email) {
+ return Patterns.EMAIL_ADDRESS.matcher(email).matches();
+ }
+
+ public void submitInformation(View view) {
+
+ phone = findViewById(R.id.phone);
+ email = findViewById(R.id.email);
+ if (!isPhoneNumber(phone.toString())) {
+ Toast.makeText(MainActivity.this, getString(R.string.wrong_phone_pattern), Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ if (!isEmail(email.toString())) {
+ Toast.makeText(MainActivity.this, getString(R.string.wrong_email_pattern), Toast.LENGTH_LONG).show();
+ }
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/layout/frame_layout_sample.xml b/app/src/main/res/layout/frame_layout_sample.xml
new file mode 100644
index 0000000..93d38ed
--- /dev/null
+++ b/app/src/main/res/layout/frame_layout_sample.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/realtive_layout_sample.xml b/app/src/main/res/layout/realtive_layout_sample.xml
new file mode 100644
index 0000000..2649b2b
--- /dev/null
+++ b/app/src/main/res/layout/realtive_layout_sample.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/scroll_view_sample.xml b/app/src/main/res/layout/scroll_view_sample.xml
new file mode 100644
index 0000000..bbddbbb
--- /dev/null
+++ b/app/src/main/res/layout/scroll_view_sample.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/spinner_sample.xml b/app/src/main/res/layout/spinner_sample.xml
index f137d0b..7b99d95 100644
--- a/app/src/main/res/layout/spinner_sample.xml
+++ b/app/src/main/res/layout/spinner_sample.xml
@@ -1,5 +1,6 @@
+=======
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+
+>>>>>>> curs3_cc1
\ No newline at end of file
diff --git a/app/src/main/res/layout/web_view_sample.xml b/app/src/main/res/layout/web_view_sample.xml
new file mode 100644
index 0000000..10496cb
--- /dev/null
+++ b/app/src/main/res/layout/web_view_sample.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/week3_cc1.xml b/app/src/main/res/layout/week3_cc1.xml
new file mode 100644
index 0000000..802a8ba
--- /dev/null
+++ b/app/src/main/res/layout/week3_cc1.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/week3_cc2.xml b/app/src/main/res/layout/week3_cc2.xml
new file mode 100644
index 0000000..e95595a
--- /dev/null
+++ b/app/src/main/res/layout/week3_cc2.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index d8ce349..4d37aaf 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -8,4 +8,5 @@
#FF000000#FFFFFFFF#ff3412
+ #FF4500
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index e8b2c28..14251a7 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -1,7 +1,15 @@
23sp
+<<<<<<< HEAD
16dp128dp64dp
+=======
+ 12dp
+ 8dp
+ 128sp
+ 256sp
+ 64sp
+>>>>>>> curs3_cc1
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 0f8b9c3..513e37c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -12,10 +12,24 @@
Please add your name hereGreetings :)Please insert a name
+<<<<<<< HEAD
TextView 3TextView 2TextView 1Of course, you’d want to replace the URL after git remote add upstream with the appropriate clone URL for the original project repository. For the rest of this article, I’m going to assume you used upstream as the name for this additional Git remote. Now, you could try pushing changes to the original repository using git push at this point, but it would probably fail because you probably don’t have permission to push changes directly to the repository. Besides, it really wouldn’t be a good idea. That’s because other people might be working on the project as well, and how in the world would we keep track of everyone’s changes? That’s where branches come in.text on the righttext centered in parent
+=======
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ https://developer.android.com/
+ text on the right
+ text below
+ Email
+ Phone
+
+ SUBMIT
+ LOGIN
+ Please enter a valid phone number!
+ Please eneter a valid email address!\n
+>>>>>>> curs3_cc1
\ No newline at end of file