注册+个人信息修改+部分ui修改

master
hjw 3 years ago
parent 5f1bdad856
commit cd4485aada

@ -18,68 +18,83 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.LeudaemiaLikeMe">
<activity android:name=".Activity.RegisterActivity"></activity>
<activity android:name=".Activity.AddEventActivity" />
<activity android:name=".Activity.MyInfoActivity"></activity>
<activity android:name=".Activity.AddClock" />
<activity android:name=".Activity.AlarmAlert" />
<activity android:name=".ClockDetail" />
<activity android:name=".Activity.AnswerActivity" />
<activity android:name=".Activity.QuestionDetailActivity" />
<activity android:name=".Activity.BlogDetailActivity" />
<activity
android:name=".Activity.BlogSearchResultActivity"
<activity android:name=".Activity.RegisterActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
<activity
android:name=".Activity.BlogSearchActivity"
<activity android:name=".Activity.AddEventActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.MyInfoActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
<activity android:name=".Activity.AddClock"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.AlarmAlert"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity android:name=".ClockDetail"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.AnswerActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.QuestionDetailActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.BlogDetailActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.BlogSearchResultActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
<activity android:name=".Activity.BlogSearchActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<meta-data
android:name="com.google.android.actions"
android:resource="@xml/network_security_config" />
<activity
android:name=".Activity.BaseActivity"
<activity android:name=".Activity.BaseActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".Activity.MainActivity"
<activity android:name=".Activity.MainActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".Activity.ChatActivity"
<activity android:name=".Activity.ChatActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".Activity.AttentionActivity"
<activity android:name=".Activity.AttentionActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".Activity.HistoryActivity"
<activity android:name=".Activity.HistoryActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".Activity.CollectActivity"
<activity android:name=".Activity.CollectActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".Activity.SafetyActivity"
<activity android:name=".Activity.SafetyActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity android:name=".Activity.AboutActivity" />
<activity android:name=".Activity.MyQuestionActivity" />
<activity android:name=".Activity.ConcernedProblemActivity" />
<activity android:name=".Activity.MdctRmdActivity" />
<activity android:name=".Activity.SearchActivity" />
<activity android:name=".Activity.InfoActivity" />
<activity android:name=".Activity.SendInvitationActivity" />
<activity android:name=".Activity.GoAnswerActivity" />
<activity android:name=".Activity.SendQuestionActivity" />
<activity android:name=".Activity.APNActivity" />
<activity android:name=".Activity.EventActivity" />
<activity android:name=".Activity.NewsDetailActivity" />
<activity android:name=".Activity.NewsSearchResultActivity" />
<activity android:name=".Activity.NewsSearchActivity" />
<activity android:name=".Activity.AboutActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.MyQuestionActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.ConcernedProblemActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.MdctRmdActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.SearchActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.InfoActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.SendInvitationActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.GoAnswerActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.SendQuestionActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.APNActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.EventActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.NewsDetailActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.NewsSearchResultActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity android:name=".Activity.NewsSearchActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<receiver
android:name=".CallAlarm"
android:process=".remote" />
<activity android:name=".Activity.LoginActivity">
<activity android:name=".Activity.LoginActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

@ -31,7 +31,7 @@ public class BaseActivity extends AppCompatActivity {
public static Owner owner;
//服务器链接
public static String SERVER_IP = "172.30.125.78";
public static String SERVER_IP = "172.18.138.225";
// 172.30.118.24 寝172.18.138.225
// static {

@ -32,6 +32,7 @@ public class LoginActivity extends BaseActivity {
private EditText edit_username;
private EditText edit_pwd;
private Button bt_login;
private Button bt_register;
private String username;
private String pwd;
@ -42,9 +43,11 @@ public class LoginActivity extends BaseActivity {
//获取数据库
SQLiteDatabase db = LitePal.getDatabase();
// Log.e("", String.valueOf(Context.getExternalFilesDir()));
edit_username = findViewById(R.id.edit_username);
edit_pwd = findViewById(R.id.edit_pwd);
bt_login = findViewById(R.id.bt_login);
bt_register = findViewById(R.id.bt_register);
bt_login.setOnClickListener(new View.OnClickListener() {
@Override
@ -61,6 +64,13 @@ public class LoginActivity extends BaseActivity {
}
}
});
bt_register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(LoginActivity.this,RegisterActivity.class);
startActivity(intent);
}
});
}
private void loginRequest(final Map paramMap){

@ -2,28 +2,153 @@ package com.example.leudaemialikeme.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.leudaemialikeme.Model.User;
import com.example.leudaemialikeme.R;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.HashMap;
import java.util.Map;
public class MyInfoActivity extends AppCompatActivity {
private User user;
private EditText edit_id;
import static com.example.leudaemialikeme.Utils.OkHttpUtil.synPost;
public class MyInfoActivity extends BaseActivity {
private User origin_user;
private User changed_user;
private TextView edit_id;
private EditText edit_username;
private EditText edit_password;
private EditText edit_confirm_password;
private EditText phone;
private EditText edit_phone;
private Button commit;
private Spinner spinner_sex;
private String toast_content;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_info);
Intent intent = getIntent();
user = (User)intent.getSerializableExtra("user");
origin_user = (User)intent.getSerializableExtra("user");
changed_user = (User)intent.getSerializableExtra("user");
initView();
setSpinner_sex();
initData();
commit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toast_content = "";
String username=edit_username.getText().toString();
changed_user.setUsername(username);
String password=edit_password.getText().toString();
String confirmPassword=edit_confirm_password.getText().toString();
if(password.equals(confirmPassword)){
changed_user.setPassword(password);
}else{
toast_content = toast_content +"确认密码不一致\n";}
String phone=edit_phone.getText().toString();
changed_user.setPhone(phone);
Map<String,User> paramMap_update=new HashMap<String,User>();
paramMap_update.put("origin_user",origin_user);
paramMap_update.put("changed_user",changed_user);
Log.e("传入的orgin sex为",origin_user.getSex());
Log.e("传入的changed_user sex为",changed_user.getSex());
String url_update=BaseActivity.SERVER_URL+"/user-servlet?action=updateUser";
//不同时,需要判断username是否已存在
new Thread(new Runnable() {
@Override
public void run() {
String jsonStr_update=synPost(url_update,paramMap_update);
Log.e("jsonstr update",jsonStr_update);
Gson gson=new Gson();
Map<String, User> jsonMap= gson.fromJson(jsonStr_update, new TypeToken<Map<String, User>>() {}.getType());
User ch_user=jsonMap.get("ch_user");
Log.e("changed_username",changed_user.getUsername());
Log.e("ch_username",ch_user.getUsername());
Log.e("origin_username",origin_user.getUsername());
if(!ch_user.getUsername().equals(changed_user.getUsername())&&!changed_user.getUsername().equals(origin_user.getUsername()))
toast_content = toast_content +"用户名重复\n";
if(!ch_user.getUsername().equals(origin_user.getUsername()))
toast_content =toast_content +"用户名修改成功\n";
if(!ch_user.getPassword().equals(origin_user.getPassword()))
toast_content =toast_content +"密码修改成功\n";
if(!ch_user.getPhone().equals(origin_user.getPhone()))
toast_content =toast_content +"手机号修改成功\n";
if(!ch_user.getSex().equals(origin_user.getSex()))
toast_content =toast_content +"性别修改成功\n";
origin_user=ch_user;
runOnUiThread(new Runnable() {
@Override
public void run() {
initData();
if(origin_user.getSex().equals("女"))
spinner_sex.setSelection(1,true);
else
spinner_sex.setSelection(0,true);
Toast.makeText(MyInfoActivity.this,
toast_content,Toast.LENGTH_SHORT).show();
}
});
}
}).start();
}
});
}
private void initView(){
edit_id=(TextView)findViewById(R.id.my_info_edit_id);
edit_username=(EditText)findViewById(R.id.my_info_edit_username);
edit_password=(EditText)findViewById(R.id.my_info_edit_password);
edit_confirm_password=(EditText)findViewById(R.id.my_info_edit_confirm_password);
edit_phone=(EditText)findViewById(R.id.my_info_phone);
spinner_sex=(Spinner)findViewById(R.id.my_info_sex);
commit=(Button)findViewById(R.id.my_info_commit);
}
private void initData(){
edit_id.setText(String.valueOf(origin_user.getIduser()));
edit_username.setText(origin_user.getUsername());
edit_password.setText(origin_user.getPassword());
edit_confirm_password.setText(origin_user.getPassword());
edit_phone.setText(origin_user.getPhone());
}
private void setSpinner_sex(){
String[] sexList= {"男","女"};
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,sexList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner_sex.setAdapter(adapter);
if(origin_user.getSex().equals("女"))
spinner_sex.setSelection(1,true);
else
spinner_sex.setSelection(0,true);
spinner_sex.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
changed_user.setSex(sexList[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
}

@ -1,16 +1,163 @@
package com.example.leudaemialikeme.Activity;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.leudaemialikeme.Dao.OwnerDao;
import com.example.leudaemialikeme.Model.Owner;
import com.example.leudaemialikeme.Model.User;
import com.example.leudaemialikeme.R;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.HashMap;
import java.util.Map;
import static com.example.leudaemialikeme.Utils.OkHttpUtil.synPost;
public class RegisterActivity extends AppCompatActivity {
public class RegisterActivity extends BaseActivity {
TextView registerUsername;
TextView registerPassword;
TextView registerPhone;
TextView registerSex;
ImageView registerBack;
Button registerCommit;
Spinner registerV2Sex;
User user=new User();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
initView();
setSpinner_v2_sex();
registerCommit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String username=registerUsername.getText().toString();
String password=registerPassword.getText().toString();
String phone=registerPhone.getText().toString();
// String sex=registerSex.getText().toString();
user.setUsername(username);
user.setPassword(password);
user.setPhone(phone);
if(judgeUser(user)){
Map<String,User> paramMap= new HashMap<String, User>();
paramMap.put("user",user);
String url=BaseActivity.SERVER_URL+"/register-servlet?action=Register";
//先要判断该用户是否存在
new Thread(new Runnable() {
@Override
public void run() {
String jsonStr=synPost(url,paramMap);
Log.e("jsonstr iduser",jsonStr);
Gson gson=new Gson();
Map<String, Integer> jsonMap= gson.fromJson(jsonStr, new TypeToken <Map<String, Integer>>() {}.getType());
int idUser = jsonMap.get("iduser");
runOnUiThread(new Runnable() {
@Override
public void run() {
if(idUser==0)
Toast.makeText(RegisterActivity.this,
"该用户名已存在",Toast.LENGTH_SHORT).show();
else if(idUser==-1)
Toast.makeText(RegisterActivity.this,
"网络连接失败",Toast.LENGTH_SHORT).show();
else{
Toast.makeText(RegisterActivity.this,
"注册成功",Toast.LENGTH_SHORT).show();
user.setIduser(idUser);
Owner newOwner = new Owner();
newOwner.setUsername(user.getUsername());
newOwner.setPassword(user.getPassword());
newOwner.setNetId(user.getIduser());
OwnerDao ownerDao=new OwnerDao();
ownerDao.insert(newOwner); //插入本地数据库
owner = newOwner;
//初始化WS链接
initWebSocket(owner.getNetId());
Intent intent=new Intent(RegisterActivity.this,MainActivity.class);
startActivity(intent);
finish();
}
}
});
}
}).start();
}}
});
registerBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void initView(){
registerUsername=(TextView)findViewById(R.id.register_username);
registerPassword=(TextView)findViewById(R.id.register_password);
registerPhone=(TextView)findViewById(R.id.register_phone);
// registerSex=(TextView)findViewById(R.id.register_sex);
registerCommit=(Button)findViewById(R.id.register_commit);
registerBack=(ImageView)findViewById(R.id.register_back);
registerV2Sex=(Spinner)findViewById(R.id.register_v2_sex);
}
private void setSpinner_v2_sex() {
String[] sexList= {"男","女"};
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,sexList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
registerV2Sex.setAdapter(adapter);
registerV2Sex.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
user.setSex(sexList[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
private boolean judgeUser(User user){
boolean judge=true;
String toast="\n";
if(user.getUsername().length()<3||user.getUsername().length()>6){
judge=false;
toast=toast+"用户名需为3-6位\n";
}
if(user.getPassword().length()<6||user.getPassword().length()>11){
judge=false;
toast=toast+"密码需为6-11位\n";
}
if(user.getPhone().length()!=11){
judge=false;
toast=toast+"手机号码输入不正确\n";
}
if(user.getSex().length()==0){
judge=false;
toast=toast+"性别尚未选择\n";
}
Toast.makeText(RegisterActivity.this,
toast,Toast.LENGTH_SHORT).show();
return judge;
}
}

@ -49,6 +49,10 @@ public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHo
}
}
public void setContext(Context context){
this.context=context;
}
public void setQuestionList(List<Question> questionList){
this.questionList=questionList;
}

@ -16,6 +16,8 @@ import com.example.leudaemialikeme.Activity.BaseActivity;
import com.example.leudaemialikeme.Activity.InfoActivity;
import com.example.leudaemialikeme.Activity.MdctRmdActivity;
import com.example.leudaemialikeme.Activity.NewsSearchActivity;
import com.example.leudaemialikeme.Activity.SendInvitationActivity;
import com.example.leudaemialikeme.Activity.SendQuestionActivity;
import com.example.leudaemialikeme.Adapter.NewsAdapter;
import com.example.leudaemialikeme.Model.News;
import com.example.leudaemialikeme.R;
@ -81,8 +83,8 @@ public class IndexFragment extends Fragment {
private void initClick(View view){
LinearLayout searchLinear=view.findViewById(R.id.search_linear);
LinearLayout recLinear=view.findViewById(R.id.rec_linear);
LinearLayout kepuLinear=view.findViewById(R.id.kepu_linear);
LinearLayout blogPostLinear=view.findViewById(R.id.blog_post_linear);
LinearLayout questionPostLinear=view.findViewById(R.id.question_post_linear);
LinearLayout clockLinear=view.findViewById(R.id.clock_linear);
LinearLayout companyLinear=view.findViewById(R.id.company);
LinearLayout tenLinear=view.findViewById(R.id.ten);
@ -99,22 +101,21 @@ public class IndexFragment extends Fragment {
startActivity(intent);
}
});
recLinear.setOnClickListener(new View.OnClickListener(){
blogPostLinear.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent intent=new Intent(getContext(), SendInvitationActivity.class);
startActivity(intent);
}
});
kepuLinear.setOnClickListener(new View.OnClickListener(){
questionPostLinear.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent intent=new Intent(getContext(), SendQuestionActivity.class);
startActivity(intent);
}
});
clockLinear.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent intent=new Intent(getContext(), MdctRmdActivity.class);
@ -123,7 +124,6 @@ public class IndexFragment extends Fragment {
});
companyLinear.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent intent=new Intent(getContext(), InfoActivity.class);

@ -101,6 +101,7 @@ public class InvitationChannelFragment extends Fragment {
// initAllBlog();// 所有blog组
// initAllBlogList(); //第一栏:全部项
questionAdapter = new QuestionAdapter();
questionAdapter.setContext(getContext());
questionAdapter.setQuestionList(allQuestion);
expAdapter = new BlogAdapter();
expAdapter.setRecnewsList(expBlog);
@ -462,6 +463,7 @@ public class InvitationChannelFragment extends Fragment {
allQuestion = questionList;
QuestionAdapter questionAdapter = new QuestionAdapter();
questionAdapter.setQuestionList(allQuestion);
questionAdapter.setContext(getContext());
questionRecyclerView.setAdapter(questionAdapter);
}
});
@ -487,6 +489,7 @@ public class InvitationChannelFragment extends Fragment {
}else if(invitationCategoryTitleNum == 4) {
getQuestionListRequest();
QuestionAdapter questionAdapter = new QuestionAdapter(allQuestion, getContext());
questionAdapter.setContext(getContext());
questionRecyclerView.setAdapter(questionAdapter);
}else if(invitationCategoryTitleNum == 2) {
Map<String, String[]> paramMap = new HashMap<String, String[]>();

@ -21,6 +21,14 @@ public class User implements Serializable {
this.sex = sex;
}
public User(String username, String password, String phone, String sex) {
super();
this.username = username;
this.password = password;
this.phone = phone;
this.sex = sex;
}
public int getIduser() {
return iduser;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -0,0 +1,16 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/white"
android:centerColor="@color/white"
android:endColor="@color/white"
/>
<corners
android:radius="30dp"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,17 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/hair_grey"
android:centerColor="@color/hair_grey"
android:endColor="@color/hair_grey"
/>
<corners
android:radius="30dp"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -5,6 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
>
<LinearLayout
android:layout_width="match_parent"
@ -21,52 +22,39 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="#FFFFFF"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:background="@color/white"
android:orientation="horizontal">
<ImageView
android:id="@+id/detail_to"
android:layout_width="47dp"
android:layout_height="34dp"
android:layout_gravity="center"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="15dp"
android:src="@drawable/back" />
<TextView
android:text="详情"
android:id="@+id/textView30"
android:layout_width="306dp"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:gravity="center"
android:text="详情"
android:textSize="19dp"
android:textStyle="bold" />
android:textSize="20dp" />
<ImageView
android:id="@+id/detail_to_search"
android:layout_width="66dp"
android:layout_height="match_parent"
app:srcCompat="@android:drawable/ic_menu_search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/detail_theme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="急性白血病经验分享,第一帖"
android:textSize="20dp" />
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="15dp"
android:src="@drawable/search_v2" />
</LinearLayout>
@ -93,6 +81,31 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:layout_marginTop="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/detail_theme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="急性白血病经验分享,第一帖"
android:textSize="20dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -3,27 +3,94 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@drawable/lo_background"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Activity.LoginActivity">
<EditText
android:id="@+id/edit_username"
<ImageView
android:layout_width="200dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:src="@drawable/login_logo" />
<TextView
android:id="@+id/textView46"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="账号"/>
android:text="小白帮"
android:textStyle="bold"
android:textSize="25dp"
<EditText
android:id="@+id/edit_pwd"
android:layout_gravity="center"
android:textColor="#29D07A"/>
<TextView
android:id="@+id/textView47"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="密码" />
android:text=" 白血病患者社区 "
android:textStyle="bold"
android:textSize="15dp"
android:layout_marginTop="5dp"
android:layout_gravity="center"
/>
<Button
android:id="@+id/bt_login"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="登录"/>
android:gravity="center"
android:layout_marginTop="25dp"
android:orientation="vertical">
<EditText
android:id="@+id/edit_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入账号"
android:minLines="2"
android:layout_margin="10dp"
android:paddingBottom="10dp" />
<EditText
android:id="@+id/edit_pwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入密码"
android:inputType="textPassword"
android:minLines="2"
android:layout_margin="10dp"
android:paddingBottom="20dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:orientation="horizontal">
<Button
android:id="@+id/bt_login"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/button_login"
android:gravity="center"
android:text="登录"
android:textColor="@color/white" />
<Button
android:id="@+id/bt_register"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/button_login"
android:text="注册"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -19,8 +19,8 @@
android:layout_weight="1"
android:text="ID:" />
<EditText
android:id="@+id/edit_id"
<TextView
android:id="@+id/my_info_edit_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -40,7 +40,7 @@
android:text="用户名:" />
<EditText
android:id="@+id/edit_username"
android:id="@+id/my_info_edit_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -60,7 +60,7 @@
android:text="密码:" />
<EditText
android:id="@+id/edit_password"
android:id="@+id/my_info_edit_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -81,7 +81,7 @@
android:text="确认密码" />
<EditText
android:id="@+id/edit_confirm_password"
android:id="@+id/my_info_edit_confirm_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -101,7 +101,7 @@
android:text="手机号:" />
<EditText
android:id="@+id/edit_phone"
android:id="@+id/my_info_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -120,31 +120,22 @@
android:layout_weight="1"
android:text="性别:" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="3" >
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="男" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="女" />
</RadioGroup>
<Spinner
android:id="@+id/my_info_sex"
android:layout_width="98dp"
android:layout_height="49dp"
android:layout_gravity="top"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginRight="5dp"
android:spinnerMode="dialog"
android:entries="@array/sex" />
</LinearLayout>
<Button
android:id="@+id/bt_commit"
android:id="@+id/my_info_commit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"

@ -5,92 +5,118 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background"
tools:context="com.example.leudaemialikeme.Activity.RegisterActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:background="@color/white"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:id="@+id/register_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:layout_marginLeft="15dp"
android:src="@drawable/back"
/>
<TextView
android:id="@+id/textView65"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:textSize="24dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center"
android:layout_marginLeft="70dp"
android:gravity="center"
android:textSize="25dp"
android:text="注册" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="15dp"
android:src="@drawable/replace"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:background="@color/white"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView33"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_margin="10dp"
android:text="用户名:" />
android:layout_gravity="center"
android:paddingLeft="20dp"
android:layout_margin="9dp"
android:text="用户名" />
<EditText
android:layout_width="0dp"
android:layout_weight="2"
android:layout_width="wrap_content"
android:layout_weight="4"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:paddingTop="20dp"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:background="@color/white"
android:id="@+id/register_username"
android:text="username"
android:hint="3-6位字符"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:background="@color/white"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/textView34"
android:layout_width="0dp"
android:layout_width="89dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18dp"
android:layout_gravity="center"
android:layout_margin="10dp"
android:text="密码:" />
android:layout_weight="1"
android:paddingLeft="20dp"
android:text="密码"
android:textSize="18dp" />
<EditText
android:layout_width="0dp"
android:layout_weight="2"
android:layout_width="wrap_content"
android:layout_weight="4"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:text="password"
android:id="@+id/register_password"
android:ems="10"
android:paddingTop="20dp"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:background="@color/white"
android:inputType="textPassword"
android:hint="6-11位字母或数字"
android:id="@+id/register_password"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:background="@color/white"
android:layout_weight="1"
android:orientation="horizontal">
@ -98,26 +124,33 @@
android:id="@+id/textView63"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:layout_gravity="center"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="电话号码:" />
android:paddingLeft="20dp"
android:text="电话号码"
android:textSize="18dp" />
<EditText
android:layout_width="0dp"
android:layout_weight="3"
android:layout_width="wrap_content"
android:layout_weight="4"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="18dp"
android:paddingTop="20dp"
android:layout_marginBottom="7dp"
android:background="@color/white"
android:id="@+id/register_phone"
android:layout_margin="10dp"
android:text="phone"
android:hint="156****7721(如)"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:background="@color/white"
android:layout_weight="1"
android:orientation="horizontal">
@ -125,20 +158,26 @@
android:id="@+id/textView64"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_margin="10dp"
android:layout_gravity="center"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="性别:" />
android:paddingLeft="20dp"
android:text="性别"
android:textSize="18dp" />
<EditText
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content"
<Spinner
android:id="@+id/register_v2_sex"
android:layout_width="wrap_content"
android:layout_weight="4"
android:layout_height="match_parent"
android:layout_gravity="center"
android:textSize="18dp"
android:id="@+id/register_sex"
android:layout_margin="10dp"
android:text="sex"
/>
android:background="@color/white"
android:entries="@array/sex"
android:spinnerMode="dialog" />
</LinearLayout>
<LinearLayout
@ -148,11 +187,13 @@
android:orientation="vertical">
<Button
android:id="@+id/button4"
android:id="@+id/register_commit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="20dp"
android:background="@drawable/button_login"
android:layout_marginTop="100dp"
android:textColor="#FAF0E6"
android:text="注册" />
</LinearLayout>

@ -29,18 +29,19 @@
android:background="@drawable/search_background"
android:orientation="horizontal">
<ImageView
<SearchView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_search" />
/>
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="搜索帖子" />
android:textSize="17dp"
android:hint="搜索帖子" />
</LinearLayout>
<ImageButton
@ -48,8 +49,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_gravity="center"
android:background="@color/white"
android:src="@mipmap/img_add"
android:src="@drawable/add_fill_v2"
/>
</LinearLayout>

@ -62,7 +62,7 @@
android:orientation="vertical">
<LinearLayout
android:id="@+id/rec_linear"
android:id="@+id/blog_post_linear"
android:layout_width="190dp"
android:layout_height="76dp"
android:layout_margin="10dp"
@ -72,11 +72,12 @@
android:elevation="10dp">
<ImageView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:src="@drawable/friends" />
android:src="@drawable/blog_image" />
<LinearLayout
android:layout_width="91dp"
@ -88,14 +89,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="好友推荐"
android:text="发帖"
android:textSize="17dp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="看看好友动态"
android:text="分享你的感触"
android:textSize="13dp" />
</LinearLayout>
@ -109,7 +110,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/kepu_linear"
android:id="@+id/question_post_linear"
android:layout_width="189dp"
android:layout_height="76dp"
android:layout_margin="10dp"
@ -121,11 +122,12 @@
<ImageView
android:id="@+id/imageView2"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:src="@drawable/kepu" />
android:src="@drawable/question_image" />
<LinearLayout
android:layout_width="wrap_content"
@ -137,7 +139,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="科普"
android:text="提问"
android:textSize="17dp"
android:textStyle="bold" />
@ -145,7 +147,7 @@
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="白血病相关科普"
android:text="提出你的困惑"
android:textSize="13dp" />
</LinearLayout>

@ -4,8 +4,6 @@
android:layout_height="wrap_content"
android:id="@+id/news"
android:layout_width="334dp"
android:layout_marginLeft="35dp"
android:layout_marginBottom="10dp"
android:background="@drawable/background"
android:elevation="10dp"
android:layout_marginTop="10dp"

@ -2,7 +2,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="#ffffff">
<androidx.recyclerview.widget.RecyclerView

@ -7,4 +7,8 @@
<item>政府</item>
<item>慈善</item>
</string-array>
<string-array name="sex">
<item></item>
<item></item>
</string-array>
</resources>
Loading…
Cancel
Save