|
|
@@ -1,9 +1,9 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.fragment.signup;
|
|
|
|
|
|
import android.content.Context;
|
|
|
-import android.content.res.TypedArray;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.util.AttributeSet;
|
|
|
+import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
@@ -14,42 +14,49 @@ import kr.co.zumo.app.R;
|
|
|
|
|
|
public class SignUpBenefitCustomView extends LinearLayout {
|
|
|
|
|
|
- LinearLayout benefit_layout;
|
|
|
- ImageView benefit_image;
|
|
|
- TextView benefit_title;
|
|
|
- TextView benefit_contents;
|
|
|
- TextView benefit_category;
|
|
|
+ LinearLayout benefitLayout;
|
|
|
+ ImageView benefitImage;
|
|
|
+ TextView benefitTitle;
|
|
|
+ TextView benefitContents;
|
|
|
+ TextView benefitCategory;
|
|
|
|
|
|
|
|
|
public SignUpBenefitCustomView(Context context) {
|
|
|
super(context);
|
|
|
- inflateViews();
|
|
|
+ inflateViews(context);
|
|
|
|
|
|
}
|
|
|
|
|
|
public SignUpBenefitCustomView(Context context, @Nullable AttributeSet attrs) {
|
|
|
super(context, attrs);
|
|
|
- inflateViews();
|
|
|
+ inflateViews(context);
|
|
|
}
|
|
|
|
|
|
- public SignUpBenefitCustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
|
|
- super(context, attrs, defStyleAttr);
|
|
|
+
|
|
|
+ private void inflateViews(Context context) {
|
|
|
+ Log.e("APP# SignUpBenefitCustomView | inflateViews", "|" + context.toString());
|
|
|
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
+ View view = inflater.inflate(R.layout.sign_up_benefit_view, this);
|
|
|
+
|
|
|
+ benefitLayout = (LinearLayout) findViewById(R.id.benefit_layout);
|
|
|
+ benefitImage = (ImageView) findViewById(R.id.benefit_image);
|
|
|
+ benefitTitle = (TextView) findViewById(R.id.benefit_title);
|
|
|
+ benefitContents = (TextView) findViewById(R.id.benefit_contents);
|
|
|
+ benefitCategory = (TextView) findViewById(R.id.benefit_category);
|
|
|
}
|
|
|
|
|
|
- private void inflateViews(){
|
|
|
- LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
- View view = inflater.inflate(R.layout.sign_up_benefit_view , this);
|
|
|
- addView(view);
|
|
|
|
|
|
- /*benefit_layout = (LinearLayout)findViewById(R.id.benefit_layout);
|
|
|
- benefit_image = (ImageView)findViewById(R.id.benefit_image);
|
|
|
- benefit_title = (TextView)findViewById(R.id.benefit_title);
|
|
|
- benefit_contents = (TextView)findViewById(R.id.benefit_contents);
|
|
|
- benefit_category = (TextView)findViewById(R.id.benefit_category);*/
|
|
|
+ private void getAttrs(AttributeSet attrs) {
|
|
|
+ //TypedArray typedArray = getContext().obtainStyledAttributes(attrs , R.styleable.BenefitView);
|
|
|
}
|
|
|
|
|
|
- private void getAttrs(AttributeSet attrs){
|
|
|
- TypedArray typedArray = getContext().obtainStyledAttributes(attrs , R.styleable.BenefitView);
|
|
|
+
|
|
|
+ public void setSignUpBenefit(int imageResource, String title, String contents, String category) {
|
|
|
+
|
|
|
+ benefitImage.setImageResource(imageResource);
|
|
|
+ benefitTitle.setText(title);
|
|
|
+ benefitContents.setText(contents);
|
|
|
+ benefitCategory.setText(category);
|
|
|
|
|
|
}
|
|
|
}
|