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
e2ddc8a9
Commit
e2ddc8a9
authored
Dec 20, 2017
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ソースコードレビュー指摘事項修正
端末電源ONの時自動起動処理追加
parent
cee93dce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
282 additions
and
212 deletions
+282
-212
.gitignore
+1
-0
app/src/main/AndroidManifest.xml
+15
-1
app/src/main/java/jp/odakyu/toiletsignage/activity/MainActivity.java
+15
-49
app/src/main/java/jp/odakyu/toiletsignage/activity/ParentActivity.java
+26
-23
app/src/main/java/jp/odakyu/toiletsignage/activity/SignageActivity.java
+0
-0
app/src/main/java/jp/odakyu/toiletsignage/application/ToiletApplication.java
+20
-20
app/src/main/java/jp/odakyu/toiletsignage/connection/ToiletServerConnection.java
+5
-4
app/src/main/java/jp/odakyu/toiletsignage/constants/ToiletConstants.java
+22
-0
app/src/main/java/jp/odakyu/toiletsignage/file/FileUtil.java
+3
-3
app/src/main/java/jp/odakyu/toiletsignage/info/ToiletInfo.java
+17
-10
app/src/main/java/jp/odakyu/toiletsignage/json/USBToiletDefaultJson.java
+12
-19
app/src/main/java/jp/odakyu/toiletsignage/logic/MainLogic.java
+38
-15
app/src/main/java/jp/odakyu/toiletsignage/receiver/OnBootReceiver.java
+32
-0
app/src/main/java/jp/odakyu/toiletsignage/task/UpdateToiletInfoTask.java
+31
-42
app/src/main/res/layout/activity_signage_1.xml
+8
-10
app/src/main/res/layout/activity_signage_3.xml
+22
-16
app/src/main/res/values/strings.xml
+15
-0
No files found.
.gitignore
View file @
e2ddc8a9
...
...
@@ -10,3 +10,4 @@
.idea/modules.xml
.idea/misc.xml
.idea/vcs.xml
.idea/dictionaries/agentec.xml
app/src/main/AndroidManifest.xml
View file @
e2ddc8a9
...
...
@@ -5,7 +5,7 @@
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<application
android:name=
".application.ToiletApplication"
android:allowBackup=
"false"
...
...
@@ -21,12 +21,25 @@
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<!-- The following two intent-filters are the key to set homescreen -->
<category
android:name=
"android.intent.category.HOME"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".activity.SignageActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
/>
<activity
android:name=
".activity.ParentActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
/>
<receiver
android:name=
".receiver.OnBootReceiver"
>
<intent-filter>
<action
android:name=
"android.intent.action.BOOT_COMPLETED"
/>
</intent-filter>
</receiver>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/jp/odakyu/toiletsignage/activity/MainActivity.java
View file @
e2ddc8a9
...
...
@@ -11,11 +11,10 @@ import android.widget.TextView;
import
android.graphics.Typeface
;
import
android.widget.Toast
;
import
jp.odakyu.toiletsignage.R
;
import
jp.odakyu.toiletsignage.constants.ToiletConstants
;
import
jp.odakyu.toiletsignage.info.ToiletInfo
;
import
jp.odakyu.toiletsignage.logic.MainLogic
;
import
jp.odakyu.toiletsignage.application.ToiletApplication
;
import
static
java
.
lang
.
Boolean
.
FALSE
;
import
static
java
.
lang
.
Boolean
.
TRUE
;
/**
* An example full-screen activity that shows and hides the system UI (i.e.
...
...
@@ -26,7 +25,6 @@ public class MainActivity extends ParentActivity {
private
TextView
mMessageTextView
;
private
final
int
REQUEST_PERMISSION
=
1000
;
private
final
int
REQUEST_CODE
=
1
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -48,30 +46,26 @@ public class MainActivity extends ParentActivity {
}
private
void
getUsbFileInfo
()
{
MainLogic
mainLogic
=
new
MainLogic
();
try
{
mainLogic
.
getToiletDefaultInfo
(
this
);
if
(
!
toiletInfo
.
getValidation
()
)
{
int
result
=
MainLogic
.
getToiletDefaultInfo
(
getApplicationContext
()
);
if
(
result
==
ToiletConstants
.
VALUE_GET_USB_INFO_VALIDATION_FAIL
)
{
mMessageTextView
.
setText
(
getString
(
R
.
string
.
initDisplayStringError
,
ToiletInfo
.
VALUE_DEFAULT_TOILET_VALIDATION_FAIL
));
Log
.
e
(
TAG
,
"
ToiletDefaultJson validation fail"
);
Log
.
w
(
TAG
,
"USB
ToiletDefaultJson validation fail"
);
return
;
}
if
(
toiletInfo
.
getToiletDefaultJsonArray
()
==
null
&&
toiletInfo
.
getToiletDefaultJsonArray
().
size
()
==
0
)
{
if
(
result
==
ToiletConstants
.
VALUE_GET_USB_INFO_FAIL
)
{
mMessageTextView
.
setText
(
getString
(
R
.
string
.
initDisplayStringError
,
ToiletInfo
.
VALUE_DEFAULT_TOILET_NULL
));
Log
.
e
(
TAG
,
"ToiletDefaultArray NULL"
);
Log
.
w
(
TAG
,
"ToiletDefaultArray NULL"
);
return
;
}
toiletInfo
.
setUsbFileCopyComplete
(
TRUE
);
toiletInfo
.
setUsbFileCopyComplete
(
true
);
ToiletApplication
application
=
(
ToiletApplication
)
this
.
getApplication
();
application
.
startTimer
();
}
catch
(
Exception
e
)
{
mMessageTextView
.
setText
(
getString
(
R
.
string
.
initDisplayStringError
,
ToiletInfo
.
VALUE_DEFAULT_TOILET_NULL
));
String
stackTrace
=
Log
.
getStackTraceString
(
e
);
Log
.
e
(
TAG
,
stackTrace
);
e
.
printStackTrace
();
Log
.
e
(
TAG
,
e
.
getLocalizedMessage
(),
e
);
}
}
...
...
@@ -81,9 +75,9 @@ public class MainActivity extends ParentActivity {
if
(
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
==
PackageManager
.
PERMISSION_GRANTED
){
return
TRUE
;
return
true
;
}
return
FALSE
;
return
false
;
}
// 許可を求める
...
...
@@ -120,40 +114,12 @@ public class MainActivity extends ParentActivity {
}
@Override
protected
void
onResume
()
{
Log
.
i
(
TAG
,
"onResume"
);
super
.
onResume
();
}
@Override
protected
void
onPause
()
{
Log
.
i
(
TAG
,
"onPause"
);
super
.
onPause
();
}
@Override
protected
void
onDestroy
()
{
Log
.
i
(
TAG
,
"onDestroy"
);
super
.
onDestroy
();
}
@Override
protected
void
onStop
()
{
Log
.
i
(
TAG
,
"onStop"
);
super
.
onStop
();
}
@Override
protected
void
onStart
()
{
Log
.
i
(
TAG
,
"onStart"
);
super
.
onStart
();
}
@Override
protected
void
reloadDisplayView
()
{
protected
void
reloadDisplayView
(
final
int
errorCount
,
final
boolean
isNetworkConnect
)
{
Log
.
d
(
TAG
,
"reloadDisplayView"
);
mHandler
.
post
(
new
Runnable
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
toiletInfo
.
getConnectErrorCount
()
==
0
)
{
if
(
errorCount
==
0
)
{
if
(
toiletInfo
.
getToiletDefaultJsonArray
().
size
()
>
0
&&
toiletInfo
.
getResultToiletJsonMapSize
()
>
0
)
{
//Move Signage View
Intent
intent
=
new
Intent
(
MainActivity
.
this
,
SignageActivity
.
class
);
...
...
@@ -163,7 +129,7 @@ public class MainActivity extends ParentActivity {
mMessageTextView
.
setText
(
getString
(
R
.
string
.
initDisplayStringError
,
ToiletInfo
.
VALUE_TOILET_SERVER_CONNECT_FAIL
));
}
}
else
{
if
(
toiletInfo
.
getNetworkConnect
()
)
{
if
(
isNetworkConnect
)
{
mMessageTextView
.
setText
(
getString
(
R
.
string
.
initDisplayStringError
,
ToiletInfo
.
VALUE_NETWORK_DIS_CONNECT
));
}
else
{
mMessageTextView
.
setText
(
getString
(
R
.
string
.
initDisplayStringError
,
ToiletInfo
.
VALUE_TOILET_SERVER_CONNECT_FAIL
));
...
...
app/src/main/java/jp/odakyu/toiletsignage/activity/ParentActivity.java
View file @
e2ddc8a9
...
...
@@ -6,13 +6,13 @@ import android.content.Intent;
import
android.content.IntentFilter
;
import
android.content.pm.ActivityInfo
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.support.v7.app.AppCompatActivity
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.Window
;
import
jp.odakyu.toiletsignage.application.ToiletApplication
;
import
jp.odakyu.toiletsignage.constants.ToiletConstants
;
import
jp.odakyu.toiletsignage.info.ToiletInfo
;
/**
...
...
@@ -22,10 +22,9 @@ import jp.odakyu.toiletsignage.info.ToiletInfo;
public
class
ParentActivity
extends
AppCompatActivity
{
private
static
final
String
TAG
=
"ParentActivity"
;
Handler
mHandler
;
ToiletInfo
toiletInfo
;
private
BroadcastReceiver
broadcastReceiver
;
private
boolean
isRunning
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -41,9 +40,6 @@ public class ParentActivity extends AppCompatActivity {
View
.
SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
View
.
SYSTEM_UI_FLAG_FULLSCREEN
);
//BackgroundThreadからMainThread使用するため
mHandler
=
new
Handler
();
toiletInfo
=
ToiletInfo
.
getInstance
();
//BroadcastReceiver設定
...
...
@@ -51,50 +47,57 @@ public class ParentActivity extends AppCompatActivity {
broadcastReceiver
=
new
BroadcastReceiver
()
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
reloadDisplayView
();
//Main ActivityとSignage Activityが両方生きている時の対策で表示しているActivityのみ実行
if
(
isRunning
)
{
boolean
isNetworkConnect
=
intent
.
getBooleanExtra
(
ToiletConstants
.
KEY_NETWORK_CONNECT
,
false
);
int
errorCount
=
intent
.
getIntExtra
(
ToiletConstants
.
KEY_ERROR_COUNT
,
-
1
);
reloadDisplayView
(
errorCount
,
isNetworkConnect
);
}
}
};
registerReceiver
(
broadcastReceiver
,
filter
);
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
public
void
finish
()
{
super
.
finish
();
unregisterReceiver
(
broadcastReceiver
);
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
}
@Override
protected
void
onStop
()
{
super
.
onStop
();
ToiletApplication
application
=
(
ToiletApplication
)
getApplication
();
//アプリがバックグラウンドのなった時のみタスクを停止
if
(!
application
.
isForegr
d
ound
(
this
))
{
if
(!
application
.
isForeground
(
this
))
{
Log
.
i
(
TAG
,
"Application Background"
);
application
.
stopTimer
();
}
super
.
onStop
();
}
@Override
protected
void
onStart
()
{
super
.
onStart
();
ToiletApplication
application
=
(
ToiletApplication
)
getApplication
();
//初回起動時以外はタスク開始(バックグラウンドからフォアグラウンド対応)
if
(
toiletInfo
.
getToiletDefaultJsonArray
()
!=
null
)
{
application
.
startTimer
();
}
super
.
onStart
();
}
@Override
protected
void
onResume
()
{
isRunning
=
true
;
super
.
onResume
();
}
@Override
protected
void
onPause
()
{
isRunning
=
false
;
super
.
onPause
();
}
//Child Classから実装
protected
void
reloadDisplayView
()
{}
protected
void
reloadDisplayView
(
final
int
errorCount
,
final
boolean
isNetworkConnect
)
{}
}
app/src/main/java/jp/odakyu/toiletsignage/activity/SignageActivity.java
View file @
e2ddc8a9
This diff is collapsed.
Click to expand it.
app/src/main/java/jp/odakyu/toiletsignage/application/ToiletApplication.java
View file @
e2ddc8a9
...
...
@@ -2,13 +2,16 @@ package jp.odakyu.toiletsignage.application;
import
android.app.ActivityManager
;
import
android.app.Application
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.util.Log
;
import
java.util.List
;
import
java.util.Timer
;
import
jp.odakyu.toiletsignage.activity.MainActivity
;
import
jp.odakyu.toiletsignage.task.UpdateToiletInfoTask
;
import
static
java
.
lang
.
Boolean
.
FALSE
;
import
static
java
.
lang
.
Boolean
.
TRUE
;
/**
* Created by agentec on 2017/12/13.
...
...
@@ -24,18 +27,7 @@ public class ToiletApplication extends Application {
super
.
onCreate
();
}
private
synchronized
void
settingToiletUpdateTimer
()
{
Log
.
i
(
TAG
,
"settingToiletUpdateTimer"
);
if
(
updateToiletInfoTimer
==
null
)
{
Log
.
i
(
TAG
,
"settingToiletUpdateTimer Start"
);
updateToiletInfoTimer
=
new
Timer
();
// スケジュール開始と同時にすぐ新着更新を開始する
int
interval
=
10000
;
//10秒
updateToiletInfoTimer
.
schedule
(
new
UpdateToiletInfoTask
(
this
),
0
,
interval
);
}
}
public
void
stopTimer
()
{
public
synchronized
void
stopTimer
()
{
Log
.
i
(
TAG
,
"stopTimer"
);
if
(
updateToiletInfoTimer
!=
null
)
{
Log
.
i
(
TAG
,
"stopTimer STOP"
);
...
...
@@ -44,23 +36,31 @@ public class ToiletApplication extends Application {
}
}
public
void
startTimer
()
{
settingToiletUpdateTimer
();
public
synchronized
void
startTimer
()
{
Log
.
i
(
TAG
,
"startTimer"
);
if
(
updateToiletInfoTimer
==
null
)
{
Log
.
i
(
TAG
,
"startTimer Start"
);
updateToiletInfoTimer
=
new
Timer
();
// スケジュール開始と同時にすぐ新着更新を開始する
int
interval
=
10000
;
//10秒
updateToiletInfoTimer
.
schedule
(
new
UpdateToiletInfoTask
(
this
),
0
,
interval
);
}
}
public
boolean
isForegr
d
ound
(
Context
context
)
{
public
boolean
isForeground
(
Context
context
)
{
ActivityManager
am
=
(
ActivityManager
)
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
assert
am
!=
null
;
List
<
ActivityManager
.
RunningAppProcessInfo
>
processInfoList
=
am
.
getRunningAppProcesses
();
boolean
isForegr
dound
=
FALSE
;
boolean
isForegr
ound
=
false
;
for
(
ActivityManager
.
RunningAppProcessInfo
info
:
processInfoList
){
if
(
info
.
processName
.
equals
(
getPackageName
())){
if
(
info
.
importance
==
ActivityManager
.
RunningAppProcessInfo
.
IMPORTANCE_FOREGROUND
){
isForegr
dound
=
TRUE
;
isForegr
ound
=
true
;
break
;
// ここにフォアグラウンドの場合の処理を実装
}
}
}
return
isForegr
d
ound
;
return
isForeground
;
}
}
app/src/main/java/jp/odakyu/toiletsignage/connection/ToiletServerConnection.java
View file @
e2ddc8a9
...
...
@@ -3,6 +3,7 @@ package jp.odakyu.toiletsignage.connection;
import
android.util.Base64
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
...
...
@@ -16,10 +17,10 @@ public class ToiletServerConnection {
private
static
final
String
TOILET_INFO_URL
=
"https://odakyu.api.toilet.mono-connect.jp/1/placements/%d/box_summaries_search"
;
private
static
final
String
LOGIN_ID
=
"nh2h2KntNPpgXcqEAtcJxwJd49jNcJ4J"
;
private
static
final
String
PASSWORD
=
"jm2kCd6ZK2EZTzcMgxtge3AC4EeJ4ZqW"
;
private
static
final
int
CONNECTION_TIMEOUT
=
30
*
1000
;
private
static
final
int
READ_TIMEOUT
=
30
*
1000
;
private
static
final
int
CONNECTION_TIMEOUT
=
5
*
1000
;
private
static
final
int
READ_TIMEOUT
=
5
*
1000
;
public
String
connectionToiletServer
(
int
toiletId
)
throws
Exception
{
public
static
String
connectionToiletServer
(
int
toiletId
)
throws
IO
Exception
{
URL
url
=
new
URL
(
String
.
format
(
TOILET_INFO_URL
,
toiletId
));
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
.
setConnectTimeout
(
CONNECTION_TIMEOUT
);
...
...
@@ -39,7 +40,7 @@ public class ToiletServerConnection {
}
final
InputStreamReader
inReader
=
new
InputStreamReader
(
in
,
encoding
);
final
BufferedReader
bufferedReader
=
new
BufferedReader
(
inReader
);
String
line
=
null
;
String
line
;
while
((
line
=
bufferedReader
.
readLine
())
!=
null
)
{
result
.
append
(
line
);
}
...
...
app/src/main/java/jp/odakyu/toiletsignage/constants/ToiletConstants.java
0 → 100644
View file @
e2ddc8a9
package
jp
.
odakyu
.
toiletsignage
.
constants
;
/**
* Created by agentec on 2017/12/14.
*/
public
interface
ToiletConstants
{
String
KEY_ERROR_COUNT
=
"error_count"
;
String
KEY_NETWORK_CONNECT
=
"network_connect"
;
int
VALUE_GET_USB_INFO_SUCCESS
=
0
;
int
VALUE_GET_USB_INFO_VALIDATION_FAIL
=
-
1
;
int
VALUE_GET_USB_INFO_FAIL
=
-
2
;
int
VALUE_TOILET_GATE_TYPE_0
=
0
;
int
VALUE_TOILET_GATE_TYPE_1
=
1
;
int
VALUE_TOILET_GATE_TYPE_3
=
3
;
String
MEIRIO_FONT_NAME
=
"meiryo.ttf"
;
String
MEIRIO_BOLD_FONT_NAME
=
"meiryob.ttf"
;
}
app/src/main/java/jp/odakyu/toiletsignage/file/FileUtil.java
View file @
e2ddc8a9
...
...
@@ -14,10 +14,10 @@ import java.io.InputStreamReader;
public
class
FileUtil
{
private
static
String
convertStreamToString
(
InputStream
is
)
throws
Exception
{
private
static
String
convertStreamToString
(
InputStream
is
)
throws
IO
Exception
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
StringBuilder
sb
=
new
StringBuilder
();
String
line
=
null
;
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
sb
.
append
(
line
).
append
(
"\n"
);
}
...
...
@@ -25,7 +25,7 @@ public class FileUtil {
return
sb
.
toString
();
}
public
static
String
getStringFromFile
(
String
filePath
)
throws
Exception
{
public
static
String
getStringFromFile
(
String
filePath
)
throws
IO
Exception
{
File
fl
=
new
File
(
filePath
);
FileInputStream
fin
=
new
FileInputStream
(
fl
);
String
ret
=
convertStreamToString
(
fin
);
...
...
app/src/main/java/jp/odakyu/toiletsignage/info/ToiletInfo.java
View file @
e2ddc8a9
...
...
@@ -4,8 +4,9 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.Map
;
import
jp.odakyu.toiletsignage.constants.ToiletConstants
;
import
jp.odakyu.toiletsignage.json.ResultToiletJson
;
import
jp.odakyu.toiletsignage.json.ToiletDefaultJson
;
import
jp.odakyu.toiletsignage.json.
USB
ToiletDefaultJson
;
/**
* Created by agentec on 2017/12/11.
...
...
@@ -29,14 +30,13 @@ public class ToiletInfo {
public
static
final
int
MAX_ERROR_COUNT
=
6
;
private
ArrayList
<
ToiletDefaultJson
>
mToiletDefaultJsonArray
;
private
Map
<
Integer
,
ArrayList
<
ResultToiletJson
>>
mResultToiletJsonMap
=
new
HashMap
<
Integer
,
ArrayList
<
ResultToiletJson
>
>();
private
ArrayList
<
USB
ToiletDefaultJson
>
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
)
{
instance
=
new
ToiletInfo
();
...
...
@@ -44,11 +44,11 @@ public class ToiletInfo {
return
instance
;
}
public
void
setToiletDefaultJsonArray
(
ArrayList
<
ToiletDefaultJson
>
defaultToiletJsonArray
)
{
public
void
setToiletDefaultJsonArray
(
ArrayList
<
USB
ToiletDefaultJson
>
defaultToiletJsonArray
)
{
mToiletDefaultJsonArray
=
defaultToiletJsonArray
;
}
public
ArrayList
<
ToiletDefaultJson
>
getToiletDefaultJsonArray
()
{
public
ArrayList
<
USB
ToiletDefaultJson
>
getToiletDefaultJsonArray
()
{
return
mToiletDefaultJsonArray
;
}
...
...
@@ -70,14 +70,14 @@ public class ToiletInfo {
public
int
getToiletSex
()
{
if
(
mToiletDefaultJsonArray
!=
null
&&
mToiletDefaultJsonArray
.
size
()
>
0
)
{
ToiletDefaultJson
toiletDefaultJson
=
mToiletDefaultJsonArray
.
get
(
0
);
USB
ToiletDefaultJson
toiletDefaultJson
=
mToiletDefaultJsonArray
.
get
(
0
);
return
toiletDefaultJson
.
getToiletSex
();
}
return
-
1
;
}
public
int
getVacantCount
(
int
toiletId
)
{
if
(
mResultToiletJsonMap
!=
null
&&
mResultToiletJsonMap
.
size
()
>
0
)
{
if
(
mResultToiletJsonMap
.
size
()
>
0
)
{
ArrayList
<
ResultToiletJson
>
resultToiletJsonArray
=
getResultToiletJsonMap
(
toiletId
);
int
vacantCount
=
0
;
for
(
ResultToiletJson
resultToiletJson:
resultToiletJsonArray
)
{
...
...
@@ -91,11 +91,11 @@ public class ToiletInfo {
}
public
int
getTotalCount
(
int
toiletId
)
{
if
(
mResultToiletJsonMap
!=
null
&&
mResultToiletJsonMap
.
size
()
>
0
)
{
if
(
mResultToiletJsonMap
.
size
()
>
0
)
{
ArrayList
<
ResultToiletJson
>
resultToiletJsonArray
=
getResultToiletJsonMap
(
toiletId
);
return
resultToiletJsonArray
.
size
();
}
return
0
;
return
-
1
;
}
public
void
setValidation
(
boolean
validation
)
{
...
...
@@ -129,4 +129,11 @@ public class ToiletInfo {
public
boolean
getNetworkConnect
()
{
return
isNetworkConnect
;
}
public
int
getToiletGateType
()
{
if
(
mToiletDefaultJsonArray
==
null
)
{
return
ToiletConstants
.
VALUE_TOILET_GATE_TYPE_0
;
}
return
mToiletDefaultJsonArray
.
size
();
}
}
app/src/main/java/jp/odakyu/toiletsignage/json/ToiletDefaultJson.java
→
app/src/main/java/jp/odakyu/toiletsignage/json/
USB
ToiletDefaultJson.java
View file @
e2ddc8a9
...
...
@@ -3,14 +3,13 @@ package jp.odakyu.toiletsignage.json;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
static
java
.
lang
.
Boolean
.
FALSE
;
import
static
java
.
lang
.
Boolean
.
TRUE
;
import
jp.odakyu.toiletsignage.info.ToiletInfo
;
/**
* Created by agentec on 2017/12/08.
*/
public
class
ToiletDefaultJson
{
public
class
USB
ToiletDefaultJson
{
/**
* JSON Param
*/
...
...
@@ -41,7 +40,7 @@ public class ToiletDefaultJson {
}
public
ToiletDefaultJson
(
JSONObject
jsonObject
)
throws
JSONException
{
public
USB
ToiletDefaultJson
(
JSONObject
jsonObject
)
throws
JSONException
{
priority
=
jsonObject
.
getInt
(
KEY_PRIORITY
);
toiletId
=
jsonObject
.
getInt
(
KEY_TOILET_ID
);
toiletSex
=
jsonObject
.
getInt
(
KEY_TOILET_SEX
);
...
...
@@ -57,33 +56,27 @@ public class ToiletDefaultJson {
public
boolean
validation
(
JSONObject
jsonObject
)
{
if
(!
jsonObject
.
has
(
KEY_PRIORITY
))
{
return
FALSE
;
return
false
;
}
if
(!
jsonObject
.
has
(
KEY_TOILET_ID
))
{
return
FALSE
;
return
false
;
}
if
(!
jsonObject
.
has
(
KEY_TOILET_SEX
))
{
return
FALSE
;
return
false
;
}
if
(
getToiletId
()
<
0
||
getToiletId
()
>
1000000
)
{
return
FALSE
;
return
false
;
}
if
(
getToiletSex
()
!=
0
&&
getToiletSex
()
!=
1
)
{
return
FALSE
;
if
(
getToiletSex
()
!=
ToiletInfo
.
VALUE_SEX_MAN
&&
getToiletSex
()
!=
ToiletInfo
.
VALUE_SEX_WOMAN
)
{
return
false
;
}
if
(
getToiletSex
()
!=
0
&&
getToiletSex
()
!=
1
)
{
return
FALSE
;
}
if
(
getPriority
()
!=
0
&&
getPriority
()
!=
1
&&
getPriority
()
!=
2
)
{
return
FALSE
;
}
return
TRUE
;
return
!(
getPriority
()
!=
ToiletInfo
.
VALUE_PRIORITY_MAIN
&&
getPriority
()
!=
ToiletInfo
.
VALUE_PRIORITY_SUB_LEFT
&&
getPriority
()
!=
ToiletInfo
.
VALUE_PRIORITY_SUB_RIGHT
);
}
}
app/src/main/java/jp/odakyu/toiletsignage/logic/MainLogic.java
View file @
e2ddc8a9
...
...
@@ -5,6 +5,7 @@ import android.os.Environment;
import
android.util.Log
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.io.File
;
...
...
@@ -12,11 +13,10 @@ import java.io.IOException;
import
java.util.ArrayList
;
import
java.util.List
;
import
jp.odakyu.toiletsignage.constants.ToiletConstants
;
import
jp.odakyu.toiletsignage.file.FileUtil
;
import
jp.odakyu.toiletsignage.info.ToiletInfo
;
import
jp.odakyu.toiletsignage.json.ToiletDefaultJson
;
import
static
java
.
lang
.
Boolean
.
FALSE
;
import
jp.odakyu.toiletsignage.json.USBToiletDefaultJson
;
/**
* Created by agentec on 2017/12/08.
...
...
@@ -27,7 +27,18 @@ public class MainLogic {
private
static
final
String
KEY_TOILET_ARRAY
=
"toiletArray"
;
private
static
final
String
TAG
=
"MainLogic"
;
public
void
getToiletDefaultInfo
(
Context
context
)
throws
Exception
{
/**
* USBドライブからトイレ情報ファイルを外部ストレージ「Download」フォルダにコピー
* @param context ToiletApplication Context
* @return VALUE_GET_USB_INFO_SUCCESS:成功、
* VALUE_GET_USB_INFO_VALIDATION_FAIL:バリデーションチェック失敗
* VALUE_GET_USB_INFO_FAIL:トイレ情報ファイル取得失敗
*
* @throws IOException Fileオブジェクト取得及びコピー時の例外
* @throws JSONException Json情報取得からの例外
*
*/
public
static
int
getToiletDefaultInfo
(
Context
context
)
throws
IOException
,
JSONException
{
String
[]
rootStorageDirectory
=
getExtSdCardPathsForActivity
(
context
);
File
downloadFilePath
=
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DOWNLOADS
);
...
...
@@ -42,17 +53,17 @@ public class MainLogic {
FileUtil
.
fileCopy
(
jsonFilePath
,
copyFilePath
);
break
;
}
else
{
Log
.
e
(
TAG
,
"usb json file not exists = "
+
jsonFilePath
);
Log
.
w
(
TAG
,
"usb json file not exists = "
+
jsonFilePath
);
}
}
if
(
new
File
(
copyFilePath
).
exists
())
{
JSONObject
jsonObject
=
new
JSONObject
(
FileUtil
.
getStringFromFile
(
copyFilePath
));
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
KEY_TOILET_ARRAY
);
ArrayList
<
ToiletDefaultJson
>
toiletDefaultJsonArray
=
new
ArrayList
<
ToiletDefaultJson
>();
boolean
isValidation
=
FALSE
;
ArrayList
<
USBToiletDefaultJson
>
toiletDefaultJsonArray
=
new
ArrayList
<
>();
boolean
isValidation
=
false
;
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++){
ToiletDefaultJson
toiletDefaultJson
=
new
ToiletDefaultJson
(
jsonArray
.
getJSONObject
(
i
));
USBToiletDefaultJson
toiletDefaultJson
=
new
USB
ToiletDefaultJson
(
jsonArray
.
getJSONObject
(
i
));
isValidation
=
toiletDefaultJson
.
validation
(
jsonArray
.
getJSONObject
(
i
));
if
(
isValidation
)
{
...
...
@@ -61,15 +72,25 @@ public class MainLogic {
break
;
}
}
ToiletInfo
.
getInstance
().
setValidation
(
isValidation
);
if
(
toiletDefaultJsonArray
.
size
()
!=
0
&&
isValidation
)
{
if
(!
isValidation
)
{
return
ToiletConstants
.
VALUE_GET_USB_INFO_VALIDATION_FAIL
;
}
if
(
toiletDefaultJsonArray
.
size
()
!=
0
)
{
ToiletInfo
.
getInstance
().
setToiletDefaultJsonArray
(
toiletDefaultJsonArray
);
}
else
{
return
ToiletConstants
.
VALUE_GET_USB_INFO_FAIL
;
}
}
return
ToiletConstants
.
VALUE_GET_USB_INFO_SUCCESS
;
}
/**
* 外部ストレージのパス情報を取得
* @param context ToiletApplication Context
* @return Storage直下のPath List
*/
private
static
String
[]
getExtSdCardPathsForActivity
(
Context
context
)
{
List
<
String
>
path
s
=
new
ArrayList
<>();
List
<
String
>
path
List
=
new
ArrayList
<>();
for
(
File
file
:
context
.
getExternalFilesDirs
(
"external"
))
{
if
(
file
!=
null
)
{
int
index
=
file
.
getAbsolutePath
().
lastIndexOf
(
"/Android/data"
);
...
...
@@ -78,15 +99,17 @@ public class MainLogic {
}
else
{
String
path
=
file
.
getAbsolutePath
().
substring
(
0
,
index
);
try
{
path
=
new
File
(
path
).
getCanonicalPath
();
String
canonicalPath
=
new
File
(
path
).
getCanonicalPath
();
pathList
.
add
(
canonicalPath
);
}
catch
(
IOException
e
)
{
// Keep non-canonical path.
Log
.
e
(
TAG
,
e
.
getLocalizedMessage
(),
e
);
}
paths
.
add
(
path
);
}
}
}
if
(
path
s
.
isEmpty
())
paths
.
add
(
"/storage/sdcard1"
);
return
path
s
.
toArray
(
new
String
[
0
]);
if
(
path
List
.
isEmpty
())
pathList
.
add
(
"/storage/sdcard1"
);
return
path
List
.
toArray
(
new
String
[
0
]);
}
}
app/src/main/java/jp/odakyu/toiletsignage/receiver/OnBootReceiver.java
0 → 100644
View file @
e2ddc8a9
package
jp
.
odakyu
.
toiletsignage
.
receiver
;
import
android.app.AlarmManager
;
import
android.app.PendingIntent
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.content.res.Resources
;
import
android.util.Log
;
import
java.util.Calendar
;
import
jp.odakyu.toiletsignage.activity.MainActivity
;
/**
* 端末の電源がONしたときに自動的にアプリを起動させるレシーバー
* Created by agentec on 2017/12/18.
*/
public
class
OnBootReceiver
extends
BroadcastReceiver
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
intent
.
getAction
().
equals
(
Intent
.
ACTION_BOOT_COMPLETED
))
{
if
(
intent
!=
null
)
{
Intent
i
=
new
Intent
(
context
,
MainActivity
.
class
);
i
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
context
.
startActivity
(
i
);
}
}
}
}
app/src/main/java/jp/odakyu/toiletsignage/task/UpdateToiletInfoTask.java
View file @
e2ddc8a9
...
...
@@ -8,18 +8,14 @@ import android.util.Log;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
java.util.ArrayList
;
import
java.util.TimerTask
;
import
jp.odakyu.toiletsignage.connection.ToiletServerConnection
;
import
jp.odakyu.toiletsignage.constants.ToiletConstants
;
import
jp.odakyu.toiletsignage.info.ToiletInfo
;
import
jp.odakyu.toiletsignage.json.ResultToiletJson
;
import
jp.odakyu.toiletsignage.json.ToiletDefaultJson
;
import
static
java
.
lang
.
Boolean
.
FALSE
;
import
static
java
.
lang
.
Boolean
.
TRUE
;
import
jp.odakyu.toiletsignage.json.USBToiletDefaultJson
;
/**
* Created by agentec on 2017/12/11.
...
...
@@ -36,33 +32,29 @@ public class UpdateToiletInfoTask extends TimerTask {
toiletInfo
=
ToiletInfo
.
getInstance
();
}
/**
* 実際トイレサーバから10秒ごとに情報を取得するタスク実行
*/
@Override
public
void
run
()
{
Log
.
i
(
TAG
,
"Thread Start"
);
boolean
isNetworkConnect
=
TRUE
;
boolean
isNetworkConnect
=
true
;
//インターネット接続チェック
if
(
isInternetAvailable
()
&&
isNetworkAvailable
(
applicationContext
))
{
ArrayList
<
ToiletDefaultJson
>
toiletInfoArray
=
toiletInfo
.
getToiletDefaultJsonArray
();
boolean
isError
=
FALSE
;
for
(
ToiletDefaultJson
toiletDefaultJson:
toiletInfoArray
)
{
ToiletServerConnection
con
=
new
ToiletServerConnection
();
if
(
isNetworkAvailable
(
applicationContext
))
{
ArrayList
<
USBToiletDefaultJson
>
toiletInfoArray
=
toiletInfo
.
getToiletDefaultJsonArray
();
boolean
isError
=
false
;
for
(
USBToiletDefaultJson
toiletDefaultJson:
toiletInfoArray
)
{
try
{
String
jsonString
=
con
.
connectionToiletServer
(
toiletDefaultJson
.
getToiletId
());
JSONObject
jsonObject
=
new
JSONObject
(
jsonString
);
if
(
jsonObject
==
null
)
{
Log
.
e
(
TAG
,
"json object null jsonString = "
+
jsonString
);
isError
=
TRUE
;
break
;
}
int
code
=
jsonObject
.
getInt
(
ResultToiletJson
.
KEY_CODE
);
if
(
code
!=
200000
)
{
Log
.
e
(
TAG
,
"response code error = "
+
code
);
isError
=
TRUE
;
String
jsonString
=
ToiletServerConnection
.
connectionToiletServer
(
toiletDefaultJson
.
getToiletId
());
if
(
jsonString
==
null
)
{
Log
.
w
(
TAG
,
"json object null jsonString"
);
isError
=
true
;
break
;
}
Log
.
d
(
TAG
,
"jsonString = "
+
jsonString
);
JSONObject
jsonObject
=
new
JSONObject
(
jsonString
);
ArrayList
<
ResultToiletJson
>
resultToiletJsonArray
=
new
ArrayList
<
ResultToiletJson
>();
ArrayList
<
ResultToiletJson
>
resultToiletJsonArray
=
new
ArrayList
<>();
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
ResultToiletJson
.
KEY_RESULT
);
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++){
ResultToiletJson
resultToiletJson
=
new
ResultToiletJson
((
JSONObject
)
jsonArray
.
get
(
i
));
...
...
@@ -70,19 +62,9 @@ public class UpdateToiletInfoTask extends TimerTask {
}
ToiletInfo
.
getInstance
().
setResultToiletJsonMap
(
toiletDefaultJson
.
getToiletId
(),
resultToiletJsonArray
);
if
(
jsonString
==
null
)
{
Log
.
e
(
TAG
,
"response json String null"
);
isError
=
TRUE
;
break
;
}
Log
.
d
(
TAG
,
"jsonString = "
+
jsonString
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
String
stackTrace
=
Log
.
getStackTraceString
(
e
);
Log
.
e
(
TAG
,
stackTrace
);
isError
=
TRUE
;
Log
.
e
(
TAG
,
e
.
getLocalizedMessage
(),
e
);
isError
=
true
;
break
;
}
}
...
...
@@ -93,24 +75,30 @@ public class UpdateToiletInfoTask extends TimerTask {
}
}
else
{
errorCount
++;
isNetworkConnect
=
FALSE
;
isNetworkConnect
=
false
;
}
toiletInfo
.
setConnectErrorCount
(
errorCount
);
toiletInfo
.
setNetworkConnect
(
isNetworkConnect
);
//Broadcast送信
Intent
intent
=
new
Intent
(
"jp.odakyu.toiletsignage.CONNECT_FINISH"
);
Intent
intent
=
new
Intent
(
ToiletInfo
.
NAME_CONNTENT_FINISH
);
intent
.
putExtra
(
ToiletConstants
.
KEY_ERROR_COUNT
,
errorCount
);
intent
.
putExtra
(
ToiletConstants
.
KEY_NETWORK_CONNECT
,
isNetworkConnect
);
applicationContext
.
sendBroadcast
(
intent
);
Log
.
d
(
TAG
,
"Thread End"
);
}
/**
* インターネット(Wifi)チェック
* @param context Application Context
* @return internet check
*/
private
boolean
isNetworkAvailable
(
Context
context
)
{
final
ConnectivityManager
connectivityManager
=
((
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
));
return
connectivityManager
.
getActiveNetworkInfo
()
!=
null
&&
connectivityManager
.
getActiveNetworkInfo
().
isConnected
();
}
/*
//実際「google.com」に影響があるが確認が取れてないので未使用
private boolean isInternetAvailable() {
try {
final InetAddress address = InetAddress.getByName("google.com");
...
...
@@ -121,4 +109,5 @@ public class UpdateToiletInfoTask extends TimerTask {
}
return false;
}
*/
}
app/src/main/res/layout/activity_signage_1.xml
View file @
e2ddc8a9
...
...
@@ -25,7 +25,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"
トイレの空き情報
"
android:text=
"
@string/toilet_vacant_info_jp
"
android:textAlignment=
"textEnd"
android:textColor=
"#746661"
android:textSize=
"53sp"
...
...
@@ -36,7 +36,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1.07"
android:text=
"
Toilets Vacancy
"
android:text=
"
@string/toilet_vacant_info_en
"
android:textAlignment=
"textStart"
android:textColor=
"#746661"
android:textSize=
"40sp"
/>
...
...
@@ -59,7 +59,7 @@
android:id=
"@+id/statusIconImageView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_to
Lef
tOf=
"@id/sexualityIconImageView"
android:layout_to
Star
tOf=
"@id/sexualityIconImageView"
android:layout_centerVertical=
"true"
app:srcCompat=
"@drawable/icon_empty_1"
/>
...
...
@@ -75,7 +75,7 @@
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_to
Right
Of=
"@id/sexualityIconImageView"
android:layout_to
End
Of=
"@id/sexualityIconImageView"
android:layout_centerVertical=
"true"
android:orientation=
"vertical"
>
...
...
@@ -95,7 +95,7 @@
android:id=
"@+id/vacantTitleJPTextView"
android:layout_width=
"150dp"
android:layout_height=
"wrap_content"
android:text=
"
空き
"
android:text=
"
@string/vacant_jp
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
...
...
@@ -105,7 +105,7 @@
android:id=
"@+id/vacantTitleENTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"
VACANT
"
android:text=
"
@string/total_en
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"30sp"
...
...
@@ -121,7 +121,6 @@
android:layout_marginStart=
"35dp"
android:background=
"@drawable/textview_count_border"
android:gravity=
"center"
android:text=
"1"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
/>
...
...
@@ -159,7 +158,7 @@
android:id=
"@+id/totalTitleJPTextView"
android:layout_width=
"150dp"
android:layout_height=
"wrap_content"
android:text=
"
総数
"
android:text=
"
@string/total_jp
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
...
...
@@ -169,7 +168,7 @@
android:id=
"@+id/totalTitleENTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"
TOTAL
"
android:text=
"
@string/total_en
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"30sp"
...
...
@@ -183,7 +182,6 @@
android:layout_marginStart=
"35dp"
android:background=
"@drawable/textview_count_border"
android:gravity=
"center"
android:text=
"11"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
/>
...
...
app/src/main/res/layout/activity_signage_3.xml
View file @
e2ddc8a9
...
...
@@ -25,7 +25,7 @@
android:layout_weight=
"1"
android:paddingBottom=
"2dp"
android:paddingTop=
"20dp"
android:text=
"
トイレの空き情報
"
android:text=
"
@string/toilet_vacant_info_jp
"
android:textAlignment=
"textEnd"
android:textColor=
"#746661"
android:textSize=
"52sp"
...
...
@@ -38,7 +38,7 @@
android:layout_weight=
"1.05"
android:paddingBottom=
"2dp"
android:paddingTop=
"20dp"
android:text=
"
Toilets Vacancy
"
android:text=
"
@string/toilet_vacant_info_en
"
android:textAlignment=
"viewStart"
android:textColor=
"#746661"
android:textSize=
"40sp"
/>
...
...
@@ -99,7 +99,7 @@
android:id=
"@+id/vacantTitleJPTextView"
android:layout_width=
"150dp"
android:layout_height=
"wrap_content"
android:text=
"
空き
"
android:text=
"
@string/vacant_jp
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
...
...
@@ -109,7 +109,7 @@
android:id=
"@+id/vacantTitleENTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"
VACANT
"
android:text=
"
@string/vacant_en
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"30sp"
...
...
@@ -125,7 +125,6 @@
android:layout_marginEnd=
"40dp"
android:background=
"@drawable/textview_count_border"
android:gravity=
"center"
android:text=
"1"
android:textColor=
"#746661"
android:textAlignment=
"center"
android:textSize=
"50sp"
/>
...
...
@@ -159,7 +158,7 @@
android:id=
"@+id/totalTitleJPTextView"
android:layout_width=
"150dp"
android:layout_height=
"wrap_content"
android:text=
"
総数
"
android:text=
"
@string/total_jp
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
...
...
@@ -169,7 +168,7 @@
android:id=
"@+id/totalTitleENTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"
TOTAL
"
android:text=
"
@string/total_en
"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"30sp"
...
...
@@ -183,7 +182,6 @@
android:layout_marginStart=
"35dp"
android:background=
"@drawable/textview_count_border"
android:gravity=
"center"
android:text=
"11"
android:textAlignment=
"center"
android:textColor=
"#746661"
android:textSize=
"50sp"
/>
...
...
@@ -211,7 +209,7 @@
android:layout_marginBottom=
"1dp"
android:layout_marginTop=
"20dp"
android:layout_weight=
"1"
android:text=
"
お近くのトイレ情報
"
android:text=
"
@string/near_toilet_info_jp
"
android:textAlignment=
"textEnd"
android:textColor=
"@android:color/white"
android:textSize=
"41sp"
...
...
@@ -224,7 +222,7 @@
android:layout_marginBottom=
"1dp"
android:layout_marginTop=
"20dp"
android:layout_weight=
"1"
android:text=
"
Other Toilets Nearby
"
android:text=
"
@string/near_toilet_info_en
"
android:textAlignment=
"textStart"
android:textColor=
"@android:color/white"
android:textSize=
"35sp"
/>
...
...
@@ -261,17 +259,22 @@
android:id=
"@+id/leftGateNameJPTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"西口地下改札外"
android:ellipsize=
"end"
android:singleLine=
"true"
android:text=
"@string/left_toilet_info_jp"
android:textAlignment=
"center"
android:textColor=
"@android:color/white"
android:textSize=
"40sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/leftGateNameENTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"The West Underground Gate(Outside)"
android:ellipsize=
"end"
android:singleLine=
"true"
android:text=
"@string/left_toilet_info_en"
android:textAlignment=
"center"
android:textColor=
"@android:color/white"
android:textSize=
"25sp"
/>
...
...
@@ -290,7 +293,7 @@
android:id=
"@+id/separator4"
android:layout_width=
"3dip"
android:layout_height=
"match_parent"
android:layout_marginStart=
"
2
0dp"
android:layout_marginStart=
"
1
0dp"
android:layout_marginTop=
"15dp"
android:layout_marginBottom=
"15dp"
android:background=
"#FFFFFF"
/>
...
...
@@ -315,8 +318,9 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:singleLine=
"true"
android:maxLines=
"1"
android:text=
"
南口改札内
"
android:text=
"
@string/right_toilet_info_jp
"
android:textAlignment=
"center"
android:textColor=
"@android:color/white"
android:textSize=
"40sp"
...
...
@@ -326,7 +330,9 @@
android:id=
"@+id/rightGateNameENTextView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"The South Gate(Inside)"
android:ellipsize=
"end"
android:singleLine=
"true"
android:text=
"@string/right_toilet_info_en"
android:textAlignment=
"center"
android:textColor=
"@android:color/white"
android:textSize=
"25sp"
/>
...
...
app/src/main/res/values/strings.xml
View file @
e2ddc8a9
...
...
@@ -2,4 +2,19 @@
<string
name=
"initDisplayString"
>
ご利用ありがとうございます。\nThank you.
</string>
<string
name=
"initDisplayStringError"
>
ご利用ありがとうございます。(%1$d)\nThank you.
</string>
<string
name=
"toilet_background_image"
>
toilet background image
</string>
<string
name=
"toilet_vacant_info_jp"
>
トイレの空き情報
</string>
<string
name=
"toilet_vacant_info_en"
>
Toilets Vacancy
</string>
<string
name=
"vacant_jp"
>
空き
</string>
<string
name=
"vacant_en"
>
VACANT
</string>
<string
name=
"total_jp"
>
総数
</string>
<string
name=
"total_en"
>
TOTAL
</string>
<string
name=
"near_toilet_info_jp"
>
お近くのトイレ情報
</string>
<string
name=
"near_toilet_info_en"
>
Other Toilets Nearby
</string>
<string
name=
"left_toilet_info_jp"
>
西口地下改札外
</string>
<string
name=
"left_toilet_info_en"
>
The West Underground Gate(Outside)
</string>
<string
name=
"right_toilet_info_jp"
>
南口改札内
</string>
<string
name=
"right_toilet_info_en"
>
The South Gate(Inside)
</string>
</resources>
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