datepicker&votetips-xml20181126

/******************MyLinearLayout.java/


public class MyLinearLayout extends LinearLayout {

    TextView ordinal,delete;

    View view;
    public MyLinearLayout(Context context, final int num) {
        super(context);
        LayoutInflater.from(context).inflate(R.layout.club_vote_item,this);

        ordinal=findViewById(R.id.vote_ordinal);
        String str=""+num;
        ordinal.setText(str);
        delete=findViewById(R.id.delete);
        delete.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getContext(),"click"+num+"",Toast.LENGTH_SHORT).show();
             //   removeView(view);
            }
        });
    }


}

/*******************MyLinearLayout.java/

/******************vote_activity.xml/

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    tools:layout_editor_absoluteY="81dp">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:focusable="true"
        android:focusableInTouchMode="true">

        <EditText
            android:id="@+id/postTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:background="@color/colorTitle"
            android:hint="输入帖子标题"
            android:padding="8dp"
            android:textSize="22dp" />

        <EditText
            android:id="@+id/postText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/postTitle"
            android:layout_weight="1"
            android:background="@color/colorWhite"
            android:gravity="left"
            android:hint="输入正文内容……"
            android:minLines="8"
            android:padding="8dp"
            android:textSize="22dp" />

        <TextView
            android:id="@+id/line1"
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:layout_below="@id/postText"
            android:background="@color/colorTitle" />

        <RadioGroup
            android:id="@+id/vote_type_group"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/line1"
            android:orientation="horizontal">

            <RadioButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="单选投票" />

            <RadioButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="多选投票" />
        </RadioGroup>

        <TextView
            android:id="@+id/line2"
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:layout_below="@id/vote_type_group"
            android:background="@color/colorTitle" />

        <RelativeLayout
            android:id="@+id/datebar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/line2">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_margin="10dp"
                android:text="投票截止日期" />

            <TextView
                android:id="@+id/datetext"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_margin="10dp"
                android:hint="xxxx-xx-xx" />

            <ImageView
                android:id="@+id/datepick"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_alignParentTop="true"
                android:layout_alignParentRight="true"
                android:layout_marginTop="0dp"
                android:src="@mipmap/ic_launcher" />
        </RelativeLayout>

        <ScrollView
            android:layout_marginBottom="65dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/datebar">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">
                <LinearLayout
                    android:id="@+id/vote_item"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">
                    <RelativeLayout
                        android:id="@+id/vote_t"
                        xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:layout_margin="12dp">

                        <TextView
                            android:id="@+id/vote_ordinal"
                            android:layout_width="50dp"
                            android:layout_height="match_parent"
                            android:layout_alignParentStart="true"
                            android:background="@color/colorVotetips"
                            android:gravity="center"
                            android:text="1" />

                        <EditText
                            android:id="@+id/vote_tipedit"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_toRightOf="@id/vote_ordinal"
                            android:background="@color/colorVote" />

                        <TextView
                            android:id="@+id/delete"
                            android:layout_width="50dp"
                            android:layout_height="50dp"
                            android:layout_alignParentRight="true"
                            android:background="@color/colorTitle"
                            android:gravity="center"
                            android:text="X" />
                    </RelativeLayout>
                </LinearLayout>

                <TextView
                    android:id="@+id/addvote"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:layout_margin="5dp"
                    android:gravity="center"
                    android:padding="5dp"
                    android:text="+添加投票选项" />
            </LinearLayout>
        </ScrollView>

        <RelativeLayout
            android:visibility="gone"
            android:id="@+id/footbar"
            android:layout_width="match_parent"
            android:layout_height="65dp"
            android:layout_alignParentBottom="true"
            android:background="@color/colorTitle"></RelativeLayout>
    </RelativeLayout>

</android.support.constraint.ConstraintLayout>

/*****************vote_activity.xml/

/**************vote_item.xml/

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_margin="12dp">

    <TextView
        android:id="@+id/vote_ordinal"
        android:layout_width="50dp"
        android:layout_height="match_parent"
        android:layout_alignParentStart="true"
        android:background="@color/colorVotetips"
        android:gravity="center"
        android:text="1" />

    <EditText
        android:id="@+id/vote_tipedit"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_toRightOf="@id/vote_ordinal"
        android:background="@color/colorVote" />

    <TextView
        android:id="@+id/delete"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentRight="true"
        android:background="@color/colorTitle"
        android:gravity="center"
        android:text="X" />
</RelativeLayout>

/****************vote_item.xml/

/***************custom_date_picker.xml/

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorWhite"
        android:paddingLeft="10dp"
        android:paddingTop="5dp"
        android:paddingRight="10dp"
        android:paddingBottom="5dp">

        <TextView
            android:id="@+id/tv_cancle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:padding="10dp"
            android:text="取消"
            android:textColor="@color/color_bg"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="@string/title"
            android:textColor="@color/color_bg"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/tv_select"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:padding="10dp"
            android:text="@string/commit"
            android:textColor="@color/color_bg"
            android:textSize="16sp" />

    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/color_bg">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:background="@color/colorWhite"
            android:orientation="horizontal"
            android:paddingLeft="20dp"
            android:paddingTop="15dp"
            android:paddingRight="20dp"
            android:paddingBottom="15dp">

            <com.example.hasee.myapplication.datepicker.DatePickerView
                android:id="@+id/year_pv"
                android:layout_width="0dp"
                android:layout_height="160dp"
                android:layout_weight="3" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center"
                android:text="@string/year"
                android:textColor="@color/color_bg"
                android:textSize="18sp" />

            <com.example.hasee.myapplication.datepicker.DatePickerView
                android:id="@+id/month_pv"
                android:layout_width="0dp"
                android:layout_height="160dp"
                android:layout_weight="2" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center"
                android:text="@string/month"
                android:textColor="@color/color_bg"
                android:textSize="18sp" />

            <com.example.hasee.myapplication.datepicker.DatePickerView
                android:id="@+id/day_pv"
                android:layout_width="0dp"
                android:layout_height="160dp"
                android:layout_weight="2" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center"
                android:text="@string/day"
                android:textColor="@color/color_bg"
                android:textSize="18sp" />

            <com.example.hasee.myapplication.datepicker.DatePickerView
                android:id="@+id/hour_pv"
                android:layout_width="0dp"
                android:layout_height="160dp"
                android:layout_weight="2" />

            <TextView
                android:id="@+id/hour_text"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center"
                android:text="@string/hour"
                android:textColor="@color/color_bg"
                android:textSize="18sp" />

            <com.example.hasee.myapplication.datepicker.DatePickerView
                android:id="@+id/minute_pv"
                android:layout_width="0dp"
                android:layout_height="160dp"
                android:layout_weight="2" />

            <TextView
                android:id="@+id/minute_text"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center"
                android:text="@string/minute"
                android:textColor="@color/color_bg"
                android:textSize="18sp" />

        </LinearLayout>

    </RelativeLayout>

</LinearLayout>

/***************custom_date_picker.xml/

/***************strings.xml/

<resources>
    <string name="app_name">My Application</string>
    <string name="cancle">取消</string>
    <string name="title">请选择时间</string>
    <string name="commit">确定</string>
    <string name="year">年</string>
    <string name="month">月</string>
    <string name="day">日</string>
    <string name="hour">时</string>
    <string name="minute">分</string>

    <string name="select_date">选择日期</string>
    <string name="current_date">当前日期</string>
    <string name="select_time">选择时间</string>
    <string name="current_time">当前时间</string>
</resources>

/**************strings.xml/

/**************style.xml/

 <style name="TimePickerDialog" parent="android:style/Theme.Dialog">
        <item name="android:windowFrame">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <!--<item name="android:windowBackground">@color/color_bg</item>-->
    </style>

/**************style.xml/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值