增加最新帖子、我的帖子UI数据管理

0515
panqihua 5 years ago
parent 82e2f1ec13
commit 8bb27af826
  1. 12
      app/src/main/java/com/community/pocket/data/main/forum/ForumHotRequest.java
  2. 48
      app/src/main/java/com/community/pocket/data/main/forum/ForumMyRequest.java
  3. 44
      app/src/main/java/com/community/pocket/data/main/forum/ForumNewRequest.java
  4. 5
      app/src/main/java/com/community/pocket/data/model/AbstractForumHot.java
  5. 75
      app/src/main/java/com/community/pocket/data/model/Forum.java
  6. 47
      app/src/main/java/com/community/pocket/data/model/ForumHot.java
  7. 35
      app/src/main/java/com/community/pocket/data/model/ForumHotList.java
  8. 33
      app/src/main/java/com/community/pocket/data/model/Hot.java
  9. 7
      app/src/main/java/com/community/pocket/data/model/UserHot.java
  10. 18
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumMyFragment.java
  11. 7
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumMyViewModel.java
  12. 20
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumNewFragment.java
  13. 7
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumNewViewModel.java
  14. 36
      app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumPost.java
  15. 15
      app/src/main/java/com/community/pocket/ui/main/ui/forum/hot/ForumHotFragment.java
  16. 4
      app/src/main/java/com/community/pocket/ui/main/ui/forum/hot/ForumHotResponse.java
  17. 54
      app/src/main/java/com/community/pocket/ui/main/ui/forum/my/ForumMyFragment.java
  18. 9
      app/src/main/java/com/community/pocket/ui/main/ui/forum/my/ForumMyResponse.java
  19. 27
      app/src/main/java/com/community/pocket/ui/main/ui/forum/my/ForumMyViewModel.java
  20. 54
      app/src/main/java/com/community/pocket/ui/main/ui/forum/news/ForumNewFragment.java
  21. 13
      app/src/main/java/com/community/pocket/ui/main/ui/forum/news/ForumNewResponse.java
  22. 29
      app/src/main/java/com/community/pocket/ui/main/ui/forum/news/ForumNewViewModel.java
  23. 2
      app/src/main/res/layout/main/layout/forum/layout/forum_my_fragment.xml
  24. 2
      app/src/main/res/layout/main/layout/forum/layout/forum_new_fragment.xml
  25. 4
      app/src/main/res/navigation/forum_navigation.xml
  26. 4
      app/src/main/res/values-en-rUS/strings.xml
  27. 4
      app/src/main/res/values-zh-rCN/strings.xml
  28. 4
      app/src/main/res/values/strings.xml

@ -2,7 +2,7 @@ package com.community.pocket.data.main.forum;
import com.community.pocket.R; import com.community.pocket.R;
import com.community.pocket.data.model.ForumHot; import com.community.pocket.data.model.ForumHot;
import com.community.pocket.data.model.ForumHotList; import com.community.pocket.data.model.Hot;
import com.community.pocket.data.model.UserHot; import com.community.pocket.data.model.UserHot;
import com.community.pocket.ui.main.ui.forum.hot.ForumHotResponse; import com.community.pocket.ui.main.ui.forum.hot.ForumHotResponse;
@ -29,25 +29,25 @@ public class ForumHotRequest {
//加载热门信息 //加载热门信息
public ForumHotResponse loadHot() { public ForumHotResponse loadHot() {
List<UserHot> userHots = new ArrayList<>(); List<UserHot> userHots = new ArrayList<>();
List<ForumHotList> topicHots = new ArrayList<>(); List<ForumHot> topicHots = new ArrayList<>();
List<ForumHotList> activeHots = new ArrayList<>(); List<ForumHot> activeHots = new ArrayList<>();
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
UserHot userHot = new UserHot(); UserHot userHot = new UserHot();
userHot.setUserId(i); userHot.setUserId(i);
userHot.setUserName("user" + i); userHot.setUserName("user" + i);
userHots.add(userHot); userHots.add(userHot);
ForumHotList forumHot = new ForumHotList(); ForumHot forumHot = new ForumHot();
forumHot.setForumId(i); forumHot.setForumId(i);
forumHot.setTitle("topIc" + i); forumHot.setTitle("topIc" + i);
topicHots.add(forumHot); topicHots.add(forumHot);
ForumHotList activeHot = new ForumHotList(); ForumHot activeHot = new ForumHot();
activeHot.setForumId(i); activeHot.setForumId(i);
activeHot.setTitle("hot" + i); activeHot.setTitle("hot" + i);
activeHots.add(activeHot); activeHots.add(activeHot);
} }
ForumHotResponse response = new ForumHotResponse(); ForumHotResponse response = new ForumHotResponse();
response.setSuccess(R.string.load_hot_ok); response.setSuccess(R.string.load_hot_ok);
response.setBody(new ForumHot(userHots, topicHots, activeHots)); response.setBody(new Hot(userHots, topicHots, activeHots));
return response; return response;
} }
} }

