신기성

burning apk

......@@ -3,6 +3,7 @@ package com.example.vip
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.graphics.drawable.GradientDrawable
import android.os.Bundle
import android.util.Half.toFloat
......@@ -33,7 +34,9 @@ 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.util.Log
import android.view.MotionEvent
import androidx.core.graphics.blue
data class MemoItemDetail(
......@@ -55,6 +58,8 @@ class DetailActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_detail)
var detaildatabase = FirebaseDatabase.getInstance().reference
if (intent.hasExtra("key")) {
......@@ -85,26 +90,64 @@ class DetailActivity : AppCompatActivity() {
val summary : String = memo!!.Content
web.loadData(summary, "text/html", "UTF-8")
val prof: SharedPreferences = getSharedPreferences("profdata", Context.MODE_PRIVATE)
val editor: SharedPreferences.Editor=prof.edit()
if(detailTitle.text.toString() in prof.getString("favorstringlist","")!!.split("@").toMutableSet()){
favorBtn.isChecked=true
}
else{
}
favorBtn.setOnClickListener {
var tempstring=prof.getString("favorstringlist","")
var sepstr=tempstring!!.split("@")
var sepstrset=sepstr.toMutableSet()
if (favorBtn.isChecked) {
tempstring = tempstring + detailTitle.text.toString() + "@"
editor.putString("favorstringlist", tempstring)
editor.commit()
Toast.makeText(
this@DetailActivity,
"찜목록 추가 완료!",
Toast.LENGTH_SHORT
).show()
Log.d("asdf1",prof.getString("favorstringlist","none"))
} else {
sepstrset.remove(detailTitle.text.toString())
editor.putString("favorstringlist", sepstrset.joinToString("@"))
editor.commit()
Toast.makeText(
this@DetailActivity,
"찜목록 제거 완료!",
Toast.LENGTH_SHORT
).show()
Log.d("asdf2",prof.getString("favorstringlist","none"))
}
}
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.favorBtn.blue
}
*/
R.id.linkBtn ->{
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(memo.Link))
startActivity(intent)
}
}
false
}
......@@ -112,8 +155,10 @@ class DetailActivity : AppCompatActivity() {
bottomBar=supportActionBar!!
val bottomNavigation: BottomNavigationView =findViewById(R.id.rightBottomBVW)
bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
/*
val bottomNavigation2: BottomNavigationView =findViewById(R.id.leftBottomBVW)
bottomNavigation2.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
*/
////bottom navigation view operation end 2
......
<?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/detail_heart_x" />
<item android:state_checked="true" android:drawable="@drawable/detail_heart_o" />
</selector>
\ 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/heart_stroke" />
<item android:state_checked="true"
android:drawable="@drawable/heart_fill" />
<item android:state_checked="false" android:drawable="@drawable/heart_stroke" />
<item android:state_checked="true" android:drawable="@drawable/heart_fill" />
</selector>
\ No newline at end of file
......
......@@ -108,8 +108,7 @@
<WebView
android:id="@+id/policy_context"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
......@@ -131,8 +130,26 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:gravity="center"
android:orientation="horizontal">
<ToggleButton
android:id="@+id/favorBtn"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginRight="50dp"
android:background="@drawable/detail_favor_selector"
android:textOff=" "
android:textOn=" " />
<Button
android:id="@+id/shareBtn"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/share"
android:textOff=" "
android:textOn=" " />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/leftBottomBVW"
android:layout_width="wrap_content"
......@@ -140,6 +157,7 @@
android:layout_gravity="bottom"
android:background="#FFF"
android:elevation="5dp"
android:visibility="gone"
app:itemIconTint="#DDDDDD"
app:labelVisibilityMode="unlabeled"
app:menu="@menu/detailpage_navigation" />
......