Explore all Menu open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Menu

xbar

v2.1.7-beta

stats

v2.7.13

tippyjs

v6.3.3

XPopup

2.7.7

Dozer

4.2.0

Popular Libraries in Menu

xbar

by matryer doticongodoticon

star image 15866 doticonMIT

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)

stats

by exelban doticonswiftdoticon

star image 10253 doticonMIT

macOS system monitor in your menu bar

tippyjs

by atomiks doticonjavascriptdoticon

star image 9266 doticonMIT

Tooltip, popover, dropdown, and menu library

XPopup

by li-xiaojun doticonjavadoticon

star image 6334 doticonApache-2.0

🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)

BoomMenu

by Nightonke doticonjavadoticon

star image 5718 doticon

A menu which can ... BOOM! - Android

Dozer

by Mortennn doticonswiftdoticon

star image 5319 doticonMPL-2.0

Hide menu bar icons on macOS

hidden

by dwarvesf doticonswiftdoticon

star image 5244 doticonMIT

An ultra-light MacOS utility that helps hide menu bar icons

Side-Menu.Android

by Yalantis doticonjavadoticon

star image 5164 doticonApache-2.0

Side menu with some categories to choose.

SideMenu

by jonkykong doticonswiftdoticon

star image 5128 doticonMIT

Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.

Trending New libraries in Menu

rofi

by adi1090x doticonshelldoticon

star image 2381 doticonGPL-3.0

A large collection of Rofi based custom Menu, Applets, Launchers & Powermenus.

phelia

by maxchehab doticontypescriptdoticon

star image 1908 doticonMIT

⚡ A reactive Slack application framework.

SwiftBar

by swiftbar doticonswiftdoticon

star image 1356 doticonMIT

Powerful macOS menu bar customization tool

react-menu

by szhsin doticonjavascriptdoticon

star image 664 doticonMIT

React component for building accessible menu, dropdown, submenu, context menu and more.

swiftui-navigation-stack

by matteopuc doticonswiftdoticon

star image 396 doticonMIT

An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation.

Fildem

by gonzaarcr doticonpythondoticon

star image 381 doticonGPL-3.0

Fildem global menu

Windows-terminal-context-menu

by kerol2r20 doticonpowershelldoticon

star image 371 doticon

📃 This is a simple script to add right click context menu for your best Windows terminal ❤

NativeYoutube

by Aayush9029 doticonswiftdoticon

star image 335 doticonGPL-3.0

Personal App that turned into "alpha released app" v2

PiStats

by Bunn doticonswiftdoticon

star image 311 doticonBSD-2-Clause

macOS app to visualize Pi-hole information

Top Authors in Menu

1

codrops

9 Libraries

star icon1283

2

googlearchive

5 Libraries

star icon67

3

CodeHimBlog

5 Libraries

star icon50

4

dynamicdriverepo

5 Libraries

star icon31

5

ukui

4 Libraries

star icon41

6

egoist

4 Libraries

star icon53

7

visini

4 Libraries

star icon84

8

firecat53

4 Libraries

star icon656

9

codingmarket07

4 Libraries

star icon9

10

Yalantis

4 Libraries

star icon15002

1

9 Libraries

star icon1283

2

5 Libraries

star icon67

3

5 Libraries

star icon50

4

5 Libraries

star icon31

5

4 Libraries

star icon41

6

4 Libraries

star icon53

7

4 Libraries

star icon84

8

4 Libraries

star icon656

9

4 Libraries

star icon9

10

4 Libraries

star icon15002

Trending Kits in Menu

No Trending Kits are available at this moment for Menu

Trending Discussions on Menu

Chrome Dev Tools Elements Tab stopped working (can't right click any DOM Node and hover over Dom Node doesnt highlight anything)

Android Navigation Component : BottomNavigationView's selected tab icon is not updated

Fixing Cluttered Titles on Graphs

java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest;

How do I set up NUnit in Visual Studio 2022?

TopAppBar flashing when navigating with Compose Navigation

Accessing the original file name of R markdown parameters file

Native Android -> How to create custom curved bottom navigation

Angular 6 to 12 Migration: Getting Multiple Warning: Css Minimizer Plugin: > Unexpected "$"

Why checkout step not recorded in the Google Analytics report?

QUESTION

Chrome Dev Tools Elements Tab stopped working (can't right click any DOM Node and hover over Dom Node doesnt highlight anything)

Asked 2022-Mar-30 at 06:55

In the Elements Tab of Chrome Dev Tools I can't right click any DOM Node anymore. I'm talking about the following menu that right click usually opens:
enter image description here

Furtheremore usually if you hover over DOM Nodes in the Elements Tab, the actual element on the website will be highlighted. This also doesnt work anymore. I have to explicitly left click the DOM Node and only then the element on the website will be highlighted. Before that it would work even just on hover.

enter image description here

I tried restarting my Browser and resetting Preferences of Dev Tools to default. Nothing works.

ANSWER

Answered 2022-Mar-09 at 18:34

Yeah, it's the latest update. I've found small solution. You need to click on 3 dots near the dom element https://prnt.sc/PwvcUE8OdSAf

Source https://stackoverflow.com/questions/71351360

QUESTION

Android Navigation Component : BottomNavigationView's selected tab icon is not updated

Asked 2022-Mar-23 at 09:36

I'm using BottomNavigationView with Navigation Component. When showing fragment is not root fragment, the tab icon is not updated (selected).

Example:
When I switch between Tab Home with Fragment A (which is root fragment) and Tab Star with Fragment B (which is also root fragment) it is working fine.
But when I navigate from Tab Home to another fragment, like fragment A2, and tap on Tab Star and again return to Tab Home, still Tab Star is selected in BottomNavigationView.

Android Navigation Component Bug

It was working fine with version 2.4.0-alpha05, This is happening when I updated it to 2.5.0-alpha01.

build.gradle (app)

1implementation "androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01"
2implementation "androidx.navigation:navigation-ui-ktx:2.5.0-alpha01"
3implementation "androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01"
4

build.gradle (root)

1implementation "androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01"
2implementation "androidx.navigation:navigation-ui-ktx:2.5.0-alpha01"
3implementation "androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01"
4classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01"
5

Graph:
Android Navigation Graph

1implementation "androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01"
2implementation "androidx.navigation:navigation-ui-ktx:2.5.0-alpha01"
3implementation "androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01"
4classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01"
5<navigation xmlns:android="http://schemas.android.com/apk/res/android"
6        xmlns:app="http://schemas.android.com/apk/res-auto"
7        xmlns:tools="http://schemas.android.com/tools"
8        android:id="@+id/graph"
9        app:startDestination="@id/fragmentA">
10    <fragment
11            android:id="@+id/fragmentA"
12            android:name="ui.test.FragmentA"
13            tools:layout="@layout/fragment_test"
14            android:label="FragmentA" >
15        <action
16                android:id="@+id/action_fragmentA_to_fragmentA2"
17                app:destination="@id/fragmentA2" />
18    </fragment>
19    <fragment
20            android:id="@+id/fragmentA2"
21            android:name="ui.test.FragmentA2"
22            tools:layout="@layout/fragment_test"
23            android:label="FragmentA2" />
24    <fragment
25            android:id="@+id/fragmentB"
26            android:name="ui.test.FragmentB"
27            tools:layout="@layout/fragment_test"
28            android:label="FragmentB" />
29</navigation>
30

Menu:

1implementation "androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01"
2implementation "androidx.navigation:navigation-ui-ktx:2.5.0-alpha01"
3implementation "androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01"
4classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01"
5<navigation xmlns:android="http://schemas.android.com/apk/res/android"
6        xmlns:app="http://schemas.android.com/apk/res-auto"
7        xmlns:tools="http://schemas.android.com/tools"
8        android:id="@+id/graph"
9        app:startDestination="@id/fragmentA">
10    <fragment
11            android:id="@+id/fragmentA"
12            android:name="ui.test.FragmentA"
13            tools:layout="@layout/fragment_test"
14            android:label="FragmentA" >
15        <action
16                android:id="@+id/action_fragmentA_to_fragmentA2"
17                app:destination="@id/fragmentA2" />
18    </fragment>
19    <fragment
20            android:id="@+id/fragmentA2"
21            android:name="ui.test.FragmentA2"
22            tools:layout="@layout/fragment_test"
23            android:label="FragmentA2" />
24    <fragment
25            android:id="@+id/fragmentB"
26            android:name="ui.test.FragmentB"
27            tools:layout="@layout/fragment_test"
28            android:label="FragmentB" />
29</navigation>
30<?xml version="1.0" encoding="utf-8"?>
31<menu xmlns:android="http://schemas.android.com/apk/res/android">
32    <item
33            android:id="@+id/fragmentA"
34            android:icon="@drawable/ic_home"
35            android:title="" />
36    <item
37            android:id="@+id/fragmentB"
38            android:icon="@drawable/ic_star"
39            android:title="" />
40</menu>
41

Am I doing something wrong? or this is bug?
How can I resolve this problem?

ANSWER

Answered 2022-Feb-12 at 06:00

Given your navigation graph, there is no way to associate fragmentA2 with your menu item fragmentA, so fragmentA is not selected when you return to fragmentA2. As per this issue:

NavigationUI has always used the current destination and what graph it is part of as the source of truth for what tab should be selected.

This can be seen by calling navigate() to go to your SecondFragment - even though you haven't used the bottom nav button, the selected tab was changed because the current destination has changed to R.id.frag_second.

So when you navigate() to R.id.frag_hint via your button in HomeFragment, NavigationUI receives a callback that the current destination has changed to R.id.frag_hint. It looks at that NavDestination and notes that there's no menu item that matches R.id.frag_hint. It then looks at the destination's parent graph - your R.id.sample <navigation> element. There's no menu item that matches that ID either, so NavigationUI can't associated that destination with any menu item and therefore simply does nothing. That is true on all versions of Navigation.

So what is different when you tap on a bottom navigation item? Well, nothing different from a NavigationUI perspective in fact: the exact same code runs and the current destination and what graph it is part of is the source of truth for what tab should be selected. In the Navigation 2.3.5, there was no state saved for each tab, so it only 'worked' because selecting a tab forced the ID of the current destination to match the destination of the menu item you just tapped.

So what you're seeing in your sample app is that there's no link between R.id.frag_hint and any menu item, which means NavigationUI does nothing. If you want to link R.id.frag_hint to your Home tab, then that's exactly what a nested navigation graph can be used for.

I.e., your navigation graph should instead look like:

1implementation &quot;androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01&quot;
2implementation &quot;androidx.navigation:navigation-ui-ktx:2.5.0-alpha01&quot;
3implementation &quot;androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01&quot;
4classpath &quot;androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01&quot;
5&lt;navigation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
6        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
7        xmlns:tools=&quot;http://schemas.android.com/tools&quot;
8        android:id=&quot;@+id/graph&quot;
9        app:startDestination=&quot;@id/fragmentA&quot;&gt;
10    &lt;fragment
11            android:id=&quot;@+id/fragmentA&quot;
12            android:name=&quot;ui.test.FragmentA&quot;
13            tools:layout=&quot;@layout/fragment_test&quot;
14            android:label=&quot;FragmentA&quot; &gt;
15        &lt;action
16                android:id=&quot;@+id/action_fragmentA_to_fragmentA2&quot;
17                app:destination=&quot;@id/fragmentA2&quot; /&gt;
18    &lt;/fragment&gt;
19    &lt;fragment
20            android:id=&quot;@+id/fragmentA2&quot;
21            android:name=&quot;ui.test.FragmentA2&quot;
22            tools:layout=&quot;@layout/fragment_test&quot;
23            android:label=&quot;FragmentA2&quot; /&gt;
24    &lt;fragment
25            android:id=&quot;@+id/fragmentB&quot;
26            android:name=&quot;ui.test.FragmentB&quot;
27            tools:layout=&quot;@layout/fragment_test&quot;
28            android:label=&quot;FragmentB&quot; /&gt;
29&lt;/navigation&gt;
30&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
31&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
32    &lt;item
33            android:id=&quot;@+id/fragmentA&quot;
34            android:icon=&quot;@drawable/ic_home&quot;
35            android:title=&quot;&quot; /&gt;
36    &lt;item
37            android:id=&quot;@+id/fragmentB&quot;
38            android:icon=&quot;@drawable/ic_star&quot;
39            android:title=&quot;&quot; /&gt;
40&lt;/menu&gt;
41&lt;navigation
42    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
43    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
44    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
45    android:id=&quot;@+id/sample&quot;
46    app:startDestination=&quot;@id/home&quot;&gt;
47   
48    &lt;navigation
49        android:id=&quot;@+id/home&quot;
50        app:startDestination=&quot;@id/frag_home&quot;&gt;
51        &lt;fragment
52            android:id=&quot;@+id/frag_home&quot;
53            android:name=&quot;eu.rekisoft.android.navbug.HomeFragment&quot;
54            tools:layout=&quot;@layout/fragment_home&quot;&gt;
55            &lt;action
56                android:id=&quot;@+id/cause_bug&quot;
57                app:destination=&quot;@id/frag_hint&quot;/&gt;
58        &lt;/fragment&gt;
59
60        &lt;fragment
61            android:id=&quot;@+id/frag_hint&quot;
62            android:name=&quot;eu.rekisoft.android.navbug.HintFragment&quot;
63            android:label=&quot;Hint&quot;
64            tools:layout=&quot;@layout/fragment_hint&quot;/&gt;
65    &lt;/navigation&gt;
66
67    &lt;fragment
68        android:id=&quot;@+id/frag_second&quot;
69        android:name=&quot;eu.rekisoft.android.navbug.SecondFragment&quot;
70        android:label=&quot;Second Fragment&quot;
71        tools:layout=&quot;@layout/fragment_second&quot;/&gt;
72
73&lt;/navigation&gt;
74

And your menu XML should be updated to use android:id="@id/home" to match your navigation graph.

Now, when you select the Home bottom nav item, the current destination changes to R.id.frag_hint (as your state was restored due to Navigation 2.4's support for multiple back stacks) and NavigationUI looks at the ID - R.id.frag_hint still doesn't match any menu item, but now the parent graph's ID, R.id.home does match a menu item - your Home menu item, hence, it becomes selected.

The intention that your navigation graph and its structure drives the UI is a key part of how NavigationUI works and is working as intended (there was a bug on earlier versions of Navigation 2.4 that broke this driving principle, but that has since been fixed in beta02). All of NavigationUI is built on public APIs specifically so that if you want to use some different logic for which bottom nav item is selected that is independent from your navigation graph structure, you can absolutely do that.

You'll note from the source code that you can call the public onNavDestinationSelected with your MenuItem to get the exact same navigate() logic which retaining your own ability to return any value from the setOnItemSelectedListener (which is what controls whether the tab becomes selected). Similarly, your own OnDestinationChangedListener can choose to look at the hierarchy of a destination to choose whether to change the selected bottom nav item or not.

So your graphs should also be using nested graphs for each tab:

1implementation &quot;androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01&quot;
2implementation &quot;androidx.navigation:navigation-ui-ktx:2.5.0-alpha01&quot;
3implementation &quot;androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01&quot;
4classpath &quot;androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01&quot;
5&lt;navigation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
6        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
7        xmlns:tools=&quot;http://schemas.android.com/tools&quot;
8        android:id=&quot;@+id/graph&quot;
9        app:startDestination=&quot;@id/fragmentA&quot;&gt;
10    &lt;fragment
11            android:id=&quot;@+id/fragmentA&quot;
12            android:name=&quot;ui.test.FragmentA&quot;
13            tools:layout=&quot;@layout/fragment_test&quot;
14            android:label=&quot;FragmentA&quot; &gt;
15        &lt;action
16                android:id=&quot;@+id/action_fragmentA_to_fragmentA2&quot;
17                app:destination=&quot;@id/fragmentA2&quot; /&gt;
18    &lt;/fragment&gt;
19    &lt;fragment
20            android:id=&quot;@+id/fragmentA2&quot;
21            android:name=&quot;ui.test.FragmentA2&quot;
22            tools:layout=&quot;@layout/fragment_test&quot;
23            android:label=&quot;FragmentA2&quot; /&gt;
24    &lt;fragment
25            android:id=&quot;@+id/fragmentB&quot;
26            android:name=&quot;ui.test.FragmentB&quot;
27            tools:layout=&quot;@layout/fragment_test&quot;
28            android:label=&quot;FragmentB&quot; /&gt;
29&lt;/navigation&gt;
30&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
31&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
32    &lt;item
33            android:id=&quot;@+id/fragmentA&quot;
34            android:icon=&quot;@drawable/ic_home&quot;
35            android:title=&quot;&quot; /&gt;
36    &lt;item
37            android:id=&quot;@+id/fragmentB&quot;
38            android:icon=&quot;@drawable/ic_star&quot;
39            android:title=&quot;&quot; /&gt;
40&lt;/menu&gt;
41&lt;navigation
42    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
43    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
44    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
45    android:id=&quot;@+id/sample&quot;
46    app:startDestination=&quot;@id/home&quot;&gt;
47   
48    &lt;navigation
49        android:id=&quot;@+id/home&quot;
50        app:startDestination=&quot;@id/frag_home&quot;&gt;
51        &lt;fragment
52            android:id=&quot;@+id/frag_home&quot;
53            android:name=&quot;eu.rekisoft.android.navbug.HomeFragment&quot;
54            tools:layout=&quot;@layout/fragment_home&quot;&gt;
55            &lt;action
56                android:id=&quot;@+id/cause_bug&quot;
57                app:destination=&quot;@id/frag_hint&quot;/&gt;
58        &lt;/fragment&gt;
59
60        &lt;fragment
61            android:id=&quot;@+id/frag_hint&quot;
62            android:name=&quot;eu.rekisoft.android.navbug.HintFragment&quot;
63            android:label=&quot;Hint&quot;
64            tools:layout=&quot;@layout/fragment_hint&quot;/&gt;
65    &lt;/navigation&gt;
66
67    &lt;fragment
68        android:id=&quot;@+id/frag_second&quot;
69        android:name=&quot;eu.rekisoft.android.navbug.SecondFragment&quot;
70        android:label=&quot;Second Fragment&quot;
71        tools:layout=&quot;@layout/fragment_second&quot;/&gt;
72
73&lt;/navigation&gt;
74&lt;navigation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
75        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
76        xmlns:tools=&quot;http://schemas.android.com/tools&quot;
77        android:id=&quot;@+id/graph&quot;
78        app:startDestination=&quot;@id/graphA&quot;&gt;
79    &lt;navigation
80        android:id=&quot;@+id/graphA&quot;
81        app:startDestination=&quot;@id/fragmentA&quot;&gt;
82        &lt;fragment
83            android:id=&quot;@+id/fragmentA&quot;
84            android:name=&quot;ui.test.FragmentA&quot;
85            tools:layout=&quot;@layout/fragment_test&quot;
86            android:label=&quot;FragmentA&quot; &gt;
87            &lt;action
88                android:id=&quot;@+id/action_fragmentA_to_fragmentA2&quot;
89                app:destination=&quot;@id/fragmentA2&quot; /&gt;
90        &lt;/fragment&gt;
91        &lt;fragment
92            android:id=&quot;@+id/fragmentA2&quot;
93            android:name=&quot;ui.test.FragmentA2&quot;
94            tools:layout=&quot;@layout/fragment_test&quot;
95            android:label=&quot;FragmentA2&quot; /&gt;
96    &lt;/navigation&gt;
97    &lt;navigation
98        android:id=&quot;@+id/graphB&quot;
99        app:startDestination=&quot;@id/fragmentB&quot;&gt;
100        &lt;fragment
101            android:id=&quot;@+id/fragmentB&quot;
102            android:name=&quot;ui.test.FragmentB&quot;
103            tools:layout=&quot;@layout/fragment_test&quot;
104            android:label=&quot;FragmentB&quot; /&gt;
105    &lt;/navigation&gt;
106&lt;/navigation&gt;
107

Menu:

1implementation &quot;androidx.navigation:navigation-fragment-ktx:2.5.0-alpha01&quot;
2implementation &quot;androidx.navigation:navigation-ui-ktx:2.5.0-alpha01&quot;
3implementation &quot;androidx.navigation:navigation-dynamic-features-fragment:2.5.0-alpha01&quot;
4classpath &quot;androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0-alpha01&quot;
5&lt;navigation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
6        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
7        xmlns:tools=&quot;http://schemas.android.com/tools&quot;
8        android:id=&quot;@+id/graph&quot;
9        app:startDestination=&quot;@id/fragmentA&quot;&gt;
10    &lt;fragment
11            android:id=&quot;@+id/fragmentA&quot;
12            android:name=&quot;ui.test.FragmentA&quot;
13            tools:layout=&quot;@layout/fragment_test&quot;
14            android:label=&quot;FragmentA&quot; &gt;
15        &lt;action
16                android:id=&quot;@+id/action_fragmentA_to_fragmentA2&quot;
17                app:destination=&quot;@id/fragmentA2&quot; /&gt;
18    &lt;/fragment&gt;
19    &lt;fragment
20            android:id=&quot;@+id/fragmentA2&quot;
21            android:name=&quot;ui.test.FragmentA2&quot;
22            tools:layout=&quot;@layout/fragment_test&quot;
23            android:label=&quot;FragmentA2&quot; /&gt;
24    &lt;fragment
25            android:id=&quot;@+id/fragmentB&quot;
26            android:name=&quot;ui.test.FragmentB&quot;
27            tools:layout=&quot;@layout/fragment_test&quot;
28            android:label=&quot;FragmentB&quot; /&gt;
29&lt;/navigation&gt;
30&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
31&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
32    &lt;item
33            android:id=&quot;@+id/fragmentA&quot;
34            android:icon=&quot;@drawable/ic_home&quot;
35            android:title=&quot;&quot; /&gt;
36    &lt;item
37            android:id=&quot;@+id/fragmentB&quot;
38            android:icon=&quot;@drawable/ic_star&quot;
39            android:title=&quot;&quot; /&gt;
40&lt;/menu&gt;
41&lt;navigation
42    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
43    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
44    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
45    android:id=&quot;@+id/sample&quot;
46    app:startDestination=&quot;@id/home&quot;&gt;
47   
48    &lt;navigation
49        android:id=&quot;@+id/home&quot;
50        app:startDestination=&quot;@id/frag_home&quot;&gt;
51        &lt;fragment
52            android:id=&quot;@+id/frag_home&quot;
53            android:name=&quot;eu.rekisoft.android.navbug.HomeFragment&quot;
54            tools:layout=&quot;@layout/fragment_home&quot;&gt;
55            &lt;action
56                android:id=&quot;@+id/cause_bug&quot;
57                app:destination=&quot;@id/frag_hint&quot;/&gt;
58        &lt;/fragment&gt;
59
60        &lt;fragment
61            android:id=&quot;@+id/frag_hint&quot;
62            android:name=&quot;eu.rekisoft.android.navbug.HintFragment&quot;
63            android:label=&quot;Hint&quot;
64            tools:layout=&quot;@layout/fragment_hint&quot;/&gt;
65    &lt;/navigation&gt;
66
67    &lt;fragment
68        android:id=&quot;@+id/frag_second&quot;
69        android:name=&quot;eu.rekisoft.android.navbug.SecondFragment&quot;
70        android:label=&quot;Second Fragment&quot;
71        tools:layout=&quot;@layout/fragment_second&quot;/&gt;
72
73&lt;/navigation&gt;
74&lt;navigation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
75        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
76        xmlns:tools=&quot;http://schemas.android.com/tools&quot;
77        android:id=&quot;@+id/graph&quot;
78        app:startDestination=&quot;@id/graphA&quot;&gt;
79    &lt;navigation
80        android:id=&quot;@+id/graphA&quot;
81        app:startDestination=&quot;@id/fragmentA&quot;&gt;
82        &lt;fragment
83            android:id=&quot;@+id/fragmentA&quot;
84            android:name=&quot;ui.test.FragmentA&quot;
85            tools:layout=&quot;@layout/fragment_test&quot;
86            android:label=&quot;FragmentA&quot; &gt;
87            &lt;action
88                android:id=&quot;@+id/action_fragmentA_to_fragmentA2&quot;
89                app:destination=&quot;@id/fragmentA2&quot; /&gt;
90        &lt;/fragment&gt;
91        &lt;fragment
92            android:id=&quot;@+id/fragmentA2&quot;
93            android:name=&quot;ui.test.FragmentA2&quot;
94            tools:layout=&quot;@layout/fragment_test&quot;
95            android:label=&quot;FragmentA2&quot; /&gt;
96    &lt;/navigation&gt;
97    &lt;navigation
98        android:id=&quot;@+id/graphB&quot;
99        app:startDestination=&quot;@id/fragmentB&quot;&gt;
100        &lt;fragment
101            android:id=&quot;@+id/fragmentB&quot;
102            android:name=&quot;ui.test.FragmentB&quot;
103            tools:layout=&quot;@layout/fragment_test&quot;
104            android:label=&quot;FragmentB&quot; /&gt;
105    &lt;/navigation&gt;
106&lt;/navigation&gt;
107&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
108&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
109    &lt;item
110            android:id=&quot;@+id/graphA&quot;
111            android:icon=&quot;@drawable/ic_home&quot;
112            android:title=&quot;&quot; /&gt;
113    &lt;item
114            android:id=&quot;@+id/graphB&quot;
115            android:icon=&quot;@drawable/ic_star&quot;
116            android:title=&quot;&quot; /&gt;
117&lt;/menu&gt;
118

Source https://stackoverflow.com/questions/71089052

QUESTION

Fixing Cluttered Titles on Graphs

Asked 2022-Mar-07 at 19:08

I made the following 25 network graphs (all of these graphs are copies for simplicity - in reality, they will all be different):

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38

I would like to "tile" them as 5 x 5 : Since these are interactive html plots - I used the following command:

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38library(manipulateWidget)
39library(htmltools)
40
41ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
42
43htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
44

I found out how to add a zoom option for each individual graph:

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38library(manipulateWidget)
39library(htmltools)
40
41ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
42
43htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
44 a = toVisNetworkData(graph) %&gt;%
45    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
46    do.call(visNetwork, .) %&gt;%
47    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%  
48    visInteraction(navigationButtons = TRUE) %&gt;% 
49    visEdges(arrows = 'to') 
50
51y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
52
53ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
54
55htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
56

enter image description here

But now the "zoom" options and "titles" have "cluttered" all the graphs!

I was thinking it might be better to "stack" all these graphs on top of each other and save each graph as a "group type" - and then hide/unhide as we please:

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38library(manipulateWidget)
39library(htmltools)
40
41ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
42
43htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
44 a = toVisNetworkData(graph) %&gt;%
45    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
46    do.call(visNetwork, .) %&gt;%
47    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%  
48    visInteraction(navigationButtons = TRUE) %&gt;% 
49    visEdges(arrows = 'to') 
50
51y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
52
53ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
54
55htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
56visNetwork(data, relations) %&gt;% 
57 visOptions(selectedBy = &quot;group&quot;)
58
  • Can we put all 25 graphs on one page and then "zoom" into each individual graph to view it better (e.g. have only one set of zoom/navigation buttons in the corner of the screen that works for all graphs)?

  • Is there a way to stop the titles from overlapping with the graphs?

  • Can we put all 25 graphs on one page and then "hide" individual graphs by "checking" an option menu button? (like the last example on this page: https://datastorm-open.github.io/visNetwork/options.html)

Here are the possible solutions I have thought of for this problem:

  • Option 1: (a single zoom/navigation option for all graphs and no cluttered labels)

enter image description here

  • Option 2: (In the future, each "trip" will be different - "trips" will contain the same nodes, but have different edge connections and different titles/subtitles.)

enter image description here

I know that this style of selection ("Option 2") can be made using the following code:

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38library(manipulateWidget)
39library(htmltools)
40
41ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
42
43htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
44 a = toVisNetworkData(graph) %&gt;%
45    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
46    do.call(visNetwork, .) %&gt;%
47    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%  
48    visInteraction(navigationButtons = TRUE) %&gt;% 
49    visEdges(arrows = 'to') 
50
51y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
52
53ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
54
55htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
56visNetwork(data, relations) %&gt;% 
57 visOptions(selectedBy = &quot;group&quot;)
58nodes &lt;- data.frame(id = 1:15, label = paste(&quot;Label&quot;, 1:15),
59 group = sample(LETTERS[1:3], 15, replace = TRUE))
60
61edges &lt;- data.frame(from = trunc(runif(15)*(15-1))+1,
62 to = trunc(runif(15)*(15-1))+1)
63
64
65
66visNetwork(nodes, edges) %&gt;% 
67    visOptions(selectedBy = &quot;group&quot;)
68

But I am not sure how to adapt the above code for a pre-existing set of "visNetwork" graphs. For example, suppose I already have "visNetwork" graphs "a, b, c, d, e" - how can I "stack them on top of each other" and "shuffle through them" with a "select menu" like in the above code?

enter image description here

Can someone please show me a way of addressing this clutter problem using Option 1 and Option 2?

Thank you!

ANSWER

Answered 2022-Mar-03 at 21:12

While my solution isn't exactly what you describe under Option 2, it is close. We use combineWidgets() to create a grid with a single column and a row height where one graph covers most of the screen height. We squeeze in a link between each widget instance that scrolls the browser window down to show the following graph when clicked.

Let me know if this is working for you. It should be possible to automatically adjust the row size according to the browser window size. Currently, this depends on the browser window height being around 1000px.

I modified your code for the graph creation slightly and wrapped it in a function. This allows us to create 25 different-looking graphs easily. This way testing the resulting HTML file is more fun! What follows the function definition is the code to create a list of HTML objects that we then feed into combineWidgets().

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38library(manipulateWidget)
39library(htmltools)
40
41ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
42
43htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
44 a = toVisNetworkData(graph) %&gt;%
45    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
46    do.call(visNetwork, .) %&gt;%
47    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%  
48    visInteraction(navigationButtons = TRUE) %&gt;% 
49    visEdges(arrows = 'to') 
50
51y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
52
53ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
54
55htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
56visNetwork(data, relations) %&gt;% 
57 visOptions(selectedBy = &quot;group&quot;)
58nodes &lt;- data.frame(id = 1:15, label = paste(&quot;Label&quot;, 1:15),
59 group = sample(LETTERS[1:3], 15, replace = TRUE))
60
61edges &lt;- data.frame(from = trunc(runif(15)*(15-1))+1,
62 to = trunc(runif(15)*(15-1))+1)
63
64
65
66visNetwork(nodes, edges) %&gt;% 
67    visOptions(selectedBy = &quot;group&quot;)
68library(visNetwork)
69library(tidyverse)
70library(igraph)
71library(manipulateWidget)
72library(htmltools)
73
74create_trip_graph &lt;-
75  function(x, distance = NULL) {
76    n &lt;- 15
77    data &lt;- tibble(d = 1:n,
78                   name =
79                     c(
80                       &quot;new york&quot;,
81                       &quot;chicago&quot;,
82                       &quot;los angeles&quot;,
83                       &quot;orlando&quot;,
84                       &quot;houston&quot;,
85                       &quot;seattle&quot;,
86                       &quot;washington&quot;,
87                       &quot;baltimore&quot;,
88                       &quot;atlanta&quot;,
89                       &quot;las vegas&quot;,
90                       &quot;oakland&quot;,
91                       &quot;phoenix&quot;,
92                       &quot;kansas&quot;,
93                       &quot;miami&quot;,
94                       &quot;newark&quot;
95                     ))
96    
97    relations &lt;-  tibble(from = sample(data$d),
98                         to = lead(from, default = from[1]))    
99    graph &lt;-
100      graph_from_data_frame(relations, directed = TRUE, vertices = data)
101    
102    V(graph)$color &lt;-
103      ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
104    
105    if (is.null(distance))
106      # This generates a random distance value if none is 
107      # specified in the function call. Values are just for 
108      # demonstration, no actual distances are calculated.
109      distance &lt;- sample(seq(19, 25, .1), 1)
110    
111    toVisNetworkData(graph) %&gt;%
112      c(., list(
113        main = paste0(&quot;Trip &quot;, x, &quot; : &quot;),
114        submain = paste0(distance, &quot;KM&quot;)
115      )) %&gt;%
116      do.call(visNetwork, .) %&gt;%
117      visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%
118      visInteraction(navigationButtons = TRUE) %&gt;%
119      visEdges(arrows = 'to')
120  }
121
122comb_vgraphs &lt;- lapply(1:25, function (x) list(
123  create_trip_graph(x),
124  htmltools::a(&quot;NEXT TRIP&quot;, 
125               onclick = 'window.scrollBy(0,950)', 
126               style = 'color:blue; text-decoration:underline;')))  %&gt;%
127  unlist(recursive = FALSE)
128
129
130ff &lt;-
131  combineWidgets(
132    list = comb_vgraphs,
133    ncol = 1,
134    height = 25 * 950,
135    rowsize = c(24, 1)
136  )
137
138htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
139

If you want to have 5 network maps per row the code gets a bit more complex and it also might lead to a situation where the user might have to do horizontal scrolling in order to see everything, which is something you usually want to avoid when creating HTML pages. Here is the code for a 5 maps per row solution:

1library(tidyverse)
2library(igraph)
3
4
5set.seed(123)
6n=15
7data = data.frame(tibble(d = paste(1:n)))
8
9relations = data.frame(tibble(
10  from = sample(data$d),
11  to = lead(from, default=from[1]),
12))
13
14data$name = c(&quot;new york&quot;, &quot;chicago&quot;, &quot;los angeles&quot;, &quot;orlando&quot;, &quot;houston&quot;, &quot;seattle&quot;, &quot;washington&quot;, &quot;baltimore&quot;, &quot;atlanta&quot;, &quot;las vegas&quot;, &quot;oakland&quot;, &quot;phoenix&quot;, &quot;kansas&quot;, &quot;miami&quot;, &quot;newark&quot; )
15
16graph = graph_from_data_frame(relations, directed=T, vertices = data) 
17
18V(graph)$color &lt;- ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
19
20plot(graph, layout=layout.circle, edge.arrow.size = 0.2, main = &quot;my_graph&quot;)
21
22library(visNetwork)
23
24    a = visIgraph(graph)  
25
26m_1 = 1
27m_2 = 23.6
28
29 a = toVisNetworkData(graph) %&gt;%
30    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
31    do.call(visNetwork, .) %&gt;%
32    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;% 
33    visEdges(arrows = 'to') 
34
35
36
37y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
38library(manipulateWidget)
39library(htmltools)
40
41ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
42
43htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
44 a = toVisNetworkData(graph) %&gt;%
45    c(., list(main = paste0(&quot;Trip &quot;, m_1, &quot; : &quot;), submain = paste0 (m_2, &quot;KM&quot;) )) %&gt;%
46    do.call(visNetwork, .) %&gt;%
47    visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%  
48    visInteraction(navigationButtons = TRUE) %&gt;% 
49    visEdges(arrows = 'to') 
50
51y = x = w = v = u = t = s = r = q  = p = o = n = m = l = k = j = i = h = g = f = e = d = c = b = a
52
53ff = combineWidgets(y , x , w , v , u , t , s , r , q  , p , o , n , m , l , k , j , i , h , g , f , e , d , c , b , a)
54
55htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
56visNetwork(data, relations) %&gt;% 
57 visOptions(selectedBy = &quot;group&quot;)
58nodes &lt;- data.frame(id = 1:15, label = paste(&quot;Label&quot;, 1:15),
59 group = sample(LETTERS[1:3], 15, replace = TRUE))
60
61edges &lt;- data.frame(from = trunc(runif(15)*(15-1))+1,
62 to = trunc(runif(15)*(15-1))+1)
63
64
65
66visNetwork(nodes, edges) %&gt;% 
67    visOptions(selectedBy = &quot;group&quot;)
68library(visNetwork)
69library(tidyverse)
70library(igraph)
71library(manipulateWidget)
72library(htmltools)
73
74create_trip_graph &lt;-
75  function(x, distance = NULL) {
76    n &lt;- 15
77    data &lt;- tibble(d = 1:n,
78                   name =
79                     c(
80                       &quot;new york&quot;,
81                       &quot;chicago&quot;,
82                       &quot;los angeles&quot;,
83                       &quot;orlando&quot;,
84                       &quot;houston&quot;,
85                       &quot;seattle&quot;,
86                       &quot;washington&quot;,
87                       &quot;baltimore&quot;,
88                       &quot;atlanta&quot;,
89                       &quot;las vegas&quot;,
90                       &quot;oakland&quot;,
91                       &quot;phoenix&quot;,
92                       &quot;kansas&quot;,
93                       &quot;miami&quot;,
94                       &quot;newark&quot;
95                     ))
96    
97    relations &lt;-  tibble(from = sample(data$d),
98                         to = lead(from, default = from[1]))    
99    graph &lt;-
100      graph_from_data_frame(relations, directed = TRUE, vertices = data)
101    
102    V(graph)$color &lt;-
103      ifelse(data$d == relations$from[1], &quot;red&quot;, &quot;orange&quot;)
104    
105    if (is.null(distance))
106      # This generates a random distance value if none is 
107      # specified in the function call. Values are just for 
108      # demonstration, no actual distances are calculated.
109      distance &lt;- sample(seq(19, 25, .1), 1)
110    
111    toVisNetworkData(graph) %&gt;%
112      c(., list(
113        main = paste0(&quot;Trip &quot;, x, &quot; : &quot;),
114        submain = paste0(distance, &quot;KM&quot;)
115      )) %&gt;%
116      do.call(visNetwork, .) %&gt;%
117      visIgraphLayout(layout = &quot;layout_in_circle&quot;) %&gt;%
118      visInteraction(navigationButtons = TRUE) %&gt;%
119      visEdges(arrows = 'to')
120  }
121
122comb_vgraphs &lt;- lapply(1:25, function (x) list(
123  create_trip_graph(x),
124  htmltools::a(&quot;NEXT TRIP&quot;, 
125               onclick = 'window.scrollBy(0,950)', 
126               style = 'color:blue; text-decoration:underline;')))  %&gt;%
127  unlist(recursive = FALSE)
128
129
130ff &lt;-
131  combineWidgets(
132    list = comb_vgraphs,
133    ncol = 1,
134    height = 25 * 950,
135    rowsize = c(24, 1)
136  )
137
138htmltools::save_html(html = ff, file = &quot;widgets.html&quot;)
139comb_vgraphs2 &lt;- lapply(1:25, function(x) {
140  a &lt;- list(create_trip_graph(x))
141  # We detect whenever we are creating the 5th, 10th, 15th etc. network map
142  # and add the link after that one.
143  if (x %% 5 == 0 &amp; x &lt; 25) a[[2]] &lt;- htmltools::a(&quot;NEXT 5 TRIPS&quot;, 
144                                          onclick = 'window.scrollBy(0,500)', 
145                                          style = 'color:blue; text-decoration:underline;')
146  a
147}) %&gt;%
148  unlist(recursive = FALSE)
149
150ff2 &lt;-
151  combineWidgets(
152    list = comb_vgraphs2,
153    ncol = 6, # We need six columns, 5 for the network maps 
154              # and 1 for the link to scroll the page.
155    height = 6 * 500,
156    width = 1700
157    #rowsize = c(24, 1)
158  )
159
160# We need to add some white space in for the scrolling by clicking the link to 
161# still work for the last row.
162ff2$widgets[[length(ff2$widgets) + 1]] &lt;- htmltools::div(style = &quot;height: 1000px;&quot;)
163
164htmltools::save_html(html = ff2, file = &quot;widgets2.html&quot;)
165

In general I'd recommend you play around with the height and width, ncol and nrow arguments of combineWidgets() to achieve a satisfying solution. My strategy when building this was to first create a grid without the scroll link and add that in, after getting the grid right.

Source https://stackoverflow.com/questions/71244872

QUESTION

java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest;

Asked 2022-Feb-25 at 23:22

It was working fine before I have done nothing, no packages update, no gradle update no nothing just created new build and this error occurs. but for some team members the error occur after gradle sync.

The issue is that build is generating successfully without any error but when opens the app it suddenly gets crash (in both debug and release mode)

Error

1    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8            at java.lang.Thread.run(Thread.java:923)
9

gradle-wrapper.properties

1    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8            at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14

build.gradle

1    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8            at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17  ext {
18      buildToolsVersion = &quot;30.0.2&quot;
19      minSdkVersion = 21
20      compileSdkVersion = 30
21      targetSdkVersion = 30
22      ndkVersion = &quot;21.4.7075529&quot;
23  }
24  repositories {
25      google()
26      mavenCentral()
27      jcenter()
28      // maven {
29      //    url 'https://maven.fabric.io/public'
30      // }
31      maven { url &quot;https://www.jitpack.io&quot; }
32  }
33  dependencies {
34      classpath(&quot;com.android.tools.build:gradle:4.2.2&quot;)
35      classpath 'com.google.gms:google-services:4.2.0'  // Google Services plugin
36      // Add the Fabric Crashlytics plugin.
37      // classpath 'io.fabric.tools:gradle:1.31.2'
38      // firebase performance sdk
39      classpath 'com.google.firebase:perf-plugin:1.4.0'
40      classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43      // NOTE: Do not place your application dependencies here; they belong
44      // in the individual module build.gradle files
45  }
46}
47
48allprojects {
49  repositories {
50      mavenCentral()
51      mavenLocal()
52      maven {
53          // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54          url(&quot;$rootDir/../node_modules/react-native/android&quot;)
55      }
56      maven {
57          // Android JSC is installed from npm
58          url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
59      }
60
61      google()
62      jcenter()
63      maven { url 'https://www.jitpack.io' }
64  }
65}
66
67
68subprojects {
69  afterEvaluate {project -&gt;
70      if (project.hasProperty(&quot;android&quot;)) {
71          android {
72              buildToolsVersion &quot;28.0.3&quot;
73              compileSdkVersion 28
74          }
75      }
76  }
77}
78
79subprojects {
80  afterEvaluate {project -&gt;
81      if (project.hasProperty(&quot;android&quot;)) {
82          android {
83              compileSdkVersion 29
84              buildToolsVersion '29.0.3'
85          }
86      }
87  }
88}
89

packages

1    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8            at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17  ext {
18      buildToolsVersion = &quot;30.0.2&quot;
19      minSdkVersion = 21
20      compileSdkVersion = 30
21      targetSdkVersion = 30
22      ndkVersion = &quot;21.4.7075529&quot;
23  }
24  repositories {
25      google()
26      mavenCentral()
27      jcenter()
28      // maven {
29      //    url 'https://maven.fabric.io/public'
30      // }
31      maven { url &quot;https://www.jitpack.io&quot; }
32  }
33  dependencies {
34      classpath(&quot;com.android.tools.build:gradle:4.2.2&quot;)
35      classpath 'com.google.gms:google-services:4.2.0'  // Google Services plugin
36      // Add the Fabric Crashlytics plugin.
37      // classpath 'io.fabric.tools:gradle:1.31.2'
38      // firebase performance sdk
39      classpath 'com.google.firebase:perf-plugin:1.4.0'
40      classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43      // NOTE: Do not place your application dependencies here; they belong
44      // in the individual module build.gradle files
45  }
46}
47
48allprojects {
49  repositories {
50      mavenCentral()
51      mavenLocal()
52      maven {
53          // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54          url(&quot;$rootDir/../node_modules/react-native/android&quot;)
55      }
56      maven {
57          // Android JSC is installed from npm
58          url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
59      }
60
61      google()
62      jcenter()
63      maven { url 'https://www.jitpack.io' }
64  }
65}
66
67
68subprojects {
69  afterEvaluate {project -&gt;
70      if (project.hasProperty(&quot;android&quot;)) {
71          android {
72              buildToolsVersion &quot;28.0.3&quot;
73              compileSdkVersion 28
74          }
75      }
76  }
77}
78
79subprojects {
80  afterEvaluate {project -&gt;
81      if (project.hasProperty(&quot;android&quot;)) {
82          android {
83              compileSdkVersion 29
84              buildToolsVersion '29.0.3'
85          }
86      }
87  }
88}
89&quot;dependencies&quot;: {
90  &quot;@eva-design/eva&quot;: &quot;^2.1.0&quot;,
91  &quot;@react-native-async-storage/async-storage&quot;: &quot;^1.15.14&quot;,
92  &quot;@react-native-community/blur&quot;: &quot;^3.6.0&quot;,
93  &quot;@react-native-community/checkbox&quot;: &quot;^0.5.0&quot;,
94  &quot;@react-native-community/netinfo&quot;: &quot;^6.0.1&quot;,
95  &quot;@react-native-community/toolbar-android&quot;: &quot;^0.1.0-rc.2&quot;,
96  &quot;@react-native-firebase/analytics&quot;: &quot;^10.3.1&quot;,
97  &quot;@react-native-firebase/app&quot;: &quot;^10.3.0&quot;,
98  &quot;@react-native-firebase/auth&quot;: &quot;^10.3.1&quot;,
99  &quot;@react-native-firebase/crashlytics&quot;: &quot;^10.3.1&quot;,
100  &quot;@react-native-firebase/dynamic-links&quot;: &quot;^10.3.1&quot;,
101  &quot;@react-native-firebase/firestore&quot;: &quot;^10.3.1&quot;,
102  &quot;@react-native-firebase/iid&quot;: &quot;^10.3.1&quot;,
103  &quot;@react-native-firebase/in-app-messaging&quot;: &quot;^10.3.1&quot;,
104  &quot;@react-native-firebase/messaging&quot;: &quot;^10.3.1&quot;,
105  &quot;@react-native-firebase/perf&quot;: &quot;^10.3.1&quot;,
106  &quot;@react-native-firebase/remote-config&quot;: &quot;^10.3.1&quot;,
107  &quot;@react-native-firebase/storage&quot;: &quot;^10.3.1&quot;,
108  &quot;@react-native-picker/picker&quot;: &quot;^2.1.0&quot;,
109  &quot;@react-navigation/bottom-tabs&quot;: &quot;^6.0.9&quot;,
110  &quot;@react-navigation/native&quot;: &quot;^6.0.6&quot;,
111  &quot;@react-navigation/stack&quot;: &quot;^6.0.11&quot;,
112  &quot;@types/react-native&quot;: &quot;^0.65.5&quot;,
113  &quot;@ui-kitten/components&quot;: &quot;^5.1.0&quot;,
114  &quot;axios&quot;: &quot;^0.19.0&quot;,
115  &quot;i18n-js&quot;: &quot;^3.5.1&quot;,
116  &quot;moment&quot;: &quot;^2.24.0&quot;,
117  &quot;native-base&quot;: &quot;2.13.8&quot;,
118  &quot;react&quot;: &quot;17.0.2&quot;,
119  &quot;react-content-loader&quot;: &quot;^4.3.4&quot;,
120  &quot;react-native&quot;: &quot;0.66.0&quot;,
121  &quot;react-native-actions-sheet&quot;: &quot;^0.5.6&quot;,
122  &quot;react-native-adjust&quot;: &quot;^4.28.0&quot;,
123  &quot;react-native-amplitude-analytics&quot;: &quot;^0.2.7&quot;,
124  &quot;react-native-animatable&quot;: &quot;^1.3.3&quot;,
125  &quot;react-native-code-push&quot;: &quot;^7.0.4&quot;,
126  &quot;react-native-config&quot;: &quot;^1.3.3&quot;,
127  &quot;react-native-contacts&quot;: &quot;^5.0.7&quot;,
128  &quot;react-native-dots-pagination&quot;: &quot;^0.2.0&quot;,
129  &quot;react-native-fbsdk-next&quot;: &quot;^6.2.0&quot;,
130  &quot;react-native-fingerprint-scanner&quot;: &quot;^6.0.0&quot;,
131  &quot;react-native-floating-action&quot;: &quot;^1.22.0&quot;,
132  &quot;react-native-geocoding&quot;: &quot;^0.4.0&quot;,
133  &quot;react-native-geolocation-service&quot;: &quot;^5.2.0&quot;,
134  &quot;react-native-gesture-handler&quot;: &quot;^1.5.2&quot;,
135  &quot;react-native-get-random-values&quot;: &quot;^1.4.0&quot;,
136  &quot;react-native-html-to-pdf-lite&quot;: &quot;^0.11.0&quot;,
137  &quot;react-native-image-base64&quot;: &quot;^0.1.4&quot;,
138  &quot;react-native-image-pan-zoom&quot;: &quot;^2.1.11&quot;,
139  &quot;react-native-image-picker&quot;: &quot;^4.1.2&quot;,
140  &quot;react-native-image-resizer&quot;: &quot;^1.2.0&quot;,
141  &quot;react-native-in-app-review&quot;: &quot;^2.1.7&quot;,
142  &quot;react-native-linear-gradient&quot;: &quot;^2.5.6&quot;,
143  &quot;react-native-loading-spinner-overlay&quot;: &quot;^1.1.0&quot;,
144  &quot;react-native-material-menu&quot;: &quot;^1.0.0&quot;,
145  &quot;react-native-material-textfield&quot;: &quot;^0.16.1&quot;,
146  &quot;react-native-modal&quot;: &quot;^13.0.0&quot;,
147  &quot;react-native-phone-call&quot;: &quot;^1.0.9&quot;,
148  &quot;react-native-ratings&quot;: &quot;^7.3.0&quot;,
149  &quot;react-native-reanimated&quot;: &quot;^1.13.0&quot;,
150  &quot;react-native-safe-area-context&quot;: &quot;^3.3.2&quot;,
151  &quot;react-native-screens&quot;: &quot;^3.9.0&quot;,
152  &quot;react-native-share&quot;: &quot;^7.2.1&quot;,
153  &quot;react-native-smooth-pincode-input&quot;: &quot;^1.0.9&quot;,
154  &quot;react-native-sms-retriever&quot;: &quot;https://github.com/sarmad1995/react-native-sms-retriever.git&quot;,
155  &quot;react-native-snap-carousel&quot;: &quot;^3.9.1&quot;,
156  &quot;react-native-splash-screen&quot;: &quot;^3.2.0&quot;,
157  &quot;react-native-svg&quot;: &quot;^12.1.1&quot;,
158  &quot;react-native-version-check&quot;: &quot;^3.4.2&quot;,
159  &quot;react-native-version-number&quot;: &quot;^0.3.6&quot;,
160  &quot;react-native-view-shot&quot;: &quot;^3.1.2&quot;,
161  &quot;react-native-walkthrough-tooltip&quot;: &quot;^1.3.0&quot;,
162  &quot;react-redux&quot;: &quot;^7.1.3&quot;,
163  &quot;redux&quot;: &quot;^4.0.4&quot;,
164  &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
165  &quot;redux-persist&quot;: &quot;^6.0.0&quot;,
166  &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
167  &quot;rn-fetch-blob&quot;: &quot;^0.12.0&quot;,
168  &quot;urbanairship-react-native&quot;: &quot;^12.0.0&quot;,
169  &quot;uuid&quot;: &quot;^8.3.0&quot;
170},
171

ANSWER

Answered 2022-Feb-25 at 23:22

We have fixed the issue by replacing

1    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8            at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17  ext {
18      buildToolsVersion = &quot;30.0.2&quot;
19      minSdkVersion = 21
20      compileSdkVersion = 30
21      targetSdkVersion = 30
22      ndkVersion = &quot;21.4.7075529&quot;
23  }
24  repositories {
25      google()
26      mavenCentral()
27      jcenter()
28      // maven {
29      //    url 'https://maven.fabric.io/public'
30      // }
31      maven { url &quot;https://www.jitpack.io&quot; }
32  }
33  dependencies {
34      classpath(&quot;com.android.tools.build:gradle:4.2.2&quot;)
35      classpath 'com.google.gms:google-services:4.2.0'  // Google Services plugin
36      // Add the Fabric Crashlytics plugin.
37      // classpath 'io.fabric.tools:gradle:1.31.2'
38      // firebase performance sdk
39      classpath 'com.google.firebase:perf-plugin:1.4.0'
40      classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43      // NOTE: Do not place your application dependencies here; they belong
44      // in the individual module build.gradle files
45  }
46}
47
48allprojects {
49  repositories {
50      mavenCentral()
51      mavenLocal()
52      maven {
53          // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54          url(&quot;$rootDir/../node_modules/react-native/android&quot;)
55      }
56      maven {
57          // Android JSC is installed from npm
58          url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
59      }
60
61      google()
62      jcenter()
63      maven { url 'https://www.jitpack.io' }
64  }
65}
66
67
68subprojects {
69  afterEvaluate {project -&gt;
70      if (project.hasProperty(&quot;android&quot;)) {
71          android {
72              buildToolsVersion &quot;28.0.3&quot;
73              compileSdkVersion 28
74          }
75      }
76  }
77}
78
79subprojects {
80  afterEvaluate {project -&gt;
81      if (project.hasProperty(&quot;android&quot;)) {
82          android {
83              compileSdkVersion 29
84              buildToolsVersion '29.0.3'
85          }
86      }
87  }
88}
89&quot;dependencies&quot;: {
90  &quot;@eva-design/eva&quot;: &quot;^2.1.0&quot;,
91  &quot;@react-native-async-storage/async-storage&quot;: &quot;^1.15.14&quot;,
92  &quot;@react-native-community/blur&quot;: &quot;^3.6.0&quot;,
93  &quot;@react-native-community/checkbox&quot;: &quot;^0.5.0&quot;,
94  &quot;@react-native-community/netinfo&quot;: &quot;^6.0.1&quot;,
95  &quot;@react-native-community/toolbar-android&quot;: &quot;^0.1.0-rc.2&quot;,
96  &quot;@react-native-firebase/analytics&quot;: &quot;^10.3.1&quot;,
97  &quot;@react-native-firebase/app&quot;: &quot;^10.3.0&quot;,
98  &quot;@react-native-firebase/auth&quot;: &quot;^10.3.1&quot;,
99  &quot;@react-native-firebase/crashlytics&quot;: &quot;^10.3.1&quot;,
100  &quot;@react-native-firebase/dynamic-links&quot;: &quot;^10.3.1&quot;,
101  &quot;@react-native-firebase/firestore&quot;: &quot;^10.3.1&quot;,
102  &quot;@react-native-firebase/iid&quot;: &quot;^10.3.1&quot;,
103  &quot;@react-native-firebase/in-app-messaging&quot;: &quot;^10.3.1&quot;,
104  &quot;@react-native-firebase/messaging&quot;: &quot;^10.3.1&quot;,
105  &quot;@react-native-firebase/perf&quot;: &quot;^10.3.1&quot;,
106  &quot;@react-native-firebase/remote-config&quot;: &quot;^10.3.1&quot;,
107  &quot;@react-native-firebase/storage&quot;: &quot;^10.3.1&quot;,
108  &quot;@react-native-picker/picker&quot;: &quot;^2.1.0&quot;,
109  &quot;@react-navigation/bottom-tabs&quot;: &quot;^6.0.9&quot;,
110  &quot;@react-navigation/native&quot;: &quot;^6.0.6&quot;,
111  &quot;@react-navigation/stack&quot;: &quot;^6.0.11&quot;,
112  &quot;@types/react-native&quot;: &quot;^0.65.5&quot;,
113  &quot;@ui-kitten/components&quot;: &quot;^5.1.0&quot;,
114  &quot;axios&quot;: &quot;^0.19.0&quot;,
115  &quot;i18n-js&quot;: &quot;^3.5.1&quot;,
116  &quot;moment&quot;: &quot;^2.24.0&quot;,
117  &quot;native-base&quot;: &quot;2.13.8&quot;,
118  &quot;react&quot;: &quot;17.0.2&quot;,
119  &quot;react-content-loader&quot;: &quot;^4.3.4&quot;,
120  &quot;react-native&quot;: &quot;0.66.0&quot;,
121  &quot;react-native-actions-sheet&quot;: &quot;^0.5.6&quot;,
122  &quot;react-native-adjust&quot;: &quot;^4.28.0&quot;,
123  &quot;react-native-amplitude-analytics&quot;: &quot;^0.2.7&quot;,
124  &quot;react-native-animatable&quot;: &quot;^1.3.3&quot;,
125  &quot;react-native-code-push&quot;: &quot;^7.0.4&quot;,
126  &quot;react-native-config&quot;: &quot;^1.3.3&quot;,
127  &quot;react-native-contacts&quot;: &quot;^5.0.7&quot;,
128  &quot;react-native-dots-pagination&quot;: &quot;^0.2.0&quot;,
129  &quot;react-native-fbsdk-next&quot;: &quot;^6.2.0&quot;,
130  &quot;react-native-fingerprint-scanner&quot;: &quot;^6.0.0&quot;,
131  &quot;react-native-floating-action&quot;: &quot;^1.22.0&quot;,
132  &quot;react-native-geocoding&quot;: &quot;^0.4.0&quot;,
133  &quot;react-native-geolocation-service&quot;: &quot;^5.2.0&quot;,
134  &quot;react-native-gesture-handler&quot;: &quot;^1.5.2&quot;,
135  &quot;react-native-get-random-values&quot;: &quot;^1.4.0&quot;,
136  &quot;react-native-html-to-pdf-lite&quot;: &quot;^0.11.0&quot;,
137  &quot;react-native-image-base64&quot;: &quot;^0.1.4&quot;,
138  &quot;react-native-image-pan-zoom&quot;: &quot;^2.1.11&quot;,
139  &quot;react-native-image-picker&quot;: &quot;^4.1.2&quot;,
140  &quot;react-native-image-resizer&quot;: &quot;^1.2.0&quot;,
141  &quot;react-native-in-app-review&quot;: &quot;^2.1.7&quot;,
142  &quot;react-native-linear-gradient&quot;: &quot;^2.5.6&quot;,
143  &quot;react-native-loading-spinner-overlay&quot;: &quot;^1.1.0&quot;,
144  &quot;react-native-material-menu&quot;: &quot;^1.0.0&quot;,
145  &quot;react-native-material-textfield&quot;: &quot;^0.16.1&quot;,
146  &quot;react-native-modal&quot;: &quot;^13.0.0&quot;,
147  &quot;react-native-phone-call&quot;: &quot;^1.0.9&quot;,
148  &quot;react-native-ratings&quot;: &quot;^7.3.0&quot;,
149  &quot;react-native-reanimated&quot;: &quot;^1.13.0&quot;,
150  &quot;react-native-safe-area-context&quot;: &quot;^3.3.2&quot;,
151  &quot;react-native-screens&quot;: &quot;^3.9.0&quot;,
152  &quot;react-native-share&quot;: &quot;^7.2.1&quot;,
153  &quot;react-native-smooth-pincode-input&quot;: &quot;^1.0.9&quot;,
154  &quot;react-native-sms-retriever&quot;: &quot;https://github.com/sarmad1995/react-native-sms-retriever.git&quot;,
155  &quot;react-native-snap-carousel&quot;: &quot;^3.9.1&quot;,
156  &quot;react-native-splash-screen&quot;: &quot;^3.2.0&quot;,
157  &quot;react-native-svg&quot;: &quot;^12.1.1&quot;,
158  &quot;react-native-version-check&quot;: &quot;^3.4.2&quot;,
159  &quot;react-native-version-number&quot;: &quot;^0.3.6&quot;,
160  &quot;react-native-view-shot&quot;: &quot;^3.1.2&quot;,
161  &quot;react-native-walkthrough-tooltip&quot;: &quot;^1.3.0&quot;,
162  &quot;react-redux&quot;: &quot;^7.1.3&quot;,
163  &quot;redux&quot;: &quot;^4.0.4&quot;,
164  &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
165  &quot;redux-persist&quot;: &quot;^6.0.0&quot;,
166  &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
167  &quot;rn-fetch-blob&quot;: &quot;^0.12.0&quot;,
168  &quot;urbanairship-react-native&quot;: &quot;^12.0.0&quot;,
169  &quot;uuid&quot;: &quot;^8.3.0&quot;
170},
171implementation 'com.facebook.android:facebook-marketing:[4,5)'
172

by

1    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2        java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3            at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4            at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5            at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8            at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17  ext {
18      buildToolsVersion = &quot;30.0.2&quot;
19      minSdkVersion = 21
20      compileSdkVersion = 30
21      targetSdkVersion = 30
22      ndkVersion = &quot;21.4.7075529&quot;
23  }
24  repositories {
25      google()
26      mavenCentral()
27      jcenter()
28      // maven {
29      //    url 'https://maven.fabric.io/public'
30      // }
31      maven { url &quot;https://www.jitpack.io&quot; }
32  }
33  dependencies {
34      classpath(&quot;com.android.tools.build:gradle:4.2.2&quot;)
35      classpath 'com.google.gms:google-services:4.2.0'  // Google Services plugin
36      // Add the Fabric Crashlytics plugin.
37      // classpath 'io.fabric.tools:gradle:1.31.2'
38      // firebase performance sdk
39      classpath 'com.google.firebase:perf-plugin:1.4.0'
40      classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43      // NOTE: Do not place your application dependencies here; they belong
44      // in the individual module build.gradle files
45  }
46}
47
48allprojects {
49  repositories {
50      mavenCentral()
51      mavenLocal()
52      maven {
53          // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54          url(&quot;$rootDir/../node_modules/react-native/android&quot;)
55      }
56      maven {
57          // Android JSC is installed from npm
58          url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
59      }
60
61      google()
62      jcenter()
63      maven { url 'https://www.jitpack.io' }
64  }
65}
66
67
68subprojects {
69  afterEvaluate {project -&gt;
70      if (project.hasProperty(&quot;android&quot;)) {
71          android {
72              buildToolsVersion &quot;28.0.3&quot;
73              compileSdkVersion 28
74          }
75      }
76  }
77}
78
79subprojects {
80  afterEvaluate {project -&gt;
81      if (project.hasProperty(&quot;android&quot;)) {
82          android {
83              compileSdkVersion 29
84              buildToolsVersion '29.0.3'
85          }
86      }
87  }
88}
89&quot;dependencies&quot;: {
90  &quot;@eva-design/eva&quot;: &quot;^2.1.0&quot;,
91  &quot;@react-native-async-storage/async-storage&quot;: &quot;^1.15.14&quot;,
92  &quot;@react-native-community/blur&quot;: &quot;^3.6.0&quot;,
93  &quot;@react-native-community/checkbox&quot;: &quot;^0.5.0&quot;,
94  &quot;@react-native-community/netinfo&quot;: &quot;^6.0.1&quot;,
95  &quot;@react-native-community/toolbar-android&quot;: &quot;^0.1.0-rc.2&quot;,
96  &quot;@react-native-firebase/analytics&quot;: &quot;^10.3.1&quot;,
97  &quot;@react-native-firebase/app&quot;: &quot;^10.3.0&quot;,
98  &quot;@react-native-firebase/auth&quot;: &quot;^10.3.1&quot;,
99  &quot;@react-native-firebase/crashlytics&quot;: &quot;^10.3.1&quot;,
100  &quot;@react-native-firebase/dynamic-links&quot;: &quot;^10.3.1&quot;,
101  &quot;@react-native-firebase/firestore&quot;: &quot;^10.3.1&quot;,
102  &quot;@react-native-firebase/iid&quot;: &quot;^10.3.1&quot;,
103  &quot;@react-native-firebase/in-app-messaging&quot;: &quot;^10.3.1&quot;,
104  &quot;@react-native-firebase/messaging&quot;: &quot;^10.3.1&quot;,
105  &quot;@react-native-firebase/perf&quot;: &quot;^10.3.1&quot;,
106  &quot;@react-native-firebase/remote-config&quot;: &quot;^10.3.1&quot;,
107  &quot;@react-native-firebase/storage&quot;: &quot;^10.3.1&quot;,
108  &quot;@react-native-picker/picker&quot;: &quot;^2.1.0&quot;,
109  &quot;@react-navigation/bottom-tabs&quot;: &quot;^6.0.9&quot;,
110  &quot;@react-navigation/native&quot;: &quot;^6.0.6&quot;,
111  &quot;@react-navigation/stack&quot;: &quot;^6.0.11&quot;,
112  &quot;@types/react-native&quot;: &quot;^0.65.5&quot;,
113  &quot;@ui-kitten/components&quot;: &quot;^5.1.0&quot;,
114  &quot;axios&quot;: &quot;^0.19.0&quot;,
115  &quot;i18n-js&quot;: &quot;^3.5.1&quot;,
116  &quot;moment&quot;: &quot;^2.24.0&quot;,
117  &quot;native-base&quot;: &quot;2.13.8&quot;,
118  &quot;react&quot;: &quot;17.0.2&quot;,
119  &quot;react-content-loader&quot;: &quot;^4.3.4&quot;,
120  &quot;react-native&quot;: &quot;0.66.0&quot;,
121  &quot;react-native-actions-sheet&quot;: &quot;^0.5.6&quot;,
122  &quot;react-native-adjust&quot;: &quot;^4.28.0&quot;,
123  &quot;react-native-amplitude-analytics&quot;: &quot;^0.2.7&quot;,
124  &quot;react-native-animatable&quot;: &quot;^1.3.3&quot;,
125  &quot;react-native-code-push&quot;: &quot;^7.0.4&quot;,
126  &quot;react-native-config&quot;: &quot;^1.3.3&quot;,
127  &quot;react-native-contacts&quot;: &quot;^5.0.7&quot;,
128  &quot;react-native-dots-pagination&quot;: &quot;^0.2.0&quot;,
129  &quot;react-native-fbsdk-next&quot;: &quot;^6.2.0&quot;,
130  &quot;react-native-fingerprint-scanner&quot;: &quot;^6.0.0&quot;,
131  &quot;react-native-floating-action&quot;: &quot;^1.22.0&quot;,
132  &quot;react-native-geocoding&quot;: &quot;^0.4.0&quot;,
133  &quot;react-native-geolocation-service&quot;: &quot;^5.2.0&quot;,
134  &quot;react-native-gesture-handler&quot;: &quot;^1.5.2&quot;,
135  &quot;react-native-get-random-values&quot;: &quot;^1.4.0&quot;,
136  &quot;react-native-html-to-pdf-lite&quot;: &quot;^0.11.0&quot;,
137  &quot;react-native-image-base64&quot;: &quot;^0.1.4&quot;,
138  &quot;react-native-image-pan-zoom&quot;: &quot;^2.1.11&quot;,
139  &quot;react-native-image-picker&quot;: &quot;^4.1.2&quot;,
140  &quot;react-native-image-resizer&quot;: &quot;^1.2.0&quot;,
141  &quot;react-native-in-app-review&quot;: &quot;^2.1.7&quot;,
142  &quot;react-native-linear-gradient&quot;: &quot;^2.5.6&quot;,
143  &quot;react-native-loading-spinner-overlay&quot;: &quot;^1.1.0&quot;,
144  &quot;react-native-material-menu&quot;: &quot;^1.0.0&quot;,
145  &quot;react-native-material-textfield&quot;: &quot;^0.16.1&quot;,
146  &quot;react-native-modal&quot;: &quot;^13.0.0&quot;,
147  &quot;react-native-phone-call&quot;: &quot;^1.0.9&quot;,
148  &quot;react-native-ratings&quot;: &quot;^7.3.0&quot;,
149  &quot;react-native-reanimated&quot;: &quot;^1.13.0&quot;,
150  &quot;react-native-safe-area-context&quot;: &quot;^3.3.2&quot;,
151  &quot;react-native-screens&quot;: &quot;^3.9.0&quot;,
152  &quot;react-native-share&quot;: &quot;^7.2.1&quot;,
153  &quot;react-native-smooth-pincode-input&quot;: &quot;^1.0.9&quot;,
154  &quot;react-native-sms-retriever&quot;: &quot;https://github.com/sarmad1995/react-native-sms-retriever.git&quot;,
155  &quot;react-native-snap-carousel&quot;: &quot;^3.9.1&quot;,
156  &quot;react-native-splash-screen&quot;: &quot;^3.2.0&quot;,
157  &quot;react-native-svg&quot;: &quot;^12.1.1&quot;,
158  &quot;react-native-version-check&quot;: &quot;^3.4.2&quot;,
159  &quot;react-native-version-number&quot;: &quot;^0.3.6&quot;,
160  &quot;react-native-view-shot&quot;: &quot;^3.1.2&quot;,
161  &quot;react-native-walkthrough-tooltip&quot;: &quot;^1.3.0&quot;,
162  &quot;react-redux&quot;: &quot;^7.1.3&quot;,
163  &quot;redux&quot;: &quot;^4.0.4&quot;,
164  &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
165  &quot;redux-persist&quot;: &quot;^6.0.0&quot;,
166  &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
167  &quot;rn-fetch-blob&quot;: &quot;^0.12.0&quot;,
168  &quot;urbanairship-react-native&quot;: &quot;^12.0.0&quot;,
169  &quot;uuid&quot;: &quot;^8.3.0&quot;
170},
171implementation 'com.facebook.android:facebook-marketing:[4,5)'
172implementation 'com.facebook.android:facebook-marketing:latest.release'
173

in android/app/build.gradle file.

Posted this so someone out there facing the same problem will find the solution easily. It took me and my team around one and a half day to figure it out as there is no clear solution out there.

Solution Ref: here

Source https://stackoverflow.com/questions/71256006

QUESTION

How do I set up NUnit in Visual Studio 2022?

Asked 2022-Feb-01 at 20:25

Does NUnit work under Visual Studio 2022? All of the setup instructions I can find relate to previous versions of Visual Studio and reference things that are not present (such as "Tools -> Manage Extensions menu in Visual Studio. Click on Online and enter the search term as NUnit Test Adapter" - the search yields no results). If it does work, how do I set it up?

ANSWER

Answered 2021-Dec-21 at 10:54

You can add both NUnit Framework and NUnit Test Adapter using NuGet Packages.

To do that, right click on your project in Solution Explorer, go to Manage NuGet packages..., in the Browse section type nunit, install NUnit package and the corresponding version adapter (NUnitTestAdapter for NUnit 2.x or NUnit3TestAdapter for NUnit 3.x).

Source https://stackoverflow.com/questions/70282628

QUESTION

TopAppBar flashing when navigating with Compose Navigation

Asked 2022-Feb-01 at 14:52

I have 2 screens which both have their own Scaffold and TopAppBar. When I navigate between them using the Jetpack Navigation Compose library, the app bar flashes. Why does it happen and how can I get rid of this?

enter image description here

Code:

Navigation:

1@Composable
2fun TodoNavHost(
3    navController: NavHostController,
4    modifier: Modifier = Modifier
5) {
6    NavHost(
7        navController = navController,
8        startDestination = TodoScreen.TodoList.name,
9        modifier = modifier
10    ) {
11        composable(TodoScreen.TodoList.name) {
12            TodoListScreen(
13                onTodoEditClicked = { todo -&gt;
14                    navController.navigate(&quot;${TodoScreen.AddEditTodo.name}?todoId=${todo.id}&quot;)
15                },
16                onFabAddNewTodoClicked = {
17                    navController.navigate(TodoScreen.AddEditTodo.name)
18                }
19            )
20        }
21        composable(
22            &quot;${TodoScreen.AddEditTodo.name}?todoId={todoId}&quot;, 
23            arguments = listOf(
24                navArgument(&quot;todoId&quot;) {
25                    type = NavType.LongType
26                    defaultValue = -1L
27                }
28            )
29        ) {
30            AddEditTodoScreen(
31                onNavigateUp = {
32                    navController.popBackStack() 
33                },
34                onNavigateBackWithResult = { result -&gt;
35                    navController.navigate(TodoScreen.TodoList.name)
36                }
37            )
38        }
39    }
40}
41

Todo list screen Scaffold with TopAppBar:

1@Composable
2fun TodoNavHost(
3    navController: NavHostController,
4    modifier: Modifier = Modifier
5) {
6    NavHost(
7        navController = navController,
8        startDestination = TodoScreen.TodoList.name,
9        modifier = modifier
10    ) {
11        composable(TodoScreen.TodoList.name) {
12            TodoListScreen(
13                onTodoEditClicked = { todo -&gt;
14                    navController.navigate(&quot;${TodoScreen.AddEditTodo.name}?todoId=${todo.id}&quot;)
15                },
16                onFabAddNewTodoClicked = {
17                    navController.navigate(TodoScreen.AddEditTodo.name)
18                }
19            )
20        }
21        composable(
22            &quot;${TodoScreen.AddEditTodo.name}?todoId={todoId}&quot;, 
23            arguments = listOf(
24                navArgument(&quot;todoId&quot;) {
25                    type = NavType.LongType
26                    defaultValue = -1L
27                }
28            )
29        ) {
30            AddEditTodoScreen(
31                onNavigateUp = {
32                    navController.popBackStack() 
33                },
34                onNavigateBackWithResult = { result -&gt;
35                    navController.navigate(TodoScreen.TodoList.name)
36                }
37            )
38        }
39    }
40}
41@Composable
42fun TodoListBody(
43    todos: List&lt;Todo&gt;,
44    todoExpandedStates: Map&lt;Long, Boolean&gt;,
45    onTodoItemClicked: (Todo) -&gt; Unit,
46    onTodoCheckedChanged: (Todo, Boolean) -&gt; Unit,
47    onTodoEditClicked: (Todo) -&gt; Unit,
48    onFabAddNewTodoClicked: () -&gt; Unit,
49    onDeleteAllCompletedConfirmed: () -&gt; Unit,
50    modifier: Modifier = Modifier,
51    errorSnackbarMessage: String = &quot;&quot;,
52    errorSnackbarShown: Boolean = false
53) {
54
55    var menuExpanded by remember { mutableStateOf(false) }
56    var showDeleteAllCompletedConfirmationDialog by rememberSaveable { mutableStateOf(false) }
57
58    Scaffold(
59        modifier,
60        topBar = {
61            TopAppBar(
62                title = { Text(&quot;My Todos&quot;) },
63                actions = {
64                    IconButton(
65                        onClick = { menuExpanded = !menuExpanded },
66                        modifier = Modifier.semantics {
67                            contentDescription = &quot;Options Menu&quot;
68                        }
69                    ) {
70                        Icon(Icons.Default.MoreVert, contentDescription = &quot;Show menu&quot;)
71                    }
72                    DropdownMenu(
73                        expanded = menuExpanded,
74                        onDismissRequest = { menuExpanded = false }) {
75                        DropdownMenuItem(
76                            onClick = {
77                                showDeleteAllCompletedConfirmationDialog = true
78                                menuExpanded = false
79                            },
80                            modifier = Modifier.semantics {
81                                contentDescription = &quot;Option Delete All Completed&quot;
82                            }) {
83                            Text(&quot;Delete all completed&quot;)
84                        }
85                    }
86                }
87
88            )
89        },
90[...]
91

Add/edit screen Scaffold with TopAppBar:

1@Composable
2fun TodoNavHost(
3    navController: NavHostController,
4    modifier: Modifier = Modifier
5) {
6    NavHost(
7        navController = navController,
8        startDestination = TodoScreen.TodoList.name,
9        modifier = modifier
10    ) {
11        composable(TodoScreen.TodoList.name) {
12            TodoListScreen(
13                onTodoEditClicked = { todo -&gt;
14                    navController.navigate(&quot;${TodoScreen.AddEditTodo.name}?todoId=${todo.id}&quot;)
15                },
16                onFabAddNewTodoClicked = {
17                    navController.navigate(TodoScreen.AddEditTodo.name)
18                }
19            )
20        }
21        composable(
22            &quot;${TodoScreen.AddEditTodo.name}?todoId={todoId}&quot;, 
23            arguments = listOf(
24                navArgument(&quot;todoId&quot;) {
25                    type = NavType.LongType
26                    defaultValue = -1L
27                }
28            )
29        ) {
30            AddEditTodoScreen(
31                onNavigateUp = {
32                    navController.popBackStack() 
33                },
34                onNavigateBackWithResult = { result -&gt;
35                    navController.navigate(TodoScreen.TodoList.name)
36                }
37            )
38        }
39    }
40}
41@Composable
42fun TodoListBody(
43    todos: List&lt;Todo&gt;,
44    todoExpandedStates: Map&lt;Long, Boolean&gt;,
45    onTodoItemClicked: (Todo) -&gt; Unit,
46    onTodoCheckedChanged: (Todo, Boolean) -&gt; Unit,
47    onTodoEditClicked: (Todo) -&gt; Unit,
48    onFabAddNewTodoClicked: () -&gt; Unit,
49    onDeleteAllCompletedConfirmed: () -&gt; Unit,
50    modifier: Modifier = Modifier,
51    errorSnackbarMessage: String = &quot;&quot;,
52    errorSnackbarShown: Boolean = false
53) {
54
55    var menuExpanded by remember { mutableStateOf(false) }
56    var showDeleteAllCompletedConfirmationDialog by rememberSaveable { mutableStateOf(false) }
57
58    Scaffold(
59        modifier,
60        topBar = {
61            TopAppBar(
62                title = { Text(&quot;My Todos&quot;) },
63                actions = {
64                    IconButton(
65                        onClick = { menuExpanded = !menuExpanded },
66                        modifier = Modifier.semantics {
67                            contentDescription = &quot;Options Menu&quot;
68                        }
69                    ) {
70                        Icon(Icons.Default.MoreVert, contentDescription = &quot;Show menu&quot;)
71                    }
72                    DropdownMenu(
73                        expanded = menuExpanded,
74                        onDismissRequest = { menuExpanded = false }) {
75                        DropdownMenuItem(
76                            onClick = {
77                                showDeleteAllCompletedConfirmationDialog = true
78                                menuExpanded = false
79                            },
80                            modifier = Modifier.semantics {
81                                contentDescription = &quot;Option Delete All Completed&quot;
82                            }) {
83                            Text(&quot;Delete all completed&quot;)
84                        }
85                    }
86                }
87
88            )
89        },
90[...]
91@Composable
92fun AddEditTodoBody(
93    todo: Todo?,
94    todoTitle: String,
95    setTitle: (String) -&gt; Unit,
96    todoImportance: Boolean,
97    setImportance: (Boolean) -&gt; Unit,
98    onSaveClick: () -&gt; Unit,
99    onNavigateUp: () -&gt; Unit,
100    modifier: Modifier = Modifier
101) {
102    Scaffold(
103        modifier,
104        topBar = {
105            TopAppBar(
106                title = { Text(todo?.let { &quot;Edit Todo&quot; } ?: &quot;Add Todo&quot;) },
107                actions = {
108                    IconButton(onClick = onSaveClick) {
109                        Icon(Icons.Default.Save, contentDescription = &quot;Save Todo&quot;)
110                    }
111                },
112                navigationIcon = {
113                    IconButton(onClick = onNavigateUp) {
114                        Icon(Icons.Default.ArrowBack, contentDescription = &quot;Back&quot;)
115                    }
116                }
117            )
118        },
119    ) { innerPadding -&gt;
120        BodyContent(
121            todoTitle = todoTitle,
122            setTitle = setTitle,
123            todoImportance = todoImportance,
124            setImportance = setImportance,
125            modifier = Modifier.padding(innerPadding)
126        )
127    }
128}
129

ANSWER

Answered 2021-Aug-03 at 11:33

It is the expected behaviour. You are constructing two separate app bars for both the screens so they are bound to flash. This is not the correct way. The correct way would be to actually put the scaffold in your main activity and place the NavHost as it's content. If you wish to modify the app bar, create variables to hold state. Then modify them from the Composables. Ideally, store then in a viewmodel. That is how it is done in compose. Through variables.

Thanks

Source https://stackoverflow.com/questions/68633717

QUESTION

Accessing the original file name of R markdown parameters file

Asked 2022-Jan-20 at 23:04

I want to provide the user a convenient way to define the input file. For this I am using the parameters functionality in markdown. If I "knit with parameters" I get asked for the input file.

Is there any chance to retrieve the file name? Because I am creating during the markdown some different files and I would use the filename of the input file as a prefix. So far, the file gets uploaded in a temp directory and there, the original file name is lost.

How can I get the file name and location via drop down menu into my markdown document? I don't want the user to write the path and filename manually.

1---
2title: &quot;Untitled&quot;
3date: &quot;11/16/2021&quot;
4output: html_document
5params:
6  date_file:
7    label: &quot;date file&quot;
8    value: 'dates.tsv'
9    input: file
10---
11
12```{r setup, include=FALSE}
13knitr::opts_chunk$set(echo = TRUE)
14```
15
16## R Markdown
17
18Filename: `r params$date_file`
19

ANSWER

Answered 2021-Nov-22 at 16:40

You could have users select a file in the rendered document by embedding a Shiny application. The caveat is that all expressions involving dependencies of the user's selection have to be wrapped inside of reactive(). That is obviously not optimal if you are trying to teach R, but in case it helps or inspires a better answer, here is an example:

1---
2title: &quot;Untitled&quot;
3date: &quot;11/16/2021&quot;
4output: html_document
5params:
6  date_file:
7    label: &quot;date file&quot;
8    value: 'dates.tsv'
9    input: file
10---
11
12```{r setup, include=FALSE}
13knitr::opts_chunk$set(echo = TRUE)
14```
15
16## R Markdown
17
18Filename: `r params$date_file`
19## Create a TSV file for testing
20cat(&quot;x\ty\n1\t2\n3\t4\n&quot;, file = &quot;test.tsv&quot;)
21
1---
2title: &quot;Untitled&quot;
3date: &quot;11/16/2021&quot;
4output: html_document
5params:
6  date_file:
7    label: &quot;date file&quot;
8    value: 'dates.tsv'
9    input: file
10---
11
12```{r setup, include=FALSE}
13knitr::opts_chunk$set(echo = TRUE)
14```
15
16## R Markdown
17
18Filename: `r params$date_file`
19## Create a TSV file for testing
20cat(&quot;x\ty\n1\t2\n3\t4\n&quot;, file = &quot;test.tsv&quot;)
21---
22title: &quot;Untitled&quot;
23output: html_document
24runtime: shiny
25---
26
27```{r setup, include=FALSE}
28knitr::opts_chunk$set(echo = TRUE)
29```
30
31Users can select a file by interacting with an embedded Shiny application.
32
33```{r ui, echo=FALSE}
34inputPanel(
35  fileInput(&quot;file&quot;, label = &quot;Select a TSV file:&quot;, accept = &quot;.tsv&quot;)
36)
37```
38
39User input is stored in a named list-like object `input`, 
40but this object can only be accessed inside of a _reactive context_.
41
42```{r test1, error=TRUE}
43input$file$name
44## Name of file selected by user ... _not_ an absolute or relative path
45fn &lt;- reactive(input$file$name)
46fn
47## Absolute path of temporary copy of file
48dp &lt;- reactive(input$file$datapath)
49dp
50```
51
52Don't be misled by how `fn` and `dp` are printed. They are not 
53strings, but _reactive expressions_. As as a result, they, too, 
54must be handled inside of a reactive context.
55
56```{r test2}
57class(fn)
58reactive(class(fn()))
59```
60
61Some more examples:
62
63```{r test3, error=TRUE}
64## Define reactive data
65dd &lt;- reactive(read.table(file = dp(), sep = &quot;\t&quot;, header = TRUE))
66## Do stuff with it
67reactive(names(dd()))
68reactive(nrow(dd()))
69## Write object to file in _working directory_
70reactive(saveRDS(dd(), file = sub(&quot;tsv$&quot;, &quot;rds&quot;, fn())))
71```
72

Source https://stackoverflow.com/questions/69985785

QUESTION

Native Android -&gt; How to create custom curved bottom navigation

Asked 2021-Dec-17 at 09:03

enter image description here

So this is the navigation my designer made for our project. Height of the bottom navigation is 70dp.

What I have tried so far.

First I downloaded a vector drawable background from design and set it as background for BottomNavigationView

1&lt;com.google.android.material.bottomnavigation.BottomNavigationView
2                android:layout_gravity=&quot;bottom&quot;
3                app:labelVisibilityMode=&quot;labeled&quot;
4                app:itemIconTint=&quot;@drawable/bnv_tab_item_foreground&quot;
5                app:itemTextColor=&quot;@drawable/bnv_tab_item_foreground&quot;
6                android:id=&quot;@+id/bottom_nav&quot;
7                android:layout_width=&quot;match_parent&quot;
8                android:layout_height=&quot;70dp&quot;
9                app:menu=&quot;@menu/menu_bottom_main&quot;
10                android:background=&quot;@drawable/background_bottom_navigation&quot;/&gt;
11

Result

enter image description here

As you can see the curve does not as good as in design. Because of different android screen sizes this approach will never work.

My second attempt was based on tutorial from Phillip Lackner https://www.youtube.com/watch?v=x6-_va1R788&t=830s

I put BottomNavigationView inside BottomAppBar. Then I created FloatingActionButton and set its layout_anchor property to BottomAppBar

1&lt;com.google.android.material.bottomnavigation.BottomNavigationView
2                android:layout_gravity=&quot;bottom&quot;
3                app:labelVisibilityMode=&quot;labeled&quot;
4                app:itemIconTint=&quot;@drawable/bnv_tab_item_foreground&quot;
5                app:itemTextColor=&quot;@drawable/bnv_tab_item_foreground&quot;
6                android:id=&quot;@+id/bottom_nav&quot;
7                android:layout_width=&quot;match_parent&quot;
8                android:layout_height=&quot;70dp&quot;
9                app:menu=&quot;@menu/menu_bottom_main&quot;
10                android:background=&quot;@drawable/background_bottom_navigation&quot;/&gt;
11&lt;com.google.android.material.bottomappbar.BottomAppBar
12                app:fabCradleRoundedCornerRadius=&quot;20dp&quot;
13                android:backgroundTint=&quot;@color/blue_menu2&quot;
14                android:id=&quot;@+id/bottom_app_bar&quot;
15                android:layout_gravity=&quot;bottom&quot;
16                android:layout_width=&quot;match_parent&quot;
17                android:layout_height=&quot;56dp&quot;&gt;
18                &lt;com.google.android.material.bottomnavigation.BottomNavigationView
19                    app:labelVisibilityMode=&quot;labeled&quot;
20                    app:itemIconTint=&quot;@drawable/bnv_tab_item_foreground&quot;
21                    app:itemTextColor=&quot;@drawable/bnv_tab_item_foreground&quot;
22                    android:id=&quot;@+id/bottom_nav&quot;
23                    app:layout_behavior=&quot;@string/hide_bottom_view_on_scroll_behavior&quot;
24                    android:layout_marginEnd=&quot;16dp&quot;
25                    android:layout_width=&quot;match_parent&quot;
26                    android:layout_height=&quot;match_parent&quot;
27                    android:background=&quot;@android:color/transparent&quot;
28                    app:menu=&quot;@menu/menu_bottom_main&quot; /&gt;
29            &lt;/com.google.android.material.bottomappbar.BottomAppBar&gt;
30
31            &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
32                android:scaleType=&quot;center&quot;
33                app:maxImageSize = &quot;56dp&quot;
34                android:id=&quot;@+id/home_floating_button&quot;
35                app:layout_anchor=&quot;@id/bottom_app_bar&quot;
36                android:layout_width=&quot;56dp&quot;
37                android:layout_height=&quot;80dp&quot;&gt;
38            &lt;/com.google.android.material.floatingactionbutton.FloatingActionButton&gt;
39

Result

enter image description here

As u can see the curve is not "Deep enough". BottomAppBar has property fabCradleVerticalOffset but unfortunately you cant put negative values.

Is it possible to use bezier curves to try to draw custom shapes in bottom navigation. I have not tried yet. I am not sure if it will work for this specific bottom navigation design. https://proandroiddev.com/how-i-drew-custom-shapes-in-bottom-bar-c4539d86afd7

How can I create this curved bottom navigation?

ANSWER

Answered 2021-Dec-17 at 09:03

I think you cannot achieve this with BottomAppBar without working some hacks around it. I can suggest you use 2 FABs, an invisible one to get the BottomAppBar curved the way you wish, and another one (the actual one) and place it at the position you need it to be placed at, here is an example

1&lt;com.google.android.material.bottomnavigation.BottomNavigationView
2                android:layout_gravity=&quot;bottom&quot;
3                app:labelVisibilityMode=&quot;labeled&quot;
4                app:itemIconTint=&quot;@drawable/bnv_tab_item_foreground&quot;
5                app:itemTextColor=&quot;@drawable/bnv_tab_item_foreground&quot;
6                android:id=&quot;@+id/bottom_nav&quot;
7                android:layout_width=&quot;match_parent&quot;
8                android:layout_height=&quot;70dp&quot;
9                app:menu=&quot;@menu/menu_bottom_main&quot;
10                android:background=&quot;@drawable/background_bottom_navigation&quot;/&gt;
11&lt;com.google.android.material.bottomappbar.BottomAppBar
12                app:fabCradleRoundedCornerRadius=&quot;20dp&quot;
13                android:backgroundTint=&quot;@color/blue_menu2&quot;
14                android:id=&quot;@+id/bottom_app_bar&quot;
15                android:layout_gravity=&quot;bottom&quot;
16                android:layout_width=&quot;match_parent&quot;
17                android:layout_height=&quot;56dp&quot;&gt;
18                &lt;com.google.android.material.bottomnavigation.BottomNavigationView
19                    app:labelVisibilityMode=&quot;labeled&quot;
20                    app:itemIconTint=&quot;@drawable/bnv_tab_item_foreground&quot;
21                    app:itemTextColor=&quot;@drawable/bnv_tab_item_foreground&quot;
22                    android:id=&quot;@+id/bottom_nav&quot;
23                    app:layout_behavior=&quot;@string/hide_bottom_view_on_scroll_behavior&quot;
24                    android:layout_marginEnd=&quot;16dp&quot;
25                    android:layout_width=&quot;match_parent&quot;
26                    android:layout_height=&quot;match_parent&quot;
27                    android:background=&quot;@android:color/transparent&quot;
28                    app:menu=&quot;@menu/menu_bottom_main&quot; /&gt;
29            &lt;/com.google.android.material.bottomappbar.BottomAppBar&gt;
30
31            &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
32                android:scaleType=&quot;center&quot;
33                app:maxImageSize = &quot;56dp&quot;
34                android:id=&quot;@+id/home_floating_button&quot;
35                app:layout_anchor=&quot;@id/bottom_app_bar&quot;
36                android:layout_width=&quot;56dp&quot;
37                android:layout_height=&quot;80dp&quot;&gt;
38            &lt;/com.google.android.material.floatingactionbutton.FloatingActionButton&gt;
39
40        &lt;androidx.coordinatorlayout.widget.CoordinatorLayout
41            android:layout_width=&quot;match_parent&quot;
42            android:layout_height=&quot;350dp&quot;
43            app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;
44
45            &lt;com.google.android.material.bottomappbar.BottomAppBar
46                android:id=&quot;@+id/bottom_app_bar&quot;
47                app:fabCradleMargin=&quot;15dp&quot;
48                app:fabCradleVerticalOffset=&quot;10dp&quot;
49                app:fabCradleRoundedCornerRadius=&quot;10dp&quot;
50                android:layout_width=&quot;match_parent&quot;
51                android:layout_height=&quot;70dp&quot;
52                android:layout_gravity=&quot;bottom&quot;
53                android:backgroundTint=&quot;#0000FF&quot;
54                app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;
55
56            &lt;/com.google.android.material.bottomappbar.BottomAppBar&gt;
57
58            &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
59                android:id=&quot;@+id/home_floating_button&quot;
60                android:layout_width=&quot;58dp&quot;
61                android:layout_height=&quot;40dp&quot;
62                android:alpha=&quot;0&quot;
63                android:scaleY=&quot;2&quot;
64                android:scaleType=&quot;center&quot;
65                app:layout_anchor=&quot;@id/bottom_app_bar&quot; /&gt;
66
67            &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
68                android:id=&quot;@+id/home_floating_button2&quot;
69                android:layout_width=&quot;58dp&quot;
70                android:layout_height=&quot;80dp&quot;
71                android:scaleType=&quot;center&quot;
72                android:layout_marginBottom=&quot;25dp&quot;
73                app:layout_anchorGravity=&quot;center&quot;
74                app:layout_anchor=&quot;@id/bottom_app_bar&quot;
75                app:maxImageSize=&quot;56dp&quot;/&gt;
76
77        &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
78
79

this will look like this

Source https://stackoverflow.com/questions/70325240

QUESTION

Angular 6 to 12 Migration: Getting Multiple Warning: Css Minimizer Plugin: &gt; Unexpected &quot;$&quot;

Asked 2021-Nov-19 at 17:27

After migrating my angular 6 project to 12. I am getting multiple warning in terminal

if in angular.json i set optimisation: false configuration then all issue get resolved but i don't want to make this changes it should be true only.

with optimisation: true i am getting all these warnings:-

Earlier same code was working fine without any warning.

1assets/.../variables.scss - Warning: Css Minimizer Plugin:  &gt; assets/.../variables.scss:6:0: warning: Unexpected &quot;$&quot;
2    6 │ $color-normal-gray:#8a8a8a;
3      ╵ ^
4
5assets/.../global.scss - Warning: Css Minimizer Plugin:  &gt; 
6assets/.../global.scss:285:2: warning: Expected identifier but found &quot;.&quot;
7    285 │   .dropdown-menu{
8        ╵   ^
9
10assets/.../global.scss - Warning: Css Minimizer Plugin:  &gt; 
11assets/.../global.scss:255:6: warning: Expected identifier but found &quot;*&quot;
12    255 │       *background-color: #d9d9d9;
13        ╵       ^
14
15assets/.../master.scss - Warning: Css Minimizer Plugin:  &gt; 
16assets/.../master.scss:567:8: warning: Expected &quot;:&quot; but found &quot;{&quot;
17    567 │   circle {
18        ╵          ^
19

My Package.json is below:

1assets/.../variables.scss - Warning: Css Minimizer Plugin:  &gt; assets/.../variables.scss:6:0: warning: Unexpected &quot;$&quot;
2    6 │ $color-normal-gray:#8a8a8a;
3      ╵ ^
4
5assets/.../global.scss - Warning: Css Minimizer Plugin:  &gt; 
6assets/.../global.scss:285:2: warning: Expected identifier but found &quot;.&quot;
7    285 │   .dropdown-menu{
8        ╵   ^
9
10assets/.../global.scss - Warning: Css Minimizer Plugin:  &gt; 
11assets/.../global.scss:255:6: warning: Expected identifier but found &quot;*&quot;
12    255 │       *background-color: #d9d9d9;
13        ╵       ^
14
15assets/.../master.scss - Warning: Css Minimizer Plugin:  &gt; 
16assets/.../master.scss:567:8: warning: Expected &quot;:&quot; but found &quot;{&quot;
17    567 │   circle {
18        ╵          ^
19 &quot;dependencies&quot;: {
20    &quot;@angular/animations&quot;: &quot;^12.2.3&quot;,
21    &quot;@angular/cdk&quot;: &quot;^12.2.2&quot;,
22    &quot;@angular/common&quot;: &quot;^12.2.3&quot;,
23    &quot;@angular/compiler&quot;: &quot;^12.2.3&quot;,
24    &quot;@angular/core&quot;: &quot;^12.2.3&quot;,
25    &quot;@angular/forms&quot;: &quot;^12.2.3&quot;,
26    &quot;@angular/http&quot;: &quot;^7.2.16&quot;,
27    &quot;@angular/material&quot;: &quot;^12.2.3&quot;,
28    &quot;@angular/platform-browser&quot;: &quot;^12.2.3&quot;,
29    &quot;@angular/platform-browser-dynamic&quot;: &quot;^12.2.3&quot;,
30    &quot;@angular/router&quot;: &quot;^12.2.3&quot;,
31    &quot;@fortawesome/fontawesome-free&quot;: &quot;^5.15.4&quot;,
32    &quot;@ngrx/store&quot;: &quot;^6.1.0&quot;,
33    &quot;@okta/okta-angular&quot;: &quot;^3.0.1&quot;,
34    &quot;@okta/okta-auth-js&quot;: &quot;^4.7.1&quot;,
35    &quot;angular-datatables&quot;: &quot;^0.6.4&quot;,
36    &quot;angular-image-slider&quot;: &quot;0.0.8&quot;,
37    &quot;autobind-decorator&quot;: &quot;^2.4.0&quot;,
38    &quot;bootstrap&quot;: &quot;^4.6.0&quot;,
39    &quot;core-js&quot;: &quot;^2.5.4&quot;,
40    &quot;file-saver&quot;: &quot;^2.0.2&quot;,
41    &quot;gulp-cli&quot;: &quot;^2.3.0&quot;,
42    &quot;json-bigint&quot;: &quot;^1.0.0&quot;,
43    &quot;jsrsasign&quot;: &quot;^10.3.0&quot;,
44    &quot;lodash&quot;: &quot;4.17.10&quot;,
45    &quot;ng-simple-slideshow&quot;: &quot;^1.2.4&quot;,
46    &quot;ng2-scroll-to-el&quot;: &quot;^1.2.1&quot;,
47    &quot;ng2-search-filter&quot;: &quot;^0.4.7&quot;,
48    &quot;ngx-filter-pipe&quot;: &quot;^2.1.2&quot;,
49    &quot;ngx-logger&quot;: &quot;3.3.11&quot;,
50    &quot;ngx-order-pipe&quot;: &quot;^2.0.1&quot;,
51    &quot;ngx-pagination&quot;: &quot;^3.2.0&quot;,
52    &quot;pagination&quot;: &quot;file:src/app/packages/pagination-0.0.1.tgz&quot;,
53    &quot;rxjs&quot;: &quot;7.3.0&quot;,
54    &quot;rxjs-compat&quot;: &quot;^6.3.2&quot;,
55    &quot;sass&quot;: &quot;^1.36.0&quot;,
56    &quot;single-spa&quot;: &quot;^5.9.2&quot;,
57    &quot;single-spa-angular&quot;: &quot;^5.0.2&quot;,
58    &quot;systemjs&quot;: &quot;^6.8.3&quot;,
59    &quot;true-case-path&quot;: &quot;^1.0.3&quot;,
60    &quot;tslint&quot;: &quot;^6.0.0&quot;,
61    &quot;xlsx&quot;: &quot;^0.17.1&quot;,
62    &quot;zone.js&quot;: &quot;~0.11.4&quot;
63  },
64  &quot;devDependencies&quot;: {
65    &quot;@angular-builders/custom-webpack&quot;: &quot;^12.1.1&quot;,
66    &quot;@angular-devkit/build-angular&quot;: &quot;^12.2.2&quot;,
67    &quot;@angular-eslint/builder&quot;: &quot;12.3.1&quot;,
68    &quot;@angular-eslint/eslint-plugin&quot;: &quot;12.3.1&quot;,
69    &quot;@angular-eslint/eslint-plugin-template&quot;: &quot;12.3.1&quot;,
70    &quot;@angular-eslint/schematics&quot;: &quot;12.3.1&quot;,
71    &quot;@angular-eslint/template-parser&quot;: &quot;12.3.1&quot;,
72    &quot;@angular/cli&quot;: &quot;^12.2.2&quot;,
73    &quot;@angular/compiler-cli&quot;: &quot;^12.2.3&quot;,
74    &quot;@angular/language-service&quot;: &quot;^12.2.3&quot;,
75    &quot;@ng-bootstrap/ng-bootstrap&quot;: &quot;^10.0.0&quot;,
76    &quot;@types/bootstrap&quot;: &quot;^4.1.2&quot;,
77    &quot;@types/jasmine&quot;: &quot;2.8.6&quot;,
78    &quot;@types/jasminewd2&quot;: &quot;2.0.3&quot;,
79    &quot;@types/lodash&quot;: &quot;4.14.110&quot;,
80    &quot;@types/node&quot;: &quot;14.6.2&quot;,
81    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;4.28.2&quot;,
82    &quot;@typescript-eslint/parser&quot;: &quot;4.28.2&quot;,
83    &quot;await&quot;: &quot;^0.2.6&quot;,
84    &quot;cheerio&quot;: &quot;^1.0.0-rc.2&quot;,
85    &quot;codelyzer&quot;: &quot;~4.2.1&quot;,
86    &quot;eslint&quot;: &quot;^7.26.0&quot;,
87    &quot;font-awesome&quot;: &quot;^4.7.0&quot;,
88    &quot;fs-promise&quot;: &quot;^2.0.3&quot;,
89    &quot;gulp&quot;: &quot;^4.0.2&quot;,
90    &quot;gulp-inline-css&quot;: &quot;^3.3.0&quot;,
91    &quot;gulp-inline-source&quot;: &quot;^4.0.0&quot;,
92    &quot;htmlhint-ng2&quot;: &quot;0.0.13&quot;,
93    &quot;husky&quot;: &quot;^1.3.1&quot;,
94    &quot;jasmine-core&quot;: &quot;~2.99.1&quot;,
95    &quot;jasmine-spec-reporter&quot;: &quot;~4.2.1&quot;,
96    &quot;karma&quot;: &quot;^6.3.4&quot;,
97    &quot;karma-chrome-launcher&quot;: &quot;^2.2.0&quot;,
98    &quot;karma-coverage-istanbul-reporter&quot;: &quot;^2.1.1&quot;,
99    &quot;karma-jasmine&quot;: &quot;~1.1.1&quot;,
100    &quot;karma-jasmine-html-reporter&quot;: &quot;^0.2.2&quot;,
101    &quot;karma-junit-reporter&quot;: &quot;^1.2.0&quot;,
102    &quot;mediaquery-text&quot;: &quot;1.0.7&quot;,
103    &quot;ng-bullet&quot;: &quot;^1.0.3&quot;,
104    &quot;protractor&quot;: &quot;^5.4.2&quot;,
105    &quot;puppeteer&quot;: &quot;^1.14.0&quot;,
106    &quot;sonar-scanner&quot;: &quot;^3.1.0&quot;,
107    &quot;ts-node&quot;: &quot;~5.0.1&quot;,
108    &quot;tslint&quot;: &quot;~5.9.1&quot;,
109    &quot;tslint-sonarts&quot;: &quot;^1.9.0&quot;,
110    &quot;typescript&quot;: &quot;^4.3.5&quot;
111  }
112

ANSWER

Answered 2021-Sep-08 at 10:30

I had the same problem. You should change the import of 'assets/.../variables.scss' to './assets/.../variables.scss'. In my case it was in styles.scss but it can be in every .scss file.

Source https://stackoverflow.com/questions/69040951

QUESTION

Why checkout step not recorded in the Google Analytics report?

Asked 2021-Nov-19 at 01:58

I'm making an enhanched ecommerce tracking with google analytics. I'm following the existing implementation in gtag.js. I have 4 checkout steps including shipping method data, payment method data, pending payment, and also paid (purchase). I've made the codes for each step below:

1. Shipping Method

1&lt;script&gt;
2    gtag('event', 'set_checkout_option', {
3        &quot;checkout_step&quot;: 1,
4        &quot;checkout_option&quot;: &quot;shipping method&quot;,
5        &quot;value&quot;: &quot;&quot;
6    });
7&lt;/script&gt;
8

2. Payment Method

1&lt;script&gt;
2    gtag('event', 'set_checkout_option', {
3        &quot;checkout_step&quot;: 1,
4        &quot;checkout_option&quot;: &quot;shipping method&quot;,
5        &quot;value&quot;: &quot;&quot;
6    });
7&lt;/script&gt;
8&lt;script&gt;
9    gtag('event', 'set_checkout_option', {
10        &quot;checkout_step&quot;: 2,
11        &quot;checkout_option&quot;: &quot;payment method&quot;,
12        &quot;value&quot;: &quot;&quot;
13    });
14&lt;/script&gt;
15

3. Pending Payment

1&lt;script&gt;
2    gtag('event', 'set_checkout_option', {
3        &quot;checkout_step&quot;: 1,
4        &quot;checkout_option&quot;: &quot;shipping method&quot;,
5        &quot;value&quot;: &quot;&quot;
6    });
7&lt;/script&gt;
8&lt;script&gt;
9    gtag('event', 'set_checkout_option', {
10        &quot;checkout_step&quot;: 2,
11        &quot;checkout_option&quot;: &quot;payment method&quot;,
12        &quot;value&quot;: &quot;&quot;
13    });
14&lt;/script&gt;
15$(&quot;#order-now-action&quot;).on('click', function() {
16    gtag('event', 'set_checkout_option', {
17        &quot;checkout_step&quot;: 3,
18        &quot;checkout_option&quot;: &quot;pending&quot;,
19        &quot;id&quot;: &quot;&quot;
20    });
21})
22

This is the checkout funnel that I created in Ecommerce Settings. enter image description here

And this is a report in the checkout behavior menu. The shipping method is recorded, but why in step 2 (payment method) to step 4 (purchase) is it not recorded? enter image description here

even though, in the sales performance menu, the transaction is recorded? enter image description here

for steps 1-3 is in 1 page, while the purchase (step 4) I did on the backend using a single url. Is it because it's on 1 page so it's not recorded?

ANSWER

Answered 2021-Nov-18 at 13:32

Generally, your setup looks fine. I would, however, suggest to do it as shown in Google's documentation: https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce

1&lt;script&gt;
2    gtag('event', 'set_checkout_option', {
3        &quot;checkout_step&quot;: 1,
4        &quot;checkout_option&quot;: &quot;shipping method&quot;,
5        &quot;value&quot;: &quot;&quot;
6    });
7&lt;/script&gt;
8&lt;script&gt;
9    gtag('event', 'set_checkout_option', {
10        &quot;checkout_step&quot;: 2,
11        &quot;checkout_option&quot;: &quot;payment method&quot;,
12        &quot;value&quot;: &quot;&quot;
13    });
14&lt;/script&gt;
15$(&quot;#order-now-action&quot;).on('click', function() {
16    gtag('event', 'set_checkout_option', {
17        &quot;checkout_step&quot;: 3,
18        &quot;checkout_option&quot;: &quot;pending&quot;,
19        &quot;id&quot;: &quot;&quot;
20    });
21})
22function onShippingComplete(stepNumber, shippingOption) {
23  ga('ec:setAction', 'checkout_option', {
24    'step': stepNumber,
25    'option': shippingOption
26  });
27
28  ga('send', 'event', 'Checkout', 'Option', {
29     hitCallback: function() {
30       // Advance to next page.
31     }
32  });
33}

But let's debug:

  1. Either in the Network tab, or through a debugger extension like adswerve's, make sure you're actually sending the calls to the collect endpoint. Go through the checkout funnel, trigger the events and inspect them. Pay attention to the property id (it's in the tid field of the payload sent to google's collect endpoint)

  2. Make sure you're generating reports on the data that has been fully processed by GA, so at least 2-day-old data for non-360 accounts and at least 4 hour-old for 360.

  3. Make sure your session is not broken between the first step and the actual purchase. For this, you either have to use the user explorer and actually see where the checkout session breaks for a specific client id. Or track a session id in a custom dimension and see that you can see all the checkout events when inspecting specific session id in a custom report. Session breakage often occurs when the source changes, or when the user id consistency breaks. A good real life example for it would be shopify's checkout being on a different TLD.

  4. Make sure you're looking at an unfiltered view just to exclude the possibility of filters interfering with the data and deleting your events.

Source https://stackoverflow.com/questions/69766923

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Menu

Tutorials and Learning Resources are not available at this moment for Menu

Share this Page

share link

Get latest updates on Menu