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
15 changes: 15 additions & 0 deletions .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
1 change: 1 addition & 0 deletions .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 .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 .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 .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 .idea/deviceManager.xml

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

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

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

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

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

6 changes: 6 additions & 0 deletions .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 .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 .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 app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
56 changes: 56 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}

android {
namespace = "com.example.umc"
compileSdk = 34

defaultConfig {
applicationId = "com.example.umc"
minSdk = 24
targetSdk = 34
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
}
kotlinOptions {
jvmTarget = "11"
}

buildFeatures {
viewBinding = true
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.appcompat)
implementation(libs.constraintlayout)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.ktx)
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.fragment:fragment-ktx:1.6.2") // ← 권장 추가
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
21 changes: 21 additions & 0 deletions 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.umc

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.umc", appContext.packageName)
}
}
43 changes: 43 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.umc"
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.UMC9thAndroid">

<!-- 앱의 시작점: BottomNavTestActivity -->
<activity
android:name=".nike.NikeActivity"
android:exported="true"
android:label="Nike"
android:theme="@style/Theme.UMC9thAndroid">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- NikeActivity: 런처 실행 -->
<activity
android:name=".emotion.EmotionActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.UMC9thAndroid" />

<!-- 기존 MainActivity -->
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.UMC9thAndroid" />

</application>
</manifest>
19 changes: 19 additions & 0 deletions app/src/main/java/com/example/umc/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.example.umc

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.umc.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

binding.tvMain.text = "Welcome UMC_9th!!"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.example.umc.bottomnav

import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.example.umc.bottomnav.MypageFragment
import com.example.umc.R
import com.example.umc.databinding.ActivityBottomNavTestBinding

class BottomNavTestActivity : AppCompatActivity() {

private lateinit var binding: ActivityBottomNavTestBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityBottomNavTestBinding.inflate(layoutInflater)
setContentView(binding.root)

// 첫 화면: 홈 프래그먼트 표시
supportFragmentManager.beginTransaction()
.replace(R.id.main_fragment_container, HomeFragment())
.commit()

// 바텀 네비게이션 아이템 선택 리스너
binding.mainBnv.setOnItemSelectedListener { item: MenuItem ->
val selectedFragment = when (item.itemId) {
R.id.homeFragment -> HomeFragment()
R.id.diaryFragment -> DiaryFragment()
R.id.calendarFragment -> CalendarFragment()
R.id.friendFragment -> FriendFragment()
R.id.mypageFragment -> MypageFragment()
else -> null
}

selectedFragment?.let {
supportFragmentManager.beginTransaction()
.replace(R.id.main_fragment_container, it)
.commit()
}

true
}
}
}
25 changes: 25 additions & 0 deletions app/src/main/java/com/example/umc/bottomnav/CalendarFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.example.umc.bottomnav

import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment

class CalendarFragment : Fragment() {

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
// 간단한 텍스트만 있는 UI
return TextView(requireContext()).apply {
text = "일기쓰기 프래그먼트"
gravity = Gravity.CENTER
textSize = 24f
}
}
}
25 changes: 25 additions & 0 deletions app/src/main/java/com/example/umc/bottomnav/DiaryFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.example.umc.bottomnav

import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment

class DiaryFragment : Fragment() {

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
// 간단한 텍스트만 있는 UI
return TextView(requireContext()).apply {
text = "일기쓰기 프래그먼트"
gravity = Gravity.CENTER
textSize = 24f
}
}
}
Loading