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/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..6fe6182
--- /dev/null
+++ b/app/src/main/res/layout/week3_cc2.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/week3_cc2_screen3.xml b/app/src/main/res/layout/week3_cc2_screen3.xml
new file mode 100644
index 0000000..32ea8a0
--- /dev/null
+++ b/app/src/main/res/layout/week3_cc2_screen3.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
\ 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..bef2985 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -8,4 +8,8 @@
#FF000000#FFFFFFFF#ff3412
+ #FF4500
+ #b30086
+ #33ccff
+ #ffcc66
\ 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..9aa8b8d 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -1,7 +1,15 @@
23sp
- 16dp
- 128dp
- 64dp
+ 12dp
+ 8dp
+ 128sp
+ 256sp
+ 64sp
+ 12dp
+ 20dp
+ 27dp
+ 200dp
+ 100dp
+ 50dp
\ 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..7fca20b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -18,4 +18,14 @@
Of 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
+ https://developer.android.com/
+ text below
+ Email
+ Phone
+
+ SUBMIT
+ LOGIN
+ Please enter a valid phone number!
+ Please eneter a valid email address!\n
+ A view group that allows the view hierarchy placed within it to be scrolled. Scroll view may have only one direct child placed within it. To add multiple views within the scroll view, make the direct child you add a view group, for example LinearLayout, and place additional views within that LinearLayout.
\ No newline at end of file