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
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

19 changes: 0 additions & 19 deletions .idea/gradle.xml

This file was deleted.

30 changes: 0 additions & 30 deletions .idea/jarRepositories.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

3 changes: 2 additions & 1 deletion app/build.gradle → Curs-1/DemoApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ plugins {

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.magdamiu.androidfundamentalsmai2021"
applicationId "com.example.demoapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
Expand Down
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";
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.magdamiu.androidfundamentalsmai2021;
package com.example.demoapp;

import android.content.Context;

Expand All @@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.magdamiu.androidfundamentalsmai2021", appContext.getPackageName());
assertEquals("com.example.demoapp", appContext.getPackageName());
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.magdamiu.androidfundamentalsmai2021">
package="com.example.demoapp">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AndroidFundamentalsMai2021">
android:theme="@style/Theme.DemoApp">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
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");
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
188 changes: 188 additions & 0 deletions Curs-1/DemoApp/app/src/main/res/layout/activity_main.xml
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"

Copy link
Copy Markdown
Owner

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

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"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The 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">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The 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
@@ -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.DemoApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand Down
18 changes: 18 additions & 0 deletions Curs-1/DemoApp/app/src/main/res/values/colors.xml
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>
8 changes: 8 additions & 0 deletions Curs-1/DemoApp/app/src/main/res/values/dimens.xml
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>
Loading