-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add timber #6
base: develop/view
Are you sure you want to change the base?
Add timber #6
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import android.os.Bundle | |
import android.text.Editable | ||
import android.text.TextWatcher | ||
import android.view.View | ||
import android.widget.Toast | ||
import androidx.activity.viewModels | ||
import androidx.core.content.ContextCompat | ||
import org.sopt.sample.base.BindingActivity | ||
|
@@ -100,6 +101,7 @@ class SignUpActivity : BindingActivity<ActivitySignUpBinding>(R.layout.activity_ | |
|
||
viewModel.signupResult.observe(this) { | ||
startActivity(Intent(this,SignInActivity::class.java)) | ||
Toast.makeText(this,getString(R.string.sign_up_success_toast_msg), Toast.LENGTH_LONG).show() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. control + alt + L 을 눌러서 코드 정렬을 시켜봅시당! |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package org.sopt.sample.remote | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseUserDTO( | ||
val page: Int, | ||
val per_page: Int, | ||
val total: Int, | ||
val total_pages: Int, | ||
@SerialName("total_pages") | ||
val totalPages: Int, | ||
val data: List<Data>, | ||
val support: Support, | ||
|
||
|
@@ -16,8 +18,10 @@ data class ResponseUserDTO( | |
data class Data( | ||
val id: Int, | ||
val email: String, | ||
val first_name: String, | ||
val last_name: String, | ||
@SerialName("first_name") | ||
val firstName: String, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 카멜케이스 좋습니다~~ |
||
@SerialName("last_name") | ||
val lastName: String, | ||
val avatar: String, | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,11 +33,10 @@ class SignupViewModel: ViewModel() { | |
response: Response<ResponseSignupDTO> | ||
) { | ||
_signupResult.value = response.body() | ||
Log.d("회원가입 성공", "${response.body()}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이곳에서 Timber를 찍을 수 있겠네용! |
||
} | ||
|
||
override fun onFailure(call: Call<ResponseSignupDTO>, t: Throwable) { | ||
TODO("Not yet implemented") | ||
|
||
} | ||
}) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="60dp" | ||
android:text="Welcome to SOPT" | ||
android:text="@string/sign_in_title" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
|
@@ -35,7 +35,7 @@ | |
android:layout_height="wrap_content" | ||
android:layout_marginStart="40dp" | ||
android:layout_marginTop="32dp" | ||
android:text="ID" | ||
android:text="@string/sign_id_label" | ||
android:textStyle="bold" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/txt_title" /> | ||
|
@@ -46,7 +46,7 @@ | |
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="40dp" | ||
android:layout_marginTop="20dp" | ||
android:hint="아이디를 입력하세요" | ||
android:hint="@string/sign_id_hint" | ||
app:layout_constraintTop_toBottomOf="@+id/txt_id_title" | ||
tools:layout_editor_absoluteX="40dp" /> | ||
|
||
|
@@ -56,7 +56,7 @@ | |
android:layout_height="wrap_content" | ||
android:layout_marginStart="40dp" | ||
android:layout_marginTop="32dp" | ||
android:text="비밀번호" | ||
android:text="@string/sign_pw_label" | ||
android:textStyle="bold" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/editText_id" /> | ||
|
@@ -67,7 +67,7 @@ | |
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="40dp" | ||
android:layout_marginTop="20dp" | ||
android:hint="비밀번호를 입력하세요" | ||
android:hint="@string/sign_pw_hint" | ||
android:inputType="textPassword" | ||
app:layout_constraintTop_toBottomOf="@+id/txt_password_title" /> | ||
|
||
|
@@ -77,7 +77,7 @@ | |
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="40dp" | ||
android:layout_marginTop="30dp" | ||
android:text="LOGIN" | ||
android:text="@string/sign_in" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/editText_pw" /> | ||
|
@@ -87,7 +87,7 @@ | |
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="40dp" | ||
android:text="SIGNUP" | ||
android:text="@string/sign_up" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/loginBtn" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:id="@+id/nav_home" | ||
android:title="홈" | ||
android:title="@string/menu_home" | ||
android:icon="@drawable/ic_home_white" /> | ||
<item android:id="@+id/nav_gallery" | ||
android:title="갤러리" | ||
android:title="@string/menu_gallery" | ||
android:icon="@drawable/ic_gallery_white" /> | ||
<item android:id="@+id/nav_search" | ||
android:title="검색" | ||
android:title="@string/menu_search" | ||
android:icon="@drawable/ic_search_white" /> | ||
</menu> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
애플리케이션 클래스 생성해서 onCreate()에 넣어주세요! 애플리케이션이 실행될 때 딱 한번 실행됩니다! 현재 코드 상에서는 홈프래그먼트가 실행될 때 마다 해당 코드가 실행될 것입니다!