Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
750df863
Commit
750df863
authored
11 years ago
by
Maxime Graulich
Browse files
Options
Downloads
Patches
Plain Diff
Android: do not allow sharing if it's compute
parent
bf548aab
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/mobile/Android/src/org/geuz/onelab/GLESRender.java
+1
-1
1 addition, 1 deletion
contrib/mobile/Android/src/org/geuz/onelab/GLESRender.java
contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java
+26
-9
26 additions, 9 deletions
contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java
with
27 additions
and
10 deletions
contrib/mobile/Android/src/org/geuz/onelab/GLESRender.java
+
1
−
1
View file @
750df863
...
@@ -54,7 +54,7 @@ public class GLESRender implements Renderer{
...
@@ -54,7 +54,7 @@ public class GLESRender implements Renderer{
public
void
onSurfaceChanged
(
GL10
gl
,
int
width
,
int
height
)
{
public
void
onSurfaceChanged
(
GL10
gl
,
int
width
,
int
height
)
{
mGModel
.
viewInit
(
width
,
height
);
mGModel
.
viewInit
(
width
,
height
);
_width
=
width
+
5
;
_width
=
width
;
_height
=
height
;
_height
=
height
;
}
}
...
...
This diff is collapsed.
Click to expand it.
contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java
+
26
−
9
View file @
750df863
package
org.geuz.onelab
;
package
org.geuz.onelab
;
import
java.io.File
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
android.app.ActionBar
;
import
android.app.ActionBar
;
import
android.app.Activity
;
import
android.app.Activity
;
...
@@ -121,21 +123,36 @@ public class MainActivity extends Activity{
...
@@ -121,21 +123,36 @@ public class MainActivity extends Activity{
_gmsh
.
onelabCB
(
"stop"
);
_gmsh
.
onelabCB
(
"stop"
);
}
}
else
if
(
item
.
getTitle
().
equals
(
"Share ..."
))
{
else
if
(
item
.
getTitle
().
equals
(
"Share ..."
))
{
File
file
=
new
File
(
this
.
getExternalFilesDir
(
null
),
"onelab_screenshot.png"
);
if
(
this
.
_compute
)
{
file
.
setReadable
(
true
,
false
);
AlertDialog
.
Builder
dialogBuilder
=
new
AlertDialog
.
Builder
(
this
);
_modelFragment
.
takeScreenshot
(
file
);
_errorDialog
=
dialogBuilder
.
setTitle
(
"Can't show the models list"
)
Intent
shareIntent
=
new
Intent
();
.
setMessage
(
"The computing have to be finished before you can take a screenshot."
)
shareIntent
.
setAction
(
Intent
.
ACTION_SEND
);
.
setPositiveButton
(
"OK"
,
new
DialogInterface
.
OnClickListener
()
{
shareIntent
.
putExtra
(
Intent
.
EXTRA_STREAM
,
Uri
.
fromFile
(
file
));
shareIntent
.
setType
(
"image/jpeg"
);
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
startActivity
(
Intent
.
createChooser
(
shareIntent
,
"Share screenshot with ..."
));
dialog
.
dismiss
();
}
})
.
show
();
}
else
{
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy_MM_dd-HH_mm_ss"
);
File
file
=
new
File
(
this
.
getExternalFilesDir
(
null
),
"onelab-screenshot-"
+
dateFormat
.
format
(
new
Date
())+
".png"
);
file
.
setReadable
(
true
,
false
);
_modelFragment
.
takeScreenshot
(
file
);
Intent
shareIntent
=
new
Intent
();
shareIntent
.
setAction
(
Intent
.
ACTION_SEND
);
shareIntent
.
putExtra
(
Intent
.
EXTRA_STREAM
,
Uri
.
fromFile
(
file
));
shareIntent
.
setType
(
"image/jpeg"
);
startActivity
(
Intent
.
createChooser
(
shareIntent
,
"Share screenshot with"
));
}
}
}
else
if
(
item
.
getItemId
()
==
android
.
R
.
id
.
home
)
else
if
(
item
.
getItemId
()
==
android
.
R
.
id
.
home
)
{
{
if
(
this
.
_compute
)
{
if
(
this
.
_compute
)
{
AlertDialog
.
Builder
dialogBuilder
=
new
AlertDialog
.
Builder
(
this
);
AlertDialog
.
Builder
dialogBuilder
=
new
AlertDialog
.
Builder
(
this
);
_errorDialog
=
dialogBuilder
.
setTitle
(
"Can't show the models list"
)
_errorDialog
=
dialogBuilder
.
setTitle
(
"Can't show the models list"
)
.
setMessage
(
"The comput
e
have to be finished before you can select an other model."
)
.
setMessage
(
"The comput
ing
have to be finished before you can select an other model."
)
.
setPositiveButton
(
"OK"
,
new
DialogInterface
.
OnClickListener
()
{
.
setPositiveButton
(
"OK"
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment