Skip to content
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

Syeonnn #12

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
77cbe5a
Delete .idea directory
syeonnn Apr 14, 2023
e83c68d
Delete app directory
syeonnn Apr 14, 2023
81d063a
Delete gradle/wrapper directory
syeonnn Apr 14, 2023
9faef76
Delete .gitignore
syeonnn Apr 14, 2023
69ff267
Delete build.gradle
syeonnn Apr 14, 2023
f5f40e9
Delete settings.gradle
syeonnn Apr 14, 2023
df617df
Delete gradlew.bat
syeonnn Apr 14, 2023
24f13f2
Delete gradle.properties
syeonnn Apr 14, 2023
69d8bc2
Delete gradlew
syeonnn Apr 14, 2023
7d6f655
[Feat(연두/박서연)3,4주차 미션
syeonnn Apr 14, 2023
24f4869
Merge branch 'syeonnn' of https://github.com/UMC-SMWU/4th_UMC_Android…
syeonnn Apr 14, 2023
e7dc006
[Feat(연두/박서연)]4주차 미션
syeonnn Apr 14, 2023
6881ed2
[Feat(연두/박서연)]3주차 미션
syeonnn Apr 14, 2023
6dbc758
readme더하기Merge branch 'syeonnn' of https://github.com/UMC-SMWU/4th_UM…
syeonnn Apr 14, 2023
afa4e74
Delete .idea directory
syeonnn Apr 14, 2023
6ebd999
Delete app directory
syeonnn Apr 14, 2023
69c639a
Delete gradle/wrapper directory
syeonnn Apr 14, 2023
efb43bb
Delete settings.gradle
syeonnn Apr 14, 2023
8de9248
Delete gradlew.bat
syeonnn Apr 14, 2023
f282ffe
Delete gradlew
syeonnn Apr 14, 2023
3c6ab2f
Delete gradle.properties
syeonnn Apr 14, 2023
e1e7c5e
Delete build.gradle
syeonnn Apr 14, 2023
66c93d7
Delete .gitignore
syeonnn Apr 14, 2023
c2f51f6
Delete 3ndStudy directory
syeonnn Apr 14, 2023
48c3f47
[Feat(연두/박서연)]3주차 미션
syeonnn Apr 14, 2023
02062f3
readme파일받기Merge branch 'syeonnn' of https://github.com/UMC-SMWU/4th_U…
syeonnn Apr 14, 2023
2118498
[Feat(연두/박서연)]5주차 미션
syeonnn Apr 26, 2023
51f1bba
[Feat(연두/박서연)]5주차미션
syeonnn Apr 29, 2023
b53906b
Delete 3rdStudy directory
syeonnn May 3, 2023
1d9562b
Delete 4thStudy directory
syeonnn May 3, 2023
e5dcf2e
Delete 5thMission directory
syeonnn May 3, 2023
a5489d8
Delete 5thStudy directory
syeonnn May 3, 2023
b4d1076
[Feat(연두/박서연)]5주차까지 미션
syeonnn May 3, 2023
27cd260
[Feat(연두/박서연)]6주차 미션
syeonnn May 6, 2023
358deba
gitignore추가
syeonnn May 6, 2023
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
2 changes: 2 additions & 0 deletions syeonnn/.gitignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
syeonnn/.DS_Store
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions syeonnn/3rdStudy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 4th_UMC_Android
UMC 4기 Android 스터디
File renamed without changes.
47 changes: 47 additions & 0 deletions syeonnn/3rdStudy/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.example.a3ndstudy'
compileSdk 33

defaultConfig {
applicationId "com.example.a3ndstudy"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding = true
}
}

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.a3ndstudy

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.a3ndstudy", appContext.packageName)
}
}
31 changes: 31 additions & 0 deletions syeonnn/3rdStudy/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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:supportsRtl="true"
android:theme="@style/Theme.3ndStudy"
tools:targetApi="31">
<activity
android:name=".ThirdActivity"
android:exported="false" />
<activity
android:name=".SecondActivity"
android:exported="false" />
<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,22 @@
package com.example.a3ndstudy

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.example.a3ndstudy.databinding.FragmentFirstBinding

class FirstFragment : Fragment() {
private lateinit var binding : FragmentFirstBinding

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = FragmentFirstBinding.inflate(layoutInflater)
return binding.root
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.example.a3ndstudy

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import com.example.a3ndstudy.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
private lateinit var getResultText: ActivityResultLauncher<Intent>

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

getResultText = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result ->
if (result.resultCode == RESULT_OK) {
val mString = result.data?.getStringExtra("result")
Toast.makeText(this,mString,Toast.LENGTH_LONG).show()
}
}

binding.button.setOnClickListener {
val text = binding.editText.text.toString()
val intent = Intent(this, SecondActivity::class.java)
intent.putExtra("text", text)
getResultText.launch(intent)
}


}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.a3ndstudy

import android.app.Activity
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import com.example.a3ndstudy.databinding.ActivitySecondBinding

class SecondActivity : AppCompatActivity() {
private lateinit var binding: ActivitySecondBinding
private lateinit var getResultText: ActivityResultLauncher<Intent>

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

val extras = intent.extras
val data = extras!!["text"] as String

binding.textView.text = data

binding.button.setOnClickListener {
val intent = Intent(this, ThirdActivity::class.java)
startActivity(intent)
}

}

override fun onBackPressed() {
val mIntent = Intent(this,MainActivity::class.java)
mIntent.putExtra("result", "back")
setResult(RESULT_OK, mIntent)
finish()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.a3ndstudy

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.example.a3ndstudy.databinding.FragmentSecondBinding

class SecondFragment : Fragment() {
private lateinit var binding : FragmentSecondBinding

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = FragmentSecondBinding.inflate(layoutInflater)
return binding.root
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.example.a3ndstudy

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import com.example.a3ndstudy.databinding.ActivityThirdBinding
import com.example.a3ndstudy.databinding.FragmentFirstBinding

class ThirdActivity : AppCompatActivity() {
private lateinit var binding: ActivityThirdBinding

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

supportFragmentManager
.beginTransaction()
.replace(binding.frameFragment.id, FirstFragment())
.commitAllowingStateLoss()

binding.btnFg1.setOnClickListener {
supportFragmentManager
.beginTransaction()
.replace(binding.frameFragment.id, FirstFragment())
.commitAllowingStateLoss()
}

binding.btnFg2.setOnClickListener {
supportFragmentManager
.beginTransaction()
.replace(binding.frameFragment.id, SecondFragment())
.commitAllowingStateLoss()
}
}
}
30 changes: 30 additions & 0 deletions syeonnn/3rdStudy/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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=".MainActivity">

<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="무엇이든 입력하세요."
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="click"
app:layout_constraintTop_toBottomOf="@+id/editText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
29 changes: 29 additions & 0 deletions syeonnn/3rdStudy/app/src/main/res/layout/activity_second.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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=".SecondActivity">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="temp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Move to page3"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
45 changes: 45 additions & 0 deletions syeonnn/3rdStudy/app/src/main/res/layout/activity_third.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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=".ThirdActivity">

<FrameLayout
android:id="@+id/frame_fragment"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent">
</FrameLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/linearLayout"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" >

<Button
android:id="@+id/btn_fg1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="fragment1"
android:layout_weight="1"
/>

<Button
android:id="@+id/btn_fg2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="fragment2"
android:layout_weight="1" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Loading