How to increase thumb in Android Slider? - nativescript

Could help me? How to increase thumb? Like this
I use
<Slider value="80" />
I found the answer for Android. Need to create file app/App_Resources/Android/src/main/res/drawable-nodpi/custom_thumb.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<gradient
android:angle="270"
android:endColor="#color/colorDekraOrange"
android:startColor="#color/colorDekraOrange" />
<size
android:height="35dp"
android:width="35dp" />
</shape>
and add a property android:thumb="#drawable/custom_thumb"
But how does this property add a Slider to nativescrip?
Thank's

Related

Circular checkbox on android in Xamarin Forms

Does anyone know how to make a custom renderer for the Xamarin forms checkbox? I want the checkbox to be circular on android devices, like they are on iOS.
I'm using Xamarin Forms 4.3.
Here is First Solution use Library:
your Solution is Here.
in that you can change your shape as per your need.
here is a Gihub Link as Here
Here is Second Solution as per your need here is Check box Renderer in Ellipse Shape.
in Xaml,
<CheckBox/>
in Android Project, First create new file. i named it CheckboxRenderer.cs
set this before namespace:
[assembly: ExportRenderer(typeof(Xamarin.Forms.CheckBox), typeof(CheckboxRenderer))]
here is my class file,
public class CheckboxRenderer : ViewRenderer<Xamarin.Forms.CheckBox, Android.Widget.CheckBox>
{
private Android.Widget.CheckBox checkBox;
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.CheckBox> e)
{
base.OnElementChanged(e);
var model = e.NewElement;
checkBox = new Android.Widget.CheckBox(Context);
checkBox.SetButtonDrawable(Resource.Drawable.custom_checkbox);
checkBox.Tag = this;
SetNativeControl(checkBox);
}
}
Create these 3 xml file in Drawble folder,
1) custom_checkbox.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true"
android:drawable="#drawable/checked" />
<item android:state_pressed="true"
android:drawable="#drawable/checked" />
<item android:state_pressed="false"
android:drawable="#drawable/unchecked" />
</selector>
2) checked.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<layer-list>
<item>
<shape android:shape="oval">
<corners android:radius="1dp" />
<stroke
android:width="1dp"
android:color="#777" />
<gradient
android:startColor="#990000"
android:centerColor="#990000"
android:endColor="#990000"
android:angle="270" />
<size
android:width="30dp"
android:height="30dp" />
</shape>
</item>
<item
android:width="8dp"
android:height="2dp"
android:top="20dp"
android:left="6dp">
<rotate
android:fromDegrees="45">
<shape android:shape="rectangle">
<solid android:color="#fff"/>
</shape>
</rotate>
</item>
<item
android:width="19dp"
android:height="2dp"
android:top="16dp"
android:left="9dp">
<rotate
android:fromDegrees="-45">
<shape android:shape="rectangle">
<solid android:color="#fff"/>
</shape>
</rotate>
</item>
</layer-list>
</item>
</selector>
3) unchecked.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<corners android:radius="1dp" />
<stroke
android:width="1dp"
android:color="#777" />
<gradient
android:startColor="#990000"
android:centerColor="#990000"
android:endColor="#990000"
android:angle="270" />
<size
android:width="30dp"
android:height="30dp" />
</shape>
ohh its Done... you will get output like this,
Hope this hepls.
In your question, you say "I want the checkbox to be circular on android devices, like they are on iOS." If this is your main goal, you may want to try the Syncfusion free community license to add a SfCheckbox control. Then you can experiment with the CornerRadius property of the checkbox. Here is what worked for me:
<StackLayout>
<checkbox:SfCheckBox Text="Round Checkbox #1" CornerRadius="10" />
<checkbox:SfCheckBox Text="Round Checkbox #2" CornerRadius="10" IsChecked="True"/>
</StackLayout>

View becomes invisible when I add attach custom view background to the view

I am trying to add a custom background to a button to make two sides rounded. But when I attach or add custom view background, the button becomes invisible. Here is my xml code:
<android.support.constraint.ConstraintLayout
Have Some Code there
<Button
android:id="#+id/Top"
android:layout_width="30dp"
android:layout_height="34dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:drawableTop="#drawable/baseline_remove_24"
android:elevation="5dp"
android:paddingTop="5dp"
android:translationZ="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="#+id/mid_button"
android:layout_width="30dp"
android:layout_height="23dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:background="#drawable/button_mid"
android:text="2"
app:layout_constraintBottom_toBottomOf="#+id/bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/Top" />
<Button
android:id="#+id/bottom"
android:layout_width="30dp"
android:layout_height="34dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="#drawable/button_bottom_side"
//background added there
android:drawableBottom="#drawable/baseline_add_24"
android:elevation="5dp"
android:paddingBottom="5dp"
android:translationZ="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />
</android.support.constraint.ConstraintLayout>
Code for custom view from drawable folder is here:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:topLeftRadius="0dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="50dp"
android:bottomRightRadius="50dp" />
<stroke android:width="1dp" android:color="#BABABA" />
<solid android:color="#ffffff"/>
padding android:left="20dp" android:top="20dp"
android:right="20dp" android:bottom="20dp" />
</shape>
Image is below:
(https://imghostr.com/BwBwqrc1)

Adding a custom button to the advanced find robbon

I've got my customizations.xml importing ok, but when I open the Advanced Find Dialog, it tell me "Ribbon XML Validation Error":
I can't seem to get any more info than that. Below is my customizations.xml text, I've tried to simplify it as much as possible.
<ImportExportXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Entities></Entities>
<Roles></Roles>
<Workflows></Workflows>
<FieldSecurityProfiles></FieldSecurityProfiles>
<Templates />
<RibbonDiffXml>
<CustomActions>
<CustomAction Id="DEW.Mscrm.AdvancedFind.Groups.Debug.UploadFetchXml"
Location="Mscrm.AdvancedFind.Groups.Debug._children" >
<CommandUIDefinition>
<Button Id="DEW.Mscrm.AdvancedFind.Groups.Debug.UploadFetchXmlButton" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules />
<EnableRules />
</RuleDefinitions>
<LocLabels />
</RibbonDiffXml>
<EntityMaps />
<EntityRelationships />
<OrganizationSettings />
<optionsets />
<Languages>
<Language>1033</Language>
</Languages>
</ImportExportXml>
For others looking to find the solution, or at least something to take note of if you're having a similar problem.
My problem was that the id for the different elements were the same. You must have unique id's even among different elements. And "Mscrm.AdvancedFind.Groups.Debug._children" should have been "Mscrm.AdvancedFind.Groups.Debug.Controls._children"

Netbeans separted TopComponent in editor mode ignores minimum size

In my Netbeans 7.11 application I have an additional separated topcomponent in an editor mode that does not respect the minimum size that I specified using the GUI-builder.
The option for "Respect Minimum Size When Resizing Windows" in the Window System tab of the branding is checked.
My .wsmode file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mode PUBLIC
"-//NetBeans//DTD Mode Properties 2.0//EN"
"http://www.netbeans.org/dtds/mode-properties2_0.dtd">
<mode version="2.0">
<name unique="myTopComponent" />
<kind type="view" />
<state type="separated" />
<constraints>
<path orientation="horizontal" number="0" weight="1" />
<path orientation="vertical" number="0" weight="1" />
</constraints>
<bounds x="150" y="150" width="1200" height="670" />
<frame state="0"/>
<empty-behavior permanent="true" />
</mode>
What am I doing wrong or what am I missing?

Getting XUL:Scale to show what numeric value is selected

I'm working with XUL, and below is abasic slider/scale implementation:
<scale value="1" min="1" max="10" increment="1"/>
However I want a numbox next to it which displays the value selected in the slider, and maybe I didn't look hard enough in the XUL tutorial, but I couldn't find a feasible answer.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<scale value="1" min="1" max="10" increment="1" id="a"/>
<textbox readonly="true" observes="a"/>
</window>

Resources