Skip to content

Commit

Permalink
1. 변경사항
Browse files Browse the repository at this point in the history
- (중고거래 -> 상품선택 -> 구매하기) 현재 총 3페이지 전환 소스와 백그라운드 파일 추가
- 백그라운드 파일 drawble 디렉토리에 추가함

2. 유의사항
- 피그마 2번 방법 페이지에 이미지를 화면에 맞게 변경하였음
- 현재 버튼은 투명버튼이 아님. 우려한대로 백그라운드 이미지의 비율이 변하면 버튼의 위치와 호환되고 있지 않음
  • Loading branch information
spyoon committed Nov 26, 2021
1 parent 76be072 commit 957dcfa
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id'kotlin-android-extensions'
}

android {
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/com/mintcho/wwmarket2/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package com.mintcho.wwmarket2

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setContentView(R.layout.activity_main) //layout 디렉토리의 xml와 1대1 매칭되도록 activity_main

mButton.setOnClickListener {
val intent = Intent(this, SubActivity::class.java) //버튼 누르면 넘어갈 페이지를 Subactivity 위치에 알맞게 변경할것
startActivity(intent)
}
}
}
18 changes: 18 additions & 0 deletions app/src/main/java/com/mintcho/wwmarket2/SubActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.mintcho.wwmarket2

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class SubActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sub)

mButton.setOnClickListener {
val intent = Intent(this, SubActivity2::class.java)
startActivity(intent)
}
}
}
11 changes: 11 additions & 0 deletions app/src/main/java/com/mintcho/wwmarket2/SubActivity2.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.mintcho.wwmarket2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class SubActivity2 : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sub2)
}
}
27 changes: 16 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<?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"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:background="@drawable/main2"
android:gravity="center"
tools:context=".MainActivity"> <!--.MainActivity java디렉토리의 액티비티와 대응되도록 변경할것 -->

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/mButton"
android:layout_width="66dp"
android:layout_height="64dp"
android:layout_marginStart="24dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="68dp"
android:text="화면전환"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
24 changes: 24 additions & 0 deletions app/src/main/res/layout/activity_sub.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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"
android:background="@drawable/main3"
android:gravity="center"
tools:context=".SubActivity">


<Button
android:id="@+id/mButton"
android:layout_width="161dp"
android:layout_height="66dp"
android:layout_marginStart="196dp"
android:layout_marginLeft="196dp"
android:layout_marginTop="648dp"
android:text="화면전환"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
12 changes: 12 additions & 0 deletions app/src/main/res/layout/activity_sub2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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"
android:background="@drawable/main4"
android:gravity="center"
tools:context=".SubActivity2">

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 957dcfa

Please sign in to comment.