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
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Authored by
신기성
2019-10-23 21:39:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9bac018496ee9b73ecdc26da1634f942be296f00
9bac0184
1 parent
e8c289b2
menu spacing
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
40 deletions
vip/app/src/main/java/com/example/vip/RecyclerAdapter.kt → vip/app/src/main/java/com/example/vip/PolicyFieldAdapter.kt
vip/app/src/main/java/com/example/vip/YoutubeItem.kt → vip/app/src/main/java/com/example/vip/PolicyFieldItem.kt
vip/app/src/main/java/com/example/vip/SignInActivity.kt
vip/app/src/main/res/layout/activity_signin.xml
vip/app/src/main/res/layout/list_item.xml → vip/app/src/main/res/layout/item_policyfield.xml
vip/app/src/main/res/values/strings.xml
vip/app/src/main/java/com/example/vip/
Recycler
Adapter.kt
→
vip/app/src/main/java/com/example/vip/
PolicyField
Adapter.kt
View file @
9bac018
...
...
@@ -5,17 +5,17 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.Toast
import
androidx.recyclerview.widget.RecyclerView
import
kotlinx.android.synthetic.main.
list_item
.view.*
import
kotlinx.android.synthetic.main.
item_policyfield
.view.*
class
RecyclerAdapter
(
private
val
items
:
ArrayList
<
Youtube
Item
>)
:
RecyclerView
.
Adapter
<
Recycler
Adapter
.
ViewHolder
>()
{
class
PolicyFieldAdapter
(
private
val
items
:
ArrayList
<
PolicyField
Item
>)
:
RecyclerView
.
Adapter
<
PolicyField
Adapter
.
ViewHolder
>()
{
override
fun
getItemCount
()
=
items
.
size
override
fun
onBindViewHolder
(
holder
:
Recycler
Adapter
.
ViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
PolicyField
Adapter
.
ViewHolder
,
position
:
Int
)
{
val
item
=
items
[
position
]
val
listener
=
View
.
OnClickListener
{
it
->
Toast
.
makeText
(
it
.
context
,
"Clicked: ${item.
title
}"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
it
.
context
,
"Clicked: ${item.
policyFieldItemText
}"
,
Toast
.
LENGTH_SHORT
).
show
()
}
holder
.
apply
{
bind
(
listener
,
item
)
...
...
@@ -24,19 +24,19 @@ class RecyclerAdapter(private val items: ArrayList<YoutubeItem>) :
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
Recycler
Adapter
.
ViewHolder
{
PolicyField
Adapter
.
ViewHolder
{
val
inflatedView
=
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
list_item
,
parent
,
false
)
return
Recycler
Adapter
.
ViewHolder
(
inflatedView
)
.
inflate
(
R
.
layout
.
item_policyfield
,
parent
,
false
)
return
PolicyField
Adapter
.
ViewHolder
(
inflatedView
)
}
class
ViewHolder
(
v
:
View
)
:
RecyclerView
.
ViewHolder
(
v
)
{
private
var
view
:
View
=
v
fun
bind
(
listener
:
View
.
OnClickListener
,
item
:
Youtube
Item
)
{
view
.
thumbnail
.
setImageDrawable
(
item
.
i
mage
)
view
.
title
.
text
=
item
.
title
fun
bind
(
listener
:
View
.
OnClickListener
,
item
:
PolicyField
Item
)
{
view
.
fieldIcon
.
setImageDrawable
(
item
.
policyFieldItemI
mage
)
view
.
fieldIconText
.
text
=
item
.
policyFieldItemText
view
.
setOnClickListener
(
listener
)
}
}
...
...
vip/app/src/main/java/com/example/vip/
Youtube
Item.kt
→
vip/app/src/main/java/com/example/vip/
PolicyField
Item.kt
View file @
9bac018
...
...
@@ -2,6 +2,6 @@ package com.example.vip
import
android.graphics.drawable.Drawable
class
YoutubeItem
(
val
image
:
Drawable
,
val
title
:
String
)
{
class
PolicyFieldItem
(
val
policyFieldItemImage
:
Drawable
,
val
policyFieldItemText
:
String
)
{
}
\ No newline at end of file
...
...
vip/app/src/main/java/com/example/vip/SignInActivity.kt
View file @
9bac018
...
...
@@ -11,21 +11,21 @@ class SignInActivity : AppCompatActivity() {
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_signin
)
val
list
=
ArrayList
<
Youtube
Item
>()
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image01
)
!!
,
getString
(
R
.
string
.
title01
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image02
)
!!
,
getString
(
R
.
string
.
title02
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image03
)
!!
,
getString
(
R
.
string
.
title03
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image04
)
!!
,
getString
(
R
.
string
.
title04
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image05
)
!!
,
getString
(
R
.
string
.
title05
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image06
)
!!
,
getString
(
R
.
string
.
title06
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image07
)
!!
,
getString
(
R
.
string
.
title07
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image08
)
!!
,
getString
(
R
.
string
.
title08
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image09
)
!!
,
getString
(
R
.
string
.
title09
)))
list
.
add
(
Youtube
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image10
)
!!
,
getString
(
R
.
string
.
title10
)))
val
adapter
=
RecyclerAdapter
(
l
ist
)
r
ecyclerView
.
adapter
=
adapter
val
policyFieldList
=
ArrayList
<
PolicyField
Item
>()
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image01
)
!!
,
getString
(
R
.
string
.
title01
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image02
)
!!
,
getString
(
R
.
string
.
title02
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image03
)
!!
,
getString
(
R
.
string
.
title03
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image04
)
!!
,
getString
(
R
.
string
.
title04
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image05
)
!!
,
getString
(
R
.
string
.
title05
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image06
)
!!
,
getString
(
R
.
string
.
title06
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image07
)
!!
,
getString
(
R
.
string
.
title07
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image08
)
!!
,
getString
(
R
.
string
.
title08
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image09
)
!!
,
getString
(
R
.
string
.
title09
)))
policyFieldList
.
add
(
PolicyField
Item
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
image10
)
!!
,
getString
(
R
.
string
.
title10
)))
val
adapter
=
PolicyFieldAdapter
(
policyFieldL
ist
)
policyFieldR
ecyclerView
.
adapter
=
adapter
}
...
...
vip/app/src/main/res/layout/activity_signin.xml
View file @
9bac018
...
...
@@ -13,14 +13,31 @@
tools:layout_editor_absoluteX=
"46dp"
tools:layout_editor_absoluteY=
"287dp"
>
<TextView
android:id=
"@+id/space_logo_and_search"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:text=
"로고 및 검색창"
/>
<TextView
android:id=
"@+id/space_rollingBanner"
android:layout_width=
"match_parent"
android:layout_height=
"200dp"
android:text=
"롤링배너창"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/
r
ecyclerView"
android:id=
"@+id/
policyFieldR
ecyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:clipToPadding=
"false"
android:layout_height=
"300dp"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
app:spanCount=
"3"
tools:listitem=
"@layout/list_item"
/>
tools:listitem=
"@layout/item_policyfield"
/>
<TextView
android:id=
"@+id/space_snackbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"스낵바창"
/>
</LinearLayout>
...
...
vip/app/src/main/res/layout/
list_item
.xml
→
vip/app/src/main/res/layout/
item_policyfield
.xml
View file @
9bac018
...
...
@@ -7,7 +7,7 @@
<ImageView
android:id=
"@+id/
thumbnail
"
android:id=
"@+id/
fieldIcon
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintLeft_toLeftOf=
"parent"
...
...
@@ -16,11 +16,11 @@
android:adjustViewBounds=
"true"
/>
<TextView
android:id=
"@+id/
title
"
android:id=
"@+id/
fieldIconText
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"20sp"
app:layout_constraintTop_toBottomOf=
"@+id/
thumbnail
"
app:layout_constraintTop_toBottomOf=
"@+id/
fieldIcon
"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
...
...
vip/app/src/main/res/values/strings.xml
View file @
9bac018
<resources>
<string
name=
"app_name"
>
vip
</string>
<string
name=
"title01"
>
10 Best Practices for Moving to a Single Activity
</string>
<string
name=
"title02"
>
Cost of a Pixel Color (Android Dev Summit 18)
</string>
<string
name=
"title03"
>
Foldables, App Bundles and more from Android Dev Summit 18!
</string>
<string
name=
"title04"
>
Fun with LiveData (Android Dev Summit 18)
</string>
<string
name=
"title05"
>
Keynote (Android Dev Summit 18)
</string>
<string
name=
"title06"
>
Modern WebView Best Practices (Android Dev Summit 18)
</string>
<string
name=
"title01"
>
교육
</string>
<string
name=
"title02"
>
고용
</string>
<string
name=
"title03"
>
주거
</string>
<string
name=
"title04"
>
건강
</string>
<string
name=
"title05"
>
서민금융
</string>
<string
name=
"title06"
>
문화
</string>
<string
name=
"title07"
>
Performance Analysis Using Systrace (Android Dev Summit 18)
</string>
<string
name=
"title08"
>
Preferential Practices for Preferences (Android Dev Summit 18)
</string>
<string
name=
"title09"
>
That’s a wrap on Android Dev Summit 2018!
</string>
...
...
Please
register
or
login
to post a comment