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
97294694
authored
Jan 11, 2017
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #777 closed
parent
11b85186
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Picto.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/net/SessionWrapper.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/Picto.java
View file @
97294694
...
...
@@ -19,7 +19,8 @@ import org.json.JSONObject;
* @author Fernando Martinez Santiago
* @version 1.0
*/
public
class
Picto
extends
Img
{
public
class
Picto
extends
Img
{
public
final
static
class
JSON_ATTTRS
{
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/ListInstructionsFragment.java
View file @
97294694
package
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
.
session
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.support.v4.app.Fragment
;
import
android.app.ProgressDialog
;
import
android.content.Context
;
...
...
@@ -14,6 +15,7 @@ import android.widget.AdapterView;
import
android.widget.ArrayAdapter
;
import
android.widget.ListView
;
import
com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity
;
import
com.yottacode.pictogram.tabletlibrary.net.SessionWrapper
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tools.PCBcontext
;
...
...
@@ -114,13 +116,17 @@ public class ListInstructionsFragment extends Fragment{
}
private
void
checkStudent
()
{
SessionWrapper
.
validateStudent
(
new
SessionWrapper
.
iValidateStudent
()
{
void
close
()
{
ListInstructionsFragment
.
this
.
getActivity
().
finish
();
startActivity
(
new
Intent
(
getActivity
(),
PictogramActivity
.
class
));
}
@Override
public
void
validLicense
(
boolean
valid_license
,
String
sexpiration
)
{
if
(!
valid_license
)
{
GUITools
.
show_alert
(
ListInstructionsFragment
.
this
.
getContext
(),
R
.
string
.
loginExpiredLicenseMsg
,
sexpiration
,
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
ListInstructionsFragment
.
this
.
getActivity
().
finish
();
close
();
}
});
}
...
...
@@ -131,7 +137,7 @@ public class ListInstructionsFragment extends Fragment{
GUITools
.
show_alert
(
ListInstructionsFragment
.
this
.
getContext
(),
R
.
string
.
session_notclosed
,
getString
(
R
.
string
.
server
),
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
ListInstructionsFragment
.
this
.
getActivity
().
finish
();
close
();
}
});
}
...
...
@@ -142,7 +148,7 @@ public class ListInstructionsFragment extends Fragment{
GUITools
.
show_alert
(
ListInstructionsFragment
.
this
.
getContext
(),
R
.
string
.
session_error
,
message
,
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
ListInstructionsFragment
.
this
.
getActivity
().
finish
();
close
();
}
});
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/session/SessionActivity.java
View file @
97294694
...
...
@@ -329,6 +329,10 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
findViewById
(
R
.
id
.
sessionTopbarMethodName
).
setVisibility
(
View
.
INVISIBLE
);
findViewById
(
R
.
id
.
sessionTopbarInstructionName
).
setVisibility
(
View
.
INVISIBLE
);
}
void
close
()
{
finish
();
startActivity
(
new
Intent
(
SessionActivity
.
this
,
PictogramActivity
.
class
));
}
private
void
set_fragment
(
boolean
isChecked
)
{
if
(
isChecked
)
{
...
...
@@ -346,7 +350,7 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
GUITools
.
show_alert
(
SessionActivity
.
this
,
R
.
string
.
session_error
,
"error "
+
error
,
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
finish
();
close
();
}
});
}
...
...
@@ -359,7 +363,7 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
GUITools
.
show_alert
(
SessionActivity
.
this
,
R
.
string
.
session_closed_ok
,
end
,
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
finish
();
close
();
}
});
...
...
@@ -370,7 +374,7 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
GUITools
.
show_alert
(
SessionActivity
.
this
,
R
.
string
.
session_error
,
getString
(
R
.
string
.
server
)
+
"(error "
+
error
+
")"
,
new
GUITools
.
iOKListener
()
{
@Override
public
void
ok
()
{
finish
();
close
();
}
});
}
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/net/SessionWrapper.java
View file @
97294694
...
...
@@ -154,7 +154,7 @@ public class SessionWrapper {
JSONObject
jlicense
=
new
JSONObject
(
license
);
sexpiration
=
jlicense
.
getString
(
"expiration_ts"
);
sexpiration
=
sexpiration
.
substring
(
0
,
sexpiration
.
indexOf
(
'T'
));
Date
dexpiration
=
new
java
.
text
.
SimpleDateFormat
(
"yyyy-
mm
-dd"
).
parse
(
sexpiration
);
Date
dexpiration
=
new
java
.
text
.
SimpleDateFormat
(
"yyyy-
MM
-dd"
).
parse
(
sexpiration
);
valid_license
=
dexpiration
.
after
(
new
Date
());
}
listener
.
validLicense
(
valid_license
,
sexpiration
);
...
...
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