Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장연우
/
WELLO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
soonmyeong2
2019-11-18 03:22:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
21e9bade828bd1d687791ff04f9184a45a41b822
21e9bade
1 parent
ffb9d6b2
connect db
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
169 additions
and
43 deletions
int2str_json.py
vip/app/src/main/java/com/example/vip/FavoritesActivity.kt
vip/app/src/main/java/com/example/vip/PolicyAdapter.kt
vip/app/src/main/java/com/example/vip/PolicyItem.kt
vip/app/src/main/java/com/example/vip/RecommendActivity.kt
int2str_json.py
0 → 100644
View file @
21e9bad
#-*- coding: utf-8 -*-
import
json
with
open
(
'tset.json'
,
'rt'
,
encoding
=
'utf-8'
)
as
json_file
:
json_data
=
json
.
load
(
json_file
)
for
js
in
json_data
:
for
key
,
value
in
js
.
items
():
if
type
(
value
)
!=
str
and
key
!=
'View'
:
js
[
key
]
=
str
(
value
)
with
open
(
'result.json'
,
'w'
,
encoding
=
'utf-8'
)
as
make_file
:
make_file
.
write
(
'['
)
for
i
,
js
in
enumerate
(
json_data
):
#make_file.write(json.dumps(js, indent="\t",ensure_ascii=False))
json
.
dump
(
js
,
make_file
,
indent
=
"
\t
"
,
ensure_ascii
=
False
)
if
i
!=
len
(
json_data
)
-
1
:
make_file
.
write
(
','
)
make_file
.
write
(
']'
)
vip/app/src/main/java/com/example/vip/FavoritesActivity.kt
View file @
21e9bad
...
...
@@ -24,10 +24,30 @@ import kotlinx.android.synthetic.main.activity_recommend.toolbar
import
kotlinx.android.synthetic.main.activity_signin.*
data class
MemoItemFavor
(
val
Target
:
String
=
""
,
val
Policy
:
String
=
""
,
val
Content
:
String
=
""
,
val
Link
:
String
=
""
val
Link
:
String
=
""
,
val
View
:
Int
=
0
,
val
Keyword
:
String
=
""
,
val
Date
:
String
=
""
,
val
Review
:
String
=
""
,
val
Score
:
Float
=
0
.
toFloat
(),
val
Category1
:
String
=
""
,
val
Category2
:
String
=
""
,
val
Category3
:
String
=
""
,
val
Category4
:
String
=
""
,
val
Category5
:
String
=
""
,
val
Category6
:
String
=
""
,
val
Category7
:
String
=
""
,
val
Category8
:
String
=
""
,
val
Category9
:
String
=
""
,
val
Category10
:
String
=
""
,
val
Category11
:
String
=
""
,
val
Category12
:
String
=
""
,
val
Category13
:
String
=
""
,
val
Category14
:
String
=
""
,
val
Category15
:
String
=
""
,
val
Category16
:
String
=
""
)
class
FavoritesActivity
:
AppCompatActivity
()
{
...
...
@@ -71,10 +91,29 @@ class FavoritesActivity : AppCompatActivity() {
PolicyItem
(
ContextCompat
.
getDrawable
(
this
@FavoritesActivity
,
R
.
drawable
.
image01
)
!!
,
memo
!!
.
Policy
,
memo
!!
.
Policy
,
memo
!!
.
Policy
,
4
.
toFloat
(),
" "
memo
.
Content
,
memo
.
Link
,
memo
.
View
,
memo
.
Keyword
,
memo
.
Date
,
memo
.
Review
,
memo
.
Score
,
memo
.
Category1
,
memo
.
Category2
,
memo
.
Category3
,
memo
.
Category4
,
memo
.
Category5
,
memo
.
Category6
,
memo
.
Category7
,
memo
.
Category8
,
memo
.
Category9
,
memo
.
Category10
,
memo
.
Category11
,
memo
.
Category12
,
memo
.
Category13
,
memo
.
Category14
,
memo
.
Category15
,
memo
.
Category16
)
)
}
...
...
@@ -85,17 +124,6 @@ class FavoritesActivity : AppCompatActivity() {
})
}
/* if (intent.hasExtra("key")) {
//textView.text = intent.getStringExtra("key") 텍뷰추가하면 인텐트로 값넘기는거 보임
} else {
Toast.makeText(this, "putExtra value not found", Toast.LENGTH_SHORT).show()
}
*/
// 1. 툴바 사용 설정
setSupportActionBar
(
toolbar
)
...
...
vip/app/src/main/java/com/example/vip/PolicyAdapter.kt
View file @
21e9bad
...
...
@@ -45,14 +45,14 @@ class PolicyAdapter(private val items: ArrayList<PolicyItem>) :
fun
bind
(
item
:
PolicyItem
)
{
view
.
policyImage
.
setImageDrawable
(
item
.
policyItemImage
)
view
.
policyDday
.
text
=
item
.
policyItemDday
view
.
policy
Host
.
text
=
item
.
policyItemHost
view
.
policy
Title
.
text
=
item
.
policyItemTitle
view
.
policy
Score
.
rating
=
item
.
policyItemScore
view
.
policy
Favor
.
text
=
item
.
policyItemFavor
if
(
item
.
policyItemDate
==
""
)
{
item
.
policyItemDate
=
"상시"
}
view
.
policy
Dday
.
text
=
item
.
policyItemDate
view
.
policy
Host
.
text
=
item
.
policyItemKeyword
view
.
policy
Title
.
text
=
item
.
policyItemPolicy
view
.
policy
Score
.
rating
=
item
.
policyScore
if
(
item
.
policyItem
Title
in
sepstrset
){
if
(
item
.
policyItem
Policy
in
sepstrset
){
view
.
policyFavor
.
isChecked
=
true
}
else
{
...
...
@@ -62,8 +62,8 @@ class PolicyAdapter(private val items: ArrayList<PolicyItem>) :
val
intent
=
Intent
(
view
.
context
,
DetailActivity
::
class
.
java
)
//putExtraStart
intent
.
putExtra
(
"key"
,
item
.
policyItem
Title
)
//putExtraEnd
intent
.
putExtra
(
"key"
,
item
.
policyItem
Policy
)
//putExtraEnd
0
view
.
context
.
startActivity
(
intent
)
}
...
...
vip/app/src/main/java/com/example/vip/PolicyItem.kt
View file @
21e9bad
...
...
@@ -3,8 +3,28 @@ package com.example.vip
import
android.graphics.drawable.Drawable
class
PolicyItem
(
val
policyItemImage
:
Drawable
,
val
policyItemDday
:
String
,
val
policyItemHost
:
String
,
val
policyItemTitle
:
String
,
val
policyItemScore
:
Float
,
val
policyItemFavor
:
String
)
\ No newline at end of file
val
policyItemPolicy
:
String
,
val
policyItemContents
:
String
,
val
policyItemLink
:
String
,
val
policyItemView
:
Int
,
val
policyItemKeyword
:
String
,
var
policyItemDate
:
String
,
val
policyReview
:
String
,
val
policyScore
:
Float
,
val
policyCategory1
:
String
,
val
policyCategory2
:
String
,
val
policyCategory3
:
String
,
val
policyCategory4
:
String
,
val
policyCategory5
:
String
,
val
policyCategory6
:
String
,
val
policyCategory7
:
String
,
val
policyCategory8
:
String
,
val
policyCategory9
:
String
,
val
policyCategory10
:
String
,
val
policyCategory11
:
String
,
val
policyCategory12
:
String
,
val
policyCategory13
:
String
,
val
policyCategory14
:
String
,
val
policyCategory15
:
String
,
val
policyCategory16
:
String
)
{}
\ No newline at end of file
...
...
vip/app/src/main/java/com/example/vip/RecommendActivity.kt
View file @
21e9bad
...
...
@@ -33,12 +33,31 @@ import androidx.core.content.ContextCompat.getSystemService
import
android.icu.lang.UCharacter.GraphemeClusterBreak.T
import
androidx.core.view.size
data class
MemoItemRecom
(
val
Target
:
String
=
""
,
val
Policy
:
String
=
""
,
val
Content
:
String
=
""
,
val
Link
:
String
=
""
val
Link
:
String
=
""
,
val
View
:
Int
=
0
,
val
Keyword
:
String
=
""
,
val
Date
:
String
=
""
,
val
Review
:
String
=
""
,
val
Score
:
Float
=
0
.
toFloat
(),
val
Category1
:
String
=
""
,
val
Category2
:
String
=
""
,
val
Category3
:
String
=
""
,
val
Category4
:
String
=
""
,
val
Category5
:
String
=
""
,
val
Category6
:
String
=
""
,
val
Category7
:
String
=
""
,
val
Category8
:
String
=
""
,
val
Category9
:
String
=
""
,
val
Category10
:
String
=
""
,
val
Category11
:
String
=
""
,
val
Category12
:
String
=
""
,
val
Category13
:
String
=
""
,
val
Category14
:
String
=
""
,
val
Category15
:
String
=
""
,
val
Category16
:
String
=
""
)
class
RecommendActivity
:
AppCompatActivity
()
{
...
...
@@ -74,12 +93,31 @@ class RecommendActivity : AppCompatActivity() {
policyList
.
add
(
PolicyItem
(
ContextCompat
.
getDrawable
(
this
@RecommendActivity
,
R
.
drawable
.
image01
)
!!
,
"상시"
,
memo
!!
.
Policy
,
memo
.
Policy
,
4
.
toFloat
(),
""
)
memo
.
Content
,
memo
.
Link
,
memo
.
View
,
memo
.
Keyword
,
memo
.
Date
,
memo
.
Review
,
memo
.
Score
,
memo
.
Category1
,
memo
.
Category2
,
memo
.
Category3
,
memo
.
Category4
,
memo
.
Category5
,
memo
.
Category6
,
memo
.
Category7
,
memo
.
Category8
,
memo
.
Category9
,
memo
.
Category10
,
memo
.
Category11
,
memo
.
Category12
,
memo
.
Category13
,
memo
.
Category14
,
memo
.
Category15
,
memo
.
Category16
)
)
}
val
adapter
=
PolicyAdapter
(
policyList
)
...
...
@@ -102,14 +140,32 @@ class RecommendActivity : AppCompatActivity() {
policyList
.
add
(
PolicyItem
(
ContextCompat
.
getDrawable
(
this
@RecommendActivity
,
R
.
drawable
.
image01
)
!!
,
"상시"
,
memo
!!
.
Policy
,
memo
.
Policy
,
4
.
toFloat
(),
""
memo
!!
.
Content
,
memo
!!
.
Link
,
memo
!!
.
View
,
memo
!!
.
Keyword
,
memo
!!
.
Date
,
memo
!!
.
Review
,
memo
!!
.
Score
,
memo
!!
.
Category1
,
memo
!!
.
Category2
,
memo
!!
.
Category3
,
memo
!!
.
Category4
,
memo
!!
.
Category5
,
memo
!!
.
Category6
,
memo
!!
.
Category7
,
memo
!!
.
Category8
,
memo
!!
.
Category9
,
memo
!!
.
Category10
,
memo
!!
.
Category11
,
memo
!!
.
Category12
,
memo
!!
.
Category13
,
memo
!!
.
Category14
,
memo
!!
.
Category15
,
memo
!!
.
Category16
)
)
//Toast.makeText(this@RecommendActivity, memo.View.toString(), Toast.LENGTH_SHORT).show()
}
val
adapter
=
PolicyAdapter
(
policyList
)
policyRecyclerView
.
adapter
=
adapter
...
...
Please
register
or
login
to post a comment