soonmyeong2

change bottom_navigation_view in detailview

......@@ -27,6 +27,11 @@ 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
data class MemoItemDetail(
val Target : String = "",
......@@ -74,6 +79,32 @@ class DetailActivity : AppCompatActivity() {
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
}
}
})
......@@ -84,7 +115,6 @@ class DetailActivity : AppCompatActivity() {
}
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
......@@ -93,11 +123,6 @@ class DetailActivity : AppCompatActivity() {
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.툴바 메뉴 버튼을 설정
......@@ -123,34 +148,7 @@ class DetailActivity : AppCompatActivity() {
}
//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
}
......
......@@ -43,9 +43,6 @@ class MainActivity : AppCompatActivity() {
startActivity(intent)
}
}
private fun loginEmail(){
......
......@@ -111,7 +111,7 @@
app:itemIconTint="#29ABE2"
app:itemTextColor="#29ABE2"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_nav_menu" />
app:menu="@menu/detailpage_navigation" />
</FrameLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/shareBtn"
android:enabled="true"
android:icon="@drawable/home"
android:title="Share"
app:showAsAction="ifRoom" />
<item
android:id="@+id/favorBtn"
android:enabled="true"
android:icon="@drawable/wish"
android:title="Heart"
app:showAsAction="ifRoom" />
<item
android:id="@+id/linkBtn"
android:enabled="true"
android:icon="@drawable/instagram"
android:title="Link"
app:showAsAction="ifRoom" />
</menu>
\ No newline at end of file