Skip to content

Commit

Permalink
(#2) Notice bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
myung6024 committed Nov 23, 2019
1 parent 27a6e8e commit 151ee1f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
7 changes: 5 additions & 2 deletions app/src/main/java/com/mashup/SplashActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.mashup

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import androidx.appcompat.app.AppCompatActivity
import com.mashup.app.login.LoginActivity
import com.mashup.app.notices.NoticesActivity
Expand Down Expand Up @@ -35,8 +36,10 @@ class SplashActivity : AppCompatActivity() {
})
)
} else {
startActivity(Intent(this, LoginActivity::class.java))
finish()
Handler().postDelayed({
startActivity(Intent(this, LoginActivity::class.java))
finish()
}, 1500)
}
}

Expand Down
37 changes: 20 additions & 17 deletions app/src/main/res/layout/login_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools">

<data>

<variable
name="viewmodel"
type="com.mashup.app.login.LoginViewModel" />
Expand Down Expand Up @@ -40,23 +41,23 @@

<LinearLayout
android:id="@+id/layoutOval"
android:layout_marginEnd="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/tvLoginMainTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_marginEnd="20dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/tvLoginMainTitle"
app:layout_constraintEnd_toEndOf="parent">

<ImageView
android:background="@drawable/circle_shape_color_primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:background="@drawable/circle_shape_color_primary" />

<ImageView
android:layout_marginStart="6dp"
android:background="@drawable/circle_shape_color_accent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:background="@drawable/circle_shape_color_accent" />
</LinearLayout>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -89,9 +90,10 @@
android:layout_marginStart="@dimen/login_margin_start_et_layout"
android:layout_marginEnd="@dimen/login_margin_end_et_layout"
android:hint="@string/login_et_email"
android:inputType="textEmailAddress"
android:text="@={viewmodel.email}"
android:textColorHint="@color/colorEtHint"
android:textSize="14sp"
android:text="@={viewmodel.email}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvEmail" />

Expand All @@ -114,9 +116,10 @@
android:layout_marginStart="@dimen/login_margin_start_et_layout"
android:layout_marginEnd="@dimen/login_margin_end_et_layout"
android:hint="@string/login_et_password"
android:inputType="textPassword"
android:text="@={viewmodel.password}"
android:textColorHint="@color/colorEtHint"
android:textSize="14sp"
android:text="@={viewmodel.password}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPassword" />

Expand All @@ -126,25 +129,25 @@
android:layout_height="50dp"
android:layout_marginTop="30dp"
android:background="@drawable/btn_radius_main"
android:onClick="@{() -> viewmodel.onClickLoginButton()}"
android:text="@string/login_btn"
android:textColor="@color/colorWhite"
android:textSize="20sp"
android:onClick="@{() -> viewmodel.onClickLoginButton()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etPassword" />
</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
android:id="@+id/tvWelcomeMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="25dp"
android:text="@string/login_tv_welcome_msg"
android:textSize="15sp"
android:layout_marginBottom="25dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
1 change: 1 addition & 0 deletions model/src/main/java/com/mashup/model/Notice.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ data class Notice(
}

fun Notice.mapToPresentation(userId: Int) = apply {
userAttendance = VoteStatus.NONE
attendanceSet.forEach { attendance ->
if (attendance.user.pk == userId) {
userAttendance = attendance.vote
Expand Down

0 comments on commit 151ee1f

Please sign in to comment.