Android使用mysql实现修改用户信息 简易新闻(十一)

Android使用mysql实现修改用户信息(暂不包括头像修改) 简易新闻(十一)

关于

本篇属于简易新闻第十一篇,所以内容上具有连贯性,但是核心的用户修改以及布局点击事件是和之前没有关系的,依然可做参考。
本篇使用了第三方MateriaDialog
添加引用如下:

//第三方弹出框
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

效果图

在这里插入图片描述

第一步,修改activity_user_data.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
    //在color.xml文件夹下添加的颜色 颜色代码 #eeeeee
    android:background="@color/colorbackground"
    tools:context=".UserMode.User_DataActivity">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <android.support.v7.widget.Toolbar
            android:id="@+id/userData_toolbar"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            //白色代码#fff
            app:titleTextColor="@color/white"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            //背景色 #3A91FB
            android:background="@color/title"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
        <LinearLayout
            android:id="@+id/lay_touxiang"
            android:orientation="horizontal"
            android:background="@color/white"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:layout_width="300dp"
                android:layout_height="match_parent"
                android:background="#01000000"
                android:gravity="center_vertical"
                android:text="头像"
                android:textStyle="bold" />
            <ImageView
                android:id="@+id/imageView_user"
                android:layout_width="55dp"
                android:background="#01000000"
                android:layout_height="55dp"
                />
        </LinearLayout>
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/black"
            />
        <LinearLayout
            android:id="@+id/layout_name"
            android:orientation="horizontal"
            android:background="@color/white"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="0dp"
                android:layout_height="55dp"
                android:layout_weight="1"
                android:layout_gravity="center_horizontal"
                android:background="#01000000"
                android:gravity="center_vertical"
                android:text="用户名"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/tv_nc_fb"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="match_parent"
                android:background="#01000000"
                android:gravity="center_vertical|center|right" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginRight="20dp"
                //这个图片来源你可以自己百度上copy一个下来
                android:src="@drawable/pdf_next"
                tools:ignore="RtlHardcoded" />

        </LinearLayout>
        //View作为中间间隔线
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/black"
            />
        <LinearLayout
            android:id="@+id/layout_sex"
            android:orientation="horizontal"
            android:background="@color/white"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="55dp"
                android:layout_weight="1"
                android:background="#01000000"
                android:gravity="center_vertical"
                android:text="性别"
                android:textStyle="bold" />
            <TextView
                android:id="@+id/text_Sex"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="3"
                android:background="#01000000"
                android:gravity="center_vertical|center|right"
                />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginRight="20dp"
                android:src="@drawable/pdf_next"
                tools:ignore="RtlHardcoded" />
        </LinearLayout>
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/black"
            />
        <LinearLayout
            android:id="@+id/layout_Age"
            android:orientation=</
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

雪の星空朝酱

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值