@ -0,0 +1,48 @@
package com.community.pocket.data.main.forum;
import com.community.pocket.R;
import com.community.pocket.data.model.Forum;
import com.community.pocket.ui.main.ui.forum.my.ForumMyResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* 我的帖子请求接口
* TODO 完善逻辑
*/
public class ForumMyRequest {
private static volatile ForumMyRequest instance;
private ForumMyRequest() {
}
public static ForumMyRequest getInstance() {
if (instance == null) {
instance = new ForumMyRequest();
}
return instance;
}
/**
* @return 加载我的帖子
*/
public ForumMyResponse loadForumMy() {
List<Forum> forumList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
Forum forum = new Forum();
forum.setTitle("标题" + i);
forum.setContent("内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容");
forum.setUsername("发帖人" + i);
forum.setTime(System.currentTimeMillis());
forum.setReply(new Random().nextInt(100));
forumList.add(forum);
}
ForumMyResponse response = new ForumMyResponse();
response.setSuccess(R.string.load_forum_my_ok);
response.setBody(forumList);
return response;
}
}

@ -0,0 +1,44 @@
package com.community.pocket.data.main.forum;
import com.community.pocket.R;
import com.community.pocket.data.model.Forum;
import com.community.pocket.ui.main.ui.forum.news.ForumNewResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* 最新帖子列表数据接口
* TODO 完善逻辑
*/
public class ForumNewRequest {
private static volatile ForumNewRequest instance;
private ForumNewRequest() {
}
public static ForumNewRequest getInstance() {
if (instance == null) {
instance = new ForumNewRequest();
}
return instance;
}
public ForumNewResponse loadForumNew() {
List<Forum> forumList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
Forum forum = new Forum();
forum.setTitle("标题" + i);
forum.setContent("内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容");
forum.setUsername("发帖人" + i);
forum.setTime(System.currentTimeMillis());
forum.setReply(new Random().nextInt(100));
forumList.add(forum);
}
ForumNewResponse response = new ForumNewResponse();
response.setSuccess(R.string.load_forum_new_ok);
response.setBody(forumList);
return response;
}
}

@ -0,0 +1,5 @@
package com.community.pocket.data.model;
public abstract class AbstractForumHot {
abstract int getId();
}

@ -0,0 +1,75 @@
package com.community.pocket.data.model;
//帖子简介内容
public class Forum {
//帖子id
private Integer forumId;
//发帖人头像
private String headImg;
//发帖人
private String username;
//发帖时间
private Long time;
//帖子标题
private String title;
//帖子内容
private String content;
//回复数
private Integer reply;
public Integer getForumId() {
return forumId;
}
public void setForumId(Integer forumId) {
this.forumId = forumId;
}
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 Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getReply() {
return reply;
}
public void setReply(Integer reply) {
this.reply = reply;
}
}

@ -1,33 +1,40 @@
package com.community.pocket.data.model; package com.community.pocket.data.model;
import java.util.List; import androidx.annotation.NonNull;
/** /**
* 热门动态实体 * 帖子列表
*/ */
public class ForumHot { public class ForumHot extends AbstractForumHot {
//活跃用户 //论坛ID
private List<UserHot> userHots; private Integer forumId;
//热门动态 //论坛标题
private List<ForumHotList> topicHots; private String title;
//热门活动
private List<ForumHotList> activeHots; public Integer getForumId() {
return forumId;
public ForumHot(List<UserHot> userHots, List<ForumHotList> topicHots, List<ForumHotList> activeHots) { }
this.userHots = userHots;
this.topicHots = topicHots; public void setForumId(Integer forumId) {
this.activeHots = activeHots; this.forumId = forumId;
}
public String getTitle() {
return title;
} }
public List<UserHot> getUserHots() { public void setTitle(String title) {
return userHots; this.title = title;
} }
public List<ForumHotList> getTopicHots() { @NonNull
return topicHots; @Override
public String toString() {
return title;
} }
public List<ForumHotList> getActiveHots() { @Override
return activeHots; int getId() {
return forumId;
} }
} }

