利用课余时间随便写的一个小东西,都是一起学习。

先上图:

安卓修改java版本 安卓系统java_smartqq安卓java源码

安卓修改java版本 安卓系统java_ide_02

安卓修改java版本 安卓系统java_ide_03

安卓修改java版本 安卓系统java_Text_04

package com.example.nanchen.listviewdemo.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.example.nanchen.listviewdemo.adapter_content.Msg;
import com.example.nanchen.listviewdemo.R;
import java.util.List;
/**
* Created by nanchen on 2016/3/28.
*
*/
public class MsgAdapter extends ArrayAdapter {
private int resourceId;
public MsgAdapter(Context context, int resource, List objects) {
super(context, resource, objects);
resourceId = resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Msg msg = getItem(position);
viewHolder viewHolder;
if(convertView == null){
convertView = LayoutInflater.from(getContext()).inflate(resourceId,null);
viewHolder = new viewHolder();
viewHolder.leftLayout = (LinearLayout) convertView.findViewById(R.id.left_layout);
viewHolder.rightLayout = (LinearLayout) convertView.findViewById(R.id.right_layout);
viewHolder.leftMsg = (TextView) convertView.findViewById(R.id.left_msg);
viewHolder.rightMsg = (TextView) convertView.findViewById(R.id.right_msg);
convertView.setTag(viewHolder);
}else{
viewHolder = (MsgAdapter.viewHolder) convertView.getTag();
}
if (msg.getType() == Msg.TYPE_RECEIVED){//若是收到的消息,则隐藏右布局,显示左布局
viewHolder.leftLayout.setVisibility(View.VISIBLE);
viewHolder.rightLayout.setVisibility(View.GONE);
viewHolder.leftMsg.setText(msg.getContent());
}else if(msg.getType() == Msg.TYPE_SENT){
viewHolder.leftLayout.setVisibility(View.GONE);
viewHolder.rightLayout.setVisibility(View.VISIBLE);
viewHolder.rightMsg.setText(msg.getContent());
}
return convertView;
}
class viewHolder{
LinearLayout leftLayout;
LinearLayout rightLayout;
TextView leftMsg;
TextView rightMsg;
}
}
packagecom.example.nanchen.listviewdemo.adapter;importandroid.content.Context;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;importandroid.widget.ArrayAdapter;importandroid.widget.ImageView;importandroid.widget.TextView;importcom.example.nanchen.listviewdemo.adapter_content.Person;importcom.example.nanchen.listviewdemo.R;importjava.util.List;/***
* Created by nanchen on 2016/3/22.*/
public class PersonAdapter extends ArrayAdapter{private intresourceId;public PersonAdapter(Context context, int textViewResourceId, Listobjects) {super(context, textViewResourceId, objects);
resourceId=textViewResourceId;
}
@Overridepublic View getView(intposition, View convertView, ViewGroup parent) {
Person person=getItem(position);
ViewHolder viewHolder;if(convertView == null){
convertView= LayoutInflater.from(getContext()).inflate(resourceId ,null);
viewHolder= newViewHolder();
viewHolder.imageView_person=(ImageView) convertView.findViewById(R.id.imageView_person);
viewHolder.textView_name=(TextView) convertView.findViewById(R.id.textView_name);
convertView.setTag(viewHolder);
}else{//view = convertView;
viewHolder =(ViewHolder) convertView.getTag();
}
viewHolder.imageView_person.setImageResource(person.getImageId());
viewHolder.textView_name.setText(person.getName());returnconvertView;
}classViewHolder{
ImageView imageView_person;
TextView textView_name;
}
}
packagecom.example.nanchen.listviewdemo.adapter_content;/*** Created by nanchen on 2016/3/28.
* 存储消息类型和内容的类*/
public classMsg {public static final int TYPE_RECEIVED = 0;public static final int TYPE_SENT = 1;privateString content;private inttype;public Msg(String content, inttype) {this.content =content;this.type =type;
}publicString getContent() {returncontent;
}public intgetType() {returntype;
}
}
packagecom.example.nanchen.listviewdemo.adapter_content;/*** Created by nanchen on 2016/3/22.*/
public classPerson {privateString name;private intimageId;public Person(String name, intimageId) {this.name =name;this.imageId =imageId;
}publicString getName() {returnname;
}public voidsetName(String name) {this.name =name;
}public intgetImageId() {returnimageId;
}public void setImageId(intimageId) {this.imageId =imageId;
}
}
1 packagecom.example.nanchen.listviewdemo.data;2
3 importandroid.os.Parcel;4 importandroid.os.Parcelable;5
6 /**
7 *8 * Created by nanchen on 2016/3/22.9 */
10 public class User implementsParcelable {11
12 privateString userName;13 privateString pwd;14
15 publicString getPwd() {16 returnpwd;17 }18
19 public voidsetPwd(String pwd) {20 this.pwd =pwd;21 }22
23 publicString getUserName() {24 returnuserName;25 }26
27 public voidsetUserName(String userName) {28 this.userName =userName;29 }30
31 @Override32 public intdescribeContents() {33 return 0;34 }35
36 @Override37 public void writeToParcel(Parcel dest, intflags) {38 dest.writeString(userName);39 dest.writeString(pwd);40 }41
42 //对象的创建器
43 public static final Parcelable.Creator CREATOR = new Parcelable.Creator(){44
45
46 @Override47 publicUser createFromParcel(Parcel source) {48 User user = newUser();49 user.userName =source.readString();50 user.pwd =source.readString();51 returnuser;52 }53
54 @Override55 public User[] newArray(intsize) {56 return new User[0];57 }58 };59 }
1 packagecom.example.nanchen.listviewdemo;2
3 importandroid.app.Activity;4
5 importjava.util.ArrayList;6 importjava.util.List;7
8 /**
9 * Created by nanchen on 2016/3/28.10 * 退出程序的最佳方案,写一个活动收集器11 */
12 public classActivityCollector {13 public static List activities = new ArrayList<>();14
15 public static voidaddActivity(Activity activity){16 activities.add(activity);17 }18
19 public static voidremoveActivity(Activity activity){20 activities.remove(activity);21 }22
23 public static voidfinishAll(){24 for(Activity activity:activities){25 if (!activity.isFinishing()){26 activity.finish();27 }28 }29 }30 }
1 packagecom.example.nanchen.listviewdemo;2
3 importandroid.app.Activity;4 importandroid.os.Bundle;5 importandroid.util.Log;6
7 /**
8 * Created by nanchen on 2016/3/28.9 * 用于知晓当前是在哪一个活动10 * 活动的最佳写法11 */
12 public class BaseActivity extendsActivity {13 @Override14 protected voidonCreate(Bundle savedInstanceState) {15 super.onCreate(savedInstanceState);16 Log.d("BaseActivity", getClass().getSimpleName());17 ActivityCollector.addActivity(this);18 }19
20 @Override21 protected voidonDestroy() {22 super.onDestroy();23 ActivityCollector.removeActivity(this);24 }25 }
packagecom.example.nanchen.listviewdemo;importandroid.content.DialogInterface;importandroid.content.Intent;importandroid.os.Bundle;importandroid.support.v7.app.AlertDialog;importandroid.view.View;importandroid.widget.Button;importandroid.widget.EditText;importandroid.widget.ListView;importandroid.widget.TextView;importandroid.widget.Toast;importcom.example.nanchen.listviewdemo.adapter.MsgAdapter;importcom.example.nanchen.listviewdemo.adapter_content.Msg;importjava.util.ArrayList;importjava.util.List;public class ChatActivity extendsBaseActivity {privateListView listView_msg;privateEditText editText_input;privateButton button_send,button_back,button_add;privateMsgAdapter msgAdapter;private List msgList = new ArrayList<>();privateTextView textView_person_name;
@Overrideprotected voidonCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
initMsg();
msgAdapter= new MsgAdapter(this,R.layout.msg_item,msgList);
listView_msg=(ListView) findViewById(R.id.listView_msg);
listView_msg.setAdapter(msgAdapter);
editText_input=(EditText) findViewById(R.id.editText_send);
editText_input.clearFocus();
button_send=(Button) findViewById(R.id.button_send);
button_send.setOnClickListener(newView.OnClickListener() {
@Overridepublic voidonClick(View v) {
String content=editText_input.getText().toString();if(content.isEmpty()){//用户输入消息为空,则弹出一个警告框
final AlertDialog.Builder builder = new AlertDialog.Builder(ChatActivity.this);
builder.setTitle("警告");
builder.setMessage("输入的消息不能为空!");
builder.setPositiveButton("确定", newDialogInterface.OnClickListener() {
@Overridepublic void onClick(DialogInterface dialog, intwhich) {
dialog.dismiss();
}
});
builder.show();
}else{
Msg msg= newMsg(content,Msg.TYPE_SENT);
msgList.add(msg);
msgAdapter.notifyDataSetChanged();//当有新消息时,刷新ListView中的显示
listView_msg.setSelection(msgList.size());//将ListView定位到最后一行
editText_input.setText("");//清空输入框中的内容
}
}
});
button_back=(Button) findViewById(R.id.button_back);
button_back.setOnClickListener(newView.OnClickListener() {
@Overridepublic voidonClick(View v) {
finish();
}
});
button_add=(Button) findViewById(R.id.button_add);
button_add.setOnClickListener(newView.OnClickListener() {
@Overridepublic voidonClick(View v) {
Toast.makeText(ChatActivity.this,"你点击了添加按钮!!!",Toast.LENGTH_SHORT).show();
}
});
textView_person_name=(TextView) findViewById(R.id.textView_person_name);
Intent intent=getIntent();
String person_name= intent.getStringExtra("PERSON_NAME");
textView_person_name.setText(person_name);
}private voidinitMsg() {
Msg msg= new Msg("Hello!",Msg.TYPE_SENT);
msgList.add(msg);
Msg msg1= new Msg("Hello!How are you?",Msg.TYPE_RECEIVED);
msgList.add(msg1);
Msg msg2= new Msg("I am fine,and you?",Msg.TYPE_SENT);
msgList.add(msg2);
Msg msg3= new Msg("I am ok!",Msg.TYPE_RECEIVED);
msgList.add(msg3);
}
}
package com.example.nanchen.listviewdemo;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;
import com.example.nanchen.listviewdemo.data.User;
public class LoginActivity extends BaseActivity {
private EditText editText_userName,editText_pwd;
private CheckBox checkBox_pwd,checkBox_autoLogin;
private SharedPreferences sp;
private ImageButton imageButton_exit;
private Button button_login;
private String userName,pwd;
private Button button_regist;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
//获得实例对象
sp = this.getSharedPreferences("userInfo", Context.MODE_PRIVATE);
editText_userName = (EditText) findViewById(R.id.editText_userName);
editText_pwd = (EditText) findViewById(R.id.editText_pwd);
imageButton_exit = (ImageButton) findViewById(R.id.ib_exit);
button_login = (Button) findViewById(R.id.button_login);
checkBox_autoLogin = (CheckBox) findViewById(R.id.checkBox_autoLogin);
checkBox_pwd = (CheckBox) findViewById(R.id.checkBox_pwd);
button_regist = (Button) findViewById(R.id.button_regist1);
//判断记住密码框状态
if(sp.getBoolean("ISCHECK",false)){//false是默认值
//设置默认是选择状态
checkBox_pwd.setChecked(true);
userName = sp.getString("USER_NAME","");
pwd = sp.getString("PWD","");
editText_userName.setText(userName);
editText_pwd.setText(pwd);
//判断自动登录复选框状态
if(sp.getBoolean("AUTO_ISCHECK",false)){
//设置自动登录框状态
checkBox_autoLogin.setChecked(true);
Intent intent = new Intent(LoginActivity.this,MainActivity.class);
startActivity(intent);
}
}
button_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
userName = editText_userName.getText().toString();
pwd = editText_pwd.getText().toString();
if(TextUtils.isEmpty(userName) || TextUtils.isEmpty(pwd)){//如果用户名或者密码为空
Toast.makeText(LoginActivity.this, "用户名或密码不能为空!", Toast.LENGTH_SHORT).show();
}else {
if(userName.equals("liushilin") && pwd.equals("luochunyan")){
Toast.makeText(LoginActivity.this,"登录成功!正在获取用户信息...",Toast.LENGTH_SHORT).show();
//如果用户选择记住密码,则把用户信息存在xml文件中
if(checkBox_pwd.isChecked()){
SharedPreferences.Editor editor = sp.edit();
editor.putString("USER_NAME",userName);
editor.putString("PWD",pwd);
editor.commit();
}
//主界面的跳转
Intent intent = new Intent(LoginActivity.this,MainActivity.class);
// intent.putExtra("USER_NAME",userName);
// intent.putExtra("PWD",pwd);
User user = new User();
user.setUserName(userName);
user.setPwd(pwd);
intent.putExtra("USER",user);
startActivity(intent);
}else{
Toast.makeText(LoginActivity.this,"用户名或密码不正确,请重新输入!",Toast.LENGTH_SHORT).show();
}
}
}
});
//监听记住密码复选框的按钮事件
checkBox_pwd.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharedPreferences.Editor editor = sp.edit();
if(checkBox_pwd.isChecked()){
editor.putBoolean("ISCHECK", true).commit();
}else{
editor.putBoolean("ISCHECK",false).commit();
}
}
});
//监听自动登录按钮事件
checkBox_autoLogin.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(checkBox_autoLogin.isChecked()){
sp.edit().putBoolean("AUTO_ISCHECK",true).commit();
}else {
sp.edit().putBoolean("AUTO_ISCHECK",false).commit();
}
}
});
//监听退出按钮事件
imageButton_exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// finish();
ActivityCollector.finishAll();//退出当前应用程序
}
});
button_regist.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(LoginActivity.this,RegistActivity.class));
}
});
}
}
package com.example.nanchen.listviewdemo;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListView;
import com.example.nanchen.listviewdemo.adapter.PersonAdapter;
import com.example.nanchen.listviewdemo.adapter_content.Person;
import java.util.ArrayList;
import java.util.List;
/**
* 使用线程机制模拟下拉加载数据的ListView控件使用
*/
public class MainActivity extends BaseActivity implements AbsListView.OnScrollListener{
private static final int DATA_UPDATE = 0x1;
private ListView listView;
private List personList = new ArrayList<>();
private PersonAdapter personAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.listView);
listView.setOnScrollListener(this);
View footerView = getLayoutInflater().inflate(R.layout.loading_layout,null);
listView.addFooterView(footerView);
initData();
personAdapter = new PersonAdapter(this,R.layout.list_item,personList);
listView.setAdapter(personAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
// Toast.makeText(MainActivity.this,"你选择了"+personList.get(position).getName(),Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this,ChatActivity.class);
intent.putExtra("PERSON_NAME",personList.get(position).getName());
startActivity(intent);
}
});
}
/**
* 初始化数据
*/
private void initData(){
Person person1 = new Person("刘世麟",R.mipmap.a_1);
personList.add(person1);
Person person2 = new Person("罗春燕",R.mipmap.a_2);
personList.add(person2);
Person person3 = new Person("王足英",R.mipmap.a_3);
personList.add(person3);
Person person4 = new Person("蔡何",R.mipmap.a_4);
personList.add(person4);
Person person5 = new Person("李兴",R.mipmap.a_5);
personList.add(person5);
Person person6 = new Person("李强",R.mipmap.a_6);
personList.add(person6);
Person person7 = new Person("李添顺",R.mipmap.a_7);
personList.add(person7);
Person person8 = new Person("晏贵秀",R.mipmap.a_8);
personList.add(person8);
Person person9 = new Person("周芳",R.mipmap.a_9);
personList.add(person9);
Person person10 = new Person("韩思明",R.mipmap.a_10);
personList.add(person10);
Person person11 = new Person("晏蜀杰",R.mipmap.a_11);
personList.add(person11);
Person person12 = new Person("马巍乃",R.mipmap.a_12);
personList.add(person12);
}
private int visibleLastIndex;//用来可显示的最后一条数据的索引
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if(personAdapter.getCount() == visibleLastIndex && scrollState == SCROLL_STATE_IDLE){
new LoadDataThread().start();
}
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
visibleLastIndex = firstVisibleItem + visibleItemCount - 1;//减去最后一个加载中那条
}
/**
* 线程间通信的机制
*/
private Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what){
case DATA_UPDATE:
personAdapter.notifyDataSetChanged();
break;
}
}
};
/**
* 模拟加载数据的线程
*/
class LoadDataThread extends Thread{
@Override
public void run() {
initData();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
handler.sendEmptyMessage(DATA_UPDATE);//通过handler发送一个更新数据的标记
}
}
}
package com.example.nanchen.listviewdemo;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.Button;
public class RegistActivity extends BaseActivity {
private Button button_regist;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_regist);
button_regist = (Button) findViewById(R.id.button_regist);
button_regist.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(RegistActivity.this);
builder.setTitle("注册");
builder.setMessage("确认注册吗?");
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(RegistActivity.this, LoginActivity.class));
}
});
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(RegistActivity.this, LoginActivity.class));
}
});
builder.show();
}
});
}
}
package com.example.nanchen.listviewdemo;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashActivity extends BaseActivity {
// private static final int STATR_ACTIVITY = 0x1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
// requestWindowFeature(Window.FEATURE_NO_TITLE);
// handler.sendEmptyMessageDelayed(STATR_ACTIVITY,2000);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(SplashActivity.this,LoginActivity.class));
}
},3000);
}
// private Handler handler = new Handler(){
// @Override
// public void handleMessage(Message msg) {
// super.handleMessage(msg);
// switch(msg.what){
// case STATR_ACTIVITY:
// startActivity(new Intent(SplashActivity.this,LoginActivity.class));
// break;
// }
// }
// };
}
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.nanchen.listviewdemo.ChatActivity">
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="1">
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Back"
android:textAllCaps="false"
android:id="@+id/button_back"/>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/textView_person_name"
android:layout_weight="4"
android:gravity="center"
/>
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="+"
android:textSize="18dp"
android:id="@+id/button_add"/>
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="7"
android:id="@+id/listView_msg">
android:layout_weight="1"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="0dp">
android:layout_width="0dp"
android:layout_weight="3"
android:id="@+id/editText_send"
android:hint="请输入你想输入的话.."
android:layout_height="wrap_content"/>
android:layout_width="0dp"
android:layout_weight="1"
android:text="发送"
android:textSize="20dp"
android:id="@+id/button_send"
android:layout_height="wrap_content"/>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@mipmap/logo_bg"
tools:context=".LoginActivity"
android:weightSum="1">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.53"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ib_exit"
android:layout_alignParentRight="true"
android:src="@mipmap/quit"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用 户 名:"
android:textSize="18dp"
android:paddingTop="18dp"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText_userName"
android:hint="请输入用户名..."
android:layout_below="@+id/textView"
android:layout_alignParentStart="true"
android:layout_alignEnd="@+id/ib_exit"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="密 码:"
android:textSize="18dp"
android:id="@+id/textView2"
android:layout_below="@+id/editText_userName"
android:layout_alignParentStart="true"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="请输入密码..."
android:ems="10"
android:id="@+id/editText_pwd"
android:layout_below="@+id/textView2"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="记住密码"
android:id="@+id/checkBox_pwd"
android:checked="false"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:layout_marginStart="27dp"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="自动登录"
android:id="@+id/checkBox_autoLogin"
android:checked="false"
android:layout_below="@+id/checkBox_pwd"
android:layout_alignStart="@+id/checkBox_pwd"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录"
android:id="@+id/button_login"
android:layout_alignBottom="@+id/checkBox_autoLogin"
android:layout_toEndOf="@+id/checkBox_pwd"
android:layout_marginStart="64dp"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注册"
android:id="@+id/button_regist1"
android:textAllCaps="false"
android:layout_alignTop="@+id/button_login"
android:layout_toEndOf="@+id/button_login"/>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/login_bg"
tools:context="com.example.nanchen.listviewdemo.MainActivity">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView"
android:dividerHeight="3.1dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
/>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@mipmap/login_bg"
tools:context="com.example.nanchen.listviewdemo.RegistActivity">
android:orientation="horizontal"
android:paddingTop="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="113dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:text="用户名:"
android:id="@+id/textView"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText_name"
android:layout_weight="1"/>
android:orientation="horizontal"
android:paddingTop="100dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="113dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:id="@+id/linearLayout">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:text="密 码:"
android:id="@+id/textView3"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_weight="1"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="完成注册"
android:id="@+id/button_regist"
android:layout_marginTop="42dp"
android:layout_below="@+id/linearLayout"
android:layout_centerHorizontal="true"/>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/app_start3"
tools:context="com.example.nanchen.listviewdemo.SplashActivity">
android:layout_width="match_parent"
android:padding="6dp"
android:layout_height="match_parent">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView_person"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/textView_name"/>
android:layout_width="match_parent"
android:layout_height="match_parent">
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正在玩命加载中..."
android:id="@+id/textView"/>
android:layout_width="match_parent"
android:padding="6dp"
android:orientation="vertical"
android:layout_height="match_parent">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/left_layout"
android:layout_gravity="left"
android:background="#c000dd">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:id="@+id/left_msg"
android:layout_margin="10dp"
android:textColor="#fff"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/right_layout"
android:layout_gravity="right"
android:background="#00e6ff">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/right_msg"
android:layout_gravity="center"
android:layout_margin="10dp"/>