신기성

empty master

Showing 204 changed files with 0 additions and 3451 deletions
# WELLO project
## description
복지 정책 앱 ver1
## todo
\ No newline at end of file
This diff could not be displayed because it is too large.
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<AndroidXmlCodeStyleSettings>
<option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" />
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.vip"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-database:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
{
"project_info": {
"project_number": "1004426035643",
"firebase_url": "https://capstone-vip.firebaseio.com",
"project_id": "capstone-vip",
"storage_bucket": "capstone-vip.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1004426035643:android:fe0fc57d688873dd4f849e",
"android_client_info": {
"package_name": "com.example.vip"
}
},
"oauth_client": [
{
"client_id": "1004426035643-ju8i4dbd1psjka5qqjsntos2kodrt2ca.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.vip",
"certificate_hash": "8ac95d8222d265210a8ef81c0f1fa04561152680"
}
},
{
"client_id": "1004426035643-0id5kb6rfoi38qi0ji2tvm7o8vvinvbe.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.vip",
"certificate_hash": "0620fb977bfe2437393ecbf8fc4e3a84a4bd2574"
}
},
{
"client_id": "1004426035643-n8hi0ab3i0km4j1srujtl0q70s97r93g.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC_eN3CjxzZwyH2oquqQYGAB3lMVolxVBE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1004426035643-n8hi0ab3i0km4j1srujtl0q70s97r93g.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.example.vip
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.vip", appContext.packageName)
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.vip">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/NoActionBar">
<activity android:name=".ChildAdapter"></activity>
<activity android:name=".InputProfilFifthFourActivity" />
<activity android:name=".InputProfilFifthThreeActivity" />
<activity android:name=".InputProfilFifthTwoActivity" />
<activity android:name=".InputProfilFifthOneActivity" />
<activity android:name=".InputProfilFourthFiveActivity" />
<activity android:name=".InputProfilFourthFourActivity" />
<activity android:name=".InputProfilFourthThreeActivity" />
<activity android:name=".InputProfilFourthTwoActivity" />
<activity android:name=".InputProfilFourthOneActivity" />
<activity android:name=".InputProfilThirdFourActivity" />
<activity android:name=".InputProfilThirdThreeActivity" />
<activity android:name=".InputProfilThirdTwoActivity" />
<activity android:name=".InputProfilThirdOneActivity" />
<activity android:name=".InputProfilSecondThreeActivity" />
<activity android:name=".InputProfilSecondTwoActivity" />
<activity android:name=".InputProfilSecondOneActivity" />
<activity android:name=".InputProfilFirstSixActivity" />
<activity android:name=".InputProfilFirstFiveActivity" />
<activity android:name=".InputProfilFirstFourActivity" />
<activity android:name=".InputProfilFirstThreeActivity" />
<activity android:name=".InputProfilFirstTwoActivity" />
<activity android:name=".FragmentActivity" />
<activity android:name=".FragmentLayout" />
<activity android:name=".InputProfilFirstOneActivity" />
<activity android:name=".WelcomeActivity" />
<activity android:name=".SettingActivity" />
<activity android:name=".DetailActivity" />
<activity android:name=".InfoActivity" />
<activity android:name=".FavoritesActivity" />
<activity android:name=".RecommendActivity" />
<activity android:name=".SignInActivity" />
<activity android:name=".SignUpActivity" />
<activity android:name=".MainActivity" />
<activity
android:name=".SearchActivity"
android:windowSoftInputMode="adjustNothing" />
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_bs.view.*
class BSAdapter(private val items: ArrayList<BSItem>) :
RecyclerView.Adapter<BSAdapter.ViewHolder>() {
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: BSAdapter.ViewHolder, position: Int) {
val item = items[position]
holder.apply {
bind(item)
itemView.tag = item
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int):
BSAdapter.ViewHolder {
val inflatedView = LayoutInflater.from(parent.context)
.inflate(R.layout.item_bs, parent, false)
return BSAdapter.ViewHolder(inflatedView)
}
class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
private var view: View = v
fun bind(item: BSItem) {
view.circleformButton.text=item.numOfBS.toString()
view.bsTextView.text=" 형제자매 "+item.numOfBS.toString()
view.womanButton.setOnClickListener {
if(view.manButton.isChecked){
view.manButton.isChecked=false
}else{
}
}
view.manButton.setOnClickListener {
if(view.womanButton.isChecked){
view.womanButton.isChecked=false
}else{
}
}
}
}
}
\ No newline at end of file
package com.example.vip
class BSItem(val numOfBS: Int)
\ No newline at end of file
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_child.view.*
import kotlinx.android.synthetic.main.item_policyfield.view.*
class ChildAdapter(private val items: ArrayList<ChildItem>) :
RecyclerView.Adapter<ChildAdapter.ViewHolder>() {
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: ChildAdapter.ViewHolder, position: Int) {
val item = items[position]
holder.apply {
bind(item)
itemView.tag = item
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int):
ChildAdapter.ViewHolder {
val inflatedView = LayoutInflater.from(parent.context)
.inflate(R.layout.item_child, parent, false)
return ChildAdapter.ViewHolder(inflatedView)
}
class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
private var view: View = v
fun bind(item: ChildItem) {
view.circleformButton.text=item.numOfChild.toString()
view.childTextView.text=" 자녀 "+item.numOfChild.toString()
view.womanButton.setOnClickListener {
if(view.manButton.isChecked){
view.manButton.isChecked=false
}else{
}
}
view.manButton.setOnClickListener {
if(view.womanButton.isChecked){
view.womanButton.isChecked=false
}else{
}
}
}
}
}
\ No newline at end of file
package com.example.vip
class ChildItem(val numOfChild: Int)
\ No newline at end of file
package com.example.vip
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Half.toFloat
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.webkit.WebView
import android.widget.ImageView
import android.widget.RatingBar
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.viewpager.widget.ViewPager
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.snackbar.Snackbar
import com.google.firebase.database.DataSnapshot
import com.google.firebase.database.DatabaseError
import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.database.ValueEventListener
import kotlinx.android.synthetic.main.activity_detail.*
import kotlinx.android.synthetic.main.activity_recommend.*
import kotlinx.android.synthetic.main.activity_signin.*
import kotlinx.android.synthetic.main.activity_signin.toolbar
import kotlinx.android.synthetic.main.search.*
import androidx.core.app.ComponentActivity.ExtraData
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import android.net.Uri
import android.view.MotionEvent
data class MemoItemDetail(
val Target : String = "",
val Policy : String = "",
val Content : String = "",
val Link : String = "",
val Date : String = "상시"
)
class DetailActivity : AppCompatActivity() {
////bottom navigation view operation start 1
lateinit var bottomBar: ActionBar
////bottom navigation view operation end 1
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_detail)
var detaildatabase = FirebaseDatabase.getInstance().reference
if (intent.hasExtra("key")) {
//textView.text = intent.getStringExtra("key") 텍뷰추가하면 인텐트로 값넘기는거 보임
detaildatabase.orderByChild("Policy").startAt(intent.getStringExtra("key")).endAt(intent.getStringExtra("key")+"\uf8ff").addListenerForSingleValueEvent(object :
ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
Toast.makeText(this@DetailActivity, "실패부분", Toast.LENGTH_SHORT).show()
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
for (memoSnapshot in dataSnapshot.children){
val memo = memoSnapshot.getValue(MemoItemDetail::class.java)
var detailImage: ImageView =findViewById(R.id.policyImageDetail)
var detailDday: TextView =findViewById(R.id.policyDdayDetail)
var detailTitle: TextView =findViewById(R.id.policyTitleDetail)
var detailScore: RatingBar =findViewById(R.id.policyScoreDetail)
var detailFavor: TextView =findViewById(R.id.policyFavorDetail)
detailImage.setImageResource(R.drawable.image01)
detailDday.text=memo!!.Date
detailTitle.text=memo!!.Policy
detailScore.rating=4.toFloat()
detailFavor.text="0"
val web : WebView = findViewById(R.id.policy_context)
val summary : String = memo!!.Content
web.loadData(summary, "text/html", "UTF-8")
val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item->
when (item.itemId){
R.id.shareBtn ->{
//val intent = Intent(this, SignInActivity::class.java)
//startActivity(intent)
//return@OnNavigationItemSelectedListener true
}
R.id.favorBtn ->{
}
R.id.linkBtn ->{
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(memo.Link))
startActivity(intent)
}
}
false
}
////bottom navigation view operation start 2
bottomBar=supportActionBar!!
val bottomNavigation: BottomNavigationView =findViewById(R.id.bottomNavigation)
bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
////bottom navigation view operation end 2
}
}
})
} else {
Toast.makeText(this, "putExtra value not found", Toast.LENGTH_SHORT).show()
}
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
// 2. 툴바 왼쪽 버튼 설정
supportActionBar!!.setDisplayHomeAsUpEnabled(true) // 왼쪽 버튼 사용 여부 true
supportActionBar!!.setHomeAsUpIndicator(R.drawable.return_page) // 왼쪽 버튼 아이콘 설정
supportActionBar!!.setDisplayShowTitleEnabled(false) // 타이틀 안보이게 하기
}
// 3.툴바 메뉴 버튼을 설정
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main_menu, menu) // main_menu 메뉴를 toolbar 메뉴 버튼으로 설정
return true
}
// 4.툴바 메뉴 버튼이 클릭 됐을 때 콜백
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
// 클릭된 메뉴 아이템의 아이디 마다 when 구절로 클릭시 동작을 설정한다.
when(item!!.itemId){
android.R.id.home->{ // 메뉴 버튼
Snackbar.make(toolbar,"Menu pressed",Snackbar.LENGTH_SHORT).show()
}
R.id.menu_search->{ // 검색 버튼
val search_Intent = Intent(this, SearchActivity::class.java)
startActivity(search_Intent)
//Snackbar.make(toolbar,"Search menu pressed",Snackbar.LENGTH_SHORT).show()
}
}
return super.onOptionsItemSelected(item)
}
//bottom navigation view operation start 3
//bottom navigation view operation end 3
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.core.content.ContextCompat
import androidx.core.content.ContextCompat.startActivity
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.snackbar.Snackbar
import com.google.firebase.database.DataSnapshot
import com.google.firebase.database.DatabaseError
import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.database.ValueEventListener
import kotlinx.android.synthetic.main.activity_recommend.*
import kotlinx.android.synthetic.main.activity_recommend.toolbar
import kotlinx.android.synthetic.main.activity_signin.*
data class MemoItemFavor(
val Target : String = "",
val Policy : String = "",
val Content : String = "",
val Link : String = ""
)
class FavoritesActivity : AppCompatActivity() {
////bottom navigation view operation start 1
lateinit var bottomBar: ActionBar
////bottom navigation view operation end 1
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_favorites)
val policyList = ArrayList<PolicyItem>()
var favordatabase = FirebaseDatabase.getInstance().reference
val prof: SharedPreferences = getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
var tempstring=prof.getString("favorstringlist","")
var sepstr=tempstring!!.split("@")
var sepstrset=sepstr.toMutableSet()
for (favor in sepstrset){
favordatabase.orderByChild("Policy").startAt(favor).endAt(favor).addListenerForSingleValueEvent(object :
ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
Toast.makeText(this@FavoritesActivity, "실패부분", Toast.LENGTH_SHORT).show()
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
for (memoSnapshot in dataSnapshot.children){
val memo = memoSnapshot.getValue(MemoItemFavor::class.java)
policyList.add(
PolicyItem(
ContextCompat.getDrawable(this@FavoritesActivity, R.drawable.image01)!!,
memo!!.Policy,
memo!!.Policy,
memo!!.Policy,
4.toFloat(),
" "
)
)
}
val adapter = PolicyAdapter(policyList)
policyRecyclerView.adapter = adapter
}
})
}
if (intent.hasExtra("key")) {
//textView.text = intent.getStringExtra("key") 텍뷰추가하면 인텐트로 값넘기는거 보임
} else {
Toast.makeText(this, "putExtra value not found", Toast.LENGTH_SHORT).show()
}
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
// 2. 툴바 왼쪽 버튼 설정
supportActionBar!!.setDisplayHomeAsUpEnabled(true) // 왼쪽 버튼 사용 여부 true
supportActionBar!!.setHomeAsUpIndicator(R.drawable.return_page) // 왼쪽 버튼 아이콘 설정
supportActionBar!!.setDisplayShowTitleEnabled(false) // 타이틀 안보이게 하기
////bottom navigation view operation start 2
bottomBar=supportActionBar!!
val bottomNavigation: BottomNavigationView =findViewById(R.id.bottomNavigation)
bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
////bottom navigation view operation end 2
}
// 3.툴바 메뉴 버튼을 설정
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main_menu, menu) // main_menu 메뉴를 toolbar 메뉴 버튼으로 설정
return true
}
// 4.툴바 메뉴 버튼이 클릭 됐을 때 콜백
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
// 클릭된 메뉴 아이템의 아이디 마다 when 구절로 클릭시 동작을 설정한다.
when(item!!.itemId){
android.R.id.home->{ // 메뉴 버튼
Snackbar.make(toolbar,"Menu pressed", Snackbar.LENGTH_SHORT).show()
}
R.id.menu_search->{ // 검색 버튼
val search_Intent = Intent(this, SearchActivity::class.java)
startActivity(search_Intent)
//Snackbar.make(toolbar,"Search menu pressed",Snackbar.LENGTH_SHORT).show()
}
}
return super.onOptionsItemSelected(item)
}
//bottom navigation view operation start 3
private val mOnNavigationItemSelectedListener=
BottomNavigationView.OnNavigationItemSelectedListener{ item->
when (item.itemId){
R.id.bottomHome ->{
val intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomRecommend ->{
val intent = Intent(this, RecommendActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomFavorites ->{
val intent = Intent(this, FavoritesActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomInfo ->{
val intent = Intent(this, InfoActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
}
false
}
//bottom navigation view operation end 3
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_info.*
class InfoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_info)
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
Toast.makeText(applicationContext,prof.getString("manorwoman","nothing"),
Toast.LENGTH_SHORT).show()
//temp
var accountImage: ImageView =findViewById(R.id.infoAccountImage)
var profilImage: ImageView =findViewById(R.id.InfoProfilImage)
accountImage.setImageResource(R.drawable.image01)
profilImage.setImageResource(R.drawable.image01)
//temp
InfoButtonLaw.setOnClickListener {
var intent = Intent(this, SettingActivity::class.java)
startActivity(intent)
}
//pushing test start
InfoButtonSettings.setOnClickListener {
//var intent = Intent(this, SettingActivity::class.java)
//test start
var intent = Intent(this, InputProfilFirstOneActivity::class.java)
//test end
startActivity(intent)
}
//pushing test end
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fifth_four.*
class InputProfilFifthFourActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fifth_four)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFifthThreeActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
editor.putInt("c1_1",1); editor.commit()
editor.putInt("c2_1",1); editor.commit()
editor.putInt("c3_1",1); editor.commit()
editor.putInt("c4_1",1); editor.commit()
editor.putInt("c5_1",1); editor.commit()
editor.putInt("c6_1",1); editor.commit()
editor.putInt("c7_1",1); editor.commit()
editor.putInt("c8_1",1); editor.commit()
editor.putInt("c9_1",1); editor.commit()
editor.putInt("c10_1",1); editor.commit()
editor.putInt("c11_1",1); editor.commit()
editor.putInt("c12_1",1); editor.commit()
editor.putInt("c13_1",1); editor.commit()
editor.putInt("c14_1",1); editor.commit()
editor.putInt("c15_1",1); editor.commit()
editor.putInt("c16_1",1); editor.commit()
var intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fifth_one.*
class InputProfilFifthOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fifth_one)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFourthFiveActivity::class.java)
startActivity(intent)
}
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFifthTwoActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fifth_three.*
class InputProfilFifthThreeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fifth_three)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFifthTwoActivity::class.java)
startActivity(intent)
}
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFifthFourActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fifth_two.*
class InputProfilFifthTwoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fifth_two)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFifthOneActivity::class.java)
startActivity(intent)
}
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFifthThreeActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_first_five.*
class InputProfilFirstFiveActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_first_five)
inmanButton.setOnClickListener {
if(outmanButton.isChecked){
outmanButton.isChecked=false
}
}
outmanButton.setOnClickListener {
if(inmanButton.isChecked){
inmanButton.isChecked=false
}
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFourActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(inmanButton.isChecked){
editor.putInt("c1_2",1); editor.commit()
}else if(outmanButton.isChecked){
editor.putInt("c1_3",1); editor.commit()
}else{
}
var intent = Intent(this, InputProfilFirstSixActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_first_one.*
class InputProfilFirstOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_first_one)
inputStartButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstTwoActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_first_six.*
class InputProfilFirstSixActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_first_six)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFiveActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(gagoojooButton.isChecked){
editor.putInt("c13_2",1); editor.commit()
}else if(gagoowonButton.isChecked){
editor.putInt("c13_3",1); editor.commit()
}else{
}
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.util.MonthDisplayHelper
import android.view.View
import android.widget.EditText
import android.widget.RadioButton
import android.widget.RadioGroup
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_input_profil_first_one.*
import kotlinx.android.synthetic.main.activity_input_profil_first_three.*
import kotlinx.android.synthetic.main.activity_input_profil_first_three.nextButton
import kotlinx.android.synthetic.main.activity_input_profil_first_two.*
class InputProfilFirstThreeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_first_three)
/* not use this code start
radio_group.setOnCheckedChangeListener(
RadioGroup.OnCheckedChangeListener { group, checkedId ->
val radio: RadioButton = findViewById(checkedId)
Toast.makeText(applicationContext," On checked change : ${radio.text}",
Toast.LENGTH_SHORT).show()
})
not use this code end */
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstTwoActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFourActivity::class.java)
startActivity(intent)
if (manButton.isChecked){
editor.putInt("c3_2",1)
editor.commit()
//마지막장에 상관없음 추가
}
else{
editor.putInt("c3_3",1)
editor.commit()
}
}
}
/* i will not use this code start
fun radio_button_click(view: View){
// Get the clicked radio button instance
val radio: RadioButton = findViewById(radio_group.checkedRadioButtonId)
Toast.makeText(applicationContext,"On click : ${radio.text}",
Toast.LENGTH_SHORT).show()
}
i will not use this code start end*/
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.EditText
import android.widget.Toast
import com.google.firebase.messaging.FirebaseMessaging
import kotlinx.android.synthetic.main.activity_input_profil_first_two.*
import kotlinx.android.synthetic.main.activity_input_profil_first_two.nextButton
import kotlinx.android.synthetic.main.activity_input_profil_second_two.*
class InputProfilFirstTwoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_first_two)
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
//editor.putString("birthdate","none")
nextButton.setOnClickListener {
var birthdateinput=findViewById<EditText>(R.id.editText).text.toString()
var birthdateint = 0
if (birthdateinput == "") {
birthdateint = 0
}
else {
birthdateint = birthdateinput.toInt()
}
if ((2019-birthdateint)<19){
editor.putInt("c1_2",1)
editor.commit()
Toast.makeText(baseContext, prof.getInt("c1_2",0).toString(), Toast.LENGTH_SHORT).show()
//마지막장에 상관없음 추가
FirebaseMessaging.getInstance().subscribeToTopic("c1_2")
.addOnCompleteListener { task ->
var msg = getString(R.string.msg_subscribed)
if (!task.isSuccessful) {
msg = getString(R.string.msg_subscribe_failed)
}
}
}
else if((2019-birthdateint)<34){
editor.putInt("c1_3",1)
editor.commit()
}
else if((2019-birthdateint)<40){
editor.putInt("c1_4",1)
editor.commit()
}
else if((2019-birthdateint)<49){
editor.putInt("c1_5",1)
editor.commit()
}
else if((2019-birthdateint)<59){
editor.putInt("c1_6",1)
editor.commit()
}
else{
editor.putInt("c1_7",1)
editor.commit()
}
var intent = Intent(this, InputProfilFirstThreeActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fourth_five.*
class InputProfilFourthFiveActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fourth_five)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFourthFourActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()}
if(iljaeButton.isChecked){editor.putInt("c8_12",1); editor.commit()}
if(specialpihaeButton.isChecked){editor.putInt("c8_13",1); editor.commit()}
if(sanuppihaeButton.isChecked){editor.putInt("c8_14",1); editor.commit()}
if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()}
//기타가 똑같은거 지정
editor.putInt("c1_1",1); editor.commit()
editor.putInt("c2_1",1); editor.commit()
editor.putInt("c3_1",1); editor.commit()
editor.putInt("c4_1",1); editor.commit()
editor.putInt("c5_1",1); editor.commit()
editor.putInt("c6_1",1); editor.commit()
editor.putInt("c7_1",1); editor.commit()
editor.putInt("c8_1",1); editor.commit()
editor.putInt("c9_1",1); editor.commit()
editor.putInt("c10_1",1); editor.commit()
editor.putInt("c11_1",1); editor.commit()
editor.putInt("c12_1",1); editor.commit()
editor.putInt("c13_1",1); editor.commit()
editor.putInt("c14_1",1); editor.commit()
editor.putInt("c15_1",1); editor.commit()
editor.putInt("c16_1",1); editor.commit()
var intent = Intent(this, InputProfilFifthOneActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fourth_four.*
class InputProfilFourthFourActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fourth_four)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFourthThreeActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()}
if(pokryukButton.isChecked){editor.putInt("c8_9",1); editor.commit()}
if(pihaeButton.isChecked){editor.putInt("c8_9",1); editor.commit()}
if(kachoolButton.isChecked){editor.putInt("c8_9",1); editor.commit()}
if(sagoButton.isChecked){editor.putInt("c8_9",1); editor.commit()}
if(ihonButton.isChecked){editor.putInt("c8_15",1); editor.commit()}
if(jaehaeButton.isChecked){editor.putInt("c8_9",1); editor.commit()}
if(hakkyobaakButton.isChecked){editor.putInt("c8_16",1); editor.commit()}
if(siljikButton.isChecked){editor.putInt("c5_9",1); editor.commit()}
if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()}
var intent = Intent(this, InputProfilFourthFiveActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import kotlinx.android.synthetic.main.activity_input_profil_fourth_one.*
class InputProfilFourthOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fourth_one)
//보유
//미보유 - 전세 월세 공공주택 무상임대 보장기관 기타
//소유
//주택세대주 주택세대구성원 무주택자 무주택세대주 무주택세대구성원
//그냥 소유 미소유-모두무주택자 2개로 함
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
questionButton.setOnClickListener {
val builder = AlertDialog.Builder(this)
val dialogView = layoutInflater.inflate(R.layout.family_member_dialog, null)
//val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt)
//val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb)
dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?"
dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람"
builder.setView(dialogView)
.setPositiveButton("확인") { dialogInterface, i ->
//mainTv.text = dialogText.text.toString()
//mainRb.rating = dialogRatingBar.rating
/* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */
}
/*
.setNegativeButton("취소") { dialogInterface, i ->
/* 취소일 때 아무 액션이 없으므로 빈칸 */
}
*/
.show()
}
val prof: SharedPreferences=getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilThirdFourActivity::class.java)
startActivity(intent)
}
yesButton.setOnClickListener {
subLinearLayout.visibility=GONE
noButton.isChecked=false
}
noButton.setOnClickListener {
subLinearLayout.visibility=VISIBLE
yesButton.isChecked=false
}
nextButton.setOnClickListener {
if(yesButton.isChecked){
editor.putInt("c14_2",1)
editor.commit()
}
if(noButton.isChecked){
editor.putInt("c14_3",1)
editor.commit()
}
if(jeonsaeButton.isChecked){
editor.putInt("c16_2",1)
editor.commit()
}
if(wolseButton.isChecked){
editor.putInt("c16_3",1)
editor.commit()
}
if(kongkongButton.isChecked){
editor.putInt("c16_4",1)
editor.commit()
}
if(moosangButton.isChecked){
editor.putInt("c16_5",1)
editor.commit()
}
if(bojangButton.isChecked){
editor.putInt("c16_6",1)
editor.commit()
}
if(guitarButton.isChecked){
editor.putInt("c16_7",1)
editor.commit()
}
var intent = Intent(this, InputProfilFourthTwoActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_fourth_three.*
class InputProfilFourthThreeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fourth_three)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFourthTwoActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()}
if(jeosodeukButton.isChecked){editor.putInt("c8_3",1); editor.commit()}
if(hanboomoButton.isChecked){editor.putInt("c8_7",1); editor.commit()}
if(oegookinButton.isChecked){editor.putInt("c8_5",1); editor.commit()}
if(damoonhwaButton.isChecked){editor.putInt("c8_4",1); editor.commit()}
if(jaangaeButton.isChecked){editor.putInt("c8_2",1); editor.commit()}
if(imshinchoolsanButton.isChecked){editor.putInt("c7_1",1); editor.commit()}
if(ipyaangButton.isChecked){editor.putInt("c8_10",1); editor.commit()}
if(gaajungButton.isChecked){editor.putInt("c8_11",1); editor.commit()}
if(bookhanButton.isChecked){editor.putInt("c8_6",1); editor.commit()}
if(gookgayoogongButton.isChecked){editor.putInt("c8_8",1); editor.commit()}
if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()}
var intent = Intent(this, InputProfilFourthFourActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import kotlinx.android.synthetic.main.activity_input_profil_fourth_two.*
class InputProfilFourthTwoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_fourth_two)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFourthOneActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(yesButton.isChecked){editor.putInt("c15_2",1); editor.commit()}
if(noButton.isChecked){editor.putInt("c15_3",1); editor.commit()}
if(jeonsaeButton.isChecked){editor.putInt("c16_2",1); editor.commit()}
if(wolseButton.isChecked){editor.putInt("c16_3",1); editor.commit()}
if(kongkongButton.isChecked){editor.putInt("c16_4",1); editor.commit()}
if(moosangButton.isChecked){editor.putInt("c16_5",1); editor.commit()}
if(bojangButton.isChecked){editor.putInt("c16_6",1); editor.commit()}
if(guitarButton.isChecked){editor.putInt("c16_7",1); editor.commit()}
var intent = Intent(this, InputProfilFourthThreeActivity::class.java)
startActivity(intent)
}
yesButton.setOnClickListener {
subLayout.visibility=GONE
noButton.isChecked=false
}
noButton.setOnClickListener {
subLayout.visibility=VISIBLE
yesButton.isChecked=false
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.RatingBar
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import kotlinx.android.synthetic.main.activity_input_profil_second_one.*
import kotlinx.android.synthetic.main.family_member_dialog.*
import kotlinx.android.synthetic.main.family_member_dialog.view.*
class InputProfilSecondOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_second_one)
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
questionButton.setOnClickListener {
val builder = AlertDialog.Builder(this)
val dialogView = layoutInflater.inflate(R.layout.family_member_dialog, null)
//val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt)
//val dialogRatingBar = dialogView.findViewById<RatingBar>(R.id.dialogRb)
dialogView.findViewById<TextView>(R.id.dialogTitle).text="가족구성원이란?"
dialogView.findViewById<TextView>(R.id.dialogContent).text="주민등록상 같은 거주지에 사는 사람"
builder.setView(dialogView)
.setPositiveButton("확인") { dialogInterface, i ->
//mainTv.text = dialogText.text.toString()
//mainRb.rating = dialogRatingBar.rating
/* 확인일 때 main의 View의 값에 dialog View에 있는 값을 적용 */
}
/*
.setNegativeButton("취소") { dialogInterface, i ->
/* 취소일 때 아무 액션이 없으므로 빈칸 */
}
*/
.show()
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilFirstFiveActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(baewoojaButton.isChecked){editor.putInt("c10_2",1); editor.commit()}
if(baewoojaboomoButton.isChecked){editor.putInt("c10_3",1); editor.commit()}
if(baewoojajoboomoButton.isChecked){editor.putInt("c10_4",1); editor.commit()}
if(brotherButton.isChecked){editor.putInt("c10_5",1); editor.commit()
editor.putString("with_brothersister","yes")}
if(baewoojabrotherButton.isChecked){editor.putInt("c10_6",1); editor.commit()}
if(donggeoButton.isChecked){editor.putInt("c10_7",1); editor.commit()}
if(fatherButton.isChecked){editor.putInt("c10_8",1); editor.commit()}
if(motherButton.isChecked){editor.putInt("c10_9",1); editor.commit()}
if(grandsonbaewoojaButton.isChecked){editor.putInt("c10_10",1); editor.commit()}
if(grandfatherButton.isChecked){editor.putInt("c10_11",1); editor.commit()}
if(grandmotherButton.isChecked){editor.putInt("c10_12",1); editor.commit()}
if(grandsonButton.isChecked){editor.putInt("c10_13",1); editor.commit()}
if(janyeoButton.isChecked){editor.putInt("c10_14",1); editor.commit()
editor.putString("with_child","yes")}
if(janyeobaewoojaButton.isChecked){editor.putInt("c10_15",1); editor.commit()}
if(nothingButton.isChecked){editor.putInt("c10_18",1); editor.commit()}
if(janyeoButton.isChecked
//prof.getString("with_child","none")=="yes"
){
var intent = Intent(this, InputProfilSecondTwoActivity::class.java)
startActivity(intent)
}else{
var intent = Intent(this, InputProfilThirdOneActivity::class.java)
startActivity(intent)
}
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.EditText
import kotlinx.android.synthetic.main.activity_input_profil_second_three.*
import kotlinx.android.synthetic.main.activity_input_profil_second_three.nextButton
import kotlinx.android.synthetic.main.activity_input_profil_second_three.previousButton
import kotlinx.android.synthetic.main.activity_input_profil_second_three.skipButton
import kotlinx.android.synthetic.main.activity_input_profil_second_three.toolbar
class InputProfilSecondThreeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_second_three)
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondTwoActivity::class.java)
startActivity(intent)
}
nextButton.setOnClickListener {
var numOfBS=findViewById<EditText>(R.id.bsNumberEditText).text.toString().toInt()
if(numOfBS>=2){
editor.putInt("c10_16",1); editor.commit()
}
if(numOfBS<2){
editor.putInt("c10_17",1); editor.commit()
}
var intent = Intent(this, InputProfilThirdOneActivity::class.java)
startActivity(intent)
}
val bsList = ArrayList<BSItem>()
bsNumberInputButton.setOnClickListener {
if(findViewById<EditText>(R.id.bsNumberEditText).text.toString().toInt()>0){
var bsNum=findViewById<EditText>(R.id.bsNumberEditText).text.toString().toInt()
var cnt=1
while(bsNum>=cnt){
bsList.add(
BSItem(cnt)
)
cnt++
}
//Toast.makeText(this, cnt.toString(), Toast.LENGTH_SHORT).show()
}
else{
var bsNum=0
}
val adapter = BSAdapter(bsList)
bsRecyclerView.adapter = adapter
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.EditText
import android.widget.Toast
import androidx.core.content.ContextCompat
import kotlinx.android.synthetic.main.activity_input_profil_second_two.*
import kotlinx.android.synthetic.main.item_child.view.*
class InputProfilSecondTwoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_second_two)
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
nextButton.setOnClickListener {
var numOfChild=findViewById<EditText>(R.id.childNumberEditText).text.toString().toInt()
if(numOfChild>=3){
editor.putInt("c10_16",1); editor.commit()
}
if(numOfChild<3){
editor.putInt("c10_17",1); editor.commit()
}
/*
editor.putString(childRecyclerView.circleformButton.text.toString()+"st janyeo birth", childRecyclerView.childBirthEditText.text.toString()); editor.commit()
if(childRecyclerView.womanButton.isChecked){
editor.putString(childRecyclerView.circleformButton.text.toString()+"st janyeo gender","woman"); editor.commit()
}else{
editor.putString(childRecyclerView.circleformButton.text.toString()+"st janyeo gender","man"); editor.commit()
}
*/
if(prof.getString("with_brothersister","none")=="yes"){
var intent = Intent(this, InputProfilSecondThreeActivity::class.java)
startActivity(intent)
}else{
var intent = Intent(this, InputProfilThirdOneActivity::class.java)
startActivity(intent)
}
}
//val dialogText = dialogView.findViewById<EditText>(R.id.dialogEt)
//mainTv.text = dialogText.text.toString()
val childList = ArrayList<ChildItem>()
childNumberInputButton.setOnClickListener {
if(findViewById<EditText>(R.id.childNumberEditText).text.toString().toInt()>0){
var childNum=findViewById<EditText>(R.id.childNumberEditText).text.toString().toInt()
var cnt=1
while(childNum>=cnt){
childList.add(
ChildItem(cnt)
)
cnt++
}
//Toast.makeText(this, cnt.toString(), Toast.LENGTH_SHORT).show()
}
else{
var childNum=0
}
val adapter = ChildAdapter(childList)
childRecyclerView.adapter = adapter
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import kotlinx.android.synthetic.main.activity_input_profil_third_four.*
class InputProfilThirdFourActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_third_four)
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilThirdThreeActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(yesButton.isChecked){
editor.putInt("c8_2",1); editor.commit()
}
if(jichaeButton.isChecked){editor.putInt("c9_2",1); editor.commit()}
if(noebyungbyunButton.isChecked){editor.putInt("c9_3",1); editor.commit()}
if(sigaakButton.isChecked){editor.putInt("c9_4",1); editor.commit()}
if(chungkaakButton.isChecked){editor.putInt("c9_5",1); editor.commit()}
if(unuhButton.isChecked){editor.putInt("c9_6",1); editor.commit()}
if(ahnmyunButton.isChecked){editor.putInt("c9_7",1); editor.commit()}
if(sinjaangButton.isChecked){editor.putInt("c9_8",1); editor.commit()}
if(simjaangButton.isChecked){editor.putInt("c9_9",1); editor.commit()}
if(gaanjaangButton.isChecked){editor.putInt("c9_10",1); editor.commit()}
if(jaangrooButton.isChecked){editor.putInt("c9_11",1); editor.commit()}
if(noejungjeungButton.isChecked){editor.putInt("c9_12",1); editor.commit()}
if(hoheupkiButton.isChecked){editor.putInt("c9_13",1); editor.commit()}
if(jijukButton.isChecked){editor.putInt("c9_14",1); editor.commit()}
if(japyeahButton.isChecked){editor.putInt("c9_15",1); editor.commit()}
if(jeongshinButton.isChecked){editor.putInt("c9_16",1); editor.commit()}
if(nothingButton.isChecked){editor.putInt("c8_1",1); editor.commit()}//DB,pref 뻑 주의
if(imshinButton.isChecked){editor.putInt("c7_2",1); editor.commit()}
if(nanchiButton.isChecked){editor.putInt("c9_17",1); editor.commit()}
if(oeButton.isChecked){editor.putInt("c9_18",1); editor.commit()}
if(yoyaangButton.isChecked){editor.putInt("c9_19",1); editor.commit()}
if(guitarButton.isChecked){editor.putInt("c8_17",1); editor.commit()}
var intent = Intent(this, InputProfilFourthOneActivity::class.java)
startActivity(intent)
}
yesButton.setOnClickListener {
eightoneLayout.visibility=VISIBLE
eighttwoLayout.visibility= GONE
}
noButton.setOnClickListener {
eightoneLayout.visibility= GONE
eighttwoLayout.visibility= VISIBLE
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_input_profil_third_one.*
class InputProfilThirdOneActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_third_one)
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
elementaryButton.setOnClickListener {
middleButton.isChecked=false
highButton.isChecked=false
specialButton.isChecked=false
universityButton.isChecked=false
graduateButton.isChecked=false
nothingButton.isChecked=false
}
middleButton.setOnClickListener {
elementaryButton.isChecked=false
highButton.isChecked=false
specialButton.isChecked=false
universityButton.isChecked=false
graduateButton.isChecked=false
nothingButton.isChecked=false
}
highButton.setOnClickListener {
elementaryButton.isChecked=false
middleButton.isChecked=false
specialButton.isChecked=false
universityButton.isChecked=false
graduateButton.isChecked=false
nothingButton.isChecked=false
}
specialButton.setOnClickListener {
elementaryButton.isChecked=false
middleButton.isChecked=false
highButton.isChecked=false
universityButton.isChecked=false
graduateButton.isChecked=false
nothingButton.isChecked=false
}
universityButton.setOnClickListener {
elementaryButton.isChecked=false
middleButton.isChecked=false
highButton.isChecked=false
specialButton.isChecked=false
graduateButton.isChecked=false
nothingButton.isChecked=false
}
graduateButton.setOnClickListener {
elementaryButton.isChecked=false
middleButton.isChecked=false
highButton.isChecked=false
specialButton.isChecked=false
universityButton.isChecked=false
nothingButton.isChecked=false
}
nothingButton.setOnClickListener {
elementaryButton.isChecked=false
middleButton.isChecked=false
highButton.isChecked=false
specialButton.isChecked=false
universityButton.isChecked=false
graduateButton.isChecked=false
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondThreeActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(elementaryButton.isChecked){
editor.putInt("c6_2",1); editor.commit()
}else if(middleButton.isChecked){
editor.putInt("c6_3",1); editor.commit()
}else if(highButton.isChecked){
editor.putInt("c6_4",1); editor.commit()
}else if(universityButton.isChecked){
editor.putInt("c6_5",1); editor.commit()
}else if(graduateButton.isChecked){
editor.putInt("c6_6",1); editor.commit()
}else if(nothingButton.isChecked){
editor.putInt("c6_7",1); editor.commit()
}else{
}
var intent = Intent(this, InputProfilThirdTwoActivity::class.java)
startActivity(intent)
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_input_profil_third_three.*
class InputProfilThirdThreeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_third_three)
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilThirdTwoActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(nothingButton.isChecked){ editor.putInt("c4_11",1); editor.commit()}
if(mipilButton.isChecked){ editor.putInt("c4_2",1); editor.commit()}
if(myunjaeButton.isChecked){ editor.putInt("c4_3",1); editor.commit()}
if(jobsoldierButton.isChecked){ editor.putInt("c4_4",1); editor.commit()}
if(bokmoojoongButton.isChecked){ editor.putInt("c4_5",1); editor.commit()}
if(mangijedaeButton.isChecked){ editor.putInt("c4_6",1); editor.commit()}
if(specialmanryoButton.isChecked){ editor.putInt("c4_7",1); editor.commit()}
if(specialbokmoosanupButton.isChecked){ editor.putInt("c4_8",1); editor.commit()}
if(specialbokmoojeonmoonButton.isChecked){ editor.putInt("c4_9",1); editor.commit()}
if(jedaeguitarButton.isChecked){ editor.putInt("c4_10",1); editor.commit()}
var intent = Intent(this, InputProfilThirdFourActivity::class.java)
startActivity(intent)
}
nothingButton.setOnClickListener {
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
mipilButton.setOnClickListener {
nothingButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
myunjaeButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
jobsoldierButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
bokmoojoongButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
mangijedaeButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
specialmanryoButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
specialbokmoosanupButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
jedaeguitarButton.isChecked=false
}
specialbokmoojeonmoonButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
jedaeguitarButton.isChecked=false
}
jedaeguitarButton.setOnClickListener {
nothingButton.isChecked=false
mipilButton.isChecked=false
myunjaeButton.isChecked=false
jobsoldierButton.isChecked=false
bokmoojoongButton.isChecked=false
mangijedaeButton.isChecked=false
specialmanryoButton.isChecked=false
specialbokmoosanupButton.isChecked=false
specialbokmoojeonmoonButton.isChecked=false
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import kotlinx.android.synthetic.main.activity_input_profil_third_two.*
class InputProfilThirdTwoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_input_profil_third_two)
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
skipButton.setOnClickListener {
var intent = Intent(this, InputProfilSecondOneActivity::class.java)
startActivity(intent)
}
previousButton.setOnClickListener {
var intent = Intent(this, InputProfilThirdOneActivity::class.java)
startActivity(intent)
}
val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
nextButton.setOnClickListener {
if(companyButton.isChecked){ editor.putInt("c5_6",1); editor.commit()}
if(workerButton.isChecked){ editor.putInt("c5_7",1); editor.commit()}
if(entireButton.isChecked){ editor.putInt("c5_9",1); editor.commit()}
if(startupButton.isChecked){ editor.putInt("c5_5",1); editor.commit()}
if(seekButton.isChecked){ editor.putInt("c5_5",1); editor.commit()}
//창업예정자랑 취준생이랑 같은 카테고리 맞음????
var intent = Intent(this, InputProfilThirdThreeActivity::class.java)
startActivity(intent)
}
jobButton.setOnClickListener {
nojobButton.isChecked=false
sixoneLayout.visibility=VISIBLE
sixtwoLayout.visibility= GONE
}
nojobButton.setOnClickListener {
jobButton.isChecked=false
sixoneLayout.visibility=GONE
sixtwoLayout.visibility= VISIBLE
}
companyButton.setOnClickListener {
workerButton.isChecked=false
}
workerButton.setOnClickListener {
companyButton.isChecked=false
}
entireButton.setOnClickListener {
startupButton.isChecked=false
seekButton.isChecked=false
}
startupButton.setOnClickListener {
entireButton.isChecked=false
seekButton.isChecked=false
}
seekButton.setOnClickListener {
entireButton.isChecked=false
startupButton.isChecked=false
}
}
}
package com.example.vip
import android.animation.Animator
import android.animation.AnimatorInflater
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import kotlinx.android.synthetic.main.activity_main.*
import org.w3c.dom.Node
import java.lang.Boolean.getBoolean
class MainActivity : AppCompatActivity() {
private val firebaseAuth = FirebaseAuth.getInstance()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//onboarding start
//onboarding end
setContentView(R.layout.activity_main)
emailSigninBtn.setOnClickListener{
loginEmail()
}
emailSignupBtn.setOnClickListener {
var intent = Intent(this, SignUpActivity::class.java)
startActivity(intent)
}
}
private fun loginEmail(){
firebaseAuth!!.signInWithEmailAndPassword(edit_email.text.toString(), edit_password.text.toString())
.addOnCompleteListener(this) {
if (it.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
Toast.makeText(this, "signInWithEmail success.",Toast.LENGTH_SHORT).show()
val user = firebaseAuth?.currentUser
if (user!=null){
var intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
}
} else {
// If sign in fails, display a message to the user.
Toast.makeText(this, "signInWithEmail failed.",Toast.LENGTH_SHORT).show()
}
}
}
}
package com.example.vip
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_policy.view.*
import kotlinx.android.synthetic.main.item_policyfield.view.*
class PolicyAdapter(private val items: ArrayList<PolicyItem>) :
RecyclerView.Adapter<PolicyAdapter.ViewHolder>() {
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: PolicyAdapter.ViewHolder, position: Int) {
val item = items[position]
holder.apply {
bind(item)
itemView.tag = item
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int):
PolicyAdapter.ViewHolder {
val inflatedView = LayoutInflater.from(parent.context)
.inflate(R.layout.item_policy, parent, false)
return PolicyAdapter.ViewHolder(inflatedView)
}
class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
private var view: View = v
val prof: SharedPreferences = view.context.getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
var tempstring=prof.getString("favorstringlist","")
var sepstr=tempstring!!.split("@")
var sepstrset=sepstr.toMutableSet()
fun bind(item: PolicyItem) {
view.policyImage.setImageDrawable(item.policyItemImage)
view.policyDday.text = item.policyItemDday
view.policyHost.text = item.policyItemHost
view.policyTitle.text = item.policyItemTitle
view.policyScore.rating= item.policyItemScore
view.policyFavor.text=item.policyItemFavor
if(item.policyItemTitle in sepstrset){
view.policyFavor.isChecked=true
}
else{
}
view.setOnClickListener{
val intent=Intent(view.context, DetailActivity::class.java)
//putExtraStart
intent.putExtra("key",item.policyItemTitle)
//putExtraEnd
view.context.startActivity(intent)
}
view.policyFavor.setOnClickListener {
if (view.policyFavor.isChecked) {
tempstring = tempstring + view.policyTitle.text.toString() + "@"
editor.putString("favorstringlist", tempstring)
editor.commit()
Toast.makeText(
view.context,
"찜목록 추가 완료! : " + view.policyTitle.text.toString(),
Toast.LENGTH_SHORT
).show()
} else {
sepstrset.remove(view.policyTitle.text.toString())
editor.putString("favorstringlist", sepstrset.joinToString("@"))
editor.commit()
Toast.makeText(
view.context,
"찜목록 제거 완료! : " + view.policyTitle.text.toString(),
Toast.LENGTH_SHORT
).show()
}
}
}
}
}
\ No newline at end of file
package com.example.vip
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_policyfield.view.*
class PolicyFieldAdapter(private val items: ArrayList<PolicyFieldItem>) :
RecyclerView.Adapter<PolicyFieldAdapter.ViewHolder>() {
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: PolicyFieldAdapter.ViewHolder, position: Int) {
val item = items[position]
holder.apply {
bind(item)
itemView.tag = item
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int):
PolicyFieldAdapter.ViewHolder {
val inflatedView = LayoutInflater.from(parent.context)
.inflate(R.layout.item_policyfield, parent, false)
return PolicyFieldAdapter.ViewHolder(inflatedView)
}
class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
private var view: View = v
fun bind(item: PolicyFieldItem) {
view.fieldIcon.setImageDrawable(item.policyFieldItemImage)
view.fieldIconText.text = item.policyFieldItemText
view.setOnClickListener{
val intent=Intent(view.context, RecommendActivity::class.java)
//putExtraStart
intent.putExtra("key",item.policyFieldItemText)
//putExtraEnd
view.context.startActivity(intent)
}
}
}
}
\ No newline at end of file
package com.example.vip
import android.graphics.drawable.Drawable
class PolicyFieldItem(val policyFieldItemImage: Drawable, val policyFieldItemText: String) {
}
\ No newline at end of file
package com.example.vip
import android.graphics.drawable.Drawable
class PolicyItem(val policyItemImage: Drawable,
val policyItemDday: String,
val policyItemHost: String,
val policyItemTitle: String,
val policyItemScore: Float,
val policyItemFavor: String) {
}
\ No newline at end of file
package com.example.vip
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.os.Bundle
import android.util.Half.toFloat
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.content.ContextCompat.startActivity
import androidx.viewpager.widget.ViewPager
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.snackbar.Snackbar
import com.google.firebase.database.DataSnapshot
import com.google.firebase.database.DatabaseError
import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.database.ValueEventListener
import kotlinx.android.synthetic.main.activity_recommend.*
import kotlinx.android.synthetic.main.activity_signin.*
import kotlinx.android.synthetic.main.activity_signin.toolbar
import kotlinx.android.synthetic.main.item_policy.*
import kotlinx.android.synthetic.main.item_policy.view.*
import kotlinx.android.synthetic.main.search.*
data class MemoItemRecom(
val Target : String = "",
val Policy : String = "",
val Content : String = "",
val Link : String = ""
)
class RecommendActivity : AppCompatActivity() {
////bottom navigation view operation start 1
lateinit var bottomBar: ActionBar
////bottom navigation view operation end 1
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_recommend)
val policyList = ArrayList<PolicyItem>()
var recomdatabase = FirebaseDatabase.getInstance().reference
if (intent.hasExtra("key")) {
//textView.text = intent.getStringExtra("key") 텍뷰추가하면 인텐트로 값넘기는거 보임
recomdatabase.orderByChild("Policy").startAt(intent.getStringExtra("key")).endAt(intent.getStringExtra("key")+"\uf8ff").addListenerForSingleValueEvent(object :
ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
Toast.makeText(this@RecommendActivity, "실패부분", Toast.LENGTH_SHORT).show()
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
for (memoSnapshot in dataSnapshot.children){
val memo = memoSnapshot.getValue(MemoItemRecom::class.java)
policyList.add(
PolicyItem(
ContextCompat.getDrawable(this@RecommendActivity, R.drawable.image01)!!,
memo!!.Policy,
memo!!.Policy,
memo!!.Policy,
4.toFloat(),
""
)
)
}
val adapter = PolicyAdapter(policyList)
policyRecyclerView.adapter = adapter
}
})
} else {
Toast.makeText(this, "putExtra value not found", Toast.LENGTH_SHORT).show()
recomdatabase.orderByChild("Policy").startAt(intent.getStringExtra("\uf8ff")).addListenerForSingleValueEvent(object :
ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
Toast.makeText(this@RecommendActivity, "실패부분", Toast.LENGTH_SHORT).show()
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
for (memoSnapshot in dataSnapshot.children){
val memo = memoSnapshot.getValue(MemoItemRecom::class.java)
policyList.add(
PolicyItem(
ContextCompat.getDrawable(this@RecommendActivity, R.drawable.image01)!!,
memo!!.Policy,
memo!!.Policy,
memo!!.Policy,
4.toFloat(),
""
)
)
}
val adapter = PolicyAdapter(policyList)
policyRecyclerView.adapter = adapter
}
})
}
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
// 2. 툴바 왼쪽 버튼 설정
supportActionBar!!.setDisplayHomeAsUpEnabled(true) // 왼쪽 버튼 사용 여부 true
supportActionBar!!.setHomeAsUpIndicator(R.drawable.return_page) // 왼쪽 버튼 아이콘 설정
supportActionBar!!.setDisplayShowTitleEnabled(false) // 타이틀 안보이게 하기
////bottom navigation view operation start 2
bottomBar=supportActionBar!!
val bottomNavigation: BottomNavigationView =findViewById(R.id.bottomNavigation)
bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
////bottom navigation view operation end 2
}
// 3.툴바 메뉴 버튼을 설정
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main_menu, menu) // main_menu 메뉴를 toolbar 메뉴 버튼으로 설정
return true
}
// 4.툴바 메뉴 버튼이 클릭 됐을 때 콜백
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
// 클릭된 메뉴 아이템의 아이디 마다 when 구절로 클릭시 동작을 설정한다.
when(item!!.itemId){
android.R.id.home->{ // 메뉴 버튼
Snackbar.make(toolbar,"Menu pressed",Snackbar.LENGTH_SHORT).show()
}
R.id.menu_search->{ // 검색 버튼
val search_Intent = Intent(this, SearchActivity::class.java)
startActivity(search_Intent)
//Snackbar.make(toolbar,"Search menu pressed",Snackbar.LENGTH_SHORT).show()
}
}
return super.onOptionsItemSelected(item)
}
//bottom navigation view operation start 3
private val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item->
when (item.itemId){
R.id.bottomHome ->{
val intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomRecommend ->{
val intent = Intent(this, RecommendActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomFavorites ->{
val intent = Intent(this, FavoritesActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomInfo ->{
val intent = Intent(this, InfoActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
}
false
}
//bottom navigation view operation end 3
}
package com.example.vip
import android.content.Context
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
//import androidx.appcompat.widget.SearchView
import androidx.core.app.ComponentActivity.ExtraData
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import android.view.View
import android.content.Intent
import android.util.Log
import android.view.inputmethod.InputMethodManager
import android.widget.*
import androidx.core.content.ContextCompat
import com.google.firebase.database.*
import com.google.firebase.database.DatabaseReference
import com.google.firebase.database.FirebaseDatabase
import kotlinx.android.synthetic.main.search.*
data class MemoItem(
val Target : String = "",
val Policy : String = "",
val Content : String = "",
val Link : String = ""
)
var database = FirebaseDatabase.getInstance().reference
class SearchActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.search)
val searchList = ArrayList<SearchItem>()
val no_search : ImageView = findViewById(R.id.no_matching) // 노서치이미지
val searchView: SearchView
searchView = findViewById(R.id.searchForm)
//searchView.onActionViewExpanded(); //new Added line
searchView.setIconifiedByDefault(false)
fun CloseKeyboard()
{
var view = this.currentFocus
if(view != null)
{
val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
}
}
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String): Boolean {
// 검색 버튼이 눌러졌을 때 이벤트 처리
val layout : LinearLayout = findViewById(R.id.hashtag_linear)
layout.setVisibility(View.GONE)
CloseKeyboard()
database.orderByChild("Policy").startAt("$query").endAt("$query"+"\uf8ff").addListenerForSingleValueEvent(object : ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
Toast.makeText(this@SearchActivity, "실패부분 : $query", Toast.LENGTH_SHORT).show()
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
if (dataSnapshot.exists() == false){ // 값 없을 때
no_search.setVisibility(View.VISIBLE)
}
else {
no_search.setVisibility(View.GONE)
}
for (memoSnapshot in dataSnapshot.children){
val memo = memoSnapshot.getValue(MemoItem::class.java)
searchList.add(
SearchItem(
ContextCompat.getDrawable(this@SearchActivity, R.drawable.image01)!!, memo!!.Policy
)
)
}
val adapter=SearchAdapter(searchList)
searchRecyclerView.adapter=adapter
}
})
searchList.clear()
return true
}
override fun onQueryTextChange(newText: String): Boolean {
// 검색어가 변경되었을 때 이벤트 처리
return false
}
})
}
}
\ No newline at end of file
package com.example.vip
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_search.view.*
class SearchAdapter(private val items: ArrayList<SearchItem>) :
RecyclerView.Adapter<SearchAdapter.ViewHolder>() {
override fun getItemCount() = items.size
override fun onBindViewHolder(holder: SearchAdapter.ViewHolder, position: Int) {
val item = items[position]
holder.apply {
bind(item)
itemView.tag = item
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int):
SearchAdapter.ViewHolder {
val inflatedView = LayoutInflater.from(parent.context)
.inflate(R.layout.item_search, parent, false)
return SearchAdapter.ViewHolder(inflatedView)
}
class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
private var view: View = v
fun bind(item: SearchItem) {
view.searchIcon.setImageDrawable(item.searchItemImage)
view.searchIconText.text = item.searchItemText
view.setOnClickListener{
val intent=Intent(view.context, DetailActivity::class.java)
intent.putExtra("key",item.searchItemText)
view.context.startActivity(intent)
}
}
}
}
\ No newline at end of file
package com.example.vip
import android.graphics.drawable.Drawable
class SearchItem(val searchItemImage: Drawable, val searchItemText: String) {
}
\ No newline at end of file
package com.example.vip
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.EditText
import android.widget.Toast
import com.google.firebase.messaging.FirebaseMessaging
import kotlinx.android.synthetic.main.activity_setting.*
class SettingActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_setting)
subscribeButton.setOnClickListener {
var editTextHello = findViewById(R.id.editText2) as EditText
Log.d(TAG, "Subscribing to weather topic")
// [START subscribe_topics]
Toast.makeText(this, editTextHello.text.toString(), Toast.LENGTH_SHORT).show()
FirebaseMessaging.getInstance().subscribeToTopic(editTextHello.text.toString())
.addOnCompleteListener { task ->
var msg = getString(R.string.msg_subscribed)
if (!task.isSuccessful) {
msg = getString(R.string.msg_subscribe_failed)
}
Log.d(TAG, msg)
Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show()
}
// [END subscribe_topics]
}
}
companion object {
private const val TAG = "SettingActivity"
}
}
package com.example.vip
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.viewpager.widget.ViewPager
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.activity_signin.*
class SignInActivity : AppCompatActivity() {
internal lateinit var viewpager : ViewPager
////bottom navigation view operation start 1
lateinit var bottomBar: ActionBar
////bottom navigation view operation end 1
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_signin)
val policyFieldList = ArrayList<PolicyFieldItem>()
policyFieldList.add(
PolicyFieldItem(
ContextCompat.getDrawable(this, R.drawable.kyoyook_icon)!!,
getString(R.string.title01)
)
)
policyFieldList.add(
PolicyFieldItem(
ContextCompat.getDrawable(this, R.drawable.koyong_icon)!!,
getString(R.string.title02)
)
)
policyFieldList.add(
PolicyFieldItem(
ContextCompat.getDrawable(this, R.drawable.joogeo_icon)!!,
getString(R.string.title03)
)
)
policyFieldList.add(
PolicyFieldItem(
ContextCompat.getDrawable(this, R.drawable.health_icon)!!,
getString(R.string.title04)
)
)
policyFieldList.add(
PolicyFieldItem(
ContextCompat.getDrawable(this, R.drawable.seomin_icon)!!,
getString(R.string.title05)
)
)
policyFieldList.add(
PolicyFieldItem(
ContextCompat.getDrawable(this, R.drawable.moonhwa_icon)!!,
getString(R.string.title06)
)
)
val adapter = PolicyFieldAdapter(policyFieldList)
policyFieldRecyclerView.adapter = adapter
viewpager = findViewById(R.id.welcomeViewPager) as ViewPager
val viewpageradapter = ViewPagerAdapter(this)
viewpager.adapter = viewpageradapter
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
// 2. 툴바 왼쪽 버튼 설정
supportActionBar!!.setDisplayHomeAsUpEnabled(true) // 왼쪽 버튼 사용 여부 true
supportActionBar!!.setHomeAsUpIndicator(R.drawable.return_page) // 왼쪽 버튼 아이콘 설정
supportActionBar!!.setDisplayShowTitleEnabled(false) // 타이틀 안보이게 하기
////bottom navigation view operation start 2
bottomBar=supportActionBar!!
val bottomNavigation: BottomNavigationView =findViewById(R.id.bottomNavigation)
bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
////bottom navigation view operation end 2
}
// 3.툴바 메뉴 버튼을 설정
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main_menu, menu) // main_menu 메뉴를 toolbar 메뉴 버튼으로 설정
return true
}
var back_pressed: Long = 0 // 뒤로가기 종료
override fun onBackPressed() {
if (back_pressed + 2000 > System.currentTimeMillis()) {
finishAffinity()
System.runFinalization()
System.exit(0)
}
//super.onBackPressed()
else
Toast.makeText(getBaseContext(), "\'뒤로\' 버튼을 한번 더 누르시면 종료됩니다.", Toast.LENGTH_SHORT).show()
back_pressed = System.currentTimeMillis()
}
// 4.툴바 메뉴 버튼이 클릭 됐을 때 콜백
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
// 클릭된 메뉴 아이템의 아이디 마다 when 구절로 클릭시 동작을 설정한다.
when(item!!.itemId){
android.R.id.home->{ // 메뉴 버튼
Snackbar.make(toolbar,"Menu pressed",Snackbar.LENGTH_SHORT).show()
}
R.id.menu_search->{ // 검색 버튼
val search_Intent = Intent(this, SearchActivity::class.java)
startActivity(search_Intent)
//Snackbar.make(toolbar,"Search menu pressed",Snackbar.LENGTH_SHORT).show()
}
}
return super.onOptionsItemSelected(item)
}
//bottom navigation view operation start 3
private val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item->
when (item.itemId){
R.id.bottomHome ->{
val intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomRecommend ->{
val intent = Intent(this, RecommendActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomFavorites ->{
val intent = Intent(this, FavoritesActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
R.id.bottomInfo ->{
val intent = Intent(this, InfoActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener true
}
}
false
}
//bottom navigation view operation end 3
}
package com.example.vip
import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.database.FirebaseDatabase
import kotlinx.android.synthetic.main.activity_signup.*
import android.util.Log
import com.google.android.gms.tasks.OnCompleteListener
import com.google.firebase.iid.FirebaseInstanceId
data class User(
val u_token : String = "",
val Policy : String = ""
)
var cnt = 0
var tkn=""
class SignUpActivity : AppCompatActivity() {
private val firebaseAuth = FirebaseAuth.getInstance()
val user_db = FirebaseDatabase.getInstance("https://capstone-vip-user.firebaseio.com/").reference
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_signup)
signupBtn.setOnClickListener{
sendToken()
createEmail()
}
//pushing code start
intent.extras?.let {
for (key in it.keySet()) {
val value = intent.extras?.get(key)
Log.d(TAG, "Key: $key Value: $value")
}
}
//pushing code end
}
//pushing code start 2
private fun sendToken(){
FirebaseInstanceId.getInstance().instanceId
.addOnCompleteListener(OnCompleteListener { task ->
if (!task.isSuccessful) {
Log.w(TAG, "getInstanceId failed", task.exception)
return@OnCompleteListener
}
// Get new Instance ID token
tkn = task.result!!.token
// Log and toast
val msg = getString(R.string.msg_token_fmt, tkn)
Log.d(TAG, msg)
Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show()
})
}
//pushing code end 2
private fun writeNewUser(u_id: String, u_token: String, Policy: String?) {
val user = User(u_token, Policy!!)
user_db.child(u_id).setValue(user)/// .setValue(user)
}
private fun createEmail(){
firebaseAuth!!.createUserWithEmailAndPassword(edit_email_sign_up.text.toString(), edit_password_sign_up.text.toString())
.addOnCompleteListener(this) {
if (it.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
val user = firebaseAuth?.currentUser
Toast.makeText(this, "회원가입 완료!", Toast.LENGTH_SHORT).show()
writeNewUser(user!!.uid, "$tkn", "NULL$cnt")
cnt ++
if(user!=null){
var intent = Intent(this, InputProfilFirstOneActivity::class.java)
startActivity(intent)
}
} else {
// If sign in fails, display a message to the user.
Toast.makeText(this, "회원가입 실패", Toast.LENGTH_SHORT).show()
}
}
}
//pushing code start 3
companion object {
private const val TAG = "SignUpActivity"
}
//pushing code end 3
}
package com.example.vip
import android.content.Intent
import android.content.SharedPreferences
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val settings: SharedPreferences = getSharedPreferences("dico", MODE_PRIVATE)
if(!settings.getBoolean("isFirst", false))
{
val editor: SharedPreferences.Editor = settings.edit()
editor.putBoolean("isFirst", true)
editor.commit()
val intent = Intent(this, WelcomeActivity::class.java)
startActivity(intent)
finish()
}
else
{
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}
}
\ No newline at end of file
package com.example.vip
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
class ViewPagerAdapter(private val context : Context) : PagerAdapter() {
private var layoutInflater : LayoutInflater? = null
val Image = arrayOf(
R.drawable.temp_view_pager_image,
R.drawable.temp_view_pager_image,
R.drawable.temp_view_pager_image
)
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object`
}
override fun getCount(): Int {
return Image.size
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
layoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val v = layoutInflater!!.inflate(R.layout.viewpager_activity, null)
val image = v.findViewById<View>(R.id.imageview) as ImageView
image.setImageResource(Image[position])
val vp = container as ViewPager
vp.addView(v , 0)
return v
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
val vp = container as ViewPager
val v = `object` as View
vp.removeView(v)
}
}
\ No newline at end of file
package com.example.vip
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.viewpager.widget.ViewPager
import kotlinx.android.synthetic.main.activity_signin.*
import kotlinx.android.synthetic.main.activity_welcome.*
class WelcomeActivity : AppCompatActivity() {
internal lateinit var welcomeViewPager: ViewPager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_welcome)
welcomeViewPager = findViewById(R.id.welcomeViewPager) as ViewPager
val viewpageradapter = WelcomeViewPagerAdapter(this)
welcomeViewPager.adapter = viewpageradapter
buttonGotIt.setOnClickListener{
var intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
}
}
package com.example.vip
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
class WelcomeViewPagerAdapter(private val context : Context) : PagerAdapter() {
private var layoutInflater : LayoutInflater? = null
val Image = arrayOf(
R.drawable.hwajilgooji1,
R.drawable.hwajilgooji2,
R.drawable.hwajilgooji3,
R.drawable.hwajilgooji3,
R.drawable.hwajilgooji3
)
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object`
}
override fun getCount(): Int {
return Image.size
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
layoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
val v = layoutInflater!!.inflate(R.layout.welcomeviewpager_activity, null)
val image = v.findViewById<View>(R.id.imageview) as ImageView
image.setImageResource(Image[position])
val vp = container as ViewPager
vp.addView(v , 0)
return v
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
val vp = container as ViewPager
val v = `object` as View
vp.removeView(v)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 배경 -->
<item
android:drawable="@color/splashfilling"/>
<!-- 로고 -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/final_splash" />
</item>
</layer-list>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 배경 -->
<item
android:drawable="@color/splashfilling"/>
<!-- 로고 -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/final_splash"/>
</item>
</layer-list>
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="5dp"
android:color="#29ABE2" />
<corners
android:bottomRightRadius="25dp"
android:bottomLeftRadius="25dp"
android:topLeftRadius="25dp"
android:topRightRadius="25dp"/>
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
<solid
android:color="#29ABE2"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/button_x" />
<item android:state_checked="true" android:drawable="@drawable/button_o" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="5dp"
android:color="#F4F4F4" />
<corners
android:bottomRightRadius="25dp"
android:bottomLeftRadius="25dp"
android:topLeftRadius="25dp"
android:topRightRadius="25dp"/>
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
<solid
android:color="#F4F4F4"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="1dp"
android:color="#29ABE2" />
<!--
<corners
android:bottomRightRadius="25dp"
android:bottomLeftRadius="25dp"
android:topLeftRadius="25dp"
android:topRightRadius="25dp"/>
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
-->
<solid
android:color="#FFFFFF"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp">
<shape android:shape="rectangle" >
<stroke
android:width="1dp"
android:color="#dcdcdc" />
<solid android:color="#FFF" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="32dp">
<shape android:shape="line">
<stroke
android:width="5dp"
android:color="#29ABE2"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.