Toggle navigation
Toggle navigation
This project
Loading...
Sign in
cse437_e
/
smartdoorlock-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오윤석
2020-11-16 23:20:58 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d2623346a848e0bd575b450cd4d3949fb5b9bd74
d2623346
1 parent
6ce108b1
원격 잠금해제 기록 API 연동
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
25 deletions
app/src/main/java/com/sunnni/smartdoorlock/data/RemoteRecord.java
app/src/main/java/com/sunnni/smartdoorlock/ui/RemoteControlRecordActivity.java
app/src/main/java/com/sunnni/smartdoorlock/ui/RemoteRecordRvAdapter.java
app/src/main/java/com/sunnni/smartdoorlock/data/RemoteRecord.java
View file @
d262334
package
com
.
sunnni
.
smartdoorlock
.
data
;
public
class
RemoteRecord
{
p
ublic
String
deviceName
;
p
ublic
String
remoteDate
;
p
rivate
String
deviceName
;
p
rivate
String
remoteDate
;
public
RemoteRecord
(
String
name
,
String
date
){
this
.
deviceName
=
name
;
this
.
remoteDate
=
date
;
}
public
String
getDeviceName
()
{
return
deviceName
;
}
public
String
getRemoteDate
()
{
return
remoteDate
;
}
}
...
...
app/src/main/java/com/sunnni/smartdoorlock/ui/RemoteControlRecordActivity.java
View file @
d262334
...
...
@@ -7,12 +7,15 @@ import androidx.core.widget.NestedScrollView;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.telecom.Call
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
import
com.sunnni.smartdoorlock.R
;
import
com.sunnni.smartdoorlock.api.Api
;
import
com.sunnni.smartdoorlock.data.Device
;
import
com.sunnni.smartdoorlock.data.RemoteRecord
;
...
...
@@ -34,7 +37,20 @@ public class RemoteControlRecordActivity extends AppCompatActivity {
setToolbar
(
mToolbar
);
setRecyclerView
();
setRecordList
();
Api
.
getRemote
(
new
Api
.
Callback
()
{
@Override
public
void
callbackMethod
(
Object
obj
)
{
if
(
obj
==
null
)
{
Toast
.
makeText
(
getApplicationContext
(),
"연결 상태가 불안정합니다."
,
Toast
.
LENGTH_SHORT
).
show
();
startActivity
(
new
Intent
(
RemoteControlRecordActivity
.
this
,
MainActivity
.
class
));
return
;
}
else
{
mRecordList
.
clear
();
mRecordList
.
addAll
(
0
,
(
ArrayList
<
RemoteRecord
>)
obj
);
mAdapter
.
notifyDataSetChanged
();
}
}
});
init
();
}
...
...
@@ -66,24 +82,4 @@ public class RemoteControlRecordActivity extends AppCompatActivity {
mRecyclerView
.
setLayoutManager
(
manager
);
mRecyclerView
.
setAdapter
(
mAdapter
);
}
private
void
setRecordList
(){
RemoteRecord
temp
;
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mRecordList
.
add
(
temp
=
new
RemoteRecord
(
"Galaxy Note 10"
,
"2020.10.07(수) 17:50:00"
));
mAdapter
.
notifyDataSetChanged
();
}
}
...
...
app/src/main/java/com/sunnni/smartdoorlock/ui/RemoteRecordRvAdapter.java
View file @
d262334
...
...
@@ -29,8 +29,8 @@ public class RemoteRecordRvAdapter extends RecyclerView.Adapter<RemoteRecordRvAd
}
void
bind
(
RemoteRecord
record
){
mTvDeviceName
.
setText
(
record
.
deviceName
);
mTvRemoteDate
.
setText
(
record
.
remoteDate
);
mTvDeviceName
.
setText
(
record
.
getDeviceName
()
);
mTvRemoteDate
.
setText
(
record
.
getRemoteDate
()
);
}
}
...
...
Please
register
or
login
to post a comment