@ -1,35 +0,0 @@
package com.community.pocket.data.model;
import androidx.annotation.NonNull;
/**
* 帖子列表
*/
public class ForumHotList {
//论坛ID
private Integer forumId;
//论坛标题
private String title;
public Integer getForumId() {
return forumId;
}
public void setForumId(Integer forumId) {
this.forumId = forumId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@NonNull
@Override
public String toString() {
return title;
}
}

@ -0,0 +1,33 @@
package com.community.pocket.data.model;
import java.util.List;
/**
* 热门动态实体
*/
public class Hot {
//活跃用户
private List<UserHot> userHots;
//热门动态
private List<ForumHot> topicHots;
//热门活动
private List<ForumHot> activeHots;
public Hot(List<UserHot> userHots, List<ForumHot> topicHots, List<ForumHot> activeHots) {
this.userHots = userHots;
this.topicHots = topicHots;
this.activeHots = activeHots;
}
public List<UserHot> getUserHots() {
return userHots;
}
public List<ForumHot> getTopicHots() {
return topicHots;
}
public List<ForumHot> getActiveHots() {
return activeHots;
}
}

@ -5,7 +5,7 @@ import androidx.annotation.NonNull;
/** /**
* 活跃用户 * 活跃用户
*/ */
public class UserHot { public class UserHot extends AbstractForumHot {
//用户ID //用户ID
private Integer userId; private Integer userId;
//用户名 //用户名
@ -32,4 +32,9 @@ public class UserHot {
public String toString() { public String toString() {
return userName; return userName;
} }
@Override
int getId() {
return userId;
}
} }

@ -1,18 +0,0 @@
package com.community.pocket.ui.main.ui.forum;
import android.view.View;
import com.community.pocket.R;
import org.xutils.view.annotation.ContentView;
/**
* 我的帖子
*/
@ContentView(R.layout.forum_my_fragment)
public class ForumMyFragment extends ForumPost {
@Override
int own() {
return View.GONE;
}
}

@ -1,7 +0,0 @@
package com.community.pocket.ui.main.ui.forum;
import androidx.lifecycle.ViewModel;
public class ForumMyViewModel extends ViewModel {
// TODO: Implement the ViewModel
}

@ -1,20 +0,0 @@
package com.community.pocket.ui.main.ui.forum;
import android.view.View;
import com.community.pocket.R;
import org.xutils.view.annotation.ContentView;
/**
* 最新帖子
*/
@ContentView(R.layout.forum_new_fragment)
public class ForumNewFragment extends ForumPost {
@Override
int own() {
return View.VISIBLE;
}
}

@ -1,7 +0,0 @@
package com.community.pocket.ui.main.ui.forum;
import androidx.lifecycle.ViewModel;
public class ForumNewViewModel extends ViewModel {
// TODO: Implement the ViewModel
}

@ -1,8 +1,6 @@
package com.community.pocket.ui.main.ui.forum; package com.community.pocket.ui.main.ui.forum;
import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateFormat; import android.text.format.DateFormat;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -10,56 +8,46 @@ import android.widget.Button;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.community.pocket.R; import com.community.pocket.R;
import com.community.pocket.data.model.Forum;
import com.community.pocket.ui.BaseFragment; import com.community.pocket.ui.BaseFragment;
import com.community.pocket.ui.main.ui.forum.data.ForumDataActivity; import com.community.pocket.ui.main.ui.forum.data.ForumDataActivity;
import com.community.pocket.util.Param; import com.community.pocket.util.Param;
import org.xutils.view.annotation.ViewInject; import org.xutils.view.annotation.ViewInject;
import java.util.Date; import java.util.List;
public abstract class ForumPost extends BaseFragment { public abstract class ForumPost extends BaseFragment {
abstract int own(); protected abstract int own();
@ViewInject(R.id.post_layout) @ViewInject(R.id.post_layout)
private LinearLayout layout; private LinearLayout layout;
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
loadPost(view);
}
/** /**
* 加载帖子数据 * 加载帖子数据
* TODO 测试数据
*/ */
@SuppressLint("SetTextI18n") protected void loadPost(List<Forum> forumList) {
private void loadPost(View view) {
for (int i = 0; i < forumList.size(); i++) {
Forum forum = forumList.get(i);
for (int i = 0; i < 10; i++) {
View childView = View.inflate(getContext(), R.layout.post, null); View childView = View.inflate(getContext(), R.layout.post, null);
TextView title = childView.findViewById(R.id.post_title); TextView title = childView.findViewById(R.id.post_title);
title.setText("标题" + i); title.setText(forum.getTitle());
TextView content = childView.findViewById(R.id.post_content); TextView content = childView.findViewById(R.id.post_content);
content.setText("内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容" + i); content.setText(forum.getContent());
TextView author = childView.findViewById(R.id.poster); TextView author = childView.findViewById(R.id.poster);
author.setVisibility(own()); author.setVisibility(own());
author.setText(getString(R.string.poster, "发帖人" + i)); author.setText(getString(R.string.poster, forum.getUsername()));
TextView postReply = childView.findViewById(R.id.post_reply); TextView postReply = childView.findViewById(R.id.post_reply);
postReply.setText(getString(R.string.post_reply, 0)); postReply.setText(getString(R.string.post_reply, forum.getReply()));
TextView time = childView.findViewById(R.id.post_time); TextView time = childView.findViewById(R.id.post_time);
Date date = new Date(); time.setText(getString(R.string.post_time, DateFormat.format(getString(R.string.dateformat), forum.getTime())));
date.setTime(System.currentTimeMillis());
time.setText(getString(R.string.post_time, DateFormat.format(getString(R.string.dateformat), date)));
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
layoutParams.setMargins(0, 0, 0, 50); layoutParams.setMargins(0, 0, 0, 50);
childView.setLayoutParams(layoutParams); childView.setLayoutParams(layoutParams);

@ -15,7 +15,8 @@ import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.community.pocket.R; import com.community.pocket.R;
import com.community.pocket.data.model.ForumHot; import com.community.pocket.data.model.AbstractForumHot;
import com.community.pocket.data.model.Hot;
import com.community.pocket.ui.BaseFragment; import com.community.pocket.ui.BaseFragment;
import org.xutils.view.annotation.ContentView; import org.xutils.view.annotation.ContentView;
@ -55,12 +56,12 @@ public class ForumHotFragment extends BaseFragment {
/** /**
* 加载热门信息 * 加载热门信息
* *
* @param forumHot 热门信息 * @param hot 热门信息
*/ */
private void loadRank(ForumHot forumHot) { private void loadRank(Hot hot) {
addRank(R.id.active_user, R.id.active_user_text, forumHot.getUserHots()); addRank(R.id.active_user, R.id.active_user_text, hot.getUserHots());
addRank(R.id.hot_topic, R.id.hot_topic_text, forumHot.getTopicHots()); addRank(R.id.hot_topic, R.id.hot_topic_text, hot.getTopicHots());
addRank(R.id.hot_events, R.id.hot_events_text, forumHot.getActiveHots()); addRank(R.id.hot_events, R.id.hot_events_text, hot.getActiveHots());
} }
/** /**
@ -68,7 +69,7 @@ public class ForumHotFragment extends BaseFragment {
* @param textId 标题布局id * @param textId 标题布局id
* @param ranks 排名数组 * @param ranks 排名数组
*/ */
private void addRank(@IdRes int constraintId, @IdRes int textId, List ranks) { private <T extends AbstractForumHot> void addRank(@IdRes int constraintId, @IdRes int textId, List<T> ranks) {
View view = getView(); View view = getView();
if (view != null) { if (view != null) {

@ -1,7 +1,7 @@
package com.community.pocket.ui.main.ui.forum.hot; package com.community.pocket.ui.main.ui.forum.hot;
import com.community.pocket.data.model.ForumHot; import com.community.pocket.data.model.Hot;
import com.community.pocket.ui.main.ui.share.Response; import com.community.pocket.ui.main.ui.share.Response;
public class ForumHotResponse extends Response<ForumHot> { public class ForumHotResponse extends Response<Hot> {
} }

@ -0,0 +1,54 @@
package com.community.pocket.ui.main.ui.forum.my;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.community.pocket.R;
import com.community.pocket.ui.main.ui.forum.ForumPost;
import org.xutils.view.annotation.ContentView;
/**
* 我的帖子
*/
@ContentView(R.layout.forum_my_fragment)
public class ForumMyFragment extends ForumPost {
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ForumMyViewModel viewModel = new ViewModelProvider(this, new ViewModelProvider.NewInstanceFactory()).get(ForumMyViewModel.class);
viewModel.loadForumMy();
//监听我的帖子加载状态
viewModel.getForumMyResponse().observe(getViewLifecycleOwner(), new Observer<ForumMyResponse>() {
@Override
public void onChanged(ForumMyResponse forumMyResponse) {
if (forumMyResponse == null) {
return;
}
if (forumMyResponse.getSuccess() != null) {
loadPost(forumMyResponse.getBody());
}
if (forumMyResponse.getError() != null) {
Toast.makeText(getContext(), forumMyResponse.getError(), Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
protected int own() {
return View.GONE;
}
}

@ -0,0 +1,9 @@
package com.community.pocket.ui.main.ui.forum.my;
import com.community.pocket.data.model.Forum;
import com.community.pocket.ui.main.ui.share.Response;
import java.util.List;
public class ForumMyResponse extends Response<List<Forum>> {
}

@ -0,0 +1,27 @@
package com.community.pocket.ui.main.ui.forum.my;
import androidx.lifecycle.MutableLiveData;
import com.community.pocket.data.main.forum.ForumMyRequest;
import com.community.pocket.ui.main.ui.share.BaseViewModel;
//我的帖子UI数据管理
public class ForumMyViewModel extends BaseViewModel<ForumMyRequest> {
//我的帖子请求状态
private MutableLiveData<ForumMyResponse> forumMyResponse = new MutableLiveData<>();
MutableLiveData<ForumMyResponse> getForumMyResponse() {
return forumMyResponse;
}
void loadForumMy() {
ForumMyResponse response = getRequest().loadForumMy();
forumMyResponse.setValue(response);
}
@Override
protected ForumMyRequest getRequest() {
return ForumMyRequest.getInstance();
}
}

@ -0,0 +1,54 @@
package com.community.pocket.ui.main.ui.forum.news;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.community.pocket.R;
import com.community.pocket.ui.main.ui.forum.ForumPost;
import org.xutils.view.annotation.ContentView;
/**
* 最新帖子
*/
@ContentView(R.layout.forum_new_fragment)
public class ForumNewFragment extends ForumPost {
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ForumNewViewModel viewModel = new ViewModelProvider(this, new ViewModelProvider.NewInstanceFactory()).get(ForumNewViewModel.class);
viewModel.loadForumNew();
//监听最新帖子请求状态
viewModel.getForumNewResponse().observe(getViewLifecycleOwner(), new Observer<ForumNewResponse>() {
@Override
public void onChanged(ForumNewResponse forumNewResponse) {
if (forumNewResponse == null) {
return;
}
if (forumNewResponse.getSuccess() != null) {
loadPost(forumNewResponse.getBody());
}
if (forumNewResponse.getError() != null) {
Toast.makeText(getContext(), forumNewResponse.getError(), Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
protected int own() {
return View.VISIBLE;
}
}

@ -0,0 +1,13 @@
package com.community.pocket.ui.main.ui.forum.news;
import com.community.pocket.data.model.Forum;
import com.community.pocket.ui.main.ui.share.Response;
import java.util.List;
/**
* 最新帖子响应实体
*/
public class ForumNewResponse extends Response<List<Forum>> {
}

@ -0,0 +1,29 @@
package com.community.pocket.ui.main.ui.forum.news;
import androidx.lifecycle.MutableLiveData;
import com.community.pocket.data.main.forum.ForumNewRequest;
import com.community.pocket.ui.main.ui.share.BaseViewModel;
/**
* 最新帖子
*/
public class ForumNewViewModel extends BaseViewModel<ForumNewRequest> {
//最新帖子请求状态
private MutableLiveData<ForumNewResponse> forumNewResponse = new MutableLiveData<>();
MutableLiveData<ForumNewResponse> getForumNewResponse() {
return forumNewResponse;
}
void loadForumNew() {
ForumNewResponse response = getRequest().loadForumNew();
forumNewResponse.setValue(response);
}
@Override
protected ForumNewRequest getRequest() {
return ForumNewRequest.getInstance();
}
}

@ -3,7 +3,7 @@
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.main.ui.forum.ForumMyFragment"> tools:context=".ui.main.ui.forum.my.ForumMyFragment">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"

@ -3,7 +3,7 @@
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.main.ui.forum.ForumNewFragment"> tools:context=".ui.main.ui.forum.news.ForumNewFragment">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"

@ -13,7 +13,7 @@
tools:layout="@layout/forum_hot_fragment" /> tools:layout="@layout/forum_hot_fragment" />
<fragment <fragment
android:id="@+id/forumNewFragment" android:id="@+id/forumNewFragment"
android:name="com.community.pocket.ui.main.ui.forum.ForumNewFragment" android:name="com.community.pocket.ui.main.ui.forum.news.ForumNewFragment"
android:label="forum_new_fragment" android:label="forum_new_fragment"
tools:layout="@layout/forum_new_fragment" /> tools:layout="@layout/forum_new_fragment" />
<fragment <fragment
@ -23,7 +23,7 @@
tools:layout="@layout/forum_post_fragment" /> tools:layout="@layout/forum_post_fragment" />
<fragment <fragment
android:id="@+id/forumMyFragment" android:id="@+id/forumMyFragment"
android:name="com.community.pocket.ui.main.ui.forum.ForumMyFragment" android:name="com.community.pocket.ui.main.ui.forum.my.ForumMyFragment"
android:label="forum_my_fragment" android:label="forum_my_fragment"
tools:layout="@layout/forum_my_fragment" /> tools:layout="@layout/forum_my_fragment" />
</navigation> </navigation>

@ -143,4 +143,8 @@
<string name="load_notice_fail">load notice fail</string> <string name="load_notice_fail">load notice fail</string>
<string name="load_hot_ok">load hot success</string> <string name="load_hot_ok">load hot success</string>
<string name="load_hot_fail">load hot fail</string> <string name="load_hot_fail">load hot fail</string>
<string name="load_forum_new_ok">load new success</string>
<string name="load_forum_new_fail">load new fail</string>
<string name="load_forum_my_ok">load forum my success</string>
<string name="load_forum_my_fail">load my forum fail</string>
</resources> </resources>

@ -143,4 +143,8 @@
<string name="load_notice_fail">加载公告信息失败</string> <string name="load_notice_fail">加载公告信息失败</string>
<string name="load_hot_ok">加载热门信息成功</string> <string name="load_hot_ok">加载热门信息成功</string>
<string name="load_hot_fail">加载热门信息失败</string> <string name="load_hot_fail">加载热门信息失败</string>
<string name="load_forum_new_ok">加载最新帖子成功</string>
<string name="load_forum_new_fail">加载最新帖子失败</string>
<string name="load_forum_my_ok">加载我的帖子成功</string>
<string name="load_forum_my_fail">加载我的帖子失败</string>
</resources> </resources>

@ -144,6 +144,10 @@
<string name="load_notice_fail">load notice fail</string> <string name="load_notice_fail">load notice fail</string>
<string name="load_hot_ok">load hot success</string> <string name="load_hot_ok">load hot success</string>
<string name="load_hot_fail">load hot fail</string> <string name="load_hot_fail">load hot fail</string>
<string name="load_forum_new_ok">load new success</string>
<string name="load_forum_new_fail">load new fail</string>
<string name="load_forum_my_ok">load forum my success</string>
<string name="load_forum_my_fail">load my forum fail</string>
<!-- Strings used for fragments for navigation --> <!-- Strings used for fragments for navigation -->
<!-- Strings used for fragments for navigation --> <!-- Strings used for fragments for navigation -->

Loading…
Cancel
Save