Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DemoTuyaKotlin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Nguyễn Cường
DemoTuyaKotlin
Commits
4dd28661
Commit
4dd28661
authored
Mar 04, 2024
by
vunguyencuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loading manage home
parent
4a198700
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
334 additions
and
74 deletions
+334
-74
SmartHomeAdapter.kt
...uya/appsdk/sample/viettelhome/adapter/SmartHomeAdapter.kt
+51
-0
DeviceFragment.kt
...com/tuya/appsdk/sample/viettelhome/home/DeviceFragment.kt
+18
-9
Home.kt
...main/java/com/tuya/appsdk/sample/viettelhome/home/Home.kt
+13
-0
HomeManageFragment.kt
...tuya/appsdk/sample/viettelhome/home/HomeManageFragment.kt
+6
-2
ListHomeFragment.kt
...m/tuya/appsdk/sample/viettelhome/home/ListHomeFragment.kt
+47
-0
SelectedHomeListener.kt
...ya/appsdk/sample/viettelhome/home/SelectedHomeListener.kt
+6
-0
LoginFragment.kt
...com/tuya/appsdk/sample/viettelhome/login/LoginFragment.kt
+0
-1
RoomFragment.kt
...a/com/tuya/appsdk/sample/viettelhome/room/RoomFragment.kt
+22
-5
bg_background_radius_top_24.xml
app/src/main/res/drawable/bg_background_radius_top_24.xml
+5
-0
ic_home_red.xml
app/src/main/res/drawable/ic_home_red.xml
+22
-0
ic_share_network.xml
app/src/main/res/drawable/ic_share_network.xml
+21
-0
fragment_device.xml
app/src/main/res/layout/fragment_device.xml
+1
-1
fragment_list_device_item.xml
app/src/main/res/layout/fragment_list_device_item.xml
+13
-14
fragment_list_home.xml
app/src/main/res/layout/fragment_list_home.xml
+45
-0
fragment_room.xml
app/src/main/res/layout/fragment_room.xml
+12
-25
item_device.xml
app/src/main/res/layout/item_device.xml
+2
-2
item_home.xml
app/src/main/res/layout/item_home.xml
+50
-0
item_spinner.xml
app/src/main/res/layout/item_spinner.xml
+0
-15
No files found.
app/src/main/java/com/tuya/appsdk/sample/viettelhome/adapter/SmartHomeAdapter.kt
0 → 100644
View file @
4dd28661
package
com.tuya.appsdk.sample.viettelhome.adapter
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.tuya.appsdk.sample.R
import
com.tuya.appsdk.sample.viettelhome.home.Home
import
com.tuya.appsdk.sample.viettelhome.home.SelectedHomeListener
import
org.w3c.dom.Text
class
SmartHomeAdapter
(
private
val
smartHomes
:
List
<
Home
>)
:
RecyclerView
.
Adapter
<
SmartHomeAdapter
.
ViewHolder
>()
{
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
imgHome
:
ImageView
=
itemView
.
findViewById
(
R
.
id
.
img_home_red
)
val
tvNameHome
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
tv_name_smart_home
)
val
imgShareNetwork
:
ImageView
=
itemView
.
findViewById
(
R
.
id
.
img_share_network
)
// init {
// itemView.setOnClickListener(this)
// }
// override fun onClick(p0: View?) {
// listenerClick.
// }
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
val
view
=
LayoutInflater
.
from
(
parent
.
context
).
inflate
(
R
.
layout
.
item_home
,
parent
,
false
)
return
ViewHolder
(
view
)
}
override
fun
getItemCount
():
Int
{
return
smartHomes
.
size
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
holder
.
tvNameHome
.
text
=
smartHomes
[
position
].
getName
()
}
// interface OnItemClickListener {
// fun onItemClick(position: Int)
// }
}
\ No newline at end of file
app/src/main/java/com/tuya/appsdk/sample/viettelhome/home/DeviceFragment.kt
View file @
4dd28661
...
@@ -6,7 +6,6 @@ import android.view.LayoutInflater
...
@@ -6,7 +6,6 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.TextView
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.viewpager2.widget.ViewPager2
import
androidx.viewpager2.widget.ViewPager2
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayout
...
@@ -16,7 +15,7 @@ import com.tuya.appsdk.sample.databinding.FragmentDeviceBinding
...
@@ -16,7 +15,7 @@ import com.tuya.appsdk.sample.databinding.FragmentDeviceBinding
import
com.tuya.appsdk.sample.viettelhome.adapter.RoomPagerAdapter
import
com.tuya.appsdk.sample.viettelhome.adapter.RoomPagerAdapter
import
com.tuya.appsdk.sample.viettelhome.room.RoomFragment
import
com.tuya.appsdk.sample.viettelhome.room.RoomFragment
class
DeviceFragment
:
Fragment
()
{
class
DeviceFragment
:
Fragment
()
,
SelectedHomeListener
{
private
lateinit
var
bindind
:
FragmentDeviceBinding
private
lateinit
var
bindind
:
FragmentDeviceBinding
...
@@ -29,15 +28,23 @@ class DeviceFragment : Fragment() {
...
@@ -29,15 +28,23 @@ class DeviceFragment : Fragment() {
):
View
?
{
):
View
?
{
// Inflate the layout for this fragment
// Inflate the layout for this fragment
bindind
=
FragmentDeviceBinding
.
inflate
(
layoutInflater
)
bindind
=
FragmentDeviceBinding
.
inflate
(
layoutInflater
)
setupTablayout
()
setupDiaglogHome
()
return
bindind
.
root
}
fun
setupDiaglogHome
(){
bindind
.
linearBtnSmartHome
.
setOnClickListener
{
val
bottomSheetDialogFilter
=
ListHomeFragment
(
this
)
bottomSheetDialogFilter
.
show
(
childFragmentManager
,
"bottom_sheet_dialog_home"
)
}
}
fun
setupTablayout
(){
val
viewPager
:
ViewPager2
=
bindind
.
viewpager2
val
viewPager
:
ViewPager2
=
bindind
.
viewpager2
val
tabLayout
:
TabLayout
=
bindind
.
tbLayout
val
tabLayout
:
TabLayout
=
bindind
.
tbLayout
val
roomAdapter
=
RoomPagerAdapter
(
childFragmentManager
,
lifecycle
)
val
roomAdapter
=
RoomPagerAdapter
(
childFragmentManager
,
lifecycle
)
// roomAdapter.addFragment(RoomFragment(),"Tất cả các thiết bị")
// roomAdapter.addFragment(RoomFragment(),"Phòng khách")
// roomAdapter.addFragment(RoomFragment(),"Phòng ngủ")
// roomAdapter.addFragment(RoomFragment(),"Phòng bếp")
// roomAdapter.addFragment(RoomFragment(),"Phòng vệ sinh")
roomAdapter
.
addFragment
(
RoomFragment
.
newInstance
())
roomAdapter
.
addFragment
(
RoomFragment
.
newInstance
())
roomAdapter
.
addFragment
(
RoomFragment
.
newInstance
())
roomAdapter
.
addFragment
(
RoomFragment
.
newInstance
())
roomAdapter
.
addFragment
(
RoomFragment
.
newInstance
())
roomAdapter
.
addFragment
(
RoomFragment
.
newInstance
())
...
@@ -66,8 +73,10 @@ class DeviceFragment : Fragment() {
...
@@ -66,8 +73,10 @@ class DeviceFragment : Fragment() {
}
}
})
})
}
override
fun
onSelectedHome
(
name
:
String
)
{
return
bindind
.
root
}
}
...
...
app/src/main/java/com/tuya/appsdk/sample/viettelhome/home/Home.kt
0 → 100644
View file @
4dd28661
package
com.tuya.appsdk.sample.viettelhome.home
class
Home
(
private
var
name
:
String
)
{
fun
setName
(
nameHome
:
String
){
name
=
nameHome
}
fun
getName
()
:
String
{
return
name
}
}
\ No newline at end of file
app/src/main/java/com/tuya/appsdk/sample/viettelhome/home/HomeManageFragment.kt
View file @
4dd28661
...
@@ -25,6 +25,12 @@ class HomeManageFragment : Fragment() {
...
@@ -25,6 +25,12 @@ class HomeManageFragment : Fragment() {
savedInstanceState
:
Bundle
?
savedInstanceState
:
Bundle
?
):
View
?
{
):
View
?
{
binding
=
FragmentHomeManageBinding
.
inflate
(
layoutInflater
)
binding
=
FragmentHomeManageBinding
.
inflate
(
layoutInflater
)
setupNavigation
()
return
binding
.
root
}
fun
setupNavigation
(){
val
bottomNavigationView
=
binding
.
bottomNavigation
val
bottomNavigationView
=
binding
.
bottomNavigation
homePageFragment
=
HomePageFragment
()
homePageFragment
=
HomePageFragment
()
deviceFragment
=
DeviceFragment
()
deviceFragment
=
DeviceFragment
()
...
@@ -47,8 +53,6 @@ class HomeManageFragment : Fragment() {
...
@@ -47,8 +53,6 @@ class HomeManageFragment : Fragment() {
requireActivity
().
supportFragmentManager
.
beginTransaction
().
replace
(
R
.
id
.
container
,
selectedFragment
!!
).
commit
()
requireActivity
().
supportFragmentManager
.
beginTransaction
().
replace
(
R
.
id
.
container
,
selectedFragment
!!
).
commit
()
true
true
}
}
return
binding
.
root
}
}
}
}
\ No newline at end of file
app/src/main/java/com/tuya/appsdk/sample/viettelhome/home/
Room
Fragment.kt
→
app/src/main/java/com/tuya/appsdk/sample/viettelhome/home/
ListHome
Fragment.kt
View file @
4dd28661
package
com.tuya.appsdk.sample.viettelhome.home
package
com.tuya.appsdk.sample.viettelhome.home
import
android.graphics.Color
import
android.graphics.drawable.ColorDrawable
import
android.os.Bundle
import
android.os.Bundle
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.google.android.material.bottomsheet.BottomSheetDialogFragment
import
com.tuya.appsdk.sample.R
import
com.tuya.appsdk.sample.R
import
com.tuya.appsdk.sample.databinding.FragmentList
DeviceItem
Binding
import
com.tuya.appsdk.sample.databinding.FragmentList
Home
Binding
import
com.tuya.appsdk.sample.databinding.FragmentRoomBinding
import
com.tuya.appsdk.sample.databinding.FragmentRoomBinding
import
com.tuya.appsdk.sample.viettelhome.adapter.DeviceAdapter
import
com.tuya.appsdk.sample.viettelhome.adapter.SmartHomeAdapter
import
com.tuya.appsdk.sample.viettelhome.device.Device
import
kotlin.math.log
class
RoomFragment
:
Fragment
()
{
class
ListHomeFragment
(
private
var
onSelectedHome
:
SelectedHomeListener
)
:
BottomSheetDialog
Fragment
()
{
private
lateinit
var
binding
:
FragmentRoomBinding
private
lateinit
var
binding
:
FragmentListHomeBinding
val
img
=
R
.
drawable
.
img_plug
.
toString
()
private
val
demoList
=
listOf
(
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 1"
,
"Phòng khách"
,
1
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 2"
,
"Phòng khách"
,
0
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 3"
,
"Phòng khách"
,
0
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 4"
,
"Phòng khách"
,
1
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 5"
,
"Phòng khách"
,
1
),
)
private
val
demoListHome
=
listOf
(
Home
(
"Smart Home"
),
Home
(
"Smart Home 1"
),
Home
(
"Smart Home 2"
)
)
override
fun
onCreateView
(
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
savedInstanceState
:
Bundle
?
):
View
?
{
):
View
?
{
binding
=
Fragment
Room
Binding
.
inflate
(
inflater
)
binding
=
Fragment
ListHome
Binding
.
inflate
(
inflater
)
return
binding
.
root
return
binding
.
root
}
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
super
.
onViewCreated
(
view
,
savedInstanceState
)
// binding.layoutListDevice.recycleListDeviceItem.apply {
val
bottomSheet
=
dialog
?.
findViewById
<
View
>(
com
.
google
.
android
.
material
.
R
.
id
.
design_bottom_sheet
)
// adapter = DeviceAdapter(demoList)
bottomSheet
?.
background
=
ColorDrawable
(
Color
.
TRANSPARENT
)
// }
binding
.
recyclerListHome
.
apply
{
binding
.
recycleListDeviceItem
.
apply
{
layoutManager
=
LinearLayoutManager
(
context
)
Log
.
d
(
"check"
,
"onViewCreated: done"
)
adapter
=
SmartHomeAdapter
(
demoListHome
)
adapter
=
DeviceAdapter
(
demoList
)
}
}
}
}
}
}
\ No newline at end of file
app/src/main/java/com/tuya/appsdk/sample/viettelhome/home/SelectedHomeListener.kt
0 → 100644
View file @
4dd28661
package
com.tuya.appsdk.sample.viettelhome.home
interface
SelectedHomeListener
{
fun
onSelectedHome
(
name
:
String
)
}
\ No newline at end of file
app/src/main/java/com/tuya/appsdk/sample/viettelhome/login/LoginFragment.kt
View file @
4dd28661
...
@@ -30,7 +30,6 @@ class LoginFragment : Fragment() {
...
@@ -30,7 +30,6 @@ class LoginFragment : Fragment() {
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
savedInstanceState
:
Bundle
?
):
View
?
{
):
View
?
{
binding
=
FragmentLoginBinding
.
inflate
(
layoutInflater
)
binding
=
FragmentLoginBinding
.
inflate
(
layoutInflater
)
initView
()
initView
()
enterPhoneNumber
()
enterPhoneNumber
()
...
...
app/src/main/java/com/tuya/appsdk/sample/viettelhome/room/RoomFragment.kt
View file @
4dd28661
...
@@ -7,30 +7,47 @@ import android.view.View
...
@@ -7,30 +7,47 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
com.tuya.appsdk.sample.R
import
com.tuya.appsdk.sample.R
import
com.tuya.appsdk.sample.databinding.FragmentRoomBinding
import
com.tuya.appsdk.sample.databinding.FragmentRoomBinding
import
com.tuya.appsdk.sample.viettelhome.adapter.DeviceAdapter
import
com.tuya.appsdk.sample.viettelhome.device.Device
class
RoomFragment
:
Fragment
()
{
class
RoomFragment
:
Fragment
()
{
companion
object
{
companion
object
{
fun
newInstance
():
RoomFragment
{
fun
newInstance
():
RoomFragment
{
val
args
=
Bundle
()
val
args
=
Bundle
()
val
fragment
=
RoomFragment
()
val
fragment
=
RoomFragment
()
fragment
.
arguments
=
args
fragment
.
arguments
=
args
return
fragment
return
fragment
}
}
}
}
private
lateinit
var
binding
:
FragmentRoomBinding
private
lateinit
var
binding
:
FragmentRoomBinding
val
img
=
R
.
drawable
.
img_plug
.
toString
()
private
val
demoList
=
listOf
(
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 1"
,
"Phòng khách"
,
1
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 2"
,
"Phòng khách"
,
0
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 3"
,
"Phòng khách"
,
0
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 4"
,
"Phòng khách"
,
1
),
Device
(
img
.
toInt
(),
"Ổ cắm thông minh 5"
,
"Phòng khách"
,
1
),
)
override
fun
onCreateView
(
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
savedInstanceState
:
Bundle
?
):
View
?
{
):
View
?
{
binding
=
FragmentRoomBinding
.
inflate
(
layoutI
nflater
)
binding
=
FragmentRoomBinding
.
inflate
(
i
nflater
)
return
binding
.
root
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
binding
.
layoutListDevice
.
recycleListDeviceItem
.
apply
{
adapter
=
DeviceAdapter
(
demoList
)
}
return
binding
.
root
}
}
...
...
app/src/main/res/drawable/bg_background_radius_top_24.xml
0 → 100644
View file @
4dd28661
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/white"
/>
<corners
android:topLeftRadius=
"24dp"
android:topRightRadius=
"24dp"
/>
</shape>
app/src/main/res/drawable/ic_home_red.xml
0 → 100644
View file @
4dd28661
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:aapt=
"http://schemas.android.com/aapt"
android:width=
"16dp"
android:height=
"16dp"
android:viewportWidth=
"16"
android:viewportHeight=
"16"
>
<path
android:pathData=
"M8.347,0.128C8.147,-0.043 7.853,-0.043 7.653,0.128L0.186,6.528L0,6.688V6.933V14C0,14.884 1.116,16 2,16H5.867C6.161,16 6.4,15.761 6.4,15.467V12.267C6.4,11.383 7.116,10.667 8,10.667C8.884,10.667 9.6,11.383 9.6,12.267V15.467C9.6,15.761 9.839,16 10.133,16H14C14.884,16 16,14.884 16,14V6.933V6.688L15.814,6.528L8.347,0.128ZM11,12.267C11,10.794 9.473,9.5 8,9.5C6.527,9.5 5,10.794 5,12.267V14.5H2C1.705,14.5 1.5,14.295 1.5,14V7.5L8,2L14.5,7.5V14C14.5,14.295 14.295,14.5 14,14.5H11V12.267Z"
android:fillType=
"evenOdd"
>
<aapt:attr
name=
"android:fillColor"
>
<gradient
android:startX=
"8"
android:startY=
"-0"
android:endX=
"21.7"
android:endY=
"5.208"
android:type=
"linear"
>
<item
android:offset=
"0"
android:color=
"#FFF8214B"
/>
<item
android:offset=
"1"
android:color=
"#FFBE0A45"
/>
</gradient>
</aapt:attr>
</path>
</vector>
app/src/main/res/drawable/ic_share_network.xml
0 → 100644
View file @
4dd28661
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:aapt=
"http://schemas.android.com/aapt"
android:width=
"14dp"
android:height=
"16dp"
android:viewportWidth=
"14"
android:viewportHeight=
"16"
>
<path
android:pathData=
"M10.858,10.287C10.477,10.287 10.1,10.363 9.749,10.511C9.399,10.66 9.081,10.877 8.816,11.151L5.524,9.038C5.781,8.371 5.781,7.633 5.524,6.967L8.816,4.853C9.279,5.327 9.893,5.625 10.551,5.696C11.21,5.767 11.873,5.607 12.426,5.244C12.98,4.88 13.39,4.336 13.587,3.703C13.783,3.07 13.753,2.389 13.503,1.776C13.252,1.163 12.796,0.656 12.213,0.342C11.63,0.027 10.956,-0.074 10.306,0.054C9.656,0.182 9.071,0.532 8.651,1.044C8.23,1.556 8.001,2.199 8.002,2.861C8.003,3.215 8.069,3.566 8.195,3.896L4.903,6.01C4.507,5.603 3.998,5.323 3.442,5.207C2.886,5.09 2.307,5.142 1.781,5.356C1.255,5.57 0.804,5.936 0.487,6.407C0.169,6.879 0,7.434 0,8.002C0,8.571 0.169,9.126 0.487,9.597C0.804,10.069 1.255,10.435 1.781,10.649C2.307,10.862 2.886,10.915 3.442,10.798C3.998,10.682 4.507,10.402 4.903,9.995L8.195,12.108C8.069,12.439 8.003,12.79 8.002,13.144C8.002,13.709 8.17,14.261 8.484,14.731C8.797,15.2 9.244,15.566 9.765,15.783C10.287,15.999 10.862,16.055 11.416,15.945C11.97,15.835 12.479,15.563 12.878,15.163C13.278,14.764 13.55,14.255 13.66,13.701C13.77,13.147 13.714,12.573 13.497,12.051C13.281,11.529 12.915,11.083 12.445,10.769C11.976,10.455 11.423,10.287 10.858,10.287ZM10.858,1.147C11.198,1.147 11.529,1.248 11.811,1.436C12.092,1.624 12.312,1.892 12.442,2.205C12.572,2.518 12.606,2.863 12.539,3.195C12.473,3.528 12.31,3.833 12.07,4.073C11.831,4.312 11.525,4.476 11.193,4.542C10.86,4.608 10.516,4.574 10.203,4.444C9.89,4.315 9.622,4.095 9.434,3.813C9.245,3.531 9.145,3.2 9.145,2.861C9.147,2.407 9.328,1.972 9.649,1.651C9.97,1.33 10.405,1.149 10.858,1.147ZM2.861,9.716C2.522,9.716 2.191,9.616 1.909,9.427C1.627,9.239 1.407,8.971 1.278,8.658C1.148,8.345 1.114,8 1.18,7.668C1.246,7.336 1.409,7.03 1.649,6.79C1.889,6.551 2.194,6.388 2.526,6.321C2.859,6.255 3.204,6.289 3.517,6.419C3.83,6.549 4.097,6.768 4.286,7.05C4.474,7.332 4.575,7.663 4.575,8.002C4.573,8.456 4.392,8.891 4.071,9.212C3.75,9.533 3.315,9.714 2.861,9.716ZM10.858,14.858C10.52,14.858 10.188,14.757 9.906,14.569C9.625,14.38 9.405,14.113 9.275,13.8C9.145,13.486 9.112,13.142 9.178,12.809C9.244,12.477 9.407,12.172 9.647,11.932C9.886,11.692 10.192,11.529 10.524,11.463C10.857,11.397 11.201,11.431 11.514,11.56C11.828,11.69 12.095,11.91 12.283,12.192C12.472,12.473 12.572,12.805 12.572,13.144C12.57,13.598 12.389,14.032 12.068,14.353C11.747,14.674 11.313,14.856 10.858,14.858Z"
>
<aapt:attr
name=
"android:fillColor"
>
<gradient
android:startX=
"6.857"
android:startY=
"-0"
android:endX=
"19.007"
android:endY=
"3.959"
android:type=
"linear"
>
<item
android:offset=
"0"
android:color=
"#FFF8214B"
/>
<item
android:offset=
"1"
android:color=
"#FFBE0A45"
/>
</gradient>
</aapt:attr>
</path>
</vector>
app/src/main/res/layout/fragment_device.xml
View file @
4dd28661
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:background=
"#F5F5F5"
android:background=
"#F5F5F5"
android:layout_marginStart=
"2
0
dp"
android:layout_marginStart=
"2
6
dp"
android:layout_marginTop=
"8dp"
/>
android:layout_marginTop=
"8dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
app/src/main/res/layout/fragment_list_device_item.xml
View file @
4dd28661
...
@@ -51,18 +51,17 @@
...
@@ -51,18 +51,17 @@
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginTop=
"8dp"
/>
android:layout_marginTop=
"8dp"
/>
<!-- <androidx.recyclerview.widget.RecyclerView-->
<androidx.recyclerview.widget.RecyclerView
<!-- android:id="@+id/recycle_list_device_item"-->
android:id=
"@+id/recycle_list_device_item"
<!-- android:layout_width="match_parent"-->
android:layout_width=
"match_parent"
<!-- android:layout_height="wrap_content"-->
android:layout_height=
"wrap_content"
<!-- app:layout_constraintTop_toBottomOf="@id/tv_detail_list_item"-->
app:layout_constraintTop_toBottomOf=
"@id/tv_detail_list_item"
<!-- app:layout_constraintStart_toStartOf="parent"-->
app:layout_constraintStart_toStartOf=
"parent"
<!-- app:layout_constraintEnd_toEndOf="parent"-->
app:layout_constraintEnd_toEndOf=
"parent"
<!-- android:layout_marginTop="16dp"-->
android:layout_marginTop=
"16dp"
<!-- android:layout_marginStart="16dp"-->
android:layout_marginStart=
"16dp"
<!-- android:layout_marginEnd="16dp"-->
android:layout_marginEnd=
"16dp"
<!-- app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"-->
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
<!-- android:orientation="vertical"-->
android:orientation=
"vertical"
<!-- tools:listitem="@layout/item_device"-->
tools:listitem=
"@layout/item_device"
/>
<!-- android:background="@color/red"/>-->
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_list_home.xml
0 → 100644
View file @
4dd28661
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
tools:context=
".viettelhome.home.ListHomeFragment"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_list_home"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:background=
"@drawable/bg_background_radius_top_24"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
app:layout_constraintTop_toBottomOf=
"@id/recycler_list_home"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:background=
"#F5F5F5"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Quản lý nhà"
android:textColor=
"#EC0D3A"
android:textSize=
"18sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_gravity=
"center"
android:padding=
"10dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_room.xml
View file @
4dd28661
...
@@ -7,39 +7,26 @@
...
@@ -7,39 +7,26 @@
tools:context=
".viettelhome.room.RoomFragment"
tools:context=
".viettelhome.room.RoomFragment"
android:background=
"#F5F5F5"
>
android:background=
"#F5F5F5"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycle_list_device_item"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0dp
"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
>
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
android:orientation=
"vertical"
tools:listitem=
"@layout/item_device"
/>
<!-- <LinearLayout-->
<include
<!-- android:layout_width="match_parent"-->
android:id=
"@+id/layout_list_device"
<!-- android:layout_height="0dp"-->
android:layout_height=
"300dp"
<!-- app:layout_constraintTop_toTopOf="parent"-->
android:layout_width=
"match_parent"
<!-- app:layout_constraintStart_toStartOf="parent"-->
layout=
"@layout/fragment_list_device_item"
/>
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- android:layout_marginTop="16dp"-->
<!-- android:layout_marginStart="16dp"-->
<!-- android:layout_marginEnd="16dp">-->
<!-- <include-->
</LinearLayout>
<!-- android:id="@+id/layout_list_device"-->
<!-- android:layout_height="300dp"-->
<!-- android:layout_width="match_parent"-->
<!-- layout= "@layout/fragment_list_device_item"-->
<!-- />-->
<!-- </LinearLayout>-->
<!-- <ImageView-->
<!-- <ImageView-->
<!-- android:id="@+id/img_bg_device_in_room"-->
<!-- android:id="@+id/img_bg_device_in_room"-->
...
...
app/src/main/res/layout/item_device.xml
View file @
4dd28661
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
android:id=
"@+id/img_device"
android:id=
"@+id/img_device"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:
src
=
"@drawable/img_plug"
android:
background
=
"@drawable/img_plug"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_marginTop=
"8dp"
/>
android:layout_marginTop=
"8dp"
/>
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
android:id=
"@+id/img_status_device"
android:id=
"@+id/img_status_device"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:
src
=
"@drawable/ic_online_status"
android:
background
=
"@drawable/ic_online_status"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@id/tv_status_device"
app:layout_constraintEnd_toStartOf=
"@id/tv_status_device"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
app/src/main/res/layout/item_home.xml
0 → 100644
View file @
4dd28661
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<ImageView
android:id=
"@+id/img_home_red"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ic_home_red"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_marginStart=
"24dp"
android:layout_marginTop=
"18dp"
/>
<TextView
android:id=
"@+id/tv_name_smart_home"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Smart Home"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:textColor=
"@color/black"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/img_home_red"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
/>
<ImageView
android:id=
"@+id/img_share_network"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ic_share_network"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
android:layout_marginTop=
"18dp"
android:layout_marginEnd=
"24dp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"#CECECE"
app:layout_constraintTop_toBottomOf=
"@id/tv_name_smart_home"
android:layout_marginTop=
"16dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/item_spinner.xml
deleted
100644 → 0
View file @
4a198700
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/tv_name_smart_home"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"20sp"
android:textColor=
"#4E4E4E"
android:textStyle=
"bold"
/>
</LinearLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment