增加帖子详情界面

登陆、注册、重置密码组件垂直居中
0515
panqihua 5 years ago
parent d12f84d4f5
commit 1b0fefaf17
  1. 1
      app/src/main/AndroidManifest.xml
  2. 67
      app/src/main/java/com/community/pocket/data/model/ForumContent.java
  3. 4
      app/src/main/java/com/community/pocket/ui/main/TestMainFragment.java
  4. 88
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumDataActivity.java
  5. 20
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumPost.java
  6. 12
      app/src/main/java/com/community/pocket/ui/main/ui/info/InfoFragment.java
  7. 6
      app/src/main/java/com/community/pocket/ui/main/ui/visitor/VisitorMyVisitor.java
  8. 6
      app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep1.java
  9. 7
      app/src/main/java/com/community/pocket/ui/resetpwd/ResetPwdStep3.java
  10. 152
      app/src/main/res/layout/activity_login.xml
  11. 194
      app/src/main/res/layout/activity_register.xml
  12. 41
      app/src/main/res/layout/main/layout/forum/layout/activity_forum_data.xml
  13. 84
      app/src/main/res/layout/main/layout/forum/layout/forum_data_content.xml
  14. 5
      app/src/main/res/layout/main/layout/forum/layout/forum_notice.xml
  15. 15
      app/src/main/res/layout/main/layout/forum/layout/post.xml
  16. 8
      app/src/main/res/layout/main/layout/info_fragment.xml
  17. 5
      app/src/main/res/layout/main/layout/visitor/layout/visitor_info.xml
  18. 20
      app/src/main/res/layout/resetpwd/layout/activity.xml
  19. 19
      app/src/main/res/layout/resetpwd/layout/fragment.xml
  20. 3
      app/src/main/res/values-en-rUS/strings.xml
  21. 3
      app/src/main/res/values-zh-rCN/strings.xml
  22. 2
      app/src/main/res/values/dimens.xml
  23. 3
      app/src/main/res/values/strings.xml

@ -10,6 +10,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar">
<activity android:name=".ui.main.ui.forum.ForumDataActivity" />
<activity android:name=".ui.main.MainMenu" />
<activity android:name=".ui.resetpwd.ResetPwdActivity" />
<activity android:name=".ui.register.RegisterActivity" />

@ -0,0 +1,67 @@
package com.community.pocket.data.model;
/**
* 论坛楼层数据
*/
public class ForumContent {
//头像
private String headImg;
//用户名
private String username;
//信用分
private Integer score;
//发帖时间
private Long time;
//楼层
private Integer tower;
//帖子正文
private String content;
public String getHeadImg() {
return headImg;
}
public void setHeadImg(String headImg) {
this.headImg = headImg;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
public Integer getTower() {
return tower;
}
public void setTower(Integer tower) {
this.tower = tower;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}

@ -25,11 +25,11 @@ public abstract class TestMainFragment extends BaseFragment {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//文本框打印信息
//文本框打印测试信息
View root = super.onCreateView(inflater, container, savedInstanceState);
final TextView textView = root.findViewById(viewId());
MutableLiveData<String> mText = new MutableLiveData<>();
mText.setValue(this.getClass().getName());
mText.setValue("未完成界面!!!");
mText.observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {

@ -0,0 +1,88 @@
package com.community.pocket.ui.main.ui.forum;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.community.pocket.R;
import com.community.pocket.ui.BaseActivity;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;
/**
* 帖子详情界面
*/
@ContentView(R.layout.activity_forum_data)
public class ForumDataActivity extends BaseActivity {
//第一楼布局
@ViewInject(R.id.first_layout)
private ConstraintLayout firstLayout;
//回复楼层布局
@ViewInject(R.id.reply_layout)
private LinearLayout replyLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initFirst();
createReply();
}
/**
* 初始化第一楼数据
* TODO 测试数据
*/
private void initFirst() {
setData(firstLayout);
}
/**
* 返回
*/
@Event(value = R.id.back)
private void back(View view) {
finish();
}
/**
* 创建楼层数据
*/
private void createReply() {
for (int i = 0; i < 10; i++) {
View view = View.inflate(this, R.layout.forum_data_content, null);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ViewGroup.MarginLayoutParams marginLayoutParams = new ViewGroup.MarginLayoutParams(layoutParams);
marginLayoutParams.setMargins(0, 50, 0, 0);
setData(view);
view.setLayoutParams(marginLayoutParams);
replyLayout.addView(view);
}
}
/**
* 设置楼层布局
*/
private void setData(View view) {
TextView name = view.findViewById(R.id.name);
name.setText("我是笨蛋");
TextView score = view.findViewById(R.id.score);
score.setText("22");
TextView time = view.findViewById(R.id.time);
time.setText(DateFormat.format(getString(R.string.dateformat), System.currentTimeMillis()));
TextView tower = view.findViewById(R.id.tower);
tower.setText(getString(R.string.tower, 1));
TextView content = view.findViewById(R.id.content);
content.setText("我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋");
}
}

@ -1,10 +1,11 @@
package com.community.pocket.ui.main.ui.forum;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -34,11 +35,11 @@ public abstract class ForumPost extends BaseFragment {
}
/**
* 加载最新帖子
* 加载帖子数据
* TODO 测试数据
*/
@SuppressLint("SetTextI18n")
private void loadPost(View view) {
//TODO 测试数据
for (int i = 0; i < 10; i++) {
View childView = View.inflate(getContext(), R.layout.post, null);
TextView title = childView.findViewById(R.id.post_title);
@ -58,6 +59,17 @@ public abstract class ForumPost extends BaseFragment {
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
layoutParams.setMargins(0, 0, 0, 50);
childView.setLayoutParams(layoutParams);
//打开帖子
Button button = childView.findViewById(R.id.showAll);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getContext(), ForumDataActivity.class));
}
});
layout.addView(childView);
}
}

@ -1,5 +1,6 @@
package com.community.pocket.ui.main.ui.info;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
@ -12,12 +13,14 @@ import androidx.annotation.RequiresApi;
import com.community.pocket.R;
import com.community.pocket.ui.BaseFragment;
import com.community.pocket.ui.login.LoginActivity;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;
import java.util.ArrayList;
@ -67,6 +70,15 @@ public class InfoFragment extends BaseFragment {
loadChart();
}
/**
* 注销登录
*/
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Event(value = R.id.logout)
private void logout(View view) {
startActivity(new Intent(view.getContext(), LoginActivity.class));
}
//加载图表数据
private void loadChart() {
LineData lineData = new LineData();

@ -111,9 +111,9 @@ public abstract class VisitorMyVisitor extends BaseFragment {
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private void createAlertNotes(String text) {
View view = View.inflate(getContext(), R.layout.visitor_info, null);
EditText editText = view.findViewById(R.id.content);
editText.setText(text);
editText.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
TextView textView = view.findViewById(R.id.content);
textView.setText(text);
textView.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
Button button = view.findViewById(R.id.close);
AlertDialog.Builder alert = new AlertDialog.Builder(Objects.requireNonNull(getContext()));
final AlertDialog alertDialog = alert.setTitle(R.string.notes).setView(view).create();

@ -1,8 +1,10 @@
package com.community.pocket.ui.resetpwd;
import android.content.Intent;
import android.os.Build;
import android.view.View;
import androidx.annotation.RequiresApi;
import androidx.navigation.fragment.NavHostFragment;
import com.community.pocket.R;
@ -12,6 +14,8 @@ import com.community.pocket.ui.login.LoginActivity;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import java.util.Objects;
/**
* 重置密码第一步输入账号邮箱
*/
@ -25,8 +29,10 @@ public class ResetPwdStep1 extends BaseFragment {
}
//返回登陆
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Event(value = R.id.back)
private void back(View view) {
startActivity(new Intent(getContext(), LoginActivity.class));
Objects.requireNonNull(getActivity()).finish();
}
}

@ -1,9 +1,12 @@
package com.community.pocket.ui.resetpwd;
import android.content.Intent;
import android.os.Build;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import com.community.pocket.R;
import com.community.pocket.ui.BaseFragment;
import com.community.pocket.ui.login.LoginActivity;
@ -11,6 +14,8 @@ import com.community.pocket.ui.login.LoginActivity;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import java.util.Objects;
/**
* 重置密码第三步输入密码
*/
@ -22,8 +27,10 @@ public class ResetPwdStep3 extends BaseFragment {
Toast.makeText(getContext(), R.string.action_reset_password, Toast.LENGTH_SHORT).show();
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Event(value = R.id.back)
private void back(View v) {
startActivity(new Intent(getContext(), LoginActivity.class));
Objects.requireNonNull(getActivity()).finish();
}
}

@ -5,103 +5,101 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".ui.login.LoginActivity">
<include layout="@layout/titlebar_layout" />
<include
android:id="@+id/titlebar"
layout="@layout/titlebar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/username"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="96dp"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_user"
android:inputType="text"
android:selectAllOnFocus="true"
android:layout_gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/titlebar"
tools:layout_constraintStart_toStartOf="parent">
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
<EditText
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autofillHints="@string/AUTOFILL_HINT_PASSWORD"
android:hint="@string/prompt_password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toStartOf="@+id/login_to_resetPwd"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/username" />
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_user"
android:inputType="text"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toStartOf="@id/login_to_resetPwd"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintEnd_toStartOf="@id/login_to_resetPwd" />
<ProgressBar
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="32dp"
android:layout_marginTop="64dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="64dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/password"
app:layout_constraintStart_toStartOf="@+id/password"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.3" />
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="49dp"
android:layout_marginStart="24dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/password">
android:layout_marginTop="8dp"
android:autofillHints="@string/AUTOFILL_HINT_PASSWORD"
android:hint="@string/prompt_password"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/username" />
<Button
android:id="@+id/back"
<ProgressBar
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/size_50"
android:enabled="false"
android:text="@string/action_sign_in"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_gravity="center"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/password" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/loading">
<Button
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/size_50"
android:enabled="false"
android:text="@string/action_sign_in"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/size_50"
android:enabled="true"
android:text="@string/action_register"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/register"
android:id="@+id/login_to_resetPwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/size_50"
android:enabled="true"
android:text="@string/action_register"
app:layout_constraintBottom_toBottomOf="parent"
android:text="@string/action_reset_password"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="@id/username" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/login_to_resetPwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/action_reset_password"
app:layout_constraintBottom_toBottomOf="@+id/password"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/username" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -6,119 +6,119 @@
android:layout_height="match_parent"
tools:context=".ui.register.RegisterActivity">
<include layout="@layout/titlebar_layout" />
<include
android:id="@+id/titlebar"
layout="@layout/titlebar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/username"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="96dp"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_user"
android:inputType="text"
android:selectAllOnFocus="true"
android:layout_gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/titlebar"
tools:layout_constraintStart_toStartOf="parent">
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
<EditText
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_password"
android:inputType="text|textPassword"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/username" />
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_user"
android:inputType="text"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/confirmPassword"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_confirm_password"
android:inputType="text|textPassword"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/password" />
<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="wrap_content"
<EditText
android:id="@+id/phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_phone"
android:inputType="text|phone"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/confirmPassword" />
android:layout_marginTop="8dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_password"
android:inputType="text|textPassword"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/username" />
<EditText
android:id="@+id/email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_email"
android:inputType="text|textEmailAddress|phone"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/phone" />
<EditText
android:id="@+id/confirmPassword"
android:layout_width="0dp"
android:layout_height="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/size_50"
android:layout_marginTop="24dp"
android:layout_marginEnd="@dimen/size_50"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/email">
android:layout_marginTop="8dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_confirm_password"
android:inputType="text|textPassword"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/password" />
<EditText
android:id="@+id/phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
<Button
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_marginTop="8dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_phone"
android:inputType="text|phone"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/confirmPassword" />
<EditText
android:id="@+id/email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/size_50"
android:text="@string/action_register"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="8dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_email"
android:inputType="text|textEmailAddress|phone"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/phone" />
<Button
android:id="@+id/back"
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/size_50"
android:text="@string/action_back"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/email">
<Button
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/size_50"
android:text="@string/action_register"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/size_50"
android:text="@string/action_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,41 @@
<?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"
android:fitsSystemWindows="true"
tools:context=".ui.main.ui.forum.ForumDataActivity">
<Button
android:id="@+id/back"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/action_back"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<include
android:id="@+id/first_layout"
layout="@layout/forum_data_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/back" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:fillViewport="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/first_layout">
<LinearLayout
android:id="@+id/reply_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,84 @@
<?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"
android:background="@drawable/border">
<ImageView
android:id="@+id/headimg"
android:layout_width="@dimen/size_200"
android:layout_height="@dimen/size_200"
android:background="@drawable/border"
android:contentDescription="@string/headimg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:gravity="center"
android:textSize="36sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/headimg"
app:layout_constraintTop_toTopOf="@id/headimg"
tools:layout_constraintStart_toEndOf="@id/headimg" />
<TextView
android:id="@+id/score"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:textSize="36sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/headimg"
app:layout_constraintTop_toBottomOf="@id/name"
tools:layout_constraintStart_toEndOf="@id/headimg" />
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/headimg"
app:layout_constraintTop_toBottomOf="@id/score"
tools:layout_constraintStart_toEndOf="@id/headimg" />
<TextView
android:id="@+id/tower"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:gravity="end"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/headimg"
app:layout_constraintTop_toBottomOf="@id/time"
tools:layout_constraintStart_toEndOf="@id/headimg" />
<TextView
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:ems="10"
android:gravity="start|top"
android:importantForAutofill="no"
android:singleLine="false"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/headimg" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
<TextView
android:id="@+id/notice_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -37,7 +37,8 @@
android:enabled="false"
android:hint="@string/notice_content_load"
android:importantForAutofill="no"
android:inputType="none|textMultiLine" />
android:singleLine="false"
android:textColor="@color/colorBlack" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

@ -31,16 +31,26 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="24dp"
android:layout_marginBottom="32dp"
android:background="@drawable/border"
android:ems="10"
android:hint="@string/load_post_content"
android:importantForAutofill="no"
android:maxLines="4"
android:maxLength="40"
app:layout_constraintBottom_toBottomOf="@id/headimg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/headimg"
app:layout_constraintTop_toTopOf="@id/headimg" />
<Button
android:id="@+id/showAll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/open_content"
app:layout_constraintEnd_toEndOf="@id/post_content"
app:layout_constraintStart_toStartOf="@id/post_content"
app:layout_constraintTop_toBottomOf="@id/post_content" />
<LinearLayout
android:id="@+id/author_layout"
android:layout_width="0dp"
@ -48,7 +58,7 @@
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/post_content">
app:layout_constraintTop_toBottomOf="@id/showAll">
<TextView
android:id="@+id/poster"
@ -76,4 +86,5 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/author_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -25,8 +25,8 @@
android:id="@+id/headimg"
android:layout_width="@dimen/size_200"
android:layout_height="@dimen/size_200"
android:background="@drawable/border"
android:contentDescription="@string/headimg"
android:src="@drawable/comm_titlebar_progress_circular"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -146,6 +146,12 @@
</LinearLayout>
</HorizontalScrollView>
<Button
android:id="@+id/logout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/action_logout" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

@ -5,15 +5,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
<TextView
android:id="@+id/content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ems="10"
android:enabled="false"
android:gravity="start|top"
android:importantForAutofill="no"
android:inputType="textMultiLine"
android:singleLine="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

@ -1,14 +1,30 @@
<?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=".ui.resetpwd.ResetPwdActivity">
<include layout="@layout/titlebar_layout" />
<include
android:id="@+id/titlebar"
layout="@layout/titlebar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include layout="@layout/fragment" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/titlebar"
app:navGraph="@navigation/nav_reset_pwd" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,19 +0,0 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/nav_reset_pwd" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -88,4 +88,7 @@
<string name="end_time">end time</string>
<string name="query">query</string>
<string name="appointment_name">appointment name</string>
<string name="tower">%1d l</string>
<string name="open_content">open_content</string>
<string name="action_logout">logout</string>
</resources>

@ -88,4 +88,7 @@
<string name="end_time">结束时间</string>
<string name="query">查询</string>
<string name="appointment_name">预约人</string>
<string name="tower">第%1d楼</string>
<string name="open_content">打开帖子</string>
<string name="action_logout">注销登录</string>
</resources>

@ -9,4 +9,6 @@
<dimen name="chart_height">200dp</dimen>
<dimen name="size_300">300dp</dimen>
<dimen name="size_200">200dp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="text_margin">16dp</dimen>
</resources>

@ -89,6 +89,9 @@
<string name="end_time">end time</string>
<string name="query">query</string>
<string name="appointment_name">appointment name</string>
<string name="tower">%1d l</string>
<string name="open_content">open_content</string>
<string name="action_logout">logout</string>
<!-- Strings used for fragments for navigation -->
<!-- Strings used for fragments for navigation -->

Loading…
Cancel
Save