parent
d12f84d4f5
commit
1b0fefaf17
@ -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; |
||||||
|
} |
||||||
|
} |
@ -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("我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋我是笨蛋"); |
||||||
|
} |
||||||
|
} |
@ -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> |
@ -1,14 +1,30 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<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" |
xmlns:tools="http://schemas.android.com/tools" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||||
tools:context=".ui.resetpwd.ResetPwdActivity"> |
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> |
</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> |
|
Loading…
Reference in new issue