// Path: SunmiDesign/sunmiui/src/main/java/sunmi/sunmiui/utils/Adaptation.java
// public class Adaptation {
// 
//     public static int screenHeight = 0;
//     public static int screenWidth = 0;
//     public static float screenDensity = 0;
//     public static int densityDpi = 0;
//     // public static int version = Integer.valueOf(android.os.Build.VERSION.SDK_INT);
// 
//     public static final int SCREEN_9_16 = 1;    // 9:16
//     public static final int SCREEN_3_4 = 2;     // 3:4
//     public static final int SCREEN_4_3 = 3;     // 4:3
//     public static final int SCREEN_16_9 = 4;    // 16:9
//     public static int proportion = SCREEN_9_16;
// 
//     // public static final float PROPORTION_9_16 = 0.56f;    // 9:16
//     // public static final float PROPORTION_3_4 = 0.75f;     // 3:4
//     // public static final float PROPORTION_4_3 = 1.33f;     // 4:3
//     // public static final float PROPORTION_16_9 = 1.77f;    // 16:9
// 
//     public static final float AVERAGE1 = 0.655f;    // (9:16+3:4)/2
//     public static final float AVERAGE2 = 1.04f;     // (3:4+4:3)/2
//     public static final float AVERAGE3 = 1.55f;     // (4:3+16:9)/2
// 
//     public static void init(Context context) {
//         if (screenDensity == 0 || screenWidth == 0 || screenHeight == 0) {
//             DisplayMetrics dm = new DisplayMetrics();
//             WindowManager wm = (WindowManager) context
//                     .getSystemService(Context.WINDOW_SERVICE);
//             wm.getDefaultDisplay().getMetrics(dm);
//             Adaptation.screenDensity = dm.density;
//             Adaptation.screenHeight = dm.heightPixels;
//             Adaptation.screenWidth = dm.widthPixels;
//             Adaptation.densityDpi = dm.densityDpi;
//         }
// 
//         float proportionF = (float) screenWidth / (float) screenHeight;
// 
//         if (proportionF <= AVERAGE1) {
//             proportion = SCREEN_9_16;
//         } else if (proportionF <= AVERAGE2) {
//             proportion = SCREEN_3_4;
//         } else if (proportionF <= AVERAGE3) {
//             proportion = SCREEN_4_3;
//         } else if (proportionF > AVERAGE3) {
//             proportion = SCREEN_16_9;
//         }
// 
//         Log.i("SCREEN CONFIG", "screenHeight:" + screenHeight + ";screenWidth:"
//                 + screenWidth + ";screenDensity:" + screenDensity
//                 + ";densityDpi:" + densityDpi);
// 
//     }
// 
// }


import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import java.util.List;
import sunmi.sunmiui.R;
import sunmi.sunmiui.utils.Adaptation;
package sunmi.sunmiui.list;



/**
 * Created by bps .
 */
public class SunmiList extends LinearLayout {

    private ListView mListView;
    private TextView mTvTitle;

    public SunmiList(Context context) {
        super(context);
        initView();
    }

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

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

    private void initView( ) {
        View view = getAdapterView();
        this.addView(view);
        mTvTitle = (TextView) view.findViewById(R.id.tv_title);
        mListView = (ListView) view.findViewById(R.id.list_view);
    }

    /**
     * 适配
     * @return
     */
    private View getAdapterView( ) {
        switch (Adaptation.proportion) {
            case Adaptation.SCREEN_9_16:
                return View.inflate(getContext(), R.layout.list_v1_9_16, null);
            case Adaptation.SCREEN_3_4:
                return View.inflate(getContext(), R.layout.list_v1_9_16, null);
// Path: SunmiDesign/sunmiui/src/main/java/sunmi/sunmiui/utils/Adaptation.java
// public class Adaptation {
// 
//     public static int screenHeight = 0;
//     public static int screenWidth = 0;
//     public static float screenDensity = 0;
//     public static int densityDpi = 0;
//     // public static int version = Integer.valueOf(android.os.Build.VERSION.SDK_INT);
// 
//     public static final int SCREEN_9_16 = 1;    // 9:16
//     public static final int SCREEN_3_4 = 2;     // 3:4
//     public static final int SCREEN_4_3 = 3;     // 4:3
//     public static final int SCREEN_16_9 = 4;    // 16:9
//     public static int proportion = SCREEN_9_16;
// 
//     // public static final float PROPORTION_9_16 = 0.56f;    // 9:16
//     // public static final float PROPORTION_3_4 = 0.75f;     // 3:4
//     // public static final float PROPORTION_4_3 = 1.33f;     // 4:3
//     // public static final float PROPORTION_16_9 = 1.77f;    // 16:9
// 
//     public static final float AVERAGE1 = 0.655f;    // (9:16+3:4)/2
//     public static final float AVERAGE2 = 1.04f;     // (3:4+4:3)/2
//     public static final float AVERAGE3 = 1.55f;     // (4:3+16:9)/2
// 
//     public static void init(Context context) {
//         if (screenDensity == 0 || screenWidth == 0 || screenHeight == 0) {
//             DisplayMetrics dm = new DisplayMetrics();
//             WindowManager wm = (WindowManager) context
//                     .getSystemService(Context.WINDOW_SERVICE);
//             wm.getDefaultDisplay().getMetrics(dm);
//             Adaptation.screenDensity = dm.density;
//             Adaptation.screenHeight = dm.heightPixels;
//             Adaptation.screenWidth = dm.widthPixels;
//             Adaptation.densityDpi = dm.densityDpi;
//         }
// 
//         float proportionF = (float) screenWidth / (float) screenHeight;
// 
//         if (proportionF <= AVERAGE1) {
//             proportion = SCREEN_9_16;
//         } else if (proportionF <= AVERAGE2) {
//             proportion = SCREEN_3_4;
//         } else if (proportionF <= AVERAGE3) {
//             proportion = SCREEN_4_3;
//         } else if (proportionF > AVERAGE3) {
//             proportion = SCREEN_16_9;
//         }
// 
//         Log.i("SCREEN CONFIG", "screenHeight:" + screenHeight + ";screenWidth:"
//                 + screenWidth + ";screenDensity:" + screenDensity
//                 + ";densityDpi:" + densityDpi);
// 
//     }
// 
// }


// Path: SunmiDesign/sunmiui/src/main/java/sunmi/sunmiui/list/SunmiList.java
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import java.util.List;
import sunmi.sunmiui.R;
import sunmi.sunmiui.utils.Adaptation;

package sunmi.sunmiui.list;



/**
 * Created by bps .
 */
public class SunmiList extends LinearLayout {

    private ListView mListView;
    private TextView mTvTitle;

    public SunmiList(Context context) {
        super(context);
        initView();
    }

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

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

    private void initView( ) {
        View view = getAdapterView();
        this.addView(view);
        mTvTitle = (TextView) view.findViewById(R.id.tv_title);
        mListView = (ListView) view.findViewById(R.id.list_view);
    }

    /**
     * 适配
     * @return
     */
    private View getAdapterView( ) {
        switch (Adaptation.proportion) {
            case Adaptation.SCREEN_9_16:
                return View.inflate(getContext(), R.layout.list_v1_9_16, null);
            case Adaptation.SCREEN_3_4:
                return View.inflate(getContext(), R.layout.list_v1_9_16, null);
            case Adaptation.SCREEN_4_3: