How to show or hide stack layout in native script - angular2-nativescript

How to show or hide stack layout in native script, like in android (view.setVisibility(View.GONE);).

I set (yourView).visibility = "collapse";
It is worked for me.

Related

Tap Jacking protection for Flutter apps

I have seen that there wont be any way of providing Tap jacking for flutter apps but I came across this
saying,
It is possible to globally disable all touches when obscured by setting this property on the root view in your MainActivity (Kotlin code Sample):
val view = findViewById<View>(android.R.id.content).rootView
view.filterTouchesWhenObscured = true
Any suggestions how to convert the above code in dart Language for Flutter App
There's no solution for this yet by the flutter community.
It's still an open issue on flutter's gh https://github.com/flutter/flutter/issues/40422

How to tap to copy html text in flutter app

My developer is building an educational app for me and we kind of have a problem. I want to know how to tap a word or phrase on the screen to show copy, highlight, web search like the image below. The app was built with flutter and the code is in dart. This feature is really needed. Will appreciate if someone can help with a plugin or just a way to do this.
If you are using webview package you have a gestureRecognizers property in webview widget, just add this line:
WebViewPlus(
gestureRecognizers: {}..add(Factory<LongPressGestureRecognizer>(() =>
LongPressGestureRecognizer())),...)
Flutter has selectable text for that
If he is using webview, maybe this could help?
How to enable text selection modal(copy/paste/select) in flutter webview?
They is a package for copy and paste text in the flutter.
FlutterClipboard.copy(item.code).then((value) {})
package link
Well I got your problem.
There is a possible solution. Here you are doing is sending data from server in html format and displayed it using html_viwer. But there is no functionality I found to select and copy so far.
The possible solution is send string data from server and use SelectableText() to show the text and you will be able to select and copy your text.
There's a solution for this, just use SelectableHtml widget instead of only Html

How to hide the the navigationbar that present in pdf viewer plugin flutter

I need to hide the navigation bar that present default in the pdfviewer plugin flutter.I used to change the value of showNavigation value to false but it doesn't work .I use the plugin flutter_plugin_pdf_viewer:any here is my code:
Containe( width:130,
height:130,
margin:EdgeInsets.all(20.0),
child:PDFViewer(document:doc2,
showNavigation : false,/*here is my issue ,when i set like this it shows nothing in the UI*/ ),)
This plugin solves this issue please check the below link
https://github.com/lohanidamodar/pdf_viewer/pull/2
Use this plugin
advance_pdf_viewer: any
I have solved this issue by changing source code of this plugin. for hiding navigation tool bar in the pdf viewer plugin use this plugin for viewing only single page from pdf :)
https://github.com/SmilingDeveloper/newpdf_viewer.git

Webview elements inspection for testing

We have a web view in our app which is being detected as a single webpage element (android.webkit.WebView). not showing the layout hierarchy to inspect individual UI components. I have tried to inspect the elements using 'UI Automator Viewer' and 'Appium Inspector' and same results. Is there any other tool which can be used for inspecting web views? Please advise!
UIAutomatorViewer is able to see native elements only. Everything underneath WebView is web elements. You need to switch from native to web context.
Link
This functionality was broken in Android Lollipop but appears to have recently been fixed with Android System Webview v44, try upgrading webview and inspecting then

Gtk menu with icons

This is critical part of my run-time created menu:
GtkWidget *menu, *menu_item;
menu = gtk_menu_new();
menu_item = gtk_image_menu_item_new_with_label("Uredi...");
//approach1 - icon don't work
//gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), gtk_image_new_from_stock(GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU));
//approach2 - icon also don't work
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), GTK_WIDGET(gtk_image_new_from_stock(GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU)));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
g_signal_connect(G_OBJECT(menu_item), "button-release-event", G_CALLBACK(menu_RELEASE), (gpointer)"");
gtk_menu_attach_to_widget(GTK_MENU(menu), button, NULL);
gtk_widget_show_all(menu);
Menu works OK but this is only one "imagemenuitem" on which I see label but don't see image.
What can be wrong here?
Gtk2, Ubuntu 11.10
I'm not 100% sure, but I believe icons in menus and buttons are no longer enabled by default. You need to turn them on to make them show up.
gconftool-2 --type bool --set /desktop/gnome/interface/menus_have_icons true
Or using dconf:
dconf write /org/gnome/desktop/interface/menus-have-icons true
Hey pretty old question so probably not much use. But I was having a very similar problem with a menu not showing images (in my case it was popup menu triggered by a button).
The way I solved it was calling the
gtk_image_menu_item_set_always_show_image(menu_item,TRUE);
This solved my problem, now my images always show :D woot :) As passing in 1 (true) means it will always show.
Ref:
http://developer.gnome.org/gtk3/3.0/GtkImageMenuItem.html