Skip to content
This repository was archived by the owner on Feb 23, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.navigation:navigation-fragment:2.5.2'
implementation 'androidx.navigation:navigation-ui:2.5.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package com.futureinsight.futureinsight.ui.contact;

import android.content.ActivityNotFoundException;
import android.graphics.Bitmap;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import com.org.futureinsight.databinding.FragmentContactusBinding;


public class contactus extends Fragment {
private FragmentContactusBinding binding;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentContactusBinding.inflate(inflater, container, false);
View root = binding.getRoot();
try {
final WebView ContactusView = binding.WebViewContact;
String Future_Insight_ContactPage_URL="https://future-insight.blog/contact";

final ProgressBar loadingPB = binding.PBLoading;

WebSettings webSettings = ContactusView.getSettings();

//Enable Javascript & alot for the webview loading properties
ContactusView.getSettings().setJavaScriptEnabled(true);
ContactusView.getSettings().setDomStorageEnabled(true);
ContactusView.getSettings().setLoadWithOverviewMode(true);
ContactusView.getSettings().setUseWideViewPort(true);
ContactusView.getSettings().setBuiltInZoomControls(true);
ContactusView.getSettings().setDisplayZoomControls(false);
ContactusView.getSettings().setSupportZoom(true);
ContactusView.getSettings().setDefaultTextEncodingName("utf-8");

ContactusView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
ContactusView.getSettings().setGeolocationEnabled(true);
ContactusView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
ContactusView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webSettings.setUseWideViewPort(true);
webSettings.setSavePassword(true);
webSettings.setSaveFormData(true);
webSettings.setEnableSmoothTransition(true);

ContactusView.loadUrl(Future_Insight_ContactPage_URL);

ContactusView.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
loadingPB.setVisibility(View.VISIBLE);
}

@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
loadingPB.setVisibility(View.GONE);
}
});

ContactusView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int keycode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN)
{
switch (keycode)
{
case KeyEvent.KEYCODE_BACK:
if (ContactusView.canGoBack())
{
ContactusView.goBack();
}
break;
}
}
return false;
}
});
}
catch (ActivityNotFoundException e) {
System.out.println("error: "+ e.getMessage());
}
return root;
}

@Override
public void onDestroyView() {
try {
super.onDestroyView();
binding = null;
}
catch (ActivityNotFoundException e) {
System.out.println("error: "+ e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.futureinsight.futureinsight.ui.gallery;

import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.KeyEvent;
Expand All @@ -20,85 +21,86 @@ public class GalleryFragment extends Fragment {

private FragmentGalleryBinding binding;

@SuppressLint("SetJavaScriptEnabled")
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
GalleryViewModel galleryViewModel =
new ViewModelProvider(this).get(GalleryViewModel.class);

binding = FragmentGalleryBinding.inflate(inflater, container, false);
View root = binding.getRoot();

//Loading web View
final WebView BlogWebView = binding.idWebViewBlog;
// URL of the blog Page
String FutureInsightsBlogURL = "https://future-insight.blog/post/";

//Loading Progress Bar
final ProgressBar loadingPB = binding.PBLoading;

WebSettings webSettings = BlogWebView.getSettings();

//Enable Javascript & alot for the webview loading properties
BlogWebView.getSettings().setJavaScriptEnabled(true);
BlogWebView.getSettings().setDomStorageEnabled(true);
BlogWebView.getSettings().setLoadWithOverviewMode(true);
BlogWebView.getSettings().setUseWideViewPort(true);
BlogWebView.getSettings().setBuiltInZoomControls(true);
BlogWebView.getSettings().setDisplayZoomControls(false);
BlogWebView.getSettings().setSupportZoom(true);
BlogWebView.getSettings().setDefaultTextEncodingName("utf-8");

//performace improvement settings
BlogWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
BlogWebView.getSettings().setGeolocationEnabled(true);
BlogWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
BlogWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webSettings.setUseWideViewPort(true);
webSettings.setSavePassword(true);
webSettings.setSaveFormData(true);
webSettings.setEnableSmoothTransition(true);


ViewGroup container, Bundle savedInstanceState) {
try {

binding = FragmentGalleryBinding.inflate(inflater, container, false);
View root = binding.getRoot();

//Loading web View
final WebView BlogWebView = binding.idWebViewBlog;
// URL of the blog Page
String FutureInsightsBlogURL = "https://future-insight.blog/post/";

//Loading Progress Bar
final ProgressBar loadingPB = binding.PBLoading;

WebSettings webSettings = BlogWebView.getSettings();

//Enable Javascript & alot for the webview loading properties
BlogWebView.getSettings().setJavaScriptEnabled(true);
BlogWebView.getSettings().setDomStorageEnabled(true);
BlogWebView.getSettings().setLoadWithOverviewMode(true);
BlogWebView.getSettings().setUseWideViewPort(true);
BlogWebView.getSettings().setBuiltInZoomControls(true);
BlogWebView.getSettings().setDisplayZoomControls(false);
BlogWebView.getSettings().setSupportZoom(true);
BlogWebView.getSettings().setDefaultTextEncodingName("utf-8");

//performace improvement settings
BlogWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
BlogWebView.getSettings().setGeolocationEnabled(true);
BlogWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
BlogWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webSettings.setUseWideViewPort(true);
webSettings.setSavePassword(true);
webSettings.setSaveFormData(true);
webSettings.setEnableSmoothTransition(true);

// Loading URL into the Blog Post
BlogWebView.loadUrl(FutureInsightsBlogURL);
BlogWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
loadingPB.setVisibility(View.VISIBLE);
}

@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
loadingPB.setVisibility(View.GONE);
}
});

// Loading URL into the Blog Post
BlogWebView.loadUrl(FutureInsightsBlogURL);
BlogWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
loadingPB.setVisibility(View.VISIBLE);
}

@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
loadingPB.setVisibility(View.GONE);
}
});

BlogWebView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int keycode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN)
{
switch (keycode)
BlogWebView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int keycode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN)
{
case KeyEvent.KEYCODE_BACK:
if (BlogWebView.canGoBack())
{
BlogWebView.goBack();
}
break;
switch (keycode)
{
case KeyEvent.KEYCODE_BACK:
if (BlogWebView.canGoBack())
{
BlogWebView.goBack();
}
break;
}
}
return false;
}
return false;
}
});
});

return root;

return root;
}catch(Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
return null;
}

@Override
Expand Down

This file was deleted.

Loading