Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AndroidFundamentalsMai2021">
<activity android:name=".ConstraintLayoutSampleActivity"></activity>
<activity android:name=".MainActivity" />
<activity android:name=".EmailsActivity" />
<activity android:name=".StartActivity">
<intent-filter>
<activity android:name=".Course4CodeChallenge3">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.magdamiu.androidfundamentalsmai2021;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

public class Course4CodeChallenge3 extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_course4_code_challenge3);
}
}
Binary file added app/src/main/res/drawable/header_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/poster_sparkling.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions app/src/main/res/layout/activity_course4_code_challenge3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
tools:context=".Course4CodeChallenge3">

<ImageView
android:id="@+id/header_image"
android:layout_width="wrap_content"
android:layout_height="@dimen/space_272"
android:contentDescription="@string/header_imagine"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/header_image" />

<ImageView
android:id="@+id/poster_sparkling"
android:layout_width="@dimen/space_96"
android:layout_height="@dimen/space_152"
android:layout_marginTop="@dimen/space_200"
android:contentDescription="@string/poster_sparkling"
app:layout_constraintStart_toStartOf="@+id/guideline1"
app:layout_constraintTop_toTopOf="@+id/header_image"
app:srcCompat="@drawable/poster_sparkling" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/space_24" />

<TextView
android:id="@+id/song_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/space_24"
android:text="@string/christmas_message"
android:textSize="@dimen/medium_text"
app:layout_constraintStart_toStartOf="@+id/guideline1"
app:layout_constraintTop_toBottomOf="@+id/poster_sparkling" />

<Button
android:id="@+id/let_it_snow_bottom"
android:layout_width="@dimen/space_176"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/space_24"
android:layout_marginEnd="@dimen/space_8"
android:background="@color/pink"
android:text="@string/let_it_snow"
android:textColor="@color/white"
app:layout_constraintEnd_toStartOf="@+id/jingle_bells_button"
app:layout_constraintStart_toStartOf="@+id/guideline1"
app:layout_constraintTop_toBottomOf="@+id/song_text_view" />

<Button
android:id="@+id/jingle_bells_button"
android:layout_width="@dimen/space_176"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/space_24"
android:layout_marginEnd="@dimen/space_24"
android:background="@color/pink"
android:text="@string/jingle_bells"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/let_it_snow_bottom"
app:layout_constraintTop_toBottomOf="@+id/song_text_view" />

<TextView
android:id="@+id/happy_holidays_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_space"
android:text="@string/happy_holidays"
android:textColor="@color/black"
android:textSize="@dimen/text_24"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/header_image" />

<TextView
android:id="@+id/from_magda_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/space_8"
android:text="@string/from_magda"
android:textColor="@color/black"
android:textSize="@dimen/medium_text"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/happy_holidays_text_view" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/space_136" />

<RatingBar
android:id="@+id/ratingBar"
style="@style/Widget.AppCompat.RatingBar.Indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/medium_space"
android:numStars="1"
android:rating="1"
android:theme="@style/RatingBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/happy_holidays_text_view" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="red">#ff3412</color>
<color name="duskYellow">#FFC922</color>
<color name="pink">#FF1493</color>
</resources>
11 changes: 10 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="medium_text">23sp</dimen>
<dimen name="medium_text">18sp</dimen>
<dimen name="medium_space">16dp</dimen>
<dimen name="space_128">128dp</dimen>
<dimen name="space_64">64dp</dimen>
<dimen name="space_136">136dp</dimen>
<dimen name="space_8">8dp</dimen>
<dimen name="text_24">24sp</dimen>
<dimen name="space_24">24dp</dimen>
<dimen name="space_176">176dp</dimen>
<dimen name="space_152">152dp</dimen>
<dimen name="space_200">200dp</dimen>
<dimen name="space_96">96dp</dimen>
<dimen name="space_272">272dp</dimen>
</resources>
9 changes: 8 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Curs Android Fundamentals</string>
<string name="app_name">Android Developer Fundamentals</string>
<string name="hello_world_from_android">Hello World from Android!</string>
<string name="this_is_my_first_textview">This is my first TextView</string>
<string name="i_am_a_button">I am a button</string>
Expand Down Expand Up @@ -58,4 +58,11 @@ Ut fermentum feugiat lorem sed ultrices. Phasellus et mattis diam. Sed faucibus
<string name="start_constraint_activity">Start Constraint Activity</string>
<string name="this_is_a_textview_in_a_constraintlayout">This is a TextView in a ConstraintLayout</string>
<string name="this_is_a_long_text_view_content">this is a long text view content</string>
<string name="header_imagine">header_imagine</string>
<string name="poster_sparkling">poster_sparkling</string>
<string name="christmas_message">Have yourself a merry little Christmas, \nLet your heart be light\nFrom now on, our troubles will be out of sight</string>
<string name="let_it_snow">LET IT SNOW</string>
<string name="jingle_bells">JINGLE BELLS</string>
<string name="happy_holidays">Happy Holidays!</string>
<string name="from_magda">From Magda</string>
</resources>
5 changes: 4 additions & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.AndroidFundamentalsMai2021" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.AndroidFundamentalsMai2021" parent="Theme.AppCompat.Light">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand All @@ -13,4 +13,7 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="RatingBar" parent="Theme.AppCompat">
<item name="colorControlActivated">@color/duskYellow</item>
</style>
</resources>