Intellij/Android Studio Find/Replace a multiline view in xml layout (Android) - replace

I have to replace this
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="gone"
app:spb_color="#FF0000"
app:spb_mirror_mode="false"
app:spb_progressiveStart_activated="true"
app:spb_progressiveStart_speed="1.5"
app:spb_progressiveStop_speed="3.4"
app:spb_reversed="false"
app:spb_sections_count="4"
app:spb_speed="2.0"
app:spb_stroke_separator_length="4dp"
app:spb_stroke_width="4dp" />
by this
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar
android:id="#+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="4dp"
android:visibility="invisible"
style="#style/GNowProgressBar"
android:indeterminate="true"/>
thoroughout my entire project using Intellij/Android Studio's Find/Replace.
Is it possible?

(For MAC and similarly for Windows)
Click on Edit (Top Left of your Intellij/Android Studio window)
Hover your cursor to "Find"
Then select "Replace Structurally"
Now the find/replace structurally window will open. Towards the bottom side of the window, uncheck all the boxes(Otherwise it might not identify the snippet through out the project).

Related

How to navigate to a page in NavigationView in WinUI3 using C++

I am working on very simple demo of NavigationView in WinUI3 using C++.
It is very unfortunate that there is no material or tutorial available for this.
<Window
x:Class="App1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<NavigationView x:Name="NavView"
IsTitleBarAutoPaddingEnabled="False"
IsTabStop="False" IsBackButtonVisible="Collapsed" PaneDisplayMode="Left">
<NavigationView.MenuItems>
<NavigationViewItem Icon="Page2" Content="Tab1" Tag="Tab1" IsSelected="True"/>
<NavigationViewItem Icon="Page2" Content="Tab2" Tag="Tab2"/>
</NavigationView.MenuItems>
<ScrollViewer>
<Frame x:Name="ContentFrame" Padding="12,0,12,24" IsTabStop="True"/>
</ScrollViewer>
</NavigationView>
</Window>
How to navigate to a Page on NavigationView using C++?
ContentFrame().Navigate(**WHAT CODE GOES HERE**);
I already know how to do it using C#. and I am not using UWP with c++/winrt.
I need solution for WinUI3 using c++
Check out the C++/WinRT sample code in the docs for NavigationView on MSDN (you can search for void MainPage::NavView_Navigate inside the page to quickly find it).
Here is a summary:
Windows::UI::Xaml::Interop::TypeName pageTypeName =
winrt::xaml_typename<NavigationViewCppWinRT::SettingsPage>();
ContentFrame().Navigate(pageTypeName, nullptr, transitionInfo);
// transitionInfo is passed to your event handler
// if you do this without a transition info, simply
// omit the last argument.

How to set up Chip and ChipGroup attributes properly?

I figured out that app: namespace attributes are not applied to Chip view in my project, though documentation and some sample code I have seen state that they do. What do I do wrong?
<com.google.android.material.chip.Chip
style="#style/Widget.Material3.Chip.Filter"
android:id="#+id/chip1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="20dp"
app:chipStrokeColor="#F0F"
app:chipStrokeWidth="1dp"
app:chipBackgroundColor="#color/biz_500"
app:chipMinHeight="48dp"
app:chipCornerRadius="7dp"
android:text="#string/text_input_girl"
android:textSize="11sp"
android:textAlignment="center" />
I also use Theme.Material3.Light.NoActionBar in application manifest.
I tried to switch to MaterialComponents, but it looks even worse.
Chips Attitude is Normal
<com.google.android.material.chip.Chip
style="#style/Widget.MaterialComponents.Chip.Entry"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="#dimen/_10sdp"
android:text="#string/app_name"
android:textAllCaps="true"
android:textColor="#color/white"
android:textSize="#dimen/_10sdp"
android:textStyle="bold"
app:checkedIcon="#drawable/ic_close_24"
app:checkedIconEnabled="false"
app:checkedIconTint="#color/white"
app:checkedIconVisible="true"
app:chipBackgroundColor="#color/purple_500"
app:chipCornerRadius="#dimen/_10sdp"
app:chipEndPadding="#dimen/_10sdp"
app:chipIconSize="#dimen/_100sdp"
app:chipMinTouchTargetSize="#dimen/_50sdp"
app:closeIcon="#drawable/ic_close_24"
app:rippleColor="#color/white" />
Chip Four Type
style="#style/Widget.MaterialComponents.Chip.Entry"
style="#style/Widget.MaterialComponents.Chip.Action"
style="#style/Widget.MaterialComponents.Chip.Choice"
style="#style/Widget.MaterialComponents.Chip.Filter"

How to make ToolBar and StatusBar Gradient

how can I make ToolBar and StatusBar Gradient as shown image1 This one I want but I'm getting StatusBar and ToolBar as image2 like this. If you observed in 1st image the ToolBar is full gradient at endColor position(bottom of the ToolBar) but 2nd image of the ToolBar is not full Gradient as 1st image at bottom of the ToolBar and showing as a straight line. My code is as given below:
#drawable:
toolbar_product_gradient.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:type="linear"
android:angle="270"
android:startColor="#44000000"
android:centerColor="#22000000"
android:endColor="#00000000"/>
</shape>
AppBarLayout with ToolBar
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="#null"
android:theme="#style/AppTheme.Transparent"
android:background="#drawable/toolbar_product_gradient" >
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarProduct"
android:layout_width="match_parent"
android:layout_height="56dp"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:contentScrim="#android:color/transparent"
app:expandedTitleTextAppearance="#android:color/transparent"
app:titleEnabled="true"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
Please help me how to get it and thanks in advance.

How to set splitter exactly to half window width in p4merge?

I'm wondering if there is a way to set the splitter in p4merge window exactly to 50% screen width. For instance in Total Commander you can right click on splitter and choose from list but there is nothing like that in p4merge.
I used Process Monitor from Sysinternals to track where p4merge writes settings.
Appears that settings file resides here
%USERPROFILE%\.p4merge\ApplicationSettings.xml
and it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!--perforce-xml-version=1.0-->
<PropertyList varName="ApplicationSettings" IsManaged="TRUE">
<String varName="CharSet">utf8-bom</String>
<PropertyList varName="Connection" IsManaged="TRUE">
<String varName="ApplicationLanguage">en</String>
</PropertyList>
<String varName="DiffOption">dl</String>
<ByteArray varName="DiffSplitter">AAAA/wAAAAAAAAACAAAA8wAAAUMBAAAAMgEAAAAB</ByteArray>
<Font varName="Font">
<family>Courier</family>
<pointSize>10</pointSize>
<weight>Normal</weight>
<italic>false</italic>
</Font>
<!--i cut it here for concise-->
</PropertyList>
My guess was:
<ByteArray varName="DiffSplitter">AAAA/wAAAAAAAAACAAAA8wAAAUMBAAAAMgEAAAAB</ByteArray>
is a place where p4merge stores the splitter position.
I didn't feel like decrypting the value so i just deleted the whole tag and splitter moved to exactly 50% width of window.

How do I change CFCHART title font?

I am using the WebCharts3D interface to create and modify charts, and then using the generated XML style as an in-line style in my Coldfusion code.
So this shows up correctly in the WebCharts3D:
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Double" style="Solid">
<title font="Arial-18-bold">
<decoration style="None"/>This is a title
</title>
</pieChart>
This simply shows the example title with no box around it, and set to the desired font size and weight. You can take this code, copy it into the WebCharts "XML Style" window, apply it, and see that it works.
I use this in my Coldfusion code like this:
<cfsavecontent variable="piecontent">
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Double" style="Solid">
<title font="Arial-18-bold">
<decoration style="None"/>This is a title
</title>
</pieChart>
</cfsavecontent>
<cfchart name="mychart" format="png"
style="#piecontent#">
<cfchartseries type= "pie">
<cfchartdata item="sample1" value="10">
<cfchartdata item="sample2" value="20">
</cfchartseries>
</cfchart>
The title correctly has "decoration" set to "none", because there is no box around it, but the title font size and weight is totally ignored. Is this a bug? Is there a workaround?
EDIT: It appears that this problem of ignored font size and weight is ALSO true for the overall font, like if you put this: <pieChart depth="Double" style="Solid" font="Arial-16-Bold">.
It seems like those particular settings are ignored in favor of the cfchart tag's font attributes. Try using those instead:
<cfchart format="png" font="Arial" fontBold="true" fontSize="18">
EDIT: While the above works with pie charts (only), it seems like another bug... What does work is interfacing with webcharts directly. It is more involved, but offers complete control over chart settings.
My experience, though I can't find any proof online other than my own testing, is that ColdFusion's implementation of Webcharts does not support styling the title.