신기성

Merge branch 'master' of http://khuhub.khu.ac.kr/2014104141/WELLO

This diff could not be displayed because it is too large.
......@@ -34,7 +34,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
......
......@@ -42,7 +42,7 @@
<activity android:name=".SignInActivity" />
<activity android:name=".SignUpActivity" />
<activity android:name=".MainActivity" />
<activity android:name=".SearchActivity" />
<activity android:name=".SearchActivity" android:windowSoftInputMode="adjustNothing"/>
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
......
......@@ -7,6 +7,7 @@ import android.util.Half.toFloat
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.webkit.WebView
import android.widget.ImageView
import android.widget.RatingBar
import android.widget.TextView
......@@ -26,12 +27,19 @@ 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
import android.view.MotionEvent
data class MemoItemDetail(
val Target : String = "",
val Policy : String = "",
val Content : String = "",
val Link : String = ""
val Link : String = "",
val Date : String = "상시"
)
class DetailActivity : AppCompatActivity() {
......@@ -59,18 +67,48 @@ class DetailActivity : AppCompatActivity() {
var detailImage: ImageView =findViewById(R.id.policyImageDetail)
var detailDday: TextView =findViewById(R.id.policyDdayDetail)
var detailHost: TextView =findViewById(R.id.policyHostDetail)
var detailTitle: TextView =findViewById(R.id.policyTitleDetail)
var detailScore: RatingBar =findViewById(R.id.policyScoreDetail)
var detailFavor: TextView =findViewById(R.id.policyFavorDetail)
detailImage.setImageResource(R.drawable.image01)
detailDday.text=memo!!.Policy
detailHost.text=memo!!.Policy
detailDday.text=memo!!.Date
detailTitle.text=memo!!.Policy
detailScore.rating=4.toFloat()
detailFavor.text="0"
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
}
}
})
......@@ -81,7 +119,6 @@ class DetailActivity : AppCompatActivity() {
}
// 1. 툴바 사용 설정
setSupportActionBar(toolbar)
......@@ -90,11 +127,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.툴바 메뉴 버튼을 설정
......@@ -120,34 +152,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
}
......
......@@ -30,6 +30,10 @@ class InfoActivity : AppCompatActivity() {
//temp
InfoButtonLaw.setOnClickListener {
var intent = Intent(this, SettingActivity::class.java)
startActivity(intent)
}
//pushing test start
InfoButtonSettings.setOnClickListener {
......
......@@ -28,7 +28,6 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
//onboarding start
//onboarding end
setContentView(R.layout.activity_main)
......@@ -43,9 +42,6 @@ class MainActivity : AppCompatActivity() {
startActivity(intent)
}
}
private fun loginEmail(){
......
package com.example.vip
import android.content.Context
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
//import androidx.appcompat.widget.SearchView
import android.widget.SearchView
import android.widget.Toast
import androidx.core.app.ComponentActivity.ExtraData
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
import android.view.View
import android.widget.Button
import android.content.Intent
import android.util.Log
import android.view.inputmethod.InputMethodManager
import android.widget.*
import androidx.core.content.ContextCompat
import com.google.firebase.database.*
import com.google.firebase.database.DatabaseReference
......@@ -35,21 +35,43 @@ class SearchActivity : AppCompatActivity() {
setContentView(R.layout.search)
val searchList = ArrayList<SearchItem>()
val no_search : ImageView = findViewById(R.id.no_matching) // 노서치이미지
val searchView: SearchView
searchView = findViewById(R.id.searchForm)
//searchView.onActionViewExpanded(); //new Added line
searchView.setIconifiedByDefault(false)
fun CloseKeyboard()
{
var view = this.currentFocus
if(view != null)
{
val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
}
}
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String): Boolean {
// 검색 버튼이 눌러졌을 때 이벤트 처리
val layout : LinearLayout = findViewById(R.id.hashtag_linear)
layout.setVisibility(View.GONE)
CloseKeyboard()
database.orderByChild("Policy").startAt("$query").endAt("$query"+"\uf8ff").addListenerForSingleValueEvent(object : ValueEventListener {
override fun onCancelled(p0: DatabaseError) {
Toast.makeText(this@SearchActivity, "실패부분 : $query", Toast.LENGTH_SHORT).show()
}
override fun onDataChange(dataSnapshot: DataSnapshot) {
if (dataSnapshot.exists() == false){ // 값 없을 때
no_search.setVisibility(View.VISIBLE)
}
else {
no_search.setVisibility(View.GONE)
}
for (memoSnapshot in dataSnapshot.children){
val memo = memoSnapshot.getValue(MemoItem::class.java)
......
......@@ -3,6 +3,7 @@ package com.example.vip
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.EditText
import android.widget.Toast
import com.google.firebase.messaging.FirebaseMessaging
import kotlinx.android.synthetic.main.activity_setting.*
......@@ -14,9 +15,11 @@ class SettingActivity : AppCompatActivity() {
setContentView(R.layout.activity_setting)
subscribeButton.setOnClickListener {
var editTextHello = findViewById(R.id.editText2) as EditText
Log.d(TAG, "Subscribing to weather topic")
// [START subscribe_topics]
FirebaseMessaging.getInstance().subscribeToTopic("news")
Toast.makeText(this, editTextHello.text.toString(), Toast.LENGTH_SHORT).show()
FirebaseMessaging.getInstance().subscribeToTopic(editTextHello.text.toString())
.addOnCompleteListener { task ->
var msg = getString(R.string.msg_subscribed)
if (!task.isSuccessful) {
......
......@@ -4,6 +4,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
......@@ -90,6 +91,20 @@ class SignInActivity : AppCompatActivity() {
return true
}
var back_pressed: Long = 0 // 뒤로가기 종료
override fun onBackPressed() {
if (back_pressed + 2000 > System.currentTimeMillis()) {
finishAffinity()
System.runFinalization()
System.exit(0)
}
//super.onBackPressed()
else
Toast.makeText(getBaseContext(), "\'뒤로\' 버튼을 한번 더 누르시면 종료됩니다.", Toast.LENGTH_SHORT).show()
back_pressed = System.currentTimeMillis()
}
// 4.툴바 메뉴 버튼이 클릭 됐을 때 콜백
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
// 클릭된 메뉴 아이템의 아이디 마다 when 구절로 클릭시 동작을 설정한다.
......

88.3 KB | W: | H:

193 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

88.3 KB | W: | H:

193 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
<stroke
android:width="3dp"
android:color="#C029ABE2" />
<corners android:radius="30dp"/>
<!--<padding
android:top="8dp"/>-->
</shape>
\ No newline at end of file
......@@ -34,56 +34,66 @@
android:src="@drawable/toolbar_logo" />
</androidx.appcompat.widget.Toolbar>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/policyImageDetail"
android:layout_width="match_parent"
android:layout_height="200dp"
android:scaleType="fitXY"
tools:srcCompat="@tools:sample/avatars" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="450dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/policyDdayDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="@+id/policyHostDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
android:layout_width="77dp"
android:layout_height="44dp"
android:background="#9949ADF9"
android:gravity="center"
android:text="TextView"
android:textColor="#FFF"
android:textSize="18sp" />
<TextView
android:id="@+id/policyTitleDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
android:layout_marginLeft="11dp"
android:layout_marginBottom="5dp"
android:text="Textw"
android:textSize="30sp" />
<RatingBar
android:id="@+id/policyScoreDetail"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/policyFavorDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView" />
<WebView
android:id="@+id/policy_context"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -100,7 +110,7 @@
app:itemIconTint="#29ABE2"
app:itemTextColor="#29ABE2"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_nav_menu" />
app:menu="@menu/detailpage_navigation" />
</FrameLayout>
</LinearLayout>
......
......@@ -25,15 +25,42 @@
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_height="0dp"
android:layout_marginTop="81dp"
android:layout_marginEnd="72dp"
android:layout_marginBottom="620dp"
android:layout_marginBottom="131dp"
android:background="@drawable/toggle_selector"
android:text="ToggleButton"
android:textOff=""
android:textOn=""
app:layout_constraintBottom_toTopOf="@+id/editText2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/topicname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="137dp"
android:layout_marginTop="180dp"
android:layout_marginBottom="181dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="@+id/subscribeButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="444dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toggleButton" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......
......@@ -2,24 +2,260 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="11dp"
android:background="#FFF"
android:elevation="5dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="모든 정책 검색"
android:textSize="20dp"
android:textColor="#000"
android:layout_gravity="center"
android:layout_centerHorizontal="true" />
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_weight="1"
android:orientation="vertical">
<SearchView
android:id="@+id/searchForm"
android:queryHint="복지 정책 입력"
app:showAsAction="always"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</SearchView>
android:layout_height="wrap_content"
android:layout_marginLeft="9dp"
android:layout_marginTop="30dp"
android:layout_marginRight="9dp"
android:layout_marginBottom="9dp"
android:background="@drawable/searchview_edge"
android:focusable="false"
android:layoutDirection="rtl"
android:paddingStart="7dp"
android:queryHint=" 정책명, 대상, 키워드를 입력하세요"
app:iconifiedByDefault="false"
app:showAsAction="always" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/searchRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_search" />
tools:listitem="@layout/item_search">
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
<ImageView
android:id="@+id/no_matching"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="img"
android:visibility="gone"
app:srcCompat="@drawable/not_matching"
tools:srcCompat="@drawable/not_matching" />
<LinearLayout
android:id="@+id/hashtag_linear"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_weight="1.1"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#6629ABE2" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal|center_vertical"
android:layout_marginStart="17dp"
android:foregroundGravity="center_vertical|center|center_horizontal">
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="가구상황별" />
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
app:chipBackgroundColor="#C6FFFFFF"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:checkable="false"
android:text="# 장애인"
android:textAppearance="@style/TextAppearance.AppCompat" />
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 한부모"
android:textAppearance="@style/TextAppearance.AppCompat" />
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 다문화"
android:textAppearance="@style/TextAppearance.AppCompat" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 저소득층"
android:textAppearance="@style/TextAppearance.AppCompat"
app:chipIcon="@drawable/image01" />
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 임신/출산"
android:textAppearance="@style/TextAppearance.AppCompat" />
</com.google.android.material.chip.ChipGroup>
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal|center_vertical"
android:foregroundGravity="center_vertical|center|center_horizontal">
<TextView
android:id="@+id/textVㅇiew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="\n생애주기별" />
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 아동"
android:textAppearance="@style/TextAppearance.AppCompat" />
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 청소년"
android:textAppearance="@style/TextAppearance.AppCompat" />
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 청년"
android:textAppearance="@style/TextAppearance.AppCompat" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.chip.ChipGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 중장년"
android:textAppearance="@style/TextAppearance.AppCompat"
app:chipIcon="@drawable/image01" />
<com.google.android.material.chip.Chip
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checkable="false"
app:chipBackgroundColor="#C6FFFFFF"
android:text="# 노년"
android:textAppearance="@style/TextAppearance.AppCompat" />
</com.google.android.material.chip.ChipGroup>
</com.google.android.material.chip.ChipGroup>
</com.google.android.material.chip.ChipGroup>
</FrameLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......
<?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