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 {
...
@@ -34,6 +34,16 @@ public class MainActivity extends ParentActivity {
mMessageTextView
=
findViewById
(
R
.
id
.
fullscreen_content
);
mMessageTextView
=
findViewById
(
R
.
id
.
fullscreen_content
);
mMessageTextView
.
setTypeface
(
Typeface
.
createFromAsset
(
getAssets
(),
"meiryob.ttf"
));
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
(!
toiletInfo
.
getUsbFileCopyComplete
())
{
//外部ストレージの権限付与
//外部ストレージの権限付与
if
(
checkPermission
())
{
if
(
checkPermission
())
{
...
...
app/src/main/java/jp/odakyu/toiletsignage/activity/SignageActivity.java
View file @
8c512c3f
...
@@ -36,7 +36,8 @@ public class SignageActivity extends ParentActivity {
...
@@ -36,7 +36,8 @@ public class SignageActivity extends ParentActivity {
}
else
if
(
toiletInfo
.
getToiletGateType
()
==
ToiletConstants
.
VALUE_TOILET_GATE_TYPE_3
)
{
}
else
if
(
toiletInfo
.
getToiletGateType
()
==
ToiletConstants
.
VALUE_TOILET_GATE_TYPE_3
)
{
setContentView
(
R
.
layout
.
activity_signage_3
);
setContentView
(
R
.
layout
.
activity_signage_3
);
}
else
{
//USBから取得したトイレ情報がない場合
}
else
{
//USBから取得したトイレ情報がない場合
moveMainView
();
//強制にエラーカウント1設定
moveMainView
(
1
,
true
);
return
;
return
;
}
}
...
@@ -135,19 +136,23 @@ public class SignageActivity extends ParentActivity {
...
@@ -135,19 +136,23 @@ public class SignageActivity extends ParentActivity {
runOnUiThread
(
new
Runnable
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
if
(
toiletInfo
.
getConnectErrorCount
()
>
ToiletInfo
.
MAX_ERROR_COUNT
)
{
if
(
errorCount
>
ToiletInfo
.
MAX_ERROR_COUNT
)
{
//サーバ側から取得したトイレ情報削除
//サーバ側から取得したトイレ情報削除
toiletInfo
.
clearResultToiletJsonMap
();
toiletInfo
.
clearResultToiletJsonMap
();
moveMainView
();
moveMainView
(
errorCount
,
isNetworkConnect
);
}
else
{
}
else
{
if
(
errorCount
==
0
)
{
settingDisplay
();
settingDisplay
();
}
}
}
}
}
});
});
}
}
private
void
moveMainView
()
{
private
void
moveMainView
(
int
errorCount
,
boolean
isNetworkConnect
)
{
Intent
intent
=
new
Intent
(
SignageActivity
.
this
,
MainActivity
.
class
);
Intent
intent
=
new
Intent
(
SignageActivity
.
this
,
MainActivity
.
class
);
intent
.
putExtra
(
ToiletConstants
.
KEY_ERROR_COUNT
,
errorCount
);
intent
.
putExtra
(
ToiletConstants
.
KEY_NETWORK_CONNECT
,
isNetworkConnect
);
startActivity
(
intent
);
startActivity
(
intent
);
finish
();
finish
();
}
}
...
@@ -156,8 +161,8 @@ public class SignageActivity extends ParentActivity {
...
@@ -156,8 +161,8 @@ public class SignageActivity extends ParentActivity {
ArrayList
<
USBToiletDefaultJson
>
toiletDefaultJsonArray
=
toiletInfo
.
getToiletDefaultJsonArray
();
ArrayList
<
USBToiletDefaultJson
>
toiletDefaultJsonArray
=
toiletInfo
.
getToiletDefaultJsonArray
();
if
(
toiletDefaultJsonArray
==
null
||
toiletDefaultJsonArray
.
size
()
==
0
)
{
if
(
toiletDefaultJsonArray
==
null
||
toiletDefaultJsonArray
.
size
()
==
0
)
{
//MainActivity 移動
//MainActivity 移動
(強制にエラーカウント1)
moveMainView
();
moveMainView
(
1
,
true
);
}
}
int
vacantCount
=
0
;
int
vacantCount
=
0
;
...
@@ -208,7 +213,8 @@ public class SignageActivity extends ParentActivity {
...
@@ -208,7 +213,8 @@ public class SignageActivity extends ParentActivity {
//サーバから取得したデータが不正なのでMainに遷移
//サーバから取得したデータが不正なのでMainに遷移
if
(
vacantCount
==
-
1
||
totalCount
==
-
1
)
{
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 {
...
@@ -28,14 +28,11 @@ public class ToiletInfo {
public
static
final
int
VALUE_NETWORK_DIS_CONNECT
=
2
;
public
static
final
int
VALUE_NETWORK_DIS_CONNECT
=
2
;
public
static
final
int
VALUE_TOILET_SERVER_CONNECT_FAIL
=
3
;
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
ArrayList
<
USBToiletDefaultJson
>
mToiletDefaultJsonArray
;
private
Map
<
Integer
,
ArrayList
<
ResultToiletJson
>>
mResultToiletJsonMap
=
new
HashMap
<>();
private
Map
<
Integer
,
ArrayList
<
ResultToiletJson
>>
mResultToiletJsonMap
=
new
HashMap
<>();
private
boolean
isValidation
=
false
;
private
boolean
isUsbFileCopyComplete
=
false
;
private
boolean
isUsbFileCopyComplete
=
false
;
private
int
mConnectErrorCount
=
0
;
private
boolean
isNetworkConnect
=
false
;
public
static
synchronized
ToiletInfo
getInstance
()
{
public
static
synchronized
ToiletInfo
getInstance
()
{
if
(
instance
==
null
)
{
if
(
instance
==
null
)
{
...
@@ -98,14 +95,6 @@ public class ToiletInfo {
...
@@ -98,14 +95,6 @@ public class ToiletInfo {
return
-
1
;
return
-
1
;
}
}
public
void
setValidation
(
boolean
validation
)
{
isValidation
=
validation
;
}
public
boolean
getValidation
()
{
return
isValidation
;
}
public
void
setUsbFileCopyComplete
(
boolean
usbFileCopyComplete
)
{
public
void
setUsbFileCopyComplete
(
boolean
usbFileCopyComplete
)
{
isUsbFileCopyComplete
=
usbFileCopyComplete
;
isUsbFileCopyComplete
=
usbFileCopyComplete
;
}
}
...
@@ -114,22 +103,6 @@ public class ToiletInfo {
...
@@ -114,22 +103,6 @@ public class ToiletInfo {
return
isUsbFileCopyComplete
;
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
()
{
public
int
getToiletGateType
()
{
if
(
mToiletDefaultJsonArray
==
null
)
{
if
(
mToiletDefaultJsonArray
==
null
)
{
return
ToiletConstants
.
VALUE_TOILET_GATE_TYPE_0
;
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