Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7dd53d0d
authored
Mar 09, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on
#63
and
#64
parent
e135bf24
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
54 additions
and
79 deletions
android/Pictogram/build.gradle
android/Pictogram/commonlibrary/build.gradle
android/Pictogram/commonlibrary/src/main/AndroidManifest.xml
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/tts/TTSHelper.java
android/Pictogram/gradle/wrapper/gradle-wrapper.properties
android/Pictogram/supervisor_tablet/build.gradle
android/Pictogram/supervisor_tablet/src/main/AndroidManifest.xml
android/Pictogram/supervisor_tablet/src/main/java/com/yottacode/pictogram/supervisor_tablet/gui/Supervisor_SerialActivity.java
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
android/Pictogram/tabletlibrary/build.gradle
android/Pictogram/tabletlibrary/src/main/AndroidManifest.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/StartAtBootReceiver.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/LoginActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/MainActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/SerialActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/net/NetServiceTablet.java
android/Pictogram/tabletlibrary/tabletlibrary.iml
android/Pictogram/yotta_tablet/build.gradle
android/Pictogram/yotta_tablet/src/main/AndroidManifest.xml
android/Pictogram/yotta_tablet/src/main/java/com/yottacode/pictogram/yotta_tablet/kiosk/BootReceiver.java
android/Pictogram/yotta_tablet/yotta_tablet.iml
android/Pictogram/build.gradle
View file @
7dd53d0d
...
...
@@ -5,7 +5,7 @@ buildscript {
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.
2.3
'
classpath
'com.android.tools.build:gradle:2.
3.0
'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
...
...
android/Pictogram/commonlibrary/build.gradle
View file @
7dd53d0d
...
...
@@ -11,7 +11,7 @@ android {
versionName
"1.0"
resValue
"string"
,
"db_name"
,
"PCB.db"
resValue
"integer"
,
"db_version"
,
"4"
resValue
"string"
,
"app_version"
,
"1.
0
"
resValue
"string"
,
"app_version"
,
"1.
1
"
resValue
"string"
,
"core_vocabulary"
,
"core_vocabulary"
resValue
"string"
,
"apk"
,
"to_be_set_in_subproject"
}
...
...
android/Pictogram/commonlibrary/src/main/AndroidManifest.xml
View file @
7dd53d0d
...
...
@@ -5,7 +5,6 @@
android:allowBackup=
"true"
android:label=
"@string/app_name"
android:supportsRtl=
"true"
>
</application>
</manifest>
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/tts/TTSHelper.java
View file @
7dd53d0d
...
...
@@ -138,6 +138,6 @@ public class TTSHelper {
Bundle
params
=
new
Bundle
();
params
.
putString
(
TextToSpeech
.
Engine
.
KEY_PARAM_VOLUME
,
"1"
);
params
.
putString
(
TextToSpeech
.
Engine
.
KEY_PARAM_UTTERANCE_ID
,
"TAPE_READ"
);
ttobj
.
speak
(
input
,
TextToSpeech
.
QUEUE_FLUSH
,
params
,
"TAPE_READ"
);
//
ttobj.speak(input, TextToSpeech.QUEUE_FLUSH, params, "TAPE_READ");
}
}
android/Pictogram/gradle/wrapper/gradle-wrapper.properties
View file @
7dd53d0d
#
Sun Jan 15 10:11:11
CET 2017
#
Mon Mar 06 08:10:53
CET 2017
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-3.
2
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-3.
3
-all.zip
android/Pictogram/supervisor_tablet/build.gradle
View file @
7dd53d0d
...
...
@@ -18,7 +18,7 @@ android {
targetSdkVersion
22
versionCode
1
versionName
"1.0"
resValue
"
string"
,
"SerialClass"
,
"com.yottacode.pictogram.supervisor_tablet.gui.Supervisor_SerialActivity
"
resValue
"
bool"
,
"NotifyAllwaysVisible"
,
"false
"
resValue
"string"
,
"apk"
,
"pictograms.apk"
// signingConfig signingConfigs.config
}
...
...
android/Pictogram/supervisor_tablet/src/main/AndroidManifest.xml
View file @
7dd53d0d
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.yottacode.pictogram.supervisor_tablet"
>
<!-- The app has the permission to receive the RECEIVE_BOOT_COMPLETED broadcast -->
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<!-- For kiosk mode -->
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<!-- For the service that restarts the app when another app go to foreground -->
...
...
@@ -20,6 +19,7 @@
<uses-permission
android:name=
"android.permission.READ_CONTACTS"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.READ_CALL_LOG"
/>
<application
android:allowBackup=
"true"
android:icon=
"@drawable/ic_launcher"
...
...
@@ -40,7 +40,7 @@
android:label=
"@string/app_name"
android:screenOrientation=
"landscape"
/>
<activity
android:name=
"
.gui.Supervisor_
SerialActivity"
android:name=
"
com.yottacode.pictogram.tabletlibrary.gui.login.
SerialActivity"
android:label=
"@string/title_activity_serial"
android:screenOrientation=
"landscape"
/>
<activity
...
...
android/Pictogram/supervisor_tablet/src/main/java/com/yottacode/pictogram/supervisor_tablet/gui/Supervisor_SerialActivity.java
deleted
100644 → 0
View file @
e135bf24
package
com
.
yottacode
.
pictogram
.
supervisor_tablet
.
gui
;
import
android.app.Activity
;
import
com.yottacode.pictogram.supervisor_tablet.R
;
import
com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity
;
import
com.yottacode.tools.GUITools
;
/**
* Created by Fernando on 21/11/2016.
*/
public
final
class
Supervisor_SerialActivity
extends
SerialActivity
{
@Override
protected
boolean
is_legal_user
(
String
user_name
,
Activity
activity
)
{
boolean
legal_user
=
com
.
yottacode
.
pictogram
.
dao
.
UserLogin
.
isSupervisorLoginPattern
(
user_name
);
if
(!
legal_user
)
GUITools
.
show_alert
(
activity
,
R
.
string
.
ilegal_user
,
user_name
);
return
legal_user
;
}
}
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
View file @
7dd53d0d
This diff is collapsed.
Click to expand it.
android/Pictogram/tabletlibrary/build.gradle
View file @
7dd53d0d
...
...
@@ -8,7 +8,7 @@ android {
targetSdkVersion
22
versionCode
1
versionName
"1.0"
resValue
"
string"
,
"SerialClass"
,
"com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity
"
resValue
"
bool"
,
"NotifyAllwaysVisible"
,
"false
"
resValue
"integer"
,
"rows"
,
"5"
resValue
"integer"
,
"columns"
,
"10"
resValue
"integer"
,
"rows_big"
,
"4"
...
...
android/Pictogram/tabletlibrary/src/main/AndroidManifest.xml
View file @
7dd53d0d
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.yottacode.pictogram.tabletlibrary"
>
<application
android:allowBackup=
"true"
android:label=
"@string/app_name"
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/StartAtBootReceiver.java
0 → 100644
View file @
7dd53d0d
package
com
.
yottacode
.
pictogram
.
tabletlibrary
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.util.Log
;
/**
* Created by Fernando on 09/03/2017.
*/
public
class
StartAtBootReceiver
extends
BroadcastReceiver
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
Intent
.
ACTION_BOOT_COMPLETED
.
equals
(
intent
.
getAction
()))
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
"Starting Pictogram Tablet when boot"
);
Intent
appIntent
=
new
Intent
(
context
,
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
context
.
startActivity
(
appIntent
,
null
);
}
}
}
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/communicator/PictogramActivity.java
View file @
7dd53d0d
...
...
@@ -52,7 +52,6 @@ import com.yottacode.pictogram.net.websockets.ActionTalk;
import
com.yottacode.pictogram.net.websockets.VocabularyTalk
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.EditPictoActivity
;
import
com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity
;
import
com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity
;
import
com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet
;
import
com.yottacode.pictogram.tools.Img
;
...
...
@@ -1011,14 +1010,7 @@ protected void showOnlyTape(boolean onlyTape) {
e
.
printStackTrace
();
}
}
Class
serialClass
;
try
{
serialClass
=
Class
.
forName
(
getString
(
R
.
string
.
SerialClass
));
}
catch
(
ClassNotFoundException
e
)
{
Log
.
e
(
this
.
getClass
().
getCanonicalName
(),
"S:"
+
getString
(
R
.
string
.
SerialClass
));
serialClass
=
SerialActivity
.
class
;
}
Intent
serialActivity
=
new
Intent
(
getBaseContext
(),
serialClass
);
Intent
serialActivity
=
new
Intent
(
getBaseContext
(),
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
if
(
lastUserName
!=
null
)
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
"Switch user to "
+
lastUserName
);
serialActivity
.
putExtra
(
"switch_usr"
,
lastUserName
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/LoginActivity.java
View file @
7dd53d0d
...
...
@@ -51,14 +51,8 @@ public class LoginActivity extends FragmentActivity {
logoutButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
Class
serialClass
;
try
{
serialClass
=
Class
.
forName
(
getString
(
R
.
string
.
SerialClass
));
}
catch
(
ClassNotFoundException
e
)
{
Log
.
e
(
this
.
getClass
().
getCanonicalName
(),
"S:"
+
getString
(
R
.
string
.
SerialClass
));
serialClass
=
SerialActivity
.
class
;
}
Intent
serialActivity
=
new
Intent
(
getBaseContext
(),
serialClass
);
Intent
serialActivity
=
new
Intent
(
getBaseContext
(),
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
serialActivity
.
putExtra
(
"resetPrevUser"
,
true
);
startActivity
(
serialActivity
);
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/MainActivity.java
View file @
7dd53d0d
...
...
@@ -25,14 +25,7 @@ public class MainActivity extends Activity {
// For deactivating the lock screen (just before setContentView)
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DISMISS_KEYGUARD
);
Class
serialClass
;
try
{
serialClass
=
Class
.
forName
(
getString
(
R
.
string
.
SerialClass
));
}
catch
(
ClassNotFoundException
e
)
{
Log
.
e
(
this
.
getClass
().
getCanonicalName
(),
"S:"
+
getString
(
R
.
string
.
SerialClass
));
serialClass
=
SerialActivity
.
class
;
}
Intent
serialActivity
=
new
Intent
(
this
,
serialClass
);
Intent
serialActivity
=
new
Intent
(
this
,
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
serialActivity
.
putExtra
(
"resetPrevUser"
,
false
);
startActivity
(
serialActivity
);
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/SerialActivity.java
View file @
7dd53d0d
...
...
@@ -43,7 +43,6 @@ public class SerialActivity extends Activity {
LinearLayout
stuList
;
LinearLayout
supList
;
protected
boolean
is_legal_user
(
String
user_name
,
Activity
activity
)
{
return
true
;}
/**
* Return the default user+pwd when login.The policy is
...
...
@@ -155,7 +154,7 @@ public class SerialActivity extends Activity {
@Override
public
void
onClick
(
View
view
)
{
String
username
=
mSerialViewMail
.
getText
().
toString
();
if
(
is_legal_user
(
username
,
SerialActivity
.
this
))
{
String
password
=
mSerialViewPass
.
getText
().
toString
();
SharedPreferences
settings
=
getSharedPreferences
(
PREFS_NAME
,
0
);
SharedPreferences
.
Editor
editor
=
settings
.
edit
();
...
...
@@ -164,7 +163,7 @@ public class SerialActivity extends Activity {
editor
.
commit
();
if
(!
username
.
equals
(
""
)
&&
!
password
.
equals
(
""
))
new
UserLogin
().
login
(
username
,
password
,
SerialActivity
.
this
,
PictogramActivity
.
class
,
LoginActivity
.
class
);
}
}
});
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/net/NetServiceTablet.java
View file @
7dd53d0d
...
...
@@ -13,7 +13,6 @@ import com.yottacode.pictogram.dao.User;
import
com.yottacode.pictogram.net.NetService
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tabletlibrary.gui.communicator.PictogramActivity
;
import
com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity
;
import
com.yottacode.pictogram.tools.PCBcontext
;
/**
...
...
@@ -36,10 +35,12 @@ public class NetServiceTablet implements NetService.iNetServiceDevice {
TaskStackBuilder
stackBuilder
=
TaskStackBuilder
.
create
(
PCBcontext
.
getContext
());
stackBuilder
.
addParentStack
(
PictogramActivity
.
class
);
stackBuilder
.
addNextIntent
(
resultIntent
);
if
(
PCBcontext
.
getContext
().
getResources
().
getBoolean
(
R
.
bool
.
NotifyAllwaysVisible
)){
PendingIntent
resultPendingIntent
=
stackBuilder
.
getPendingIntent
(
0
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
builder
.
setContentIntent
(
resultPendingIntent
);
}
}
public
void
notifyStatus
(
boolean
updated
)
{
String
user
=
""
;
...
...
@@ -78,13 +79,7 @@ public class NetServiceTablet implements NetService.iNetServiceDevice {
Log
.
i
(
LOG_TAG
,
"App restarting"
);
Context
context
=
activity
.
getBaseContext
();
Class
serialClass
;
try
{
serialClass
=
Class
.
forName
(
context
.
getString
(
R
.
string
.
SerialClass
));
}
catch
(
ClassNotFoundException
e
)
{
Log
.
e
(
LOG_TAG
,
"S:"
+
PCBcontext
.
getContext
().
getString
(
R
.
string
.
SerialClass
));
serialClass
=
SerialActivity
.
class
;
}
Intent
serialActivity
=
new
Intent
(
context
,
serialClass
);
Intent
serialActivity
=
new
Intent
(
context
,
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
serialActivity
.
putExtra
(
"resetPrevUser"
,
false
);
serialActivity
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
context
.
startActivity
(
serialActivity
);
...
...
@@ -97,14 +92,7 @@ public class NetServiceTablet implements NetService.iNetServiceDevice {
Context
context
=
PCBcontext
.
getContext
();
Class
serialClass
;
try
{
serialClass
=
Class
.
forName
(
PCBcontext
.
getContext
().
getString
(
R
.
string
.
SerialClass
));
}
catch
(
ClassNotFoundException
e
)
{
Log
.
e
(
LOG_TAG
,
"S:"
+
PCBcontext
.
getContext
().
getString
(
R
.
string
.
SerialClass
));
serialClass
=
SerialActivity
.
class
;
}
Intent
serialActivity
=
new
Intent
(
context
,
serialClass
);
Intent
serialActivity
=
new
Intent
(
context
,
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
login
.
SerialActivity
.
class
);
serialActivity
.
putExtra
(
"resetPrevUser"
,
direct_login
);
context
.
startActivity
(
serialActivity
);
...
...
android/Pictogram/tabletlibrary/tabletlibrary.iml
View file @
7dd53d0d
This diff is collapsed.
Click to expand it.
android/Pictogram/yotta_tablet/build.gradle
View file @
7dd53d0d
...
...
@@ -20,6 +20,7 @@ android {
versionName
"1.0"
resValue
"string"
,
"SerialClass"
,
"com.yottacode.pictogram.tabletlibrary.gui.login.SerialActivity"
resValue
"string"
,
"apk"
,
"pictogram.apk"
resValue
"bool"
,
"NotifyAllwaysVisible"
,
"true"
// signingConfig signingConfigs.config
}
productFlavors
{
...
...
android/Pictogram/yotta_tablet/src/main/AndroidManifest.xml
View file @
7dd53d0d
...
...
@@ -56,7 +56,8 @@
android:launchMode=
"singleTop"
android:screenOrientation=
"landscape"
/>
<!-- Intent Filter to run the app when the boot is completed -->
<receiver
android:name=
".kiosk.BootReceiver"
>
<receiver
android:name=
".kiosk.BootReceiver"
android:label=
"BootReceiver"
>
<intent-filter>
<action
android:name=
"android.intent.action.BOOT_COMPLETED"
/>
</intent-filter>
...
...
@@ -64,7 +65,11 @@
<!-- Service for restarting the app when another app go to foreground -->
<service
android:name=
".kiosk.KioskService"
android:exported=
"false"
/>
android:exported=
"false"
>
<intent-filter>
<action
android:name=
"com.yottacode.pictogram.yotta_tablet.kiosk.KioskService"
/>
</intent-filter>
</service>
<activity
android:name=
"com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity"
...
...
android/Pictogram/yotta_tablet/src/main/java/com/yottacode/pictogram/yotta_tablet/kiosk/BootReceiver.java
View file @
7dd53d0d
...
...
@@ -18,8 +18,10 @@ public class BootReceiver extends BroadcastReceiver {
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
Intent
.
ACTION_BOOT_COMPLETED
.
equals
(
intent
.
getAction
()))
{
Intent
myIntent
=
new
Intent
(
context
,
MainActivity
.
class
);
myIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
context
.
startActivity
(
myIntent
);
}
}
}
android/Pictogram/yotta_tablet/yotta_tablet.iml
View file @
7dd53d0d
This diff is collapsed.
Click to expand it.
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