Skip to content

Commit

Permalink
fix about page constructor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
caodongping committed Oct 11, 2016
1 parent 1beaece commit f444658
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Expand Up @@ -24,8 +24,21 @@ public class NaviBar extends BaseLinearLayout {
@Bind(R.id.rightTextView)
TextView rightTextView;

public NaviBar(Context context) {
super(context);
}

public NaviBar(Context context, AttributeSet attrs) {
super(context, attrs);
}

public NaviBar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

@Override
protected void init(Context context, AttributeSet attrs) {
super.init(context, attrs);
if (attrs != null) {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.NaviBar);
leftTextView.setText(a.getString(R.styleable.NaviBar_nb_left_text));
Expand Down
Expand Up @@ -14,12 +14,22 @@

public class BaseLinearLayout extends LinearLayout {

public BaseLinearLayout(Context context) {
super(context);
init(context, null);
}

public BaseLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}

public BaseLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
init(context, attrs);
}

private void init() {
protected void init(Context context, AttributeSet attrs) {
LayoutBinder.bind(this);
ButterKnife.bind(this);
}
Expand Down

0 comments on commit f444658

Please sign in to comment.