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
70383978
authored
Jan 02, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issues #740 y #741 cerrados
parent
d034abc7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
95 additions
and
29 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/net/RestapiWrapper.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/PictoUploader.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/tools/BitmapTools.java
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/ListInstructionsFragment.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/SessionActivity.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/SessionFragment.java
android/Pictogram/tabletlibrary/src/main/res/anim/leftin.xml
android/Pictogram/tabletlibrary/src/main/res/anim/leftout.xml
android/Pictogram/tabletlibrary/src/main/res/anim/rightin.xml
android/Pictogram/tabletlibrary/src/main/res/anim/rightout.xml
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/session_model.png
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/session_spontaneous.png
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/session_supervised.png
android/Pictogram/tabletlibrary/tabletlibrary.iml
android/Pictogram/yotta_tablet/yotta_tablet.iml
android/Pictogram/commonlibrary/src/main/java/com/yottacode/net/RestapiWrapper.java
View file @
70383978
...
...
@@ -15,6 +15,7 @@ import java.io.InputStreamReader;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.net.UnknownHostException
;
import
java.nio.charset.Charset
;
import
java.util.Hashtable
;
import
javax.net.ssl.HttpsURLConnection
;
...
...
@@ -195,7 +196,9 @@ public class RestapiWrapper {
if
(
json_params
)
{
urlConnection
.
setRequestProperty
(
"Content-Type"
,
"application/json;charset=utf-8"
);
urlConnection
.
setRequestProperty
(
"Accept"
,
"application/json, text/plain, */*"
);
}
}
else
urlConnection
.
setRequestProperty
(
"Content-Type"
,
"application/x-www-form-urlencoded; charset=utf-8"
);
String
sparams
;
if
(
json_params
)
{
sparams
=
params
.
get
(
"json"
);
...
...
@@ -216,7 +219,7 @@ public class RestapiWrapper {
//Send request
DataOutputStream
wr
=
new
DataOutputStream
(
urlConnection
.
getOutputStream
());
wr
.
write
Bytes
(
sparams
);
wr
.
write
(
sparams
.
getBytes
(
Charset
.
forName
(
"UTF-8"
))
);
wr
.
flush
();
wr
.
close
();
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
70383978
...
...
@@ -148,9 +148,9 @@ public class Vocabulary implements Iterable<Picto> {
public
void
synchronize
()
{
synchronize_upload
();
synchronize_upload
();
// (i) uploading
//
download
//
and (ii) downloading
final
String
picto_str
=
"/pictos"
;
String
operation
=
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_restapi_operation_stu
()+
picto_str
;
PCBcontext
.
getRestapiWrapper
().
ask
(
operation
,
new
RestapiWrapper
.
iRestapiListener
()
{
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/PictoUploader.java
View file @
70383978
...
...
@@ -156,7 +156,9 @@ public class PictoUploader {
params
.
put
(
"picto"
,
Integer
.
toString
(
id_picto
));
params
.
put
(
"lang"
,
PCBcontext
.
getPcbdb
().
getCurrentUser
().
get_lang_stu
());
params
.
put
(
"text"
,
picto
.
get_translation
());
PCBcontext
.
getRestapiWrapper
().
ask
(
"picto/exp"
,
params
,
"post"
,
new
RestapiWrapper
.
iRestapiListener
()
{
Log
.
i
(
this
.
getClass
().
getCanonicalName
(),
"Uploading translation: "
+
picto
.
get_translation
());
PCBcontext
.
getRestapiWrapper
().
ask
(
"picto/exp"
,
params
,
"post"
,
new
RestapiWrapper
.
iRestapiListener
()
{
@Override
public
void
preExecute
()
{
}
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/tools/BitmapTools.java
View file @
70383978
...
...
@@ -49,9 +49,9 @@ public class BitmapTools {
return
resize
(
width
,
height
);
}
public
BitmapTools
paintSquare
(
int
thickness
,
int
color
)
{
for
(
int
i
=
0
;
i
<
this
.
bitmap
.
getWidth
();
i
+
+
)
for
(
int
t
=
1
;
t
<=
thickness
;
t
+
+
)
{
public
BitmapTools
paintSquare
(
int
thickness
,
int
color
,
int
step
)
{
for
(
int
i
=
0
;
i
<
this
.
bitmap
.
getWidth
();
i
+
=
step
)
for
(
int
t
=
1
;
t
<=
thickness
;
t
+
=
step
)
{
this
.
bitmap
.
setPixel
(
i
,
0
+
t
-
1
,
color
);
this
.
bitmap
.
setPixel
(
i
,
this
.
bitmap
.
getHeight
()
-
t
,
color
);
}
...
...
@@ -138,10 +138,23 @@ public class BitmapTools {
}
public
void
disableBitmap
()
{
public
BitmapTools
disableBitmap
()
{
Canvas
canvas
=
new
Canvas
(
bitmap
);
Paint
alphaPaint
=
new
Paint
();
alphaPaint
.
setAlpha
(
30
);
canvas
.
drawBitmap
(
bitmap
,
0
,
0
,
alphaPaint
);
return
this
;
}
public
BitmapTools
paintPause
(
)
{
int
thickness
=
8
;
int
color
=
Color
.
DKGRAY
;
for
(
int
i
=
this
.
bitmap
.
getWidth
()/
2
;
i
<
this
.
bitmap
.
getWidth
()/
2
+
thickness
;
i
++)
for
(
int
t
=
this
.
bitmap
.
getHeight
()/
8
;
t
<=
this
.
bitmap
.
getHeight
()-
this
.
bitmap
.
getHeight
()/
8
;
t
++)
{
this
.
bitmap
.
setPixel
(
i
-
8
,
t
,
color
);
this
.
bitmap
.
setPixel
(
i
+
8
,
t
,
color
);
}
return
this
;
}
}
android/Pictogram/supervisor_tablet/supervisor_tablet.iml
View file @
70383978
This diff is collapsed.
Click to expand it.
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/PictogramActivity.java
View file @
70383978
...
...
@@ -1056,7 +1056,8 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public
void
saved
(
Picto
localPicto
)
{
PictogramActivity
.
this
.
refresh
();
try
{
new
PictoUploader
(
localPicto
).
upload
(
PictogramActivity
.
this
);
if
(
PCBcontext
.
is_user_online
())
new
PictoUploader
(
localPicto
).
upload
(
PictogramActivity
.
this
);
}
catch
(
IOException
e
)
{
Log
.
e
(
Vocabulary
.
class
.
getCanonicalName
(),
e
.
getMessage
());
}
...
...
@@ -1139,6 +1140,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
Intent
sessionActivity
=
new
Intent
(
this
,
SessionActivity
.
class
);
sessionActivity
.
setFlags
(
Intent
.
FLAG_ACTIVITY_REORDER_TO_FRONT
);
startActivity
(
sessionActivity
);
overridePendingTransition
(
R
.
anim
.
leftin
,
R
.
anim
.
leftout
);
}
}
break
;
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/ListInstructionsFragment.java
View file @
70383978
...
...
@@ -95,7 +95,6 @@ public class ListInstructionsFragment extends Fragment{
GUITools
.
show_alert
(
PCBcontext
.
getContext
(),
R
.
string
.
session_error
,
error
);
}
});
progressDialog
=
ProgressDialog
.
show
(
getActivity
(),
getString
(
R
.
string
.
session_instruction
),
getString
(
R
.
string
.
session_loading
));
}
else
initAdapters
();
...
...
@@ -104,6 +103,7 @@ public class ListInstructionsFragment extends Fragment{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_instructions_session
,
container
,
false
);
progressDialog
=
ProgressDialog
.
show
(
getActivity
(),
getString
(
R
.
string
.
session_instruction
),
getString
(
R
.
string
.
session_loading
));
checkStudent
();
initMethods
(
view
);
initInstructions
(
view
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/SessionActivity.java
View file @
70383978
...
...
@@ -223,9 +223,10 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
break
;
case
MotionEvent
.
ACTION_MOVE
:
if
(
event
.
getX
()>
firstTouchX
+
100
)
{
if
(
firstTouchX
>
event
.
getX
()
+
100
)
{
Intent
pictogramActivity
=
new
Intent
(
this
,
PictogramActivity
.
class
);
startActivity
(
pictogramActivity
);
overridePendingTransition
(
R
.
anim
.
leftin
,
R
.
anim
.
leftout
);
}
break
;
case
MotionEvent
.
ACTION_UP
:
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/SessionFragment.java
View file @
70383978
...
...
@@ -3,6 +3,7 @@ package com.yottacode.pictogram.tabletlibrary.gui.session;
import
android.app.Activity
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.view.LayoutInflater
;
...
...
@@ -117,7 +118,7 @@ public class SessionFragment extends Fragment implements ActionTalk.iActionListe
if
(
paused
)
{
bmp
=
bmp
.
copy
(
bmp
.
getConfig
(),
true
);
new
BitmapTools
(
bmp
).
disableBitmap
();
new
BitmapTools
(
bmp
).
paintPause
();
}
this
.
adapter_pictomsg
.
addItem
(
bmp
,
picto
.
get_translation
());
getActivity
().
runOnUiThread
(
new
Runnable
()
{
...
...
android/Pictogram/tabletlibrary/src/main/res/anim/leftin.xml
0 → 100644
View file @
70383978
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shareInterpolator=
"false"
>
<translate
android:duration=
"500"
android:fromXDelta=
"100%p"
android:toXDelta=
"0"
android:interpolator=
"@android:anim/linear_interpolator"
/>
</set>
android/Pictogram/tabletlibrary/src/main/res/anim/leftout.xml
0 → 100644
View file @
70383978
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shareInterpolator=
"false"
>
<translate
android:duration=
"500"
android:fromXDelta=
"0"
android:toXDelta=
"-100%p"
android:interpolator=
"@android:anim/linear_interpolator"
/>
</set>
android/Pictogram/tabletlibrary/src/main/res/anim/rightin.xml
0 → 100644
View file @
70383978
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shareInterpolator=
"false"
>
<translate
android:duration=
"500"
android:fromXDelta=
"100%"
android:toXDelta=
"0%"
android:fromYDelta=
"0%"
android:toYDelta=
"0%"
android:interpolator=
"@android:anim/linear_interpolator"
/>
</set>
android/Pictogram/tabletlibrary/src/main/res/anim/rightout.xml
0 → 100644
View file @
70383978
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shareInterpolator=
"false"
>
<translate
android:duration=
"500"
android:fromXDelta=
"0%"
android:toXDelta=
"-100%"
android:fromYDelta=
"0%"
android:toYDelta=
"0%"
android:interpolator=
"@android:anim/linear_interpolator"
/>
</set>
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/session_model.png
0 → 100644
View file @
70383978
5.21 KB
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/session_spontaneous.png
View file @
70383978
3.56 KB
|
W:
|
H:
1.35 KB
|
W:
|
H:
2-up
Swipe
Onion skin
android/Pictogram/tabletlibrary/src/main/res/drawable-hdpi/session_supervised.png
View file @
70383978
1.35 KB
|
W:
|
H:
3.56 KB
|
W:
|
H:
2-up
Swipe
Onion skin
android/Pictogram/tabletlibrary/tabletlibrary.iml
View file @
70383978
...
...
@@ -73,14 +73,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
...
...
@@ -89,6 +81,14 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/annotations"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/bundles"
/>
...
...
android/Pictogram/yotta_tablet/yotta_tablet.iml
View file @
70383978
...
...
@@ -18,7 +18,7 @@
<option
name=
"ALLOW_USER_CONFIGURATION"
value=
"false"
/>
<option
name=
"MANIFEST_FILE_RELATIVE_PATH"
value=
"/src/main/AndroidManifest.xml"
/>
<option
name=
"RES_FOLDER_RELATIVE_PATH"
value=
"/src/main/res"
/>
<option
name=
"RES_FOLDERS_RELATIVE_PATH"
value=
""
/>
<option
name=
"RES_FOLDERS_RELATIVE_PATH"
value=
"
file://$MODULE_DIR$/src/main/res
"
/>
<option
name=
"ASSETS_FOLDER_RELATIVE_PATH"
value=
"/src/main/assets"
/>
</configuration>
</facet>
...
...
@@ -43,13 +43,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavorDebug/jni"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavorDebug/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavorDebug/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavorDebug/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavorDebug/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavorDebug/assets"
type=
"java-test-resource"
/>
...
...
@@ -58,6 +51,13 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavorDebug/jni"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavorDebug/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/testDevFlavorDebug/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/r/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/rs/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/source/apt/androidTest/DevFlavor/debug"
isTestSource=
"true"
generated=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/res/rs/androidTest/DevFlavor/debug"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DevFlavor/debug"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavor/res"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavor/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/DevFlavor/assets"
type=
"java-resource"
/>
...
...
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