Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2017 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/776df81ad9f9ed35f2289d5d5efd4187 to your computer and use it in GitHub Desktop.
Save anonymous/776df81ad9f9ed35f2289d5d5efd4187 to your computer and use it in GitHub Desktop.
Custom view
package com.sublink.app.presentation;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import com.sublink.app.R;
public class ItemConsist extends LinearLayout {
public ItemConsist(Context context) {
super(context);
init();
}
public ItemConsist(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public ItemConsist(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
public ItemConsist(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init();
}
private void init() {
inflate(getContext(), R.layout.view_change_subtype, this);
}
public void someMethodOfItemConsist() {
//do whatever you want
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment