How to set Ripple effect on a LinearLayout programmatically?

You can use this way. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { // If we’re running on Honeycomb or newer, then we can use the Theme’s // selectableItemBackground to ensure that the View has a pressed state TypedValue outValue = new TypedValue(); this.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true); textView.setBackgroundResource(outValue.resourceId); }

Make specific parts of a text clickable in flutter [duplicate]

Use RichText with TextSpan and GestureRecognizer. With GestureRecognizer you can detect tap, double tap, long press and etc. Widget build(BuildContext context) { TextStyle defaultStyle = TextStyle(color: Colors.grey, fontSize: 20.0); TextStyle linkStyle = TextStyle(color: Colors.blue); return RichText( text: TextSpan( style: defaultStyle, children: <TextSpan>[ TextSpan(text: ‘By clicking Sign Up, you agree to our ‘), TextSpan( text: ‘Terms … Read more

How to increase the clickable area of an anchor or button element?

To increase the area of a text link you can use the following css; a { display: inline-block; position: relative; z-index: 1; padding: 2em; margin: -2em; } <a href=””>An anchor element</a> Display: inline-block is required so that margins and padding can be set Position needs to be relative so that… z-index can be used to … Read more