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
33179040
Commit
33179040
authored
11 years ago
by
Maxime Graulich
Browse files
Options
Downloads
Patches
Plain Diff
Fix the black screen issue
parent
8995af56
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/res/layout/model.xml
+9
-7
9 additions, 7 deletions
contrib/mobile/Android/res/layout/model.xml
contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java
+22
-20
22 additions, 20 deletions
contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java
with
31 additions
and
27 deletions
contrib/mobile/Android/res/layout/model.xml
+
9
−
7
View file @
33179040
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<ImageView
<ImageView
android:id=
"@+id/icon
e
"
android:id=
"@+id/icon"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:contentDescription=
"icon
e
"
android:contentDescription=
"icon"
android:src=
"@drawable/ic_launcher"
/>
android:src=
"@drawable/ic_launcher"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<TextView
android:id=
"@+id/tit
r
e"
android:id=
"@+id/tit
l
e"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:textColor=
"#ffffff"
/>
android:textColor=
"#ffffff"
android:textIsSelectable=
"false"
/>
<TextView
<TextView
android:id=
"@+id/description"
android:id=
"@+id/description"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textColor=
"#ffffff"
/>
android:textColor=
"#ffffff"
android:textIsSelectable=
"false"
/>
</LinearLayout>
</LinearLayout>
...
...
This diff is collapsed.
Click to expand it.
contrib/mobile/Android/src/org/geuz/onelab/MainActivity.java
+
22
−
20
View file @
33179040
...
@@ -58,6 +58,7 @@ public class MainActivity extends Activity {
...
@@ -58,6 +58,7 @@ public class MainActivity extends Activity {
private
UndragableViewPager
pager
;
private
UndragableViewPager
pager
;
private
List
<
Parameter
>
params
=
new
ArrayList
<
Parameter
>();
private
List
<
Parameter
>
params
=
new
ArrayList
<
Parameter
>();
private
SeparatedListView
paramListView
;
private
SeparatedListView
paramListView
;
private
boolean
compute
=
false
;
@Override
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -65,8 +66,7 @@ public class MainActivity extends Activity {
...
@@ -65,8 +66,7 @@ public class MainActivity extends Activity {
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
//this.requestWindowFeature(Window.FEATURE_NO_TITLE);
LinearLayout
layout
=
new
LinearLayout
(
this
);
LinearLayout
layout
=
new
LinearLayout
(
this
);
loading
=
new
ProgressDialog
(
this
);
loading
=
new
ProgressDialog
(
this
);
layout
.
setLayoutParams
(
new
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
LayoutParams
.
MATCH_PARENT
));
layout
.
setLayoutParams
(
new
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
LayoutParams
.
MATCH_PARENT
));
...
@@ -74,7 +74,7 @@ public class MainActivity extends Activity {
...
@@ -74,7 +74,7 @@ public class MainActivity extends Activity {
pager
=
new
UndragableViewPager
(
this
);
pager
=
new
UndragableViewPager
(
this
);
pager
.
setLayoutParams
(
new
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
LayoutParams
.
MATCH_PARENT
));
pager
.
setLayoutParams
(
new
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
LayoutParams
.
MATCH_PARENT
));
pager
.
setAdapter
(
new
AdaptedPager
());
pager
.
setAdapter
(
new
AdaptedPager
());
pager
.
setOffscreenPageLimit
(
3
);
pager
.
setOffscreenPageLimit
(
2
);
pager
.
setCurrentItem
(
0
);
pager
.
setCurrentItem
(
0
);
layout
.
addView
(
pager
);
layout
.
addView
(
pager
);
dialogBuilder
=
new
AlertDialog
.
Builder
(
this
);
dialogBuilder
=
new
AlertDialog
.
Builder
(
this
);
...
@@ -85,11 +85,11 @@ public class MainActivity extends Activity {
...
@@ -85,11 +85,11 @@ public class MainActivity extends Activity {
Bundle
extras
=
getIntent
().
getExtras
();
Bundle
extras
=
getIntent
().
getExtras
();
if
(
intent
!=
null
&&
intent
.
getAction
()
!=
null
&&
intent
.
getAction
().
equals
(
Intent
.
ACTION_VIEW
))
{
if
(
intent
!=
null
&&
intent
.
getAction
()
!=
null
&&
intent
.
getAction
().
equals
(
Intent
.
ACTION_VIEW
))
{
String
tmp
=
intent
.
getData
().
getPath
();
String
tmp
=
intent
.
getData
().
getPath
();
pager
.
setCurrentItem
(
1
);
pager
.
setCurrentItem
(
1
,
true
);
gmsh
.
load
(
tmp
);
gmsh
.
load
(
tmp
);
}
}
else
if
(
extras
!=
null
)
{
else
if
(
extras
!=
null
)
{
pager
.
setCurrentItem
(
0
);
pager
.
setCurrentItem
(
0
,
true
);
//extras.getInt("model");
//extras.getInt("model");
//extras.getString("name");
//extras.getString("name");
String
tmp
=
extras
.
getString
(
"file"
);
String
tmp
=
extras
.
getString
(
"file"
);
...
@@ -201,7 +201,6 @@ public class MainActivity extends Activity {
...
@@ -201,7 +201,6 @@ public class MainActivity extends Activity {
case
1
:
// OpenGL ES view
case
1
:
// OpenGL ES view
renderer
=
new
GLESRender
(
gmsh
);
renderer
=
new
GLESRender
(
gmsh
);
glView
=
new
mGLSurfaceView
(
container
.
getContext
(),
renderer
);
glView
=
new
mGLSurfaceView
(
container
.
getContext
(),
renderer
);
//TODO the glView seems break the ViewPager (black square appear ...)
glView
.
setEGLContextClientVersion
(
1
);
glView
.
setEGLContextClientVersion
(
1
);
glView
.
setRenderer
(
renderer
);
glView
.
setRenderer
(
renderer
);
glView
.
setRenderMode
(
GLSurfaceView
.
RENDERMODE_WHEN_DIRTY
);
glView
.
setRenderMode
(
GLSurfaceView
.
RENDERMODE_WHEN_DIRTY
);
...
@@ -411,17 +410,17 @@ public class MainActivity extends Activity {
...
@@ -411,17 +410,17 @@ public class MainActivity extends Activity {
reset
=
new
Button
(
ctx
);
reset
=
new
Button
(
ctx
);
run
.
setText
(
"Run"
);
run
.
setText
(
"Run"
);
reset
.
setText
(
"Reset"
);
reset
.
setText
(
"Reset"
);
run
.
setOnClickListener
(
new
OnClickListener
()
{
public
void
onClick
(
View
v
)
{
run
.
setOnClickListener
(
new
OnClickListener
()
{
if
(
run
.
getText
().
equals
(
"Show progress"
))
public
void
onClick
(
View
v
)
{
{
if
(
compute
)
{
loading
.
show
();
loading
.
show
();
return
;
}
else
{
new
Run
().
execute
();
pager
.
setCurrentItem
(
1
,
true
);
}
}
}
else
});
new
Run
().
execute
();
pager
.
setCurrentItem
(
1
,
true
);
}});
reset
.
setOnClickListener
(
new
OnClickListener
()
{
public
void
onClick
(
View
v
)
{
reset
.
setOnClickListener
(
new
OnClickListener
()
{
public
void
onClick
(
View
v
)
{
if
(
gmsh
.
onelabCB
(
"reset"
)
==
1
){
if
(
gmsh
.
onelabCB
(
"reset"
)
==
1
){
getAvailableParam
();
getAvailableParam
();
...
@@ -469,6 +468,7 @@ public class MainActivity extends Activity {
...
@@ -469,6 +468,7 @@ public class MainActivity extends Activity {
@Override
@Override
protected
void
onPreExecute
()
{
protected
void
onPreExecute
()
{
compute
=
true
;
loading
.
setTitle
(
"Please wait"
);
loading
.
setTitle
(
"Please wait"
);
loading
.
setButton
(
DialogInterface
.
BUTTON_NEUTRAL
,
"Hide"
,
new
DialogInterface
.
OnClickListener
()
{
loading
.
setButton
(
DialogInterface
.
BUTTON_NEUTRAL
,
"Hide"
,
new
DialogInterface
.
OnClickListener
()
{
...
@@ -485,7 +485,7 @@ public class MainActivity extends Activity {
...
@@ -485,7 +485,7 @@ public class MainActivity extends Activity {
});
});
loading
.
setMessage
(
"..."
);
loading
.
setMessage
(
"..."
);
loading
.
show
();
loading
.
show
();
run
.
setText
(
"Show progress"
);
//
run.setText("Show progress");
reset
.
setEnabled
(
false
);
reset
.
setEnabled
(
false
);
super
.
onPreExecute
();
super
.
onPreExecute
();
}
}
...
@@ -498,14 +498,16 @@ public class MainActivity extends Activity {
...
@@ -498,14 +498,16 @@ public class MainActivity extends Activity {
@Override
@Override
protected
void
onPostExecute
(
Integer
[]
result
)
{
protected
void
onPostExecute
(
Integer
[]
result
)
{
loading
.
dismiss
();
run
.
setText
(
"Run"
);
Vibrator
v
=
(
Vibrator
)
getSystemService
(
Context
.
VIBRATOR_SERVICE
);
Vibrator
v
=
(
Vibrator
)
getSystemService
(
Context
.
VIBRATOR_SERVICE
);
v
.
vibrate
(
350
);
v
.
vibrate
(
350
);
run
.
setEnabled
(
true
);
reset
.
setEnabled
(
true
);
reset
.
setEnabled
(
true
);
run
.
setEnabled
(
true
);
//run.setText("Run"); // TODO this seems break the ViewPager
pager
.
postInvalidate
();
glView
.
requestRender
();
glView
.
requestRender
();
super
.
onPostExecute
(
result
);
super
.
onPostExecute
(
result
);
loading
.
dismiss
();
compute
=
false
;
}
}
}
}
...
...
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