Skip to content

Instantly share code, notes, and snippets.

@guffyWave
Created October 18, 2016 14:18
Show Gist options
  • Save guffyWave/34793e01c695ce60b81b5b737988f91e to your computer and use it in GitHub Desktop.
Save guffyWave/34793e01c695ce60b81b5b737988f91e to your computer and use it in GitHub Desktop.
public class ShowHideToggleButton extends LinearLayout {
Context context;
public ShowHideToggleButton(final Context context) {
this(context, null);
}
public ShowHideToggleButton(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public ShowHideToggleButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
addView(inflater.inflate(R.layout.xxxx, null));
...
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment