Skip to content

Commit

Permalink
ISSUE #18 Modify : Make Study Activity View Finish
Browse files Browse the repository at this point in the history
  • Loading branch information
TaeseongYun committed Jul 24, 2020
1 parent 30819fe commit 572cc1e
Show file tree
Hide file tree
Showing 24 changed files with 683 additions and 269 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ dependencies {
implementation project(':domain')
implementation project(':local')
implementation project(':remote')
implementation project(':constant')
}
androidExtensions {

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.activity.UserPreferPlaceActivity"></activity>
<activity android:name=".ui.activity.SelectedCategoryActivity" />
<activity
android:name=".ui.activity.TemporaryStudyActivity"
android:theme="@style/NoActionBar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun HorizontalCategoryListView.setBindingAdapter(
}

items?.let {
setCategory(it)
setLayoutData(it)
initSelected()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ package com.studyship.application.binding
import android.widget.TextView
import androidx.databinding.BindingAdapter
import com.studyship.application.R
import tsthec.tsstudy.domain.model.DomainMakeStudyResponse

@BindingAdapter("temporaryStudyText")
fun TextView.setBindingTemporary(item: Int?) {
text = if(item == 0) {
text = if (item == 0) {
context.getString(R.string.temporary_storage_my_study_empty)
} else {
context.getString(R.string.temporary_storage_my_study, item)
}
// item?.temporarySize.takeIf {
// }?.run {
//
// } ?: run { text = }
}

@BindingAdapter("userSelectedStudyCategory")
fun TextView.setSelectedUserSelected(items: List<String>?) {
items?.let {
text = it.joinToString()
} ?: let { text = context.getString(R.string.go_to_category) }
}

@BindingAdapter("userPreferStudyPlace")
fun TextView.setPreferStudyPlace(items: List<String>?) {
items?.let {
text = it.joinToString()
} ?: let { text = context.getString(R.string.user_prefer_place) }
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,56 @@
package com.studyship.application.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.lifecycle.observe
import com.studyship.application.BR
import com.studyship.application.R
import com.studyship.application.base.activity.BaseActivity
import com.studyship.application.databinding.ActivityCreateStudyBinding
import com.studyship.application.util.comfortableStartActivity
import com.tsdev.presentation.MakeStudyViewModel
import kotlinx.android.synthetic.main.activity_create_study.*
import org.koin.androidx.viewmodel.ext.android.viewModel
import tsthec.tsstudy.constant.SimpleClassName

class CreateStudyActivity : AppCompatActivity() {
class CreateStudyActivity :
BaseActivity<MakeStudyViewModel, ActivityCreateStudyBinding>(R.layout.activity_create_study) {

override val viewModel: MakeStudyViewModel by viewModel()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_create_study)

bind {
setVariable(BR.vm, viewModel)
setVariable(BR.simpleClass, SimpleClassName)
}
gather_date_layout.setLayoutData(listOf("", "", "", "", "", "", ""))

viewModel.moveActivityLiveData.observe(this) {
when (it.getContentValue()) {
SimpleClassName.SELECTED_CLASS -> {
comfortableStartActivity<SelectedCategoryActivity>()
}
SimpleClassName.PREFER_PLACE -> {
comfortableStartActivity<UserPreferPlaceActivity>()
}
}
}

user_level_horizontal.setLayoutData(listOf("입문", "중급", "고급", "실무", "미정"))

user_level_horizontal.setCategoryOnClickListener = {
Log.e("POSITION", it.toString())
}

user_time_horizontal.setLayoutData(listOf("오전", "오후", "저녁", "미정"))
user_time_horizontal.setCategoryOnClickListener = {
Log.e("POSITION", it.toString())
}

user_many_horizontal.setLayoutData(listOf("2명", "3명", "4명", "5명이상"))
user_many_horizontal.setCategoryOnClickListener = {
Log.e("POSITION", it.toString())
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.studyship.application.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.studyship.application.R

class SelectedCategoryActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_selected_category)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.studyship.application.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.studyship.application.R

class UserPreferPlaceActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_user_prefer_place)
}
}
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_insert_invitation_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#B3B3B3"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M17,12h-5v5h5v-5zM16,1v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2h-1L18,1h-2zM19,19L5,19L5,8h14v11z"/>
</vector>
Loading

0 comments on commit 572cc1e

Please sign in to comment.