Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stavor
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
Container Registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Stavor
Commits
c1a60055
Commit
c1a60055
authored
10 years ago
by
Xavier Gibert
Browse files
Options
Downloads
Patches
Plain Diff
Slider HUD panel
parent
75e8617d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
res/layout/sphere_merged.xml
+3
-2
3 additions, 2 deletions
res/layout/sphere_merged.xml
src/fragments/SphereFragment.java
+11
-7
11 additions, 7 deletions
src/fragments/SphereFragment.java
src/web/WebAppInterface.java
+1
-0
1 addition, 0 deletions
src/web/WebAppInterface.java
with
15 additions
and
9 deletions
res/layout/sphere_merged.xml
+
3
−
2
View file @
c1a60055
...
...
@@ -4,14 +4,14 @@
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:background=
"@color/panel_limit"
android:gravity=
"
bot
to
m
"
android:gravity=
"to
p
"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/commentsLayout"
android:layout_width=
"fill_parent"
android:layout_height=
"match_parent"
android:background=
"@color/
grey2
"
android:background=
"@color/
black
"
android:orientation=
"vertical"
>
</LinearLayout>
...
...
@@ -37,6 +37,7 @@
android:id=
"@+id/content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/custom_border"
android:orientation=
"vertical"
>
<TextView
...
...
This diff is collapsed.
Click to expand it.
src/fragments/SphereFragment.java
+
11
−
7
View file @
c1a60055
...
...
@@ -58,7 +58,7 @@ public final class SphereFragment extends Fragment {
public
ModelSimulation
sim
;
XWalkView
browser
;
LinearLayout
commentsLayout
;
LinearLayout
commentsLayout
,
slider_content
;
@SuppressWarnings
(
"deprecation"
)
@SuppressLint
({
"JavascriptInterface"
,
"SetJavaScriptEnabled"
,
"NewApi"
})
...
...
@@ -72,7 +72,8 @@ public final class SphereFragment extends Fragment {
drawer
.
setOnDrawerOpenListener
(
new
OnDrawerOpenListener
()
{
public
void
onDrawerOpened
()
{
LinearLayout
.
LayoutParams
layoutParams
=
new
LinearLayout
.
LayoutParams
(
browser
.
getLayoutParams
());
layoutParams
.
height
=
browser
.
getLayoutParams
().
height
/
2
;
layoutParams
.
height
=
browser
.
getHeight
()-
slider_content
.
getHeight
();
layoutParams
.
width
=
LayoutParams
.
MATCH_PARENT
;
browser
.
setLayoutParams
(
layoutParams
);
}
});
...
...
@@ -81,11 +82,12 @@ public final class SphereFragment extends Fragment {
public
void
onDrawerClosed
()
{
LinearLayout
.
LayoutParams
layoutParams
=
new
LinearLayout
.
LayoutParams
(
browser
.
getLayoutParams
());
layoutParams
.
height
=
LayoutParams
.
MATCH_PARENT
;
layoutParams
.
width
=
LayoutParams
.
MATCH_PARENT
;
browser
.
setLayoutParams
(
layoutParams
);
}
});
//XWalkView browser = (XWalkView
) rootView.findViewById(R.id.
xbrowser
);
slider_content
=
(
LinearLayout
)
rootView
.
findViewById
(
R
.
id
.
content
);
browser
=
new
XWalkView
(
this
.
getActivity
().
getApplicationContext
(),
this
.
getActivity
());
XWalkSettings
browserSettings
=
browser
.
getSettings
();
...
...
@@ -101,19 +103,20 @@ public final class SphereFragment extends Fragment {
browser
.
clearCache
(
true
);
/*browser.setXWalkWebChromeClient(new org.xwalk.core.client.XWalkDefaultWebChromeClient(rootView.getContext(), browser) {
public void onProgressChanged(WebView view, int progress) {
browser
.
setXWalkWebChromeClient
(
new
org
.
xwalk
.
core
.
client
.
XWalkDefaultWebChromeClient
(
rootView
.
getContext
(),
browser
)
{
@Override
public
void
onProgressChanged
(
XWalkView
view
,
int
progress
)
{
// Activities and WebViews measure progress with different scales.
// The progress meter will automatically disappear when we reach 100%
getActivity
().
setProgress
(
progress
*
100
);
}
});
browser
.
setXWalkClient
(
new
org
.
xwalk
.
core
.
client
.
XWalkDefaultClient
(
rootView
.
getContext
(),
browser
)
{
public void onReceivedError(
Web
View view, int errorCode, String description, String failingUrl) {
public
void
onReceivedError
(
XWalk
View
view
,
int
errorCode
,
String
description
,
String
failingUrl
)
{
Toast
.
makeText
(
getActivity
(),
"Oh no! "
+
description
,
Toast
.
LENGTH_LONG
).
show
();
}
});
*/
browser
.
addJavascriptInterface
(
new
webclient
.
UAJscriptHandler
(
null
),
"unlockingandroid"
);
browser
.
addJavascriptInterface
(
new
UANOOP
()
{},
"unlockingandroid"
);
browser
.
addJavascriptInterface
(
null
,
"unlockingandroid"
);
...
...
@@ -121,6 +124,7 @@ public final class SphereFragment extends Fragment {
sim
=
(
ModelSimulation
)
getArguments
().
getSerializable
(
ARG_SIM_OBJ
);
sim
.
setCurrentView
(
rootView
);
browser
.
addJavascriptInterface
(
new
WebAppInterface
(
getActivity
(),
sim
),
"Android"
);
commentsLayout
=(
LinearLayout
)
rootView
.
findViewById
(
R
.
id
.
commentsLayout
);
commentsLayout
.
addView
(
browser
);
...
...
This diff is collapsed.
Click to expand it.
src/web/WebAppInterface.java
+
1
−
0
View file @
c1a60055
...
...
@@ -9,6 +9,7 @@ import android.os.Handler;
import
android.widget.Toast
;
import
org.chromium.content.browser.JavascriptInterface
;
//XGGDEBUG:WAITING use ( org.xwalk.core.JavascriptInterface ) when the code is merged in: https://github.com/crosswalk-project/crosswalk/pull/1876/files
//import android.webkit.JavascriptInterface; Used for WebView not XWalkView
public
class
WebAppInterface
{
...
...
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