-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package br.com.hay.hay.feeling | ||
|
||
data class Feeling( | ||
val title: String | ||
) |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/br/com/hay/hay/feeling/RegisterFeelingContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package br.com.hay.hay.feeling | ||
|
||
class RegisterFeelingContract { | ||
|
||
interface View { | ||
fun setPresenter(presenter: Presenter) | ||
fun showSubTitle(subTitle: String) | ||
fun showFeelings(feelings: List<Feeling>) | ||
} | ||
|
||
interface Presenter { | ||
fun start() | ||
fun onClickNextButton() | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
app/src/main/java/br/com/hay/hay/feeling/RegisterFeelingFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package br.com.hay.hay.feeling | ||
|
||
import android.os.Bundle | ||
import android.support.v4.app.Fragment | ||
import android.support.v7.widget.RecyclerView | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.Button | ||
import android.widget.TextView | ||
import br.com.hay.hay.R | ||
|
||
class RegisterFeelingFragment : Fragment(), RegisterFeelingContract.View { | ||
|
||
private lateinit var mPresenter : RegisterFeelingContract.Presenter | ||
private lateinit var mNextButton : Button | ||
private lateinit var mSubTitleTextView: TextView | ||
private lateinit var mFeelingList : RecyclerView | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
val view = inflater.inflate(R.layout.fragment_register_feeling_layout, container, false) | ||
|
||
mNextButton = view.findViewById(R.id.button_next) | ||
mSubTitleTextView = view.findViewById(R.id.text_sub_title) | ||
mFeelingList = view.findViewById(R.id.list_feelings) | ||
|
||
mNextButton.setOnClickListener { | ||
mPresenter.onClickNextButton() | ||
} | ||
|
||
return view | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
mPresenter.start() | ||
} | ||
|
||
override fun setPresenter(presenter: RegisterFeelingContract.Presenter) { | ||
mPresenter = presenter | ||
} | ||
|
||
override fun showSubTitle(subTitle: String) { | ||
mSubTitleTextView.text = subTitle | ||
} | ||
|
||
override fun showFeelings(feelings: List<Feeling>) { | ||
|
||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/br/com/hay/hay/feeling/RegisterFeelingPresenter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package br.com.hay.hay.feeling | ||
|
||
class RegisterFeelingPresenter : RegisterFeelingContract.Presenter { | ||
|
||
fun RegisterFeelingPresenter() { | ||
|
||
} | ||
|
||
override fun start() { | ||
|
||
} | ||
|
||
override fun onClickNextButton() { | ||
|
||
} | ||
} | ||
|
61 changes: 61 additions & 0 deletions
61
app/src/main/res/layout/fragment_register_feeling_layout.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.constraint.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"> | ||
|
||
<TextView | ||
android:id="@+id/text_title_screen" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="16dp" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="32dp" | ||
android:text="COMO VAI VOCÊ?" | ||
android:textSize="42sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/text_sub_title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="8dp" | ||
android:layout_marginStart="8dp" | ||
android:layout_marginTop="8dp" | ||
tools:text="Qua Jul 25 16:03:30" | ||
android:textSize="21sp" | ||
android:textColor="#000" | ||
app:layout_constraintEnd_toEndOf="@+id/text_title_screen" | ||
app:layout_constraintStart_toStartOf="@+id/text_title_screen" | ||
app:layout_constraintTop_toBottomOf="@+id/text_title_screen" /> | ||
|
||
|
||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/list_feelings" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_marginBottom="6dp" | ||
android:layout_marginTop="32dp" | ||
app:layout_constraintBottom_toTopOf="@+id/button_next" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/text_sub_title" /> | ||
|
||
<Button | ||
android:id="@+id/button_next" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:background="#0F0" | ||
style="?android:attr/borderlessButtonStyle" | ||
android:text="Next" | ||
android:textColor="#fff" | ||
android:textSize="16sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" /> | ||
|
||
</android.support.constraint.ConstraintLayout> |