Android安卓开发源码(动态留言页增删改查)

在这里插入图片描述

完整项目链接:https://download.csdn.net/download/xx080/85387577

MySQLites.java(创建数据库数据表及方法)

package com.example.qq;

import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;

import java.util.ArrayList;
import java.util.List;

class MySQLites extends SQLiteOpenHelper {
    private static final String DB_NAME="stays.db";
    private static final String TABLE_NAME="stay";
    private static final String CREATE_TABLE_SQL_USER="create table stay(id integer primary key autoincrement" +
            ",names text,contents text,del text)";
    public MySQLites(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    public MySQLites(@Nullable Context context) {
        super(context, DB_NAME, null,1);
    }

    @RequiresApi(api = Build.VERSION_CODES.P)
    public MySQLites(@Nullable Context context, @Nullable String name, int version, @NonNull SQLiteDatabase.OpenParams openParams) {
        super(context, name, version, openParams);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL(CREATE_TABLE_SQL_USER);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {
    }


    //查询全部留言
    public List<Userstays> selectallStay(String name){
        SQLiteDatabase db=getReadableDatabase();
        List<Userstays> userstaysList=new ArrayList<>();
        Cursor c=db.query("stay",null,null,null,null,null,null,null);
        if(c!=null){
            while(c.moveToNext()){
                @SuppressLint("Range") String stayName=c.getString(c.getColumnIndex("names"));
                @SuppressLint("Range") String stayContent=c.getString(c.getColumnIndex("contents"));
                Userstays userstays=new Userstays();
                userstays.setNames(stayName);
                userstays.setContents(stayContent);
                userstaysList.add(userstays);
            }
            c.close();
        }
        return userstaysList;
    }
    //添加留言
    public long insertStay(Userstays userstays) {
        SQLiteDatabase db=getReadableDatabase();
        ContentValues contentValues=new ContentValues();
        contentValues.put("names",userstays.getNames());
        contentValues.put("contents",userstays.getContents());
        return db.insert(TABLE_NAME,null,contentValues);
    }

    //留言删除
    public int deleteDataByName(String name){
        SQLiteDatabase db=getWritableDatabase();
        return db.delete(TABLE_NAME,"names like ?",new String[]{name});
    }


    //留言修改
    public long updateStay(Userstays userstays){
        SQLiteDatabase db=getWritableDatabase();
        ContentValues contentValues=new ContentValues();
        contentValues.put("names",userstays.getNames());
        contentValues.put("contents",userstays.getContents());
        return db.update(TABLE_NAME,contentValues,"names like ?",new String[]{userstays.getEditn()});
    }
}

DynamicsActivity.java

package com.example.qq;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.bottomnavigation.BottomNavigationView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;

public class DynamicsActivity extends AppCompatActivity {
    private BottomNavigationView navigationView;
    private ImageView dyimg_zan,dyimg_zan2;
    private boolean display;
    private LinearLayout stayL,dyL;
    private Button inBtn,adminBtn,editBtn;
    private ImageButton dyEdit;
    private MySQLites mySQLites;
    private TextView stayTv,tvv;
    private ListView dyLv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dynamics);


        mySQLites=new MySQLites(this);
        DyFragment dyFragment=new DyFragment();
        FragmentManager supportFragmentManager=getSupportFragmentManager();
        FragmentTransaction fragmentTransaction=supportFragmentManager.beginTransaction();
        fragmentTransaction.replace(R.id.dy_fl,dyFragment);
        fragmentTransaction.commit();
        display=true;
        initView();


        navigationView.setSelectedItemId(R.id.dynamics);
        navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                switch (item.getItemId()) {
                    case R.id.message:
                        startActivity(new Intent(getApplicationContext(),MessageActivity.class));
                        overridePendingTransition(0,0);
                        return true;
                    case R.id.contact:
                        startActivity(new Intent(getApplicationContext(),ContactActivity.class));
                        overridePendingTransition(0,0);
                        return true;
                    case R.id.dynamics:

                        return true;
                }
                return false;
            }
        });

        editBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getApplicationContext(),EditstayActivity.class));
                overridePendingTransition(0,0);
            }
        });


        inBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getApplicationContext(),StayActivity.class));
                overridePendingTransition(0,0);

            }
        });


    }


    private void initView() {
        navigationView=findViewById(R.id.navigation_bottom);
        dyimg_zan=findViewById(R.id.img_zan);
        dyimg_zan2=findViewById(R.id.img_zan2);
        stayL=findViewById(R.id.stay_ll);
        dyL=findViewById(R.id.dy_ll);
        inBtn=findViewById(R.id.in_btn);
        dyLv=findViewById(R.id.dy_lv);
//        stayTv=findViewById(R.id.stay_tv_name);
//        dyDelete=findViewById(R.id.dels);
//        dyEdit=findViewById(R.id.edits);
        editBtn=findViewById(R.id.edit_btn);
    }


    //留言
    String name="1";
    public void stayOnClick(View view) {
        if(display==true){
            dyL.setVisibility(View.GONE);
            stayL.setVisibility(View.VISIBLE);
            display=false;
        }else{
            dyL.setVisibility(View.VISIBLE);
            stayL.setVisibility(View.GONE);
            display=true;
        }

        //listview输出数据库内容
            List<Userstays> userstays=mySQLites.selectallStay(name);
            if(userstays!=null){
                List<HashMap<String, Object>> data = new ArrayList<HashMap<String,Object>>(); //获取键值对
                for(Userstays userspace1:userstays){
                    HashMap<String,Object> item=new HashMap<String,Object>();
                    item.put("names",userspace1.getNames());
                    item.put("contents",userspace1.getContents());
                    data.add(item);
                }
                SimpleAdapter adapter=new SimpleAdapter(this,data,R.layout.item_layout_dy,new String[]{"names","contents"},
                        new int[]{R.id.item_names,R.id.item_contents}); //将获取到的数据库内容进行显示
                dyLv.setAdapter(adapter);
                //listview 通过item实现长按删除
                dyLv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
                    @Override
                    public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
                        //提示对话框
                        AlertDialog.Builder builder=new AlertDialog.Builder(DynamicsActivity.this);
                        builder.setIcon(R.drawable.delete);
                        builder.setTitle("警告:");
                        builder.setMessage("确定删除这条留言吗?");
                        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
                                TextView c = (TextView) view.findViewById(R.id.item_names); //获取所被点击行的名字
                                String name= c.getText().toString(); //对所获取到的名字进行转换
                                int ad= mySQLites.deleteDataByName(name); //调用删除
                                if(ad>0){
                                    ToastUtill.toastshort(DynamicsActivity.this,"删除成功!");
                                    startActivity(new Intent(getApplicationContext(),DynamicsActivity.class));
                                    overridePendingTransition(0,0);
                                }else{
                                    ToastUtill.toastshort(DynamicsActivity.this,"删除失败!");
                                }
                            }
                        });
                        builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
                                ToastUtill.toastshort(DynamicsActivity.this,"已取消");
                            }
                        });
                        builder.show();
//                    Toast.makeText(StayadminActivity.this, playerChanged+"", Toast.LENGTH_LONG).show();
                        return false;
                    }
                });

            }


    }


}

StayActivity.java(添加留言)

package com.example.qq;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;

public class StayActivity extends AppCompatActivity {
    private MySQLites mySQLites;
    private Button publishBtn;
    private EditText stayEtName,stayEtContent;
    private LinearLayout stayL,dyL;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_stay);
        initView();
        mySQLites=new MySQLites(this);
        publishBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String name=stayEtName.getText().toString().trim();
                String content=stayEtContent.getText().toString().trim();
                Userstays userstays=new Userstays();
                userstays.setNames(name);
                userstays.setContents(content);

                long rowId=mySQLites.insertStay(userstays);
                if(rowId!=-1){
                    ToastUtill.toastshort(StayActivity.this,"发表成功");
                    startActivity(new Intent(getApplicationContext(),DynamicsActivity.class));
                }else{
                    ToastUtill.toastshort(StayActivity.this,"哦豁,发表失败了!");

                }
            }
        });
    }

    private void initView() {
        publishBtn=findViewById(R.id.publish_btn);
        stayEtName=findViewById(R.id.stay_ed_name);
        stayEtContent=findViewById(R.id.stay_ed_content);
        stayL=findViewById(R.id.stay_ll);
        dyL=findViewById(R.id.dy_ll);
    }

}

EditstayActivity.java(点击想要修改的留言)

package com.example.qq;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class EditstayActivity extends AppCompatActivity {
    private MySQLites mySQLites;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_editstay);

        mySQLites=new MySQLites(this);
        ListView stayEdit=findViewById(R.id.stay_edit_lv);


        String name="1";
        List<Userstays> userstays=mySQLites.selectallStay(name);
        if(userstays!=null) {
            List<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>();
            for (Userstays userspace1 : userstays) {
                HashMap<String, Object> item = new HashMap<String, Object>();
                item.put("names", userspace1.getNames());
                item.put("contents", userspace1.getContents());
                item.put("del", userspace1.getEditn());
                data.add(item);
            }
            SimpleAdapter adapter = new SimpleAdapter(this, data,
                    R.layout.item_layout_dyadmine, new String[]{"names", "contents"},
                    new int[]{R.id.item_editnames, R.id.item_editcontents});
            stayEdit.setAdapter(adapter);
            stayEdit.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                    TextView tv=(TextView) view.findViewById(R.id.item_editnames);
                    TextView tvs=(TextView) view.findViewById(R.id.item_editcontents);

                    String name=tv.getText().toString();
                    String content=tvs.getText().toString();
                    Intent intents = new Intent(EditstayActivity.this,EditstaysActivity.class);
                    intents.putExtra("name",name.trim() );  //传值
                    intents.putExtra("content",content.trim() );
                    startActivity(intents);


                }
            });
        }
    }


}

EditstaysActivity.java(修改留言页)

package com.example.qq;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class EditstaysActivity extends AppCompatActivity {
    private EditText editName,editContent;
    private Button Btn;
    private MySQLites mySQLites;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_editstays);
        mySQLites=new MySQLites(this);

        initView();
        Intent intent=getIntent();
        editName.setText(intent.getStringExtra("name"));
        editContent.setText(intent.getStringExtra("content"));

        Btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String ename=editName.getText().toString();
                String econtent=editContent.getText().toString();
                Userstays userstays=new Userstays();
                userstays.setEditn(intent.getStringExtra("name")); //传递最初没有修改的姓名
                userstays.setNames(ename);
                userstays.setContents(econtent);
                long ad=mySQLites.updateStay(userstays);
                if(ad>0){
                    ToastUtill.toastshort(EditstaysActivity.this,"修改成功");
                    startActivity(new Intent(getApplicationContext(),DynamicsActivity.class));
                }else{
                    ToastUtill.toastshort(EditstaysActivity.this,"修改失败啦");
                }
            }
        });
    }

    private void initView() {
        editName=findViewById(R.id.edit_name);
        editContent=findViewById(R.id.edit_content);
        Btn=findViewById(R.id.edit_btns);
    }
}

activity_dynamics.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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=".DynamicsActivity">
    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/navigation_bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#F3F3F3"
        app:itemIconTint="@drawable/ic_home"
        app:itemTextColor="@drawable/ic_home"
        app:layout_constraintBottom_toBottomOf="parent"
        app:menu="@menu/navigation"
        />
    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/g1"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.12"
        />
    <LinearLayout
        android:id="@+id/dy_top"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:orientation="horizontal"
        android:padding="8dp"
        app:layout_constraintBottom_toTopOf="@id/g1"
        >
        <ImageView
            android:layout_width="60dp"
            android:layout_height="60dp"

            android:background="@drawable/head"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="张三"
            android:layout_gravity="center"
            android:layout_marginLeft="7dp"
            android:layout_weight="1"
            android:textSize="18sp"
            android:textColor="@color/black"/>
        <ImageView
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_gravity="center"
            android:layout_marginRight="5dp"
            android:background="@drawable/jt_right" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/cens"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintTop_toBottomOf="@id/dy_top"
        app:layout_constraintLeft_toLeftOf="parent"
        >
        <ImageView
            android:id="@+id/img_c"
            android:layout_width="355dp"
            android:layout_height="73dp"
            android:layout_marginBottom="10dp"
            android:background="@drawable/dy_img"
            />
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="1dp"
            android:onClick="stayOnClick"
            android:gravity="center"
            android:orientation="vertical">
            <ImageView
                android:layout_width="30dp"
                android:layout_height="35dp"
                android:layout_marginTop="8dp"
                android:layout_marginLeft="5dp"
                android:background="@drawable/liuyan"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="1dp"
                android:text="留言"
                android:textColor="@color/black"/>
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/dy_ll"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#f5f5f5"
        android:visibility="visible"
        app:layout_constraintBottom_toTopOf="@id/navigation_bottom"
        app:layout_constraintTop_toBottomOf="@id/cens"
        >
        <FrameLayout
            android:id="@+id/dy_fl"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

    </LinearLayout>
    <LinearLayout
        android:id="@+id/stay_ll"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:visibility="invisible"
        android:orientation="vertical"
        app:layout_constraintBottom_toTopOf="@id/navigation_bottom"
        app:layout_constraintTop_toBottomOf="@id/cens">
        <Button
            android:id="@+id/in_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="添加留言"
            android:textColor="@color/black"
            />
        <Button
            android:id="@+id/edit_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="修改留言"
            android:textColor="@color/black"
            />
        <LinearLayout

            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <ListView
                android:id="@+id/dy_lv"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>

        </LinearLayout>
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

activity_editstay.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical"
    tools:context=".EditstayActivity">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="点击想要修改的留言"
        android:gravity="center"
        android:textColor="#F44336"
        android:textSize="18sp"
        android:background="#C2FAFA"
        android:textStyle="bold"
        />
    <ListView
        android:id="@+id/stay_edit_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout>

activity_editstays.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical"
    tools:context=".EditstayActivity">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="留言修改"
        android:gravity="center"
        android:textColor="#F44336"
        android:textSize="18sp"
        android:background="#C2FAFA"
        android:textStyle="bold"
        />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_margin="20dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="姓名:"
            android:textSize="23sp"/>
        <EditText
            android:id="@+id/edit_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:layout_marginLeft="10dp"
            android:padding="3dp"
            android:background="@drawable/ed_style_edit"/>

    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_margin="20dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="内容:"
            android:textSize="23sp" />

        <EditText
            android:id="@+id/edit_content"
            android:layout_width="match_parent"
            android:layout_height="130dp"
            android:textSize="20sp"
            android:layout_marginLeft="10dp"
            android:padding="3dp"
            android:background="@drawable/ed_style_edit"/>

    </LinearLayout>
    <Button
        android:id="@+id/edit_btns"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="提交修改"
        android:textSize="18sp"
        android:layout_gravity="center"/>

</LinearLayout>

item_layout_dy.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="match_parent"
    android:orientation="horizontal"
    android:gravity="center"
    android:padding="10dp"
    android:layout_marginTop="5dp">
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">
        <TextView
            android:id="@+id/item_names"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="16sp"
            android:textColor="@color/black"
            android:textIsSelectable="false"
            android:textStyle="bold"
            />
        <TextView
            android:id="@+id/item_contents"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:layout_marginTop="10dp"
            android:gravity="center"
            android:textColor="@color/black"
            android:layout_marginLeft="20dp"
            android:textIsSelectable="false"
            />
    </LinearLayout>
<!--    <LinearLayout-->
<!--        android:layout_width="wrap_content"-->
<!--        android:layout_height="wrap_content"-->
<!--        android:orientation="vertical">-->
<!--        <ImageButton-->
<!--            android:id="@+id/edits"-->
<!--            android:layout_width="25dp"-->
<!--            android:layout_height="25dp"-->
<!--            android:background="@drawable/edit"-->
<!--            />-->
<!--        <ImageButton-->
<!--            android:id="@+id/dels"-->
<!--            android:layout_marginTop="3dp"-->
<!--            android:layout_width="25dp"-->
<!--            android:layout_height="25dp"-->
<!--            android:background="@drawable/delete"-->
<!--            />-->

<!--    </LinearLayout>-->



</LinearLayout>

item_layout_dyadmine.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="match_parent"
    android:orientation="horizontal"
    android:gravity="center"
    android:padding="10dp"
    android:layout_marginTop="5dp">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">
        <TextView
            android:id="@+id/item_editnames"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="16sp"
            android:textColor="@color/black"
            android:textIsSelectable="false"
            android:textStyle="bold"
            />
        <TextView
            android:id="@+id/item_editcontents"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:textColor="@color/black"
            android:layout_marginLeft="20dp"
            android:textIsSelectable="false"
            />
    </LinearLayout>




</LinearLayout>
  • 4
    点赞
  • 60
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

xx080

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

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

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

打赏作者

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

抵扣说明:

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

余额充值