Showing
4 changed files
with
54 additions
and
37 deletions
... | @@ -27,6 +27,11 @@ import kotlinx.android.synthetic.main.activity_recommend.* | ... | @@ -27,6 +27,11 @@ import kotlinx.android.synthetic.main.activity_recommend.* |
27 | import kotlinx.android.synthetic.main.activity_signin.* | 27 | import kotlinx.android.synthetic.main.activity_signin.* |
28 | import kotlinx.android.synthetic.main.activity_signin.toolbar | 28 | import kotlinx.android.synthetic.main.activity_signin.toolbar |
29 | import kotlinx.android.synthetic.main.search.* | 29 | import kotlinx.android.synthetic.main.search.* |
30 | +import androidx.core.app.ComponentActivity.ExtraData | ||
31 | +import androidx.core.content.ContextCompat.getSystemService | ||
32 | +import android.icu.lang.UCharacter.GraphemeClusterBreak.T | ||
33 | +import android.net.Uri | ||
34 | + | ||
30 | 35 | ||
31 | data class MemoItemDetail( | 36 | data class MemoItemDetail( |
32 | val Target : String = "", | 37 | val Target : String = "", |
... | @@ -74,6 +79,32 @@ class DetailActivity : AppCompatActivity() { | ... | @@ -74,6 +79,32 @@ class DetailActivity : AppCompatActivity() { |
74 | val web : WebView = findViewById(R.id.policy_context) | 79 | val web : WebView = findViewById(R.id.policy_context) |
75 | val summary : String = memo!!.Content | 80 | val summary : String = memo!!.Content |
76 | web.loadData(summary, "text/html", "UTF-8") | 81 | web.loadData(summary, "text/html", "UTF-8") |
82 | + | ||
83 | + val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item-> | ||
84 | + when (item.itemId){ | ||
85 | + | ||
86 | + R.id.shareBtn ->{ | ||
87 | + //val intent = Intent(this, SignInActivity::class.java) | ||
88 | + //startActivity(intent) | ||
89 | + //return@OnNavigationItemSelectedListener true | ||
90 | + } | ||
91 | + R.id.favorBtn ->{ | ||
92 | + | ||
93 | + } | ||
94 | + R.id.linkBtn ->{ | ||
95 | + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(memo.Link)) | ||
96 | + startActivity(intent) | ||
97 | + } | ||
98 | + } | ||
99 | + false | ||
100 | + } | ||
101 | + ////bottom navigation view operation start 2 | ||
102 | + bottomBar=supportActionBar!! | ||
103 | + val bottomNavigation: BottomNavigationView =findViewById(R.id.bottomNavigation) | ||
104 | + bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener) | ||
105 | + ////bottom navigation view operation end 2 | ||
106 | + | ||
107 | + | ||
77 | } | 108 | } |
78 | } | 109 | } |
79 | }) | 110 | }) |
... | @@ -84,7 +115,6 @@ class DetailActivity : AppCompatActivity() { | ... | @@ -84,7 +115,6 @@ class DetailActivity : AppCompatActivity() { |
84 | } | 115 | } |
85 | 116 | ||
86 | 117 | ||
87 | - | ||
88 | // 1. 툴바 사용 설정 | 118 | // 1. 툴바 사용 설정 |
89 | setSupportActionBar(toolbar) | 119 | setSupportActionBar(toolbar) |
90 | 120 | ||
... | @@ -93,11 +123,6 @@ class DetailActivity : AppCompatActivity() { | ... | @@ -93,11 +123,6 @@ class DetailActivity : AppCompatActivity() { |
93 | supportActionBar!!.setHomeAsUpIndicator(R.drawable.return_page) // 왼쪽 버튼 아이콘 설정 | 123 | supportActionBar!!.setHomeAsUpIndicator(R.drawable.return_page) // 왼쪽 버튼 아이콘 설정 |
94 | supportActionBar!!.setDisplayShowTitleEnabled(false) // 타이틀 안보이게 하기 | 124 | supportActionBar!!.setDisplayShowTitleEnabled(false) // 타이틀 안보이게 하기 |
95 | 125 | ||
96 | - ////bottom navigation view operation start 2 | ||
97 | - bottomBar=supportActionBar!! | ||
98 | - val bottomNavigation: BottomNavigationView =findViewById(R.id.bottomNavigation) | ||
99 | - bottomNavigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener) | ||
100 | - ////bottom navigation view operation end 2 | ||
101 | 126 | ||
102 | } | 127 | } |
103 | // 3.툴바 메뉴 버튼을 설정 | 128 | // 3.툴바 메뉴 버튼을 설정 |
... | @@ -123,34 +148,7 @@ class DetailActivity : AppCompatActivity() { | ... | @@ -123,34 +148,7 @@ class DetailActivity : AppCompatActivity() { |
123 | } | 148 | } |
124 | 149 | ||
125 | //bottom navigation view operation start 3 | 150 | //bottom navigation view operation start 3 |
126 | - private val mOnNavigationItemSelectedListener=BottomNavigationView.OnNavigationItemSelectedListener{item-> | ||
127 | - when (item.itemId){ | ||
128 | 151 | ||
129 | - R.id.bottomHome ->{ | ||
130 | - val intent = Intent(this, SignInActivity::class.java) | ||
131 | - startActivity(intent) | ||
132 | - return@OnNavigationItemSelectedListener true | ||
133 | - } | ||
134 | - R.id.bottomRecommend ->{ | ||
135 | - val intent = Intent(this, RecommendActivity::class.java) | ||
136 | - startActivity(intent) | ||
137 | - return@OnNavigationItemSelectedListener true | ||
138 | - } | ||
139 | - R.id.bottomFavorites ->{ | ||
140 | - val intent = Intent(this, FavoritesActivity::class.java) | ||
141 | - startActivity(intent) | ||
142 | - return@OnNavigationItemSelectedListener true | ||
143 | - } | ||
144 | - R.id.bottomInfo ->{ | ||
145 | - val intent = Intent(this, InfoActivity::class.java) | ||
146 | - startActivity(intent) | ||
147 | - return@OnNavigationItemSelectedListener true | ||
148 | - } | ||
149 | - | ||
150 | - | ||
151 | - } | ||
152 | - false | ||
153 | - } | ||
154 | //bottom navigation view operation end 3 | 152 | //bottom navigation view operation end 3 |
155 | 153 | ||
156 | } | 154 | } | ... | ... |
... | @@ -111,7 +111,7 @@ | ... | @@ -111,7 +111,7 @@ |
111 | app:itemIconTint="#29ABE2" | 111 | app:itemIconTint="#29ABE2" |
112 | app:itemTextColor="#29ABE2" | 112 | app:itemTextColor="#29ABE2" |
113 | app:labelVisibilityMode="labeled" | 113 | app:labelVisibilityMode="labeled" |
114 | - app:menu="@menu/bottom_nav_menu" /> | 114 | + app:menu="@menu/detailpage_navigation" /> |
115 | </FrameLayout> | 115 | </FrameLayout> |
116 | 116 | ||
117 | </LinearLayout> | 117 | </LinearLayout> | ... | ... |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
4 | + <item | ||
5 | + android:id="@+id/shareBtn" | ||
6 | + android:enabled="true" | ||
7 | + android:icon="@drawable/home" | ||
8 | + android:title="Share" | ||
9 | + app:showAsAction="ifRoom" /> | ||
10 | + <item | ||
11 | + android:id="@+id/favorBtn" | ||
12 | + android:enabled="true" | ||
13 | + android:icon="@drawable/wish" | ||
14 | + android:title="Heart" | ||
15 | + app:showAsAction="ifRoom" /> | ||
16 | + <item | ||
17 | + android:id="@+id/linkBtn" | ||
18 | + android:enabled="true" | ||
19 | + android:icon="@drawable/instagram" | ||
20 | + android:title="Link" | ||
21 | + app:showAsAction="ifRoom" /> | ||
22 | +</menu> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment