신기성

burning apk

...@@ -3,6 +3,7 @@ package com.example.vip ...@@ -3,6 +3,7 @@ package com.example.vip
3 import android.app.Activity 3 import android.app.Activity
4 import android.content.Context 4 import android.content.Context
5 import android.content.Intent 5 import android.content.Intent
6 +import android.content.SharedPreferences
6 import android.graphics.drawable.GradientDrawable 7 import android.graphics.drawable.GradientDrawable
7 import android.os.Bundle 8 import android.os.Bundle
8 import android.util.Half.toFloat 9 import android.util.Half.toFloat
...@@ -33,7 +34,9 @@ import androidx.core.app.ComponentActivity.ExtraData ...@@ -33,7 +34,9 @@ import androidx.core.app.ComponentActivity.ExtraData
33 import androidx.core.content.ContextCompat.getSystemService 34 import androidx.core.content.ContextCompat.getSystemService
34 import android.icu.lang.UCharacter.GraphemeClusterBreak.T 35 import android.icu.lang.UCharacter.GraphemeClusterBreak.T
35 import android.net.Uri 36 import android.net.Uri
37 +import android.util.Log
36 import android.view.MotionEvent 38 import android.view.MotionEvent
39 +import androidx.core.graphics.blue
37 40
38 41
39 data class MemoItemDetail( 42 data class MemoItemDetail(
...@@ -55,6 +58,8 @@ class DetailActivity : AppCompatActivity() { ...@@ -55,6 +58,8 @@ class DetailActivity : AppCompatActivity() {
55 super.onCreate(savedInstanceState) 58 super.onCreate(savedInstanceState)
56 setContentView(R.layout.activity_detail) 59 setContentView(R.layout.activity_detail)
57 60
61 +
62 +
58 var detaildatabase = FirebaseDatabase.getInstance().reference 63 var detaildatabase = FirebaseDatabase.getInstance().reference
59 64
60 if (intent.hasExtra("key")) { 65 if (intent.hasExtra("key")) {
...@@ -85,26 +90,64 @@ class DetailActivity : AppCompatActivity() { ...@@ -85,26 +90,64 @@ class DetailActivity : AppCompatActivity() {
85 val summary : String = memo!!.Content 90 val summary : String = memo!!.Content
86 web.loadData(summary, "text/html", "UTF-8") 91 web.loadData(summary, "text/html", "UTF-8")
87 92
93 + val prof: SharedPreferences = getSharedPreferences("profdata", Context.MODE_PRIVATE)
94 + val editor: SharedPreferences.Editor=prof.edit()
95 +
96 + if(detailTitle.text.toString() in prof.getString("favorstringlist","")!!.split("@").toMutableSet()){
97 + favorBtn.isChecked=true
98 + }
99 + else{
100 + }
88 101
102 + favorBtn.setOnClickListener {
103 + var tempstring=prof.getString("favorstringlist","")
104 + var sepstr=tempstring!!.split("@")
105 + var sepstrset=sepstr.toMutableSet()
106 +
107 +
108 + if (favorBtn.isChecked) {
109 + tempstring = tempstring + detailTitle.text.toString() + "@"
110 + editor.putString("favorstringlist", tempstring)
111 + editor.commit()
112 + Toast.makeText(
113 + this@DetailActivity,
114 + "찜목록 추가 완료!",
115 + Toast.LENGTH_SHORT
116 + ).show()
117 + Log.d("asdf1",prof.getString("favorstringlist","none"))
118 + } else {
119 + sepstrset.remove(detailTitle.text.toString())
120 + editor.putString("favorstringlist", sepstrset.joinToString("@"))
121 + editor.commit()
122 + Toast.makeText(
123 + this@DetailActivity,
124 + "찜목록 제거 완료!",
125 + Toast.LENGTH_SHORT
126 + ).show()
127 + Log.d("asdf2",prof.getString("favorstringlist","none"))
128 + }
129 + }
89 130
90 131
91 val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item-> 132 val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item->
92 when (item.itemId){ 133 when (item.itemId){
93 134
135 + /*
94 R.id.shareBtn ->{ 136 R.id.shareBtn ->{
95 //val intent = Intent(this, SignInActivity::class.java) 137 //val intent = Intent(this, SignInActivity::class.java)
96 //startActivity(intent) 138 //startActivity(intent)
97 //return@OnNavigationItemSelectedListener true 139 //return@OnNavigationItemSelectedListener true
98 } 140 }
99 R.id.favorBtn ->{ 141 R.id.favorBtn ->{
100 - 142 + R.id.favorBtn.blue
101 -
102 143
103 } 144 }
145 + */
104 R.id.linkBtn ->{ 146 R.id.linkBtn ->{
105 val intent = Intent(Intent.ACTION_VIEW, Uri.parse(memo.Link)) 147 val intent = Intent(Intent.ACTION_VIEW, Uri.parse(memo.Link))
106 startActivity(intent) 148 startActivity(intent)
107 } 149 }
150 +
108 } 151 }
109 false 152 false
110 } 153 }
...@@ -112,8 +155,10 @@ class DetailActivity : AppCompatActivity() { ...@@ -112,8 +155,10 @@ class DetailActivity : AppCompatActivity() {
112 bottomBar=supportActionBar!! 155 bottomBar=supportActionBar!!
113 val bottomNavigation: BottomNavigationView =findViewById(R.id.rightBottomBVW) 156 val bottomNavigation: BottomNavigationView =findViewById(R.id.rightBottomBVW)
114 bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener) 157 bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
158 + /*
115 val bottomNavigation2: BottomNavigationView =findViewById(R.id.leftBottomBVW) 159 val bottomNavigation2: BottomNavigationView =findViewById(R.id.leftBottomBVW)
116 bottomNavigation2.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener) 160 bottomNavigation2.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
161 + */
117 162
118 ////bottom navigation view operation end 2 163 ////bottom navigation view operation end 2
119 164
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
3 +
4 + <item android:state_checked="false" android:drawable="@drawable/detail_heart_x" />
5 + <item android:state_checked="true" android:drawable="@drawable/detail_heart_o" />
6 +</selector>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <selector xmlns:android="http://schemas.android.com/apk/res/android"> 2 <selector xmlns:android="http://schemas.android.com/apk/res/android">
3 3
4 - <item android:state_checked="false" 4 + <item android:state_checked="false" android:drawable="@drawable/heart_stroke" />
5 - android:drawable="@drawable/heart_stroke" /> 5 + <item android:state_checked="true" android:drawable="@drawable/heart_fill" />
6 - <item android:state_checked="true"
7 - android:drawable="@drawable/heart_fill" />
8 </selector> 6 </selector>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -108,8 +108,7 @@ ...@@ -108,8 +108,7 @@
108 <WebView 108 <WebView
109 android:id="@+id/policy_context" 109 android:id="@+id/policy_context"
110 android:layout_width="match_parent" 110 android:layout_width="match_parent"
111 - android:layout_height="wrap_content" 111 + android:layout_height="wrap_content" />
112 - android:layout_weight="1" />
113 </LinearLayout> 112 </LinearLayout>
114 </LinearLayout> 113 </LinearLayout>
115 </ScrollView> 114 </ScrollView>
...@@ -131,8 +130,26 @@ ...@@ -131,8 +130,26 @@
131 android:layout_width="match_parent" 130 android:layout_width="match_parent"
132 android:layout_height="match_parent" 131 android:layout_height="match_parent"
133 android:layout_weight="1.2" 132 android:layout_weight="1.2"
133 + android:gravity="center"
134 android:orientation="horizontal"> 134 android:orientation="horizontal">
135 135
136 + <ToggleButton
137 + android:id="@+id/favorBtn"
138 + android:layout_width="32dp"
139 + android:layout_height="32dp"
140 + android:layout_marginRight="50dp"
141 + android:background="@drawable/detail_favor_selector"
142 + android:textOff=" "
143 + android:textOn=" " />
144 +
145 + <Button
146 + android:id="@+id/shareBtn"
147 + android:layout_width="30dp"
148 + android:layout_height="30dp"
149 + android:background="@drawable/share"
150 + android:textOff=" "
151 + android:textOn=" " />
152 +
136 <com.google.android.material.bottomnavigation.BottomNavigationView 153 <com.google.android.material.bottomnavigation.BottomNavigationView
137 android:id="@+id/leftBottomBVW" 154 android:id="@+id/leftBottomBVW"
138 android:layout_width="wrap_content" 155 android:layout_width="wrap_content"
...@@ -140,6 +157,7 @@ ...@@ -140,6 +157,7 @@
140 android:layout_gravity="bottom" 157 android:layout_gravity="bottom"
141 android:background="#FFF" 158 android:background="#FFF"
142 android:elevation="5dp" 159 android:elevation="5dp"
160 + android:visibility="gone"
143 app:itemIconTint="#DDDDDD" 161 app:itemIconTint="#DDDDDD"
144 app:labelVisibilityMode="unlabeled" 162 app:labelVisibilityMode="unlabeled"
145 app:menu="@menu/detailpage_navigation" /> 163 app:menu="@menu/detailpage_navigation" />
......