Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odakyuToiletSignage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kddi
odakyuToiletSignage
Commits
8c512c3f
Commit
8c512c3f
authored
Dec 26, 2017
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
サイネージ再生画面からメンテナンス画面に遷移時に通信失敗数およびネットワーク接続状態を送る処理追加
parent
0148a589
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
35 deletions
+24
-35
app/src/main/java/jp/odakyu/toiletsignage/activity/MainActivity.java
+10
-0
app/src/main/java/jp/odakyu/toiletsignage/activity/SignageActivity.java
+13
-7
app/src/main/java/jp/odakyu/toiletsignage/info/ToiletInfo.java
+1
-28
No files found.
app/src/main/java/jp/odakyu/toiletsignage/activity/MainActivity.java
View file @
8c512c3f
...
...
@@ -34,6 +34,16 @@ public class MainActivity extends ParentActivity {
mMessageTextView
=
findViewById
(
R
.
id
.
fullscreen_content
);
mMessageTextView
.
setTypeface
(
Typeface
.
createFromAsset
(
getAssets
(),
"meiryob.ttf"
));
//サイネージ画面から戻った時の情報収集
Intent
intent
=
getIntent
();
if
(
intent
!=
null
)
{
int
errorCount
=
intent
.
getIntExtra
(
ToiletConstants
.
KEY_ERROR_COUNT
,
-
1
);
boolean
isNetworkConnect
=
intent
.
getBooleanExtra
(
ToiletConstants
.
KEY_NETWORK_CONNECT
,
false
);
if
(
errorCount
!=
-
1
&&
errorCount
!=
0
)
{
reloadDisplayView
(
errorCount
,
isNetworkConnect
);
}
}
if
(!
toiletInfo
.
getUsbFileCopyComplete
())
{
//外部ストレージの権限付与
if
(
checkPermission
())
{
...
...
app/src/main/java/jp/odakyu/toiletsignage/activity/SignageActivity.java
View file @
8c512c3f
...
...
@@ -36,7 +36,8 @@ public class SignageActivity extends ParentActivity {
}
else
if
(
toiletInfo
.
getToiletGateType
()
==
ToiletConstants
.
VALUE_TOILET_GATE_TYPE_3
)
{
setContentView
(
R
.
layout
.
activity_signage_3
);
}
else
{
//USBから取得したトイレ情報がない場合
moveMainView
();
//強制にエラーカウント1設定
moveMainView
(
1
,
true
);
return
;
}
...
...
@@ -135,19 +136,23 @@ public class SignageActivity extends ParentActivity {
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
toiletInfo
.
getConnectErrorCount
()
>
ToiletInfo
.
MAX_ERROR_COUNT
)
{
if
(
errorCount
>
ToiletInfo
.
MAX_ERROR_COUNT
)
{
//サーバ側から取得したトイレ情報削除
toiletInfo
.
clearResultToiletJsonMap
();
moveMainView
();
moveMainView
(
errorCount
,
isNetworkConnect
);
}
else
{
if
(
errorCount
==
0
)
{
settingDisplay
();
}
}
}
});
}
private
void
moveMainView
()
{
private
void
moveMainView
(
int
errorCount
,
boolean
isNetworkConnect
)
{
Intent
intent
=
new
Intent
(
SignageActivity
.
this
,
MainActivity
.
class
);
intent
.
putExtra
(
ToiletConstants
.
KEY_ERROR_COUNT
,
errorCount
);
intent
.
putExtra
(
ToiletConstants
.
KEY_NETWORK_CONNECT
,
isNetworkConnect
);
startActivity
(
intent
);
finish
();
}
...
...
@@ -156,8 +161,8 @@ public class SignageActivity extends ParentActivity {
ArrayList
<
USBToiletDefaultJson
>
toiletDefaultJsonArray
=
toiletInfo
.
getToiletDefaultJsonArray
();
if
(
toiletDefaultJsonArray
==
null
||
toiletDefaultJsonArray
.
size
()
==
0
)
{
//MainActivity 移動
moveMainView
();
//MainActivity 移動
(強制にエラーカウント1)
moveMainView
(
1
,
true
);
}
int
vacantCount
=
0
;
...
...
@@ -208,7 +213,8 @@ public class SignageActivity extends ParentActivity {
//サーバから取得したデータが不正なのでMainに遷移
if
(
vacantCount
==
-
1
||
totalCount
==
-
1
)
{
moveMainView
();
//強制にエラーカウント1設定
moveMainView
(
1
,
true
);
}
}
}
app/src/main/java/jp/odakyu/toiletsignage/info/ToiletInfo.java
View file @
8c512c3f
...
...
@@ -28,14 +28,11 @@ public class ToiletInfo {
public
static
final
int
VALUE_NETWORK_DIS_CONNECT
=
2
;
public
static
final
int
VALUE_TOILET_SERVER_CONNECT_FAIL
=
3
;
public
static
final
int
MAX_ERROR_COUNT
=
6
;
public
static
final
int
MAX_ERROR_COUNT
=
5
;
private
ArrayList
<
USBToiletDefaultJson
>
mToiletDefaultJsonArray
;
private
Map
<
Integer
,
ArrayList
<
ResultToiletJson
>>
mResultToiletJsonMap
=
new
HashMap
<>();
private
boolean
isValidation
=
false
;
private
boolean
isUsbFileCopyComplete
=
false
;
private
int
mConnectErrorCount
=
0
;
private
boolean
isNetworkConnect
=
false
;
public
static
synchronized
ToiletInfo
getInstance
()
{
if
(
instance
==
null
)
{
...
...
@@ -98,14 +95,6 @@ public class ToiletInfo {
return
-
1
;
}
public
void
setValidation
(
boolean
validation
)
{
isValidation
=
validation
;
}
public
boolean
getValidation
()
{
return
isValidation
;
}
public
void
setUsbFileCopyComplete
(
boolean
usbFileCopyComplete
)
{
isUsbFileCopyComplete
=
usbFileCopyComplete
;
}
...
...
@@ -114,22 +103,6 @@ public class ToiletInfo {
return
isUsbFileCopyComplete
;
}
public
void
setConnectErrorCount
(
int
connectErrorCount
)
{
mConnectErrorCount
=
connectErrorCount
;
}
public
int
getConnectErrorCount
()
{
return
mConnectErrorCount
;
}
public
void
setNetworkConnect
(
boolean
networkConnect
)
{
isNetworkConnect
=
networkConnect
;
}
public
boolean
getNetworkConnect
()
{
return
isNetworkConnect
;
}
public
int
getToiletGateType
()
{
if
(
mToiletDefaultJsonArray
==
null
)
{
return
ToiletConstants
.
VALUE_TOILET_GATE_TYPE_0
;
...
...
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