Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
39d54b3e
Commit
39d54b3e
authored
Jul 30, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show progress while loading
parent
84fa9e50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
app/src/main/java/app/insti/fragment/AddEventFragment.java
app/src/main/java/app/insti/fragment/AddEventFragment.java
+21
-5
No files found.
app/src/main/java/app/insti/fragment/AddEventFragment.java
View file @
39d54b3e
package
app.insti.fragment
;
package
app.insti.fragment
;
import
android.app.ProgressDialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.ActivityNotFoundException
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.net.Uri
;
...
@@ -35,6 +36,8 @@ import retrofit2.Response;
...
@@ -35,6 +36,8 @@ import retrofit2.Response;
public
class
AddEventFragment
extends
BaseFragment
{
public
class
AddEventFragment
extends
BaseFragment
{
private
ProgressDialog
progressDialog
;
public
ValueCallback
<
Uri
[]>
uploadMessage
;
public
ValueCallback
<
Uri
[]>
uploadMessage
;
public
AddEventFragment
()
{
public
AddEventFragment
()
{
...
@@ -52,6 +55,12 @@ public class AddEventFragment extends BaseFragment {
...
@@ -52,6 +55,12 @@ public class AddEventFragment extends BaseFragment {
container
.
removeAllViews
();
container
.
removeAllViews
();
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_add_event
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_add_event
,
container
,
false
);
/* Show progress dialog */
progressDialog
=
new
ProgressDialog
(
getContext
());
progressDialog
.
setMessage
(
"Loading"
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
show
();
String
host
=
"insti.app"
;
String
host
=
"insti.app"
;
Toolbar
toolbar
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
Toolbar
toolbar
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
toolbar
.
setTitle
(
getArguments
().
containsKey
(
"id"
)
?
"Update Event"
:
"Add Event"
);
toolbar
.
setTitle
(
getArguments
().
containsKey
(
"id"
)
?
"Update Event"
:
"Add Event"
);
...
@@ -119,6 +128,7 @@ public class AddEventFragment extends BaseFragment {
...
@@ -119,6 +128,7 @@ public class AddEventFragment extends BaseFragment {
public
class
MyWebViewClient
extends
WebViewClient
{
public
class
MyWebViewClient
extends
WebViewClient
{
@Override
@Override
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
String
url
)
{
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
String
url
)
{
/* Check URL */
if
(
url
.
contains
(
"/event/"
))
{
if
(
url
.
contains
(
"/event/"
))
{
url
=
url
.
substring
(
url
.
lastIndexOf
(
"/"
)
+
1
);
url
=
url
.
substring
(
url
.
lastIndexOf
(
"/"
)
+
1
);
...
@@ -143,12 +153,18 @@ public class AddEventFragment extends BaseFragment {
...
@@ -143,12 +153,18 @@ public class AddEventFragment extends BaseFragment {
}
}
public
class
MyWebChromeClient
extends
WebChromeClient
{
public
class
MyWebChromeClient
extends
WebChromeClient
{
/*@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
android.util.Log.wtf("cWebView", consoleMessage.message());
return true;
}*/
@Override
public
void
onProgressChanged
(
WebView
view
,
int
progress
)
{
if
(
progress
<
100
)
{
progressDialog
.
show
();
}
if
(
progress
==
100
)
{
progressDialog
.
dismiss
();
}
}
@Override
public
boolean
onShowFileChooser
(
WebView
webView
,
ValueCallback
<
Uri
[]>
filePathCallback
,
FileChooserParams
fileChooserParams
)
{
public
boolean
onShowFileChooser
(
WebView
webView
,
ValueCallback
<
Uri
[]>
filePathCallback
,
FileChooserParams
fileChooserParams
)
{
// make sure there is no existing message
// make sure there is no existing message
if
(
uploadMessage
!=
null
)
{
if
(
uploadMessage
!=
null
)
{
...
...
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