-
Notifications
You must be signed in to change notification settings - Fork 15
Stefan Popescu - Curs 2 - Code Challenge 1 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
53b495d
1d90a10
c9acbca
029b310
a9e5c69
ea1befc
b48454b
bc71f85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /** | ||
| * Automatically generated file. DO NOT MODIFY | ||
| */ | ||
| package com.example.demoapp; | ||
|
|
||
| public final class BuildConfig { | ||
| public static final boolean DEBUG = Boolean.parseBoolean("true"); | ||
| public static final String APPLICATION_ID = "com.example.demoapp"; | ||
| public static final String BUILD_TYPE = "debug"; | ||
| public static final int VERSION_CODE = 1; | ||
| public static final String VERSION_NAME = "1.0"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,18 @@ | ||
| package com.magdamiu.androidfundamentalsmai2021; | ||
| package com.example.demoapp; | ||
|
|
||
| import androidx.appcompat.app.AppCompatActivity; | ||
|
|
||
| import android.os.Bundle; | ||
| import android.util.Log; | ||
| import android.widget.Button; | ||
| import android.widget.EditText; | ||
| import android.widget.TextView; | ||
|
|
||
| public class MainActivity extends AppCompatActivity { | ||
|
|
||
| @Override | ||
| protected void onCreate(Bundle savedInstanceState) { | ||
| super.onCreate(savedInstanceState); | ||
| setContentView(R.layout.activity_main); | ||
|
|
||
| Log.e("tag-error", "my first error log"); | ||
| Log.v("tag-verbose", "my first verbose log"); | ||
| Log.w("tag-warning", "my first warning log"); | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,188 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| xmlns:tools="http://schemas.android.com/tools" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="match_parent" | ||
| android:orientation="vertical" | ||
| tools:context=".MainActivity"> | ||
|
|
||
| <LinearLayout | ||
| android:layout_weight="60" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:orientation="vertical"> | ||
|
|
||
| <LinearLayout | ||
| android:layout_weight="1" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="fill_parent" | ||
| android:orientation="horizontal"> | ||
|
|
||
| <TextView | ||
| android:layout_weight="1" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:text="@string/orange_textview" | ||
| android:textColor="@color/white" | ||
| android:background="@color/first_textview_color" | ||
| android:textAlignment="center" | ||
| android:gravity="center"/> | ||
|
|
||
| <TextView | ||
| android:layout_weight="1" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:text="@string/green_textview" | ||
| android:textColor="@color/black" | ||
| android:background="@color/second_textview_color" | ||
| android:textAlignment="center" | ||
| android:gravity="center"/> | ||
|
|
||
| <TextView | ||
| android:layout_weight="1" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:text="@string/blue_textview" | ||
| android:textColor="@color/white" | ||
| android:background="@color/third_textview_color" | ||
| android:textAlignment="center" | ||
| android:gravity="center"/> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| <LinearLayout | ||
| android:layout_weight="1" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="fill_parent" | ||
| android:orientation="horizontal" | ||
| android:layout_margin="@dimen/small_margin"> | ||
|
|
||
| <Button | ||
| android:layout_weight="1" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:text="@string/blue_button" | ||
| android:textColor="@color/black" | ||
| android:backgroundTint="@color/first_button_color" | ||
| android:layout_margin="@dimen/small_margin"/> | ||
|
|
||
| <ImageView | ||
| android:layout_weight="1" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:src="@drawable/paint_palette" | ||
| android:layout_margin="@dimen/image_margin"/> | ||
|
|
||
| <Button | ||
| android:layout_weight="1" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="fill_parent" | ||
| android:text="@string/green_button" | ||
| android:textColor="@color/black" | ||
| android:backgroundTint="@color/second_button_color" | ||
| android:layout_margin="@dimen/small_margin"/> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| <LinearLayout | ||
| android:layout_weight="40" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="fill_parent" | ||
| android:orientation="vertical"> | ||
|
|
||
| <LinearLayout | ||
| android:layout_weight="70" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="fill_parent" | ||
| android:orientation="vertical" | ||
| android:background="@color/yellow_layout" | ||
| android:gravity="center"> | ||
|
|
||
| <EditText | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:hint="@string/first_edittext"/> | ||
|
|
||
| <EditText | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:hint="@string/second_edittext"/> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| <LinearLayout | ||
| android:layout_weight="30" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="fill_parent" | ||
| android:orientation="vertical" | ||
| android:background="@color/cyan_layout"> | ||
|
|
||
| <LinearLayout | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:orientation="horizontal"> | ||
|
|
||
| <CheckBox | ||
| android:layout_weight="8" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="wrap_content" | ||
| android:text="@string/notify_me"/> | ||
|
|
||
| <TextView | ||
| android:layout_weight="5" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginStart="100dp" | ||
| android:text="@string/auto_backup" | ||
| android:textColor="@color/black"/> | ||
|
|
||
| <Switch | ||
| android:layout_weight="9" | ||
| android:layout_width="fill_parent" | ||
| android:layout_height="wrap_content"/> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| <View | ||
| android:layout_width="match_parent" | ||
| android:layout_height="@dimen/bar_height" | ||
| android:background="@color/bar_color"/> | ||
|
|
||
| <RatingBar | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:progressTint="#ED5087" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please consider adding the colors in colors,xml to be able reusing them |
||
| android:numStars="5" | ||
| android:stepSize="0.5" | ||
| android:rating="4"/> | ||
|
|
||
| <View | ||
| android:layout_width="match_parent" | ||
| android:layout_height="@dimen/bar_height" | ||
| android:background="@color/bar_color"/> | ||
|
|
||
| <RadioGroup | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_margin="5dp"> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please consider defining some pre-defined margins/paddings. Use numbers that are multiple of 8 (example: 8, 16, 32, 64, etc) |
||
|
|
||
| <RadioButton | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:text="@string/yes"/> | ||
|
|
||
| <RadioButton | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:text="@string/no"/> | ||
|
|
||
| </RadioGroup> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| </LinearLayout> | ||
|
|
||
| </LinearLayout> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <resources> | ||
| <color name="purple_200">#FFBB86FC</color> | ||
| <color name="purple_500">#FF6200EE</color> | ||
| <color name="purple_700">#FF3700B3</color> | ||
| <color name="teal_200">#FF03DAC5</color> | ||
| <color name="teal_700">#FF018786</color> | ||
| <color name="black">#FF000000</color> | ||
| <color name="white">#FFFFFFFF</color> | ||
| <color name="first_textview_color">#FC987E</color> | ||
| <color name="second_textview_color">#CDEDD7</color> | ||
| <color name="third_textview_color">#7BCCC6</color> | ||
| <color name="first_button_color">#79CBC5</color> | ||
| <color name="second_button_color">#A0C998</color> | ||
| <color name="yellow_layout">#FCCA59</color> | ||
| <color name="cyan_layout">#79CBC5</color> | ||
| <color name="bar_color">#7B85B0</color> | ||
| </resources> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <resources> | ||
| <dimen name="text_size">23sp</dimen> | ||
| <dimen name="medium_space">16dp</dimen> | ||
| <dimen name="image_margin">10dp</dimen> | ||
| <dimen name="small_margin">5dp</dimen> | ||
| <dimen name="bar_height">1dp</dimen> | ||
| </resources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just be aware that fill parent is deprecated in API level 8 https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#FILL_PARENT