xuxiuxi
2017-03-31 3a5971c3330fde8044ecb0bd9c277fa263ed251e


git-svn-id: http://192.168.1.226/svn/proxy@306 454eff88-639b-444f-9e54-f578c98de674
6个文件已修改
98 ■■■■■ 已修改文件
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/dialog/CountrySelectionDialog.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/dialog/SingleSelectionDialog.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/dialog/VisitReasonDialog.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/res/layout/dialog_country.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/res/layout/dialog_single_selection.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/res/layout/dialog_visit_reason.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/dialog/CountrySelectionDialog.java
@@ -16,6 +16,9 @@
import cn.com.basic.face.util.OkButtonClickedListener;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnItemSelected;
import com.wx.wheelview.widget.WheelView;
import java.util.ArrayList;
@@ -24,51 +27,60 @@
public class CountrySelectionDialog extends PopupWindow implements View.OnClickListener, WheelView.OnWheelItemSelectedListener {
    @ViewInject(R.id.dialog_country_ok)
    private TextView dialog_country_ok;
    @ViewInject(R.id.dialog_country_cancel)
    private TextView dialog_country_cancel;
    @ViewInject(R.id.dialog_country_name_first_letter)
    private WheelView dialog_country_name_first_letter;
    @ViewInject(R.id.dialog_country_name)
    private WheelView dialog_country_name;
    private Context mContext;
    private View view;
    private TextView mTvConfirm, mTvCancel;
    private WheelView mWheelViewTitle, mWheelViewName;
    private HashMap<String, List<String>> countryData;
    private List<String> countryWordList;
    private List<String> countryList;
    public CountrySelectionDialog(Context context, String[] countryWordData, List<String> countryWordList, HashMap<String, List<String>> countryData) {
    @OnItemSelected(R.id.dialog_country_name)
    public void dialog_country_name_click(View view) {
        System.out.println("");
    }
    public CountrySelectionDialog(Context context, String[] countryWordData, List<String> countryWordList, HashMap<String, List<String>> countryData) {
        this.mContext = context;
        view = LayoutInflater.from(context).inflate(R.layout.dialog_country, null);
        mWheelViewTitle = (WheelView) view.findViewById(R.id.pop_country_title);
        mWheelViewTitle.setOnWheelItemSelectedListener(this);
        mWheelViewName = (WheelView) view.findViewById(R.id.pop_country_name);
        mWheelViewName.setOnWheelItemSelectedListener(this);
        mTvCancel = (TextView) view.findViewById(R.id.pop_country_cancel);
        mTvConfirm = (TextView) view.findViewById(R.id.pop_country_confirm);
        mTvCancel.setOnClickListener(this);
        mTvConfirm.setOnClickListener(this);
        ViewUtils.inject(this, view);
        dialog_country_cancel = (TextView) view.findViewById(R.id.dialog_country_cancel);
        dialog_country_ok = (TextView) view.findViewById(R.id.dialog_country_ok);
        dialog_country_cancel.setOnClickListener(this);
        dialog_country_ok.setOnClickListener(this);
        this.countryWordList = countryWordList;
        this.countryData = countryData;
        countryList = countryData.get(countryWordList.get(mWheelViewTitle.getSelection()));
        mWheelViewTitle.setWheelAdapter(new MyWheelAdapter(context));
        mWheelViewTitle.setSkin(WheelView.Skin.Holo);
        mWheelViewTitle.setWheelSize(5);
        mWheelViewTitle.setBackgroundResource(R.color.colorBackground);
        mWheelViewName.setWheelAdapter(new MyWheelAdapter(context));
        mWheelViewName.setSkin(WheelView.Skin.Holo);
        mWheelViewName.setWheelSize(5);
        mWheelViewName.setBackgroundResource(R.color.colorBackground);
        countryList = countryData.get(countryWordList.get(dialog_country_name_first_letter.getSelection()));
        dialog_country_name_first_letter.setWheelAdapter(new MyWheelAdapter(context));
        dialog_country_name_first_letter.setSkin(WheelView.Skin.Holo);
        dialog_country_name_first_letter.setWheelSize(5);
        dialog_country_name_first_letter.setBackgroundResource(R.color.colorBackground);
        dialog_country_name.setWheelAdapter(new MyWheelAdapter(context));
        dialog_country_name.setSkin(WheelView.Skin.Holo);
        dialog_country_name.setWheelSize(5);
        dialog_country_name.setBackgroundResource(R.color.colorBackground);
        WheelView.WheelViewStyle style = new WheelView.WheelViewStyle();
        style.selectedTextColor = Color.parseColor("#11c3e3");
        style.textColor = Color.parseColor("#bcc6cf");
        style.selectedTextSize = 22;
        style.textSize = 16;
        style.holoBorderColor = Color.parseColor("#11c3e3");
        mWheelViewTitle.setStyle(style);
        mWheelViewName.setStyle(style);
        dialog_country_name_first_letter.setStyle(style);
        dialog_country_name.setStyle(style);
        initData();
        setOutsideTouchable(true);
        view.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                View popLayout = view.findViewById(R.id.pop_single_ll);
                View popLayout = view.findViewById(R.id.dialog_country_linear_layout);
                int top = popLayout.getTop();
                int bottom = popLayout.getBottom();
                int left = popLayout.getLeft();
@@ -102,9 +114,9 @@
        if (view instanceof AppCompatTextView) {
            if (((AppCompatTextView) view).getText().equals("确认")) {
                for (OkButtonClickedListener okButtonClickedListener : okButtonClickedListeners) {
                    if (mWheelViewTitle.getCurrentPosition() >= 0) {
                        countryList = countryData.get(countryWordList.get(mWheelViewTitle.getCurrentPosition()));
                        okButtonClickedListener.onItemSelected(0, null, countryList.get(mWheelViewName.getCurrentPosition()));
                    if (dialog_country_name_first_letter.getCurrentPosition() >= 0) {
                        countryList = countryData.get(countryWordList.get(dialog_country_name_first_letter.getCurrentPosition()));
                        okButtonClickedListener.onItemSelected(0, null, countryList.get(dialog_country_name.getCurrentPosition()));
                    }
                }
                dismiss();
@@ -117,14 +129,14 @@
    @Override
    public void onItemSelected(int position, Object o) {
        countryList = countryData.get(countryWordList.get(mWheelViewTitle.getCurrentPosition()));
        countryList = countryData.get(countryWordList.get(dialog_country_name_first_letter.getCurrentPosition()));
    }
    private void initData() {
        mWheelViewTitle.setWheelData(countryWordList);
        mWheelViewTitle.join(mWheelViewName);
        mWheelViewTitle.joinDatas(countryData);
        mWheelViewName.setWheelData(countryList);
        dialog_country_name_first_letter.setWheelData(countryWordList);
        dialog_country_name_first_letter.join(dialog_country_name);
        dialog_country_name_first_letter.joinDatas(countryData);
        dialog_country_name.setWheelData(countryList);
    }
    private List<OkButtonClickedListener> okButtonClickedListeners = new ArrayList<OkButtonClickedListener>();
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/dialog/SingleSelectionDialog.java
@@ -67,7 +67,7 @@
        view.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
            View popLayout = view.findViewById(R.id.pop_single_ll);
            View popLayout = view.findViewById(R.id.dialog_country_linear_layout);
            int top = popLayout.getTop();
            int bottom = popLayout.getBottom();
            int left = popLayout.getLeft();
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/dialog/VisitReasonDialog.java
@@ -67,7 +67,7 @@
        view.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
            View popLayout = view.findViewById(R.id.pop_single_ll);
            View popLayout = view.findViewById(R.id.dialog_country_linear_layout);
            int top = popLayout.getTop();
            int bottom = popLayout.getBottom();
            int left = popLayout.getLeft();
VisitFace/DemoForBsk/app/src/main/res/layout/dialog_country.xml
@@ -5,7 +5,7 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:id="@+id/pop_single_ll"
        android:id="@+id/dialog_country_linear_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
@@ -27,18 +27,16 @@
            android:paddingRight="@dimen/view_size_10"
            android:orientation="horizontal">
            <com.wx.wheelview.widget.WheelView
                android:id="@+id/pop_country_title"
                android:id="@+id/dialog_country_name_first_letter"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"></com.wx.wheelview.widget.WheelView>
                android:layout_weight="1"/>
            <com.wx.wheelview.widget.WheelView
                android:id="@+id/pop_country_name"
                android:id="@+id/dialog_country_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/view_size_10"
                android:layout_weight="1"></com.wx.wheelview.widget.WheelView>
                android:layout_weight="1"/>
        </LinearLayout>
        <View
            android:layout_width="match_parent"
@@ -49,7 +47,7 @@
            android:layout_height="50dp"
            android:orientation="horizontal">
            <TextView
                android:id="@+id/pop_country_confirm"
                android:id="@+id/dialog_country_ok"
                android:layout_weight="1"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
@@ -61,7 +59,7 @@
                android:layout_height="match_parent"
                android:background="@color/colorText_5"/>
            <TextView
                android:id="@+id/pop_country_cancel"
                android:id="@+id/dialog_country_cancel"
                android:layout_weight="1"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
VisitFace/DemoForBsk/app/src/main/res/layout/dialog_single_selection.xml
@@ -5,7 +5,7 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:id="@+id/pop_single_ll"
        android:id="@+id/dialog_country_linear_layout"
        android:layout_width="350dp"
        android:layout_height="wrap_content"
        android:gravity="center"
VisitFace/DemoForBsk/app/src/main/res/layout/dialog_visit_reason.xml
@@ -5,7 +5,7 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:id="@+id/pop_single_ll"
        android:id="@+id/dialog_country_linear_layout"
        android:layout_width="350dp"
        android:layout_height="wrap_content"
        android:gravity="center"