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
ef655788
authored
May 16, 2017
by
Germán Callejas Alcántara
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Muestra de version de la app funcionando correctamente a la version 1.2
parent
8a746203
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
14 deletions
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/DeviceHelper.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/NetService.java
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/SplashScreenActivity.java
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/dao/DeviceHelper.java
View file @
ef655788
...
@@ -20,8 +20,7 @@ import java.io.InputStream;
...
@@ -20,8 +20,7 @@ import java.io.InputStream;
* @version 1.0
* @version 1.0
*/
*/
public
class
DeviceHelper
{
public
class
DeviceHelper
{
public
static
float
version
=
Float
.
valueOf
(
BuildConfig
.
VERSION_NAME
).
floatValue
();
public
static
float
version
=
Float
.
valueOf
(
BuildConfig
.
VERSION_NAME
);
//Float.valueOf(PCBcontext.getContext().getResources().getString(R.string.app_version)).floatValue();
public
static
String
getDBName
(
Context
context
)
{
public
static
String
getDBName
(
Context
context
)
{
return
context
.
getResources
().
getString
(
R
.
string
.
db_name
);
return
context
.
getResources
().
getString
(
R
.
string
.
db_name
);
...
...
android/Pictogram/commonlibrary/src/main/java/com/yottacode/pictogram/net/NetService.java
View file @
ef655788
...
@@ -155,7 +155,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
...
@@ -155,7 +155,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
public
void
result
(
JSONObject
result
)
{
public
void
result
(
JSONObject
result
)
{
try
{
try
{
final
float
version
=
Float
.
valueOf
(
result
.
getString
(
"version"
));
final
float
version
=
Float
.
valueOf
(
result
.
getString
(
"version"
));
if
(
PCBcontext
.
getActivityContext
()
!=
null
&&
version
>
DeviceHelper
.
getAppVersion
()
&&
newVersionContext
!=
PCBcontext
.
getActivityContext
())
{
if
(
PCBcontext
.
getActivityContext
()
!=
null
&&
version
>
DeviceHelper
.
getAppVersion
()
&&
newVersionContext
!=
PCBcontext
.
getActivityContext
())
{
newVersionContext
=
PCBcontext
.
getActivityContext
();
// prevent from showing several times the alert
newVersionContext
=
PCBcontext
.
getActivityContext
();
// prevent from showing several times the alert
newVersionAlert
(
version
,
PCBcontext
.
getActivityContext
(),
version
);
newVersionAlert
(
version
,
PCBcontext
.
getActivityContext
(),
version
);
...
...
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/SplashScreenActivity.java
View file @
ef655788
...
@@ -4,14 +4,13 @@ package com.yottacode.pictogram.tabletlibrary.gui.login;
...
@@ -4,14 +4,13 @@ package com.yottacode.pictogram.tabletlibrary.gui.login;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.content.pm.ActivityInfo
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.Window
;
import
android.view.Window
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.yottacode.pictogram.
tabletlibrary.BuildConfig
;
import
com.yottacode.pictogram.
dao.DeviceHelper
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tabletlibrary.R
;
import
com.yottacode.pictogram.tools.PCBcontext
;
import
java.util.Timer
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
java.util.TimerTask
;
...
@@ -35,14 +34,7 @@ public class SplashScreenActivity extends Activity {
...
@@ -35,14 +34,7 @@ public class SplashScreenActivity extends Activity {
setContentView
(
R
.
layout
.
activity_splash_screen
);
setContentView
(
R
.
layout
.
activity_splash_screen
);
TextView
version
=
(
TextView
)
findViewById
(
R
.
id
.
labelVersion
);
TextView
version
=
(
TextView
)
findViewById
(
R
.
id
.
labelVersion
);
PackageInfo
pInfo
=
null
;
version
.
setText
(
getResources
().
getString
(
R
.
string
.
version_label
)+
" "
+
DeviceHelper
.
getAppVersion
());
try
{
pInfo
=
getPackageManager
().
getPackageInfo
(
getPackageName
(),
0
);
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
e
.
printStackTrace
();
}
String
versionName
=
pInfo
.
versionName
;
version
.
setText
(
getResources
().
getString
(
R
.
string
.
version_label
)+
" "
+
BuildConfig
.
VERSION_NAME
);
TimerTask
task
=
new
TimerTask
()
{
TimerTask
task
=
new
TimerTask
()
{
@Override
@Override
...
...
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