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
Binary file added EmotionPost.zip
Binary file not shown.
15 changes: 15 additions & 0 deletions Week1(Test)/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions Week1(Test)/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Week1(Test)/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Week1(Test)/.idea/AndroidProjectSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Week1(Test)/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Week1(Test)/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions Week1(Test)/.idea/deviceManager.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Week1(Test)/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Week1(Test)/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Week1(Test)/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Week1(Test)/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Week1(Test)/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
47 changes: 47 additions & 0 deletions Week1(Test)/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
plugins {
alias(libs.plugins.android.application)
}

android {
namespace = "com.example.emotionpost"
compileSdk {
version = release(36) {
minorApiLevel = 1
}
}

defaultConfig {
applicationId = "com.example.emotionpost"
minSdk = 24
targetSdk = 36
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
21 changes: 21 additions & 0 deletions Week1(Test)/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.emotionpost

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.emotionpost", appContext.packageName)
}
}
25 changes: 25 additions & 0 deletions Week1(Test)/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.EmotionPost">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.example.emotionpost

import android.graphics.Color
import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)


val ivHappy = findViewById<ImageView>(R.id.yellow_happy)
val tvHappy = findViewById<TextView>(R.id.tv_happy_text)

ivHappy.setOnClickListener {

tvHappy.setTextColor(Color.parseColor("#FFD600"))
}

val ivPHappy = findViewById<ImageView>(R.id.purple_happy)
val tvPHappy = findViewById<TextView>(R.id.tv_excited_text)

ivPHappy.setOnClickListener {

tvPHappy.setTextColor(Color.parseColor("#87CEEB"))

}


val ivNormal = findViewById<ImageView>(R.id.purple_soso)
val tvNormal = findViewById<TextView>(R.id.tv_soso_text)

ivNormal.setOnClickListener {

tvNormal.setTextColor(Color.parseColor("#D1C4E9"))

}

val ivStressed = findViewById<ImageView>(R.id.green_sad)
val tvStressed = findViewById<TextView>(R.id.tv_green_sad_text)

ivStressed.setOnClickListener {

tvStressed.setTextColor(Color.parseColor("#A5D6A7"))

}

val ivGrumpy = findViewById<ImageView>(R.id.angry_red)
val tvGrumpy = findViewById<TextView>(R.id.tv_angry_red_text)

ivGrumpy.setOnClickListener {

tvGrumpy.setTextColor(Color.parseColor("#FF5252"))

}
}
}
32 changes: 32 additions & 0 deletions Week1(Test)/app/src/main/res/drawable/angry_red.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="45dp"
android:viewportWidth="40"
android:viewportHeight="45">
<path
android:pathData="M13.264,3.543L13.487,3.639L13.708,3.536L20.001,0.599L26.403,3.537L26.629,3.641L26.854,3.539L33.366,0.597L39.456,3.391V40.741L33.467,43.535L26.517,40.587L26.29,40.49L26.068,40.598L19.992,43.53L13.484,40.592L13.261,40.49L13.037,40.592L6.525,43.531L0.544,40.741V3.387L6.424,0.596L13.264,3.543Z"
android:strokeWidth="1.08696"
android:fillColor="#F6F6F6"
android:strokeColor="#000000"/>
<path
android:pathData="M4.239,6.413h31.304v31.522h-31.304z"
android:strokeWidth="1.08696"
android:fillColor="#EB8B8B"
android:strokeColor="#000000"/>
<path
android:pathData="M27.319,14.562C27.319,15.524 26.638,16.304 25.798,16.304C24.957,16.304 24.276,15.524 24.276,14.562C24.276,14.291 25.109,14.357 25.801,14.152C26.545,13.931 27.319,13.6 27.319,14.562Z"
android:fillColor="#000000"/>
<path
android:pathData="M14.493,14.562C14.493,15.524 15.175,16.304 16.015,16.304C16.855,16.304 17.537,15.524 17.537,14.562C17.537,14.291 16.704,14.357 16.012,14.152C15.267,13.931 14.493,13.6 14.493,14.562Z"
android:fillColor="#000000"/>
<path
android:pathData="M20.472,20.544m-2.826,0a2.826,2.826 0,1 1,5.652 0a2.826,2.826 0,1 1,-5.652 0"
android:strokeWidth="1.08696"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
<path
android:pathData="M28.829,30.431C28.829,30.431 23.923,26.038 20.147,25.664C16.347,25.289 10.652,28.682 10.652,28.682"
android:strokeWidth="1.08696"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
</vector>
32 changes: 32 additions & 0 deletions Week1(Test)/app/src/main/res/drawable/green_sad.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="45dp"
android:viewportWidth="40"
android:viewportHeight="45">
<path
android:pathData="M13.264,3.543L13.487,3.639L13.708,3.536L20.001,0.599L26.403,3.537L26.629,3.641L26.854,3.539L33.366,0.597L39.456,3.391V40.741L33.467,43.535L26.517,40.587L26.29,40.49L26.068,40.598L19.992,43.53L13.484,40.592L13.261,40.49L13.037,40.592L6.525,43.531L0.544,40.741V3.387L6.424,0.596L13.264,3.543Z"
android:strokeWidth="1.08696"
android:fillColor="#F6F6F6"
android:strokeColor="#000000"/>
<path
android:pathData="M4.239,6.413h31.304v31.522h-31.304z"
android:strokeWidth="1.08696"
android:fillColor="#B1D3B9"
android:strokeColor="#000000"/>
<path
android:pathData="M14.493,14.891a1.196,1.848 0,1 0,2.391 0a1.196,1.848 0,1 0,-2.391 0z"
android:fillColor="#000000"/>
<path
android:pathData="M24.928,14.891a1.196,1.848 0,1 0,2.391 0a1.196,1.848 0,1 0,-2.391 0z"
android:fillColor="#000000"/>
<path
android:pathData="M20.472,20.978m-2.826,0a2.826,2.826 0,1 1,5.652 0a2.826,2.826 0,1 1,-5.652 0"
android:strokeWidth="1.08696"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
<path
android:pathData="M28.829,30.865C28.829,30.865 23.923,26.472 20.147,26.099C16.347,25.723 10.652,29.117 10.652,29.117"
android:strokeWidth="1.08696"
android:fillColor="#00000000"
android:strokeColor="#000000"/>
</vector>
Loading