soonmyeong2

search menu redesinged

1 +wello_firebase_SDKKey.json
...\ No newline at end of file ...\ No newline at end of file
1 +import firebase_admin
2 +from firebase_admin import credentials
3 +from firebase_admin import messaging
4 +
5 +cred = credentials.Certificate("./wello_firebase_SDKKey.json")
6 +wello = firebase_admin.initialize_app(cred)
7 +
8 +print("WELLO project name : ", wello.project_id)
9 +
10 +# These registration tokens come from the client FCM SDKs.
11 +registration_tokens = [
12 + "eSNbW5he2RA:APA91bHqe2ir6xeYq-R143J3pmAD1KuYuPqa-_3oHIw93hQKe9nMGZ2Ol3foV9GXciZCP8WHUbfIEb7Ymr-BGSl22Tau_mvOSqVTqNP5V2UU8sbOjZm9TgBxirxy-A0KynHxKCLcMnYF"
13 + "dJCm74G7qY0:APA91bGydGRjb91_bX6X8Oyx0kqyFHoXzgF0ZZmD_IygEDCqYPHxJ46os8sHytEmHWIpASDzTk-RZESgkZvdcJavKLJWtVY5uxWl2xUEPefyrcJ-kLWnLHcgPbDTCVLoGe_ZivOFuY9Y"
14 +]
15 +
16 +# Subscribe the devices corresponding to the registration tokens to the
17 +# topic.
18 +response = messaging.subscribe_to_topic(registration_tokens, "kisung")
19 +
20 +# See the TopicManagementResponse reference documentation
21 +# for the contents of response.
22 +print(response.success_count, 'tokens were subscribed successfully')
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
19 android:theme="@style/SplashTheme"> 19 android:theme="@style/SplashTheme">
20 <intent-filter> 20 <intent-filter>
21 <action android:name="android.intent.action.MAIN" /> 21 <action android:name="android.intent.action.MAIN" />
22 -
23 <category android:name="android.intent.category.LAUNCHER" /> 22 <category android:name="android.intent.category.LAUNCHER" />
24 </intent-filter> 23 </intent-filter>
25 </activity> 24 </activity>
26 </application> 25 </application>
26 +</manifest>
27 27
28 -</manifest>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -47,7 +47,6 @@ class MainActivity : AppCompatActivity() { ...@@ -47,7 +47,6 @@ class MainActivity : AppCompatActivity() {
47 47
48 emailSigninBtn.setOnClickListener{ 48 emailSigninBtn.setOnClickListener{
49 loginEmail() 49 loginEmail()
50 -
51 } 50 }
52 51
53 emailSignupBtn.setOnClickListener { 52 emailSignupBtn.setOnClickListener {
......
1 package com.example.vip 1 package com.example.vip
2 2
3 +import android.content.Context
3 import android.os.Bundle 4 import android.os.Bundle
4 import androidx.appcompat.app.AppCompatActivity 5 import androidx.appcompat.app.AppCompatActivity
5 -//import androidx.appcompat.widget.SearchView
6 import android.widget.SearchView 6 import android.widget.SearchView
7 import android.widget.Toast 7 import android.widget.Toast
8 -import androidx.core.app.ComponentActivity.ExtraData
9 -import androidx.core.content.ContextCompat.getSystemService
10 -import android.icu.lang.UCharacter.GraphemeClusterBreak.T
11 import android.view.View 8 import android.view.View
12 import android.widget.Button 9 import android.widget.Button
13 import android.content.Intent 10 import android.content.Intent
14 import android.util.Log 11 import android.util.Log
12 +import android.view.inputmethod.InputMethodManager
15 import androidx.core.content.ContextCompat 13 import androidx.core.content.ContextCompat
16 import com.google.firebase.database.* 14 import com.google.firebase.database.*
17 import com.google.firebase.database.DatabaseReference 15 import com.google.firebase.database.DatabaseReference
18 import com.google.firebase.database.FirebaseDatabase 16 import com.google.firebase.database.FirebaseDatabase
19 import kotlinx.android.synthetic.main.search.* 17 import kotlinx.android.synthetic.main.search.*
18 +import androidx.core.app.ComponentActivity.ExtraData
19 +import androidx.core.content.ContextCompat.getSystemService
20 +import android.icu.lang.UCharacter.GraphemeClusterBreak.T
21 +
22 +
20 23
21 24
22 25
...@@ -30,6 +33,13 @@ data class MemoItem( ...@@ -30,6 +33,13 @@ data class MemoItem(
30 var database = FirebaseDatabase.getInstance().reference 33 var database = FirebaseDatabase.getInstance().reference
31 34
32 class SearchActivity : AppCompatActivity() { 35 class SearchActivity : AppCompatActivity() {
36 +
37 +
38 + fun View.hideKeyboard() {
39 + val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
40 + imm.hideSoftInputFromWindow(windowToken, 0)
41 + }
42 +
33 override fun onCreate(savedInstanceState: Bundle?) { 43 override fun onCreate(savedInstanceState: Bundle?) {
34 super.onCreate(savedInstanceState) 44 super.onCreate(savedInstanceState)
35 setContentView(R.layout.search) 45 setContentView(R.layout.search)
...@@ -45,6 +55,10 @@ class SearchActivity : AppCompatActivity() { ...@@ -45,6 +55,10 @@ class SearchActivity : AppCompatActivity() {
45 override fun onQueryTextSubmit(query: String): Boolean { 55 override fun onQueryTextSubmit(query: String): Boolean {
46 // 검색 버튼이 눌러졌을 때 이벤트 처리 56 // 검색 버튼이 눌러졌을 때 이벤트 처리
47 57
58 + //버튼 눌를때 아래 삭제
59 + view.hideKeyboard()
60 + view.visibility = View.GONE
61 +
48 database.orderByChild("Policy").startAt("$query").endAt("$query"+"\uf8ff").addListenerForSingleValueEvent(object : ValueEventListener { 62 database.orderByChild("Policy").startAt("$query").endAt("$query"+"\uf8ff").addListenerForSingleValueEvent(object : ValueEventListener {
49 override fun onCancelled(p0: DatabaseError) { 63 override fun onCancelled(p0: DatabaseError) {
50 Toast.makeText(this@SearchActivity, "실패부분 : $query", Toast.LENGTH_SHORT).show() 64 Toast.makeText(this@SearchActivity, "실패부분 : $query", Toast.LENGTH_SHORT).show()
......
...@@ -41,8 +41,6 @@ class SignUpActivity : AppCompatActivity() { ...@@ -41,8 +41,6 @@ class SignUpActivity : AppCompatActivity() {
41 } 41 }
42 } 42 }
43 //pushing code end 43 //pushing code end
44 -
45 -
46 } 44 }
47 45
48 //pushing code start 2 46 //pushing code start 2
......
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
5 - android:orientation="vertical"
6 android:layout_width="match_parent" 5 android:layout_width="match_parent"
7 - android:layout_height="match_parent"> 6 + android:layout_height="match_parent"
7 + android:orientation="vertical">
8 8
9 <SearchView 9 <SearchView
10 android:id="@+id/searchForm" 10 android:id="@+id/searchForm"
11 - android:queryHint="복지 정책 입력"
12 - app:showAsAction="always"
13 android:layout_width="match_parent" 11 android:layout_width="match_parent"
14 - android:layout_height="wrap_content" > 12 + android:layout_height="wrap_content"
15 - 13 + android:queryHint="복지 정책 입력"
16 - </SearchView> 14 + app:showAsAction="always"/>
17 15
18 <androidx.recyclerview.widget.RecyclerView 16 <androidx.recyclerview.widget.RecyclerView
19 android:id="@+id/searchRecyclerView" 17 android:id="@+id/searchRecyclerView"
20 android:layout_width="match_parent" 18 android:layout_width="match_parent"
21 - android:layout_height="340dp" 19 + android:layout_height="668dp"
20 + android:layout_above="@+id/view"
21 + android:layout_below="@+id/searchForm"
22 + android:layout_alignParentStart="true"
23 + android:layout_marginStart="0dp"
24 + android:layout_marginTop="15dp"
25 + android:layout_marginBottom="-320dp"
22 app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" 26 app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
23 app:spanCount="3" 27 app:spanCount="3"
24 - app:layout_constraintBottom_toBottomOf="@id/bottom_navigation"
25 tools:listitem="@layout/item_search" /> 28 tools:listitem="@layout/item_search" />
26 -</LinearLayout>
...\ No newline at end of file ...\ No newline at end of file
29 +
30 + <View
31 + android:id="@+id/view"
32 + android:layout_width="match_parent"
33 + android:layout_height="320dp"
34 + android:layout_alignParentStart="true"
35 + android:layout_alignParentBottom="true"
36 + android:layout_marginStart="0dp"
37 + android:background="#8029ABE2"
38 + app:layout_constraintStart_toStartOf="@id/searchRecyclerView"
39 + app:layout_constraintTop_toTopOf="@id/searchRecyclerView" />
40 +
41 +</RelativeLayout>
...\ No newline at end of file ...\ No newline at end of file
......