generated from IN-SOPT-ANDROID/in-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
16 changed files
with
225 additions
and
71 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
9 changes: 6 additions & 3 deletions
9
app/src/main/java/org/sopt/sample/presentation/home/HomeActivity.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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
package org.sopt.sample.presentation.home | ||
|
||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import org.sopt.sample.R | ||
import org.sopt.sample.databinding.ActivityHomeBinding | ||
import org.sopt.sample.entity.User | ||
import org.sopt.sample.util.binding.BaseActivity | ||
import org.sopt.sample.util.base.BaseActivity | ||
|
||
class HomeActivity : BaseActivity<ActivityHomeBinding>(R.layout.activity_home) { | ||
private val homeViewModel: HomeViewModel by viewModels() | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
binding.vm = homeViewModel | ||
getUserInfo() | ||
} | ||
|
||
private fun getUserInfo() { | ||
val userInfo = intent.getSerializableExtra("userInfo") as User | ||
binding.tvHomeName.text = getString(R.string.home_name_is, userInfo.id) | ||
binding.tvHomeMbti.text = getString(R.string.home_mbti_is, userInfo.mbti) | ||
homeViewModel.id.value = getString(R.string.home_id_is, userInfo.id) | ||
homeViewModel.mbti.value = getString(R.string.home_mbti_is, userInfo.mbti) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/sopt/sample/presentation/home/HomeViewModel.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,9 @@ | ||
package org.sopt.sample.presentation.home | ||
|
||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
|
||
class HomeViewModel : ViewModel() { | ||
val id = MutableLiveData<String>() | ||
val mbti = MutableLiveData<String>() | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
.../sopt/sample/util/binding/BaseActivity.kt → ...org/sopt/sample/util/base/BaseActivity.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
2 changes: 1 addition & 1 deletion
2
.../sopt/sample/util/binding/BaseFragment.kt → ...org/sopt/sample/util/base/BaseFragment.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
2 changes: 1 addition & 1 deletion
2
...in/java/org/sopt/sample/util/ToastUtil.kt → ...sopt/sample/util/extensions/ContextExt.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
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,8 @@ | ||
package org.sopt.sample.util.extensions | ||
|
||
import android.view.View | ||
import com.google.android.material.snackbar.Snackbar | ||
|
||
fun View.showSnackbar(message: String) { | ||
Snackbar.make(this, message, Snackbar.LENGTH_SHORT).show() | ||
} |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M7.579,12 L14,5.579 15.421,7 9,13.421 7.579,12zM14,18.421 L7.579,12 9,10.579 15.421,17 14,18.421z" | ||
android:fillColor="#C8C8C8"/> | ||
</vector> |
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
Oops, something went wrong.