FAQ Database Discussion Community


Viewpager: lose the state of toggle button when swiping

android,android-viewpager,togglebutton,android-pageradapter,recycling
I am creating a Gallery with image and like button using Viewpager and PagerAdapter. Please refer to my code: public class GalleryAdapter extends PagerAdapter { private Activity _activity; private ArrayList<MyPhotoItem> _imageCollection; // Components in fullsceen layout ImageView imgDisplay; private ToggleButton btnLike; // Variable for btnLike private boolean isChecked; // constructor...

WPF - Program fails when using ToggleButton Trigger on IsMouseOver

wpf,crash,togglebutton,eventtrigger
I am getting a weird crash whenever I am trying to change a path fill using a trigger on a ToggleButton. After doing some process of elimination it seems that the actual trigger property is causing the program to crash. When it crashes I am getting this: Problem signature: Problem...

How can I access multiple ToggleButtons created in a class?

arrays,javafx,togglebutton
I have a GridPane (6x9) made with SceneBuilder. Inside that GridPane I created 50 ToggleButtons in my controller with the following code: @FXML private void initialize() { Font numbersFont = new Font("Arial", 10); for (int y = 0; y < 9; y++){ for (int x = 1; x < 7;...

Customized switch toggle button

android,xml,android-layout,togglebutton,android-togglebutton
I wan't to customized my switch in android. The problem is that the default button overlay my own drawable. What have i done: create my own graphics (2 graphics) create a xml in the drawable folder, that's look like this: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/switch_female" android:state_checked="false"/> <item android:drawable="@drawable/switch_male"...

Semantic UI toggle button not appearing correctly

html,css,togglebutton,semantic-ui
I am using Semantic-UI for my web app and am using the Toggle checkbox. The way it should appear as show in the docs is show below (Green toggle): However on my site it actually shows like this: I haven't touched the CSS for it so I have no idea...

Userform controls - looping and checking value

loops,excel-vba,controls,togglebutton,userform
I am trying to loop through two sets of controls on a userform. If a combination of two controls (togglebuttons) are true then do something. The sub is called from the userform where the controls are created. This is the first time I've used the userform control variable, the code...

Use toggle button to control sound

android,audio,togglebutton
I need my app to play all the sounds when toggle button is checked and stop playing them when it is unchecked.By all sounds I mean the sound played when other buttons present in the activity and other activities are pressed. Following is my toggle button: <ToggleButton android:layout_width="70dp" android:layout_height="70dp" android:id="@+id/toggleButton"...

Updating togglebutton cheched state gives error

android,xamarin,togglebutton,checked
i have this ToggleButton <ToggleButton android:id="@+id/PlaymusicToggleButton" android:layout_width="30dp" android:layout_height="30dp" android:textOn="" android:textOff="" android:layout_weight="0" android:background="@drawable/mediabutton" android:layout_marginRight="10dp" android:layout_centerVertical="true" /> <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:state_pressed="true"...

JavaFX - Concurrency and updating label

java,concurrency,javafx,label,togglebutton
I've got problem with these piece of code. I want to make an application, which constatnly displays randomized values in labels as long as the Toggle Button is pressed. That's what I created, it works but window after a few seconds is lagging horrible. What am I doing wrong? Here...

How to preserve the state of toggle button in listview in android

android,listview,state,togglebutton
i have listview with toggle button.i face a problem when i scroll down the toggle button the state of toggle button changed,and also when i click on first toggleButton the fourth toggle button also checked. i also want to save the all toggle button states and the text on that...

Android Graphical layout doesnt show toggle button

android,eclipse,togglebutton,graphical-layout-editor
I'm new with android programming and i have a problem. I use Eclipse and i create a Toggle Button but in Graphical layout that doesn't show anything and it shows me this "Exception raised during rendering: -1". What can i do? I post below my code that i have used....

Control style of each individual ToggleButton in Windows Phone 8.1

windows-phone-8.1,controltemplate,togglebutton
I am building a Windows Phone 8.1 (non SilverLight) application. I want my ToggleButtons to look different when toggled, so I have the following code: <Page.Resources> <!-- Custom style for Windows.UI.Xaml.Controls.Primitives.ToggleButton --> <Style TargetType="ToggleButton"> <Setter Property="Background" Value="{ThemeResource ToggleButtonBackgroundThemeBrush}" /> <Setter Property="Foreground" Value="{ThemeResource ToggleButtonForegroundThemeBrush}"/> <Setter Property="BorderBrush" Value="{ThemeResource...

Toggle low state won't be sent to python cgi

javascript,python,html,cgi,togglebutton
I'm trying to send the state of a bootstrap toggle button to a python cgi script. It works fine when the toggle is true (python script prints "true") but when false, the python script prints "None" as if the input value I try to send was empty. The console.log(tgl_state); prints...

Removing padding from toggle button in Android

android,android-layout,togglebutton
I am creating a simple toggle button in android and setting background as a drawable. <ToggleButton android:layout_width="wrap_content" android:drawablePadding="0dp" android:layout_height="wrap_content" android:text="" android:textSize="12sp" android:padding="0dp" android:id="@+id/tag_text" android:background="@drawable/toggle_selector"/> toggle_selector.xml looks like this: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item...

WPF ItemsControl and Togglebuttons weird behaviour

c#,wpf,itemscontrol,togglebutton
I've been working on a WPF application but encountered some weird behaviour when using ItemsControl to display a list of togglebuttons with binding. It works just fine when it is displaying a collection of 1 element, but when I have two elements it behaves very strange. It will not show...

Jquery toggle jumps

jquery,toggle,slidetoggle,togglebutton
Could someone tell me a solution for this issue? As you can see, the div "jumps" when using the Toggle function. http://codepen.io/AndrewRed/pen/vErjob?editors=101 <p>Text above animation</p> <input type="button" class="btn" Value="Animate"/> <div id="animate"> <p>Text to animate</p> <p>Text to animate 2</p> </div> <p>Text below animation</p> $("input").on('click', function(){ $("#animate").toggle('slow'); }); ...

WP 8.1 ToggleButton Change Icon when Checked / UnChecked

xaml,windows-phone-8.1,togglebutton
I have the following XAML code for Windows Phone 8.1 (non SilverLight): <Grid> <ToggleButton Name="TogBtn" VerticalAlignment="Center" HorizontalAlignment="Center" Checked="ToggleButton_OnChecked"> <SymbolIcon Symbol="play"></SymbolIcon> </ToggleButton> </Grid> The output of the above code is: How can I change the icon to a stop icon when the toggle button is checked and then back to play...

toggle button mouse listener null pointer exception

java,mouselistener,togglebutton
I'm creating a version of Minesweeper in java, but am having issues setting up the mouse listener for the toggleButtons. I need to do different things on left and right click, so this is what I've setup so far in my MyPanel class: import javax.swing.*; import java.awt.*; import java.awt.event.*; import...

Angularjs Apply toggle function to only the clicked button inside ng-repeat

javascript,angularjs,angularjs-ng-repeat,this,togglebutton
I created this fiddle exclusively to adress my problem. I am ng-repeating certain section. I have a toggle functionality to be implemented inside it. However, when I click the button, function gets triggered for all the repeated items. This works fine when not using ng-repeat inspite of using the same...

jquery-toggles setting state without triggering on change event

javascript,jquery,togglebutton
I'm using the jquery-toggles plugin from simon tabor https://github.com/simontabor/jquery-toggles and need to be able to set the state of the toggle WITHOUT triggering the on toggle event. Is that possible? If not, is it possible to remove and re-add the toggle using jquery (and set the initial state as needed)....

How do I start with the tab expanded (toggle)?

javascript,html,css,togglebutton
So I am modifying a web page and there is a table on the bottom of the page that starts minimized. When you click the arrow it opens upward to reveal the table. I am attempting to modify it so that it already starts off opened when the page loads....