Remove the Navigation Bar in Webview
So I want to load only the body of the html and I want to remove the Navigation Bar. Is it possible to remove navigation bar of the website in WebView?
1 answer
-
answered 2022-05-04 09:11
Mahdi Iranmanesh
You can use JSOUP, like this:
document= Jsoup.connect(url).get(); document.getElementsByClass("main-navigation").remove();
checkout this link
do you know?
how many words do you know
See also questions close to this topic
-
Updating a Single Column In Room Database
That's the function I'm using for updat
private fun updateSettingsDatabase(settingsDao: SettingsDao) { lifecycleScope.launch { settingsDao.update(SettingsEntity( 1, nightMode=nightModeResult, )) } } @Query("SELECT * FROM `settings-table`") fun fetchCurrentSettings(): Flow<List<SettingsEntity>>
I specified
nightMode=
because I thought that this way I'm only updating this colummn, but it turns out that it resets every column, how do I update a single column, while keeping the values the rest of the columns? -
Using EdittextPreference for Goto search
sorry for my poor English. I want to use EditTextPreference in my bottom nav like the pic below, ![screenshot][1]
I have recycleview xml in my project with in many sub cardview layouts(which is scrollable) and I want to create item in the bottom nav which is called "Goto". When the "Goto" item is clicked i want it to pop-up like the screenshot. And when user enters a number(according to the cardviews i.e if the number of cardview is 40 user must enter 1-40) I want to search the cardview by its ID. Thank you and I hope u got it, If u have any questions let me know [1]: https://i.stack.imgur.com/grK8P.jpg
My xml format look like this. As you see in the blow since the cardviews are huge in number it is not cool to scroll all the way down that is why i need Goto item in the bottom nav to search it by its ID when the user click number in the EditTextPreference as u see in the screenshot. i.e The screenshot is not from my app
<LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> .. .. .. .. many more..
-
IOS Launcher in android studio
I'm trying to change the whole Android OS installed app icons into IOS icons, please help me with the proper code or library for android kotlin
-
Add adblock in webview
I'm trying to add adblock in my fragment, and when I'm tryed inisialize webview I got underline
this
onnew AdBlockerWebView.init(this).initializeWebView(webView);
linepackage com.example.bottomnavigationview; import android.os.Bundle; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebResourceResponse; import android.webkit.WebView; import android.webkit.WebViewClient; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.monstertechno.adblocker.AdBlockerWebView; import com.monstertechno.adblocker.util.AdBlocker; public class Fragment2 extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment2,container,false); View v = inflater.inflate(R.layout.fragment2,container,false); WebView webView = (WebView)v.findViewById(R.id.webView); new AdBlockerWebView.init(this).initializeWebView(webView); webView.setWebViewClient(new Browser_home()); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient()); webView.loadUrl("https://cyber.sports.ru/dota2/match/"); webView.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View view, int i, KeyEvent keyEvent) { if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) { if (keyEvent.getKeyCode() == KeyEvent.KEYCODE_BACK){ if(webView != null){ if (webView.canGoBack()){ webView.goBack(); } else { getActivity().onBackPressed(); } } } } return true; } }); return v; }
where I need put line new
AdBlockerWebView.init(this).initializeWebView(webView);
to fix my error? -
How can I make FrameLayout for Video have round corners with Agora?
At the moment, I tried with this but didn't work.
val surfaceView = RtcEngine.CreateRendererView(baseContext) surfaceView.apply { clipToOutline = true clipBounds = Rect(15,15, 15, 15) outlineProvider = CircularOutlineProvider(15) setZOrderMediaOverlay(true) } binding.localVideoViewContainer.apply { addView(surfaceView) clipToOutline = true clipBounds = Rect(15,15, 15, 15) outlineProvider = CircularOutlineProvider(15) }
class CircularOutlineProvider(val c: Int):ViewOutlineProvider() { override fun getOutline(view:View, outline:Outline) { outline.setRoundRect(c, c, view.width - c, view.height - c, view.width/2f) } }
<FrameLayout android:id="@+id/local_video_view_container" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="true" android:clipToOutline="true" tools:background="@color/gray_7f"/>
I even tried with setting background with drawable file like this, but didn't work.
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#CCCCCC"/> <stroke android:width="2dp" android:color="#999999"/> <padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp"/> <corners android:radius="8dp" /> </shape>
<FrameLayout android:width="match_parent" android:height="wrap_content" android:background="@drawable/rounded_shape"/>
plus, WebView also has similar issue. Is that related?