Questions tagged [android-togglebutton]

A toggle button allows the user to change a setting between two states.

A toggle button allows the user to change a setting between two states. It displays checked/unchecked states as a button with a "light" indicator and by default accompanied with the text "ON" or "OFF".

For more information, see the Toggle Buttons guide.

199 questions
1
vote
1 answer

One Toggle Button on at a time

I am working on a an Android Application . i have created some toggle buttons dynamically and they are clickable too... what i want to achieve is toggle on any specific button and its ok. but when i toggle on any other button all other toggle…
Addi.Star
  • 475
  • 2
  • 15
  • 36
1
vote
2 answers

Toggle button not toggling on Android

I have a class with toggle buttons defined like so: public class DeviceControlActivity extends Activity implements View.OnClickListener private ToggleButton b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12; @Override public void onCreate(Bundle…
marciokoko
  • 4,988
  • 8
  • 51
  • 91
1
vote
0 answers

accessibility text for switch view reads as " switch checked" and "switched not checked" if the textOn and textOff is empty

In my application i need to show a switch view with no text , i am using below code.
Krishna
  • 805
  • 8
  • 14
1
vote
3 answers

Placing ImageView to the left of centered buttons

I am trying to place a ImageView object to the left of a linear layout object (that is a parent of two buttons). I basically want two buttons centered horizontally with the screen with an image place to the left of the centered buttons. I still want…
Vik
  • 23
  • 8
1
vote
1 answer

Android ToggleButton clear-ish on older versions?

I am making an app that uses a ToggleButton, and I am making sure it works on older devices. On my GS4 (Running Android 5+), it looks like this: On my GS3 (Running Below Android 5), however, it looks like this: Does anyone know how to fix this…
Benjamin Owen
  • 608
  • 2
  • 10
  • 28
1
vote
2 answers

Fullscreen switching in all application

In my previous post Fullscreen switching i've try the next code: if (isChecked) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); …
1
vote
1 answer

How to create this toggle button?

How can I create a toggle button that looks like this? Currently I have the below:
oznecro
  • 457
  • 5
  • 16
1
vote
0 answers

Undesired Togglebutton icon when not using a Theme

I'm having an issue with Togglebuttons when not specifying a theme. If I use any theme they look fine but if I remove the android:theme="@style/AppTheme" tag from AndroidManifest.xml Togglebuttons add an unwanted icon. Sample image here: I made a…
Origence
  • 155
  • 3
  • 10
1
vote
1 answer

How to Create Sliding Buttons in Android?

I want to create sliding buttons in Android, When we slide up the light indicator will glow, as we need change image while sliding it. I have tried with toggle button and switch but its not having sliding effect? Any suggestion on this.
1
vote
0 answers

ToggleButton height not changing (beyond a minimum height) programmatically (Android)

I'm creating a button programmatically. ToggleButton button = new ToggleButton(mContext, null, android.R.attr.borderlessButtonStyle); I'm not able to change the height of the button below a minimum level. It does increase above a default level.…
vinay vyas
  • 491
  • 1
  • 4
  • 17
1
vote
0 answers

Android - Toggling width & height on ACTION_MOVE

Hey i'm a beginner in programming and stuff, and i need a little bit help from anyone here, so... i have some imageview with shrink/grow effect on ACTION_UP and ACTION_DOWN , and i want to toggle the width and height when the MotionEvent switch to…
1
vote
1 answer

Use a Switch to toggle bluetooth in Android

I want to use a switch: http://developer.android.com/guide/topics/ui/controls/togglebutton.html to toggle something like Bluetooth which needs a prompt. The problem is when the user denies the action. If it's done just as shown in the example, the…
1
vote
1 answer

How to check and uncheck checkbox inside getView() on clicking the toggle button outside the CustomAdapter class in android?

I have a layout having a toggle button and a listview. The toggle button is outside the listview.Listview contains texts and checkboxes. How could I check and uncheck the checkbox inside the getView() of my CustomAdapter class on clicking the toggle…
1
vote
1 answer

Android 4.4: ToggleButton background is visible even the view is "GONE"

It seems that my problem is specific for Android versions 4.4 and above. Here is what I am trying to do: I have an ExpandableListView with GroupViews and ChapterViews. GroupViews contain a toggle button which is visible only if they have children…
1
vote
3 answers

Android - ToggleButton losses it's state after scrolling ListView

I have been trying from two days to solve this problem. I have seen many questions related to this problem. But they didn't work for me. I have a custom ListView. It's every row includes one ImageView, two TextViews and one ToggleButton. These all…