// Path: androidapp/app/src/main/java/com/qianmi/boat/widget/CheckListRelativeLayout.java
// public class CheckListRelativeLayout extends LinearLayout {
// 
// 
//     private Context context;
//     private TextView tvTitleName;
//     private TextView tvTitleDetail;
//     private LinearLayout linearCont;
//     private RelativeLayout relateiveLayout;
// 
//     private String name;
//     private ArrayList<String> checkItemList = new ArrayList<>();
// 
//     public CheckListRelativeLayout(Context context,String name,ArrayList<String> list) {
//         super(context);
//         this.context = context;
//         initViews();
//         this.checkItemList.addAll(list);
//         addContView();
//     }
// 
//     public CheckListRelativeLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//         this.context = context;
//         initViews();
//     }
// 
//     private void initViews() {
//         LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//         inflater.inflate(R.layout.check_list_linearlayout, this);
//         this.tvTitleName = (TextView) findViewById(R.id.tv_title_name);
//         this.tvTitleDetail = (TextView) findViewById(R.id.tv_title_detail);
//         linearCont = (LinearLayout) findViewById(R.id.linear_cont);
//         relateiveLayout = (RelativeLayout) findViewById(R.id.relative_title);
//         relateiveLayout.setOnClickListener(new OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 if (linearCont.getVisibility() == VISIBLE) {
//                     goneLinearCont();
//                 } else {
//                     linearCont.setVisibility(VISIBLE);
//                     Animation animation = AnimationUtils.loadAnimation(context, R.anim.menu_visible);
//                     linearCont.startAnimation(animation);
//                 }
//             }
//         });
//     }
// 
//     private void goneLinearCont() {
//         Animation animation = AnimationUtils.loadAnimation(context, R.anim.menu_gone);
//         linearCont.startAnimation(animation);
//         animation.setAnimationListener(new Animation.AnimationListener() {
//             @Override
//             public void onAnimationStart(Animation animation) {
//             }
// 
//             @Override
//             public void onAnimationEnd(Animation animation) {
//                 linearCont.setVisibility(GONE);
//             }
// 
//             @Override
//             public void onAnimationRepeat(Animation animation) {
// 
//             }
//         });
//     }
// 
//     private void addContView() {
//         for (int i = 0; i < checkItemList.size(); i++) {
//             CheckItemView checkItemView = new CheckItemView(context, checkItemList.get(i));
//             linearCont.addView(checkItemView);
//             checkItemView.setDataChangeListener(new DataChangeListener() {
//                 @Override
//                 public void dataChange(DataChangeEvent event, int count) {
//                     refreshView();
//                 }
//             });
//         }
//         refreshView();
//     }
// 
//     private void refreshView() {
//         int count = 0;
//         int allCount = linearCont.getChildCount();
//         for (int i = 0; i < allCount; i++) {
//             if(((CheckItemView)linearCont.getChildAt(i)).isChoosed()){
//                 count++;
//             }
//         }
//         if (allCount == count) {
//             tvTitleDetail.setTextColor(getResources().getColor(R.color.white));
//             goneLinearCont();
//         }else{
//             linearCont.setVisibility(VISIBLE);
//             tvTitleDetail.setTextColor(getResources().getColor(R.color.red));
//         }
//         tvTitleDetail.setText(count+"/"+allCount+"["+allCount+"]");
//     }
// 
//     private void getSelectedCount() {
// 
//     }
// 
//     public void setListViews(List<String> list) {
//         this.checkItemList.addAll(list);
//         addContView();
//     }
// 
//     public void setTitleName(String name) {
//         if (TextUtils.isEmpty(name)) {
//             return;
//         }
//         tvTitleName.setText(name);
//     }
// 
// }


import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import com.qianmi.boat.R;
import com.qianmi.boat.widget.CheckListRelativeLayout;
import java.util.Arrays;
import butterknife.Bind;
import butterknife.ButterKnife;
package com.qianmi.boat.activity;





public class SettingsActivity extends AppCompatActivity {

    @Bind(R.id.linar_setting1)
    CheckListRelativeLayout linarSetting1;
    @Bind(R.id.linar_setting2)
    CheckListRelativeLayout linarSetting2;
    @Bind(R.id.linar_setting3)
    CheckListRelativeLayout linarSetting3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);
        ButterKnife.bind(this);
        settData();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_settings, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
// Path: androidapp/app/src/main/java/com/qianmi/boat/widget/CheckListRelativeLayout.java
// public class CheckListRelativeLayout extends LinearLayout {
// 
// 
//     private Context context;
//     private TextView tvTitleName;
//     private TextView tvTitleDetail;
//     private LinearLayout linearCont;
//     private RelativeLayout relateiveLayout;
// 
//     private String name;
//     private ArrayList<String> checkItemList = new ArrayList<>();
// 
//     public CheckListRelativeLayout(Context context,String name,ArrayList<String> list) {
//         super(context);
//         this.context = context;
//         initViews();
//         this.checkItemList.addAll(list);
//         addContView();
//     }
// 
//     public CheckListRelativeLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//         this.context = context;
//         initViews();
//     }
// 
//     private void initViews() {
//         LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//         inflater.inflate(R.layout.check_list_linearlayout, this);
//         this.tvTitleName = (TextView) findViewById(R.id.tv_title_name);
//         this.tvTitleDetail = (TextView) findViewById(R.id.tv_title_detail);
//         linearCont = (LinearLayout) findViewById(R.id.linear_cont);
//         relateiveLayout = (RelativeLayout) findViewById(R.id.relative_title);
//         relateiveLayout.setOnClickListener(new OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 if (linearCont.getVisibility() == VISIBLE) {
//                     goneLinearCont();
//                 } else {
//                     linearCont.setVisibility(VISIBLE);
//                     Animation animation = AnimationUtils.loadAnimation(context, R.anim.menu_visible);
//                     linearCont.startAnimation(animation);
//                 }
//             }
//         });
//     }
// 
//     private void goneLinearCont() {
//         Animation animation = AnimationUtils.loadAnimation(context, R.anim.menu_gone);
//         linearCont.startAnimation(animation);
//         animation.setAnimationListener(new Animation.AnimationListener() {
//             @Override
//             public void onAnimationStart(Animation animation) {
//             }
// 
//             @Override
//             public void onAnimationEnd(Animation animation) {
//                 linearCont.setVisibility(GONE);
//             }
// 
//             @Override
//             public void onAnimationRepeat(Animation animation) {
// 
//             }
//         });
//     }
// 
//     private void addContView() {
//         for (int i = 0; i < checkItemList.size(); i++) {
//             CheckItemView checkItemView = new CheckItemView(context, checkItemList.get(i));
//             linearCont.addView(checkItemView);
//             checkItemView.setDataChangeListener(new DataChangeListener() {
//                 @Override
//                 public void dataChange(DataChangeEvent event, int count) {
//                     refreshView();
//                 }
//             });
//         }
//         refreshView();
//     }
// 
//     private void refreshView() {
//         int count = 0;
//         int allCount = linearCont.getChildCount();
//         for (int i = 0; i < allCount; i++) {
//             if(((CheckItemView)linearCont.getChildAt(i)).isChoosed()){
//                 count++;
//             }
//         }
//         if (allCount == count) {
//             tvTitleDetail.setTextColor(getResources().getColor(R.color.white));
//             goneLinearCont();
//         }else{
//             linearCont.setVisibility(VISIBLE);
//             tvTitleDetail.setTextColor(getResources().getColor(R.color.red));
//         }
//         tvTitleDetail.setText(count+"/"+allCount+"["+allCount+"]");
//     }
// 
//     private void getSelectedCount() {
// 
//     }
// 
//     public void setListViews(List<String> list) {
//         this.checkItemList.addAll(list);
//         addContView();
//     }
// 
//     public void setTitleName(String name) {
//         if (TextUtils.isEmpty(name)) {
//             return;
//         }
//         tvTitleName.setText(name);
//     }
// 
// }


// Path: androidapp/app/src/main/java/com/qianmi/boat/activity/SettingsActivity.java
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import com.qianmi.boat.R;
import com.qianmi.boat.widget.CheckListRelativeLayout;
import java.util.Arrays;
import butterknife.Bind;
import butterknife.ButterKnife;

package com.qianmi.boat.activity;





public class SettingsActivity extends AppCompatActivity {

    @Bind(R.id.linar_setting1)
    CheckListRelativeLayout linarSetting1;
    @Bind(R.id.linar_setting2)
    CheckListRelativeLayout linarSetting2;
    @Bind(R.id.linar_setting3)
    CheckListRelativeLayout linarSetting3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);
        ButterKnife.bind(this);
        settData();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_settings, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {