缘池,和许愿树的内容
This commit is contained in:
parent
b97c82899f
commit
3e90031acf
|
|
@ -261,9 +261,6 @@ public class LiveRoomController {
|
||||||
|
|
||||||
// ========== 关注主播接口 ==========
|
// ========== 关注主播接口 ==========
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private com.zbkj.service.service.FollowRecordService followRecordService;
|
|
||||||
|
|
||||||
@ApiOperation(value = "开始直播")
|
@ApiOperation(value = "开始直播")
|
||||||
@PostMapping("/room/{id}/start")
|
@PostMapping("/room/{id}/start")
|
||||||
public CommonResult<Map<String, Object>> startLive(@PathVariable Integer id) {
|
public CommonResult<Map<String, Object>> startLive(@PathVariable Integer id) {
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@ package com.example.livestreaming;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityDrawGuessBinding;
|
import com.example.livestreaming.databinding.ActivityDrawGuessBinding;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class DrawGuessActivity extends AppCompatActivity {
|
public class DrawGuessActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String CATEGORY = "你画我猜";
|
||||||
private ActivityDrawGuessBinding binding;
|
private ActivityDrawGuessBinding binding;
|
||||||
|
private PostAdapter postAdapter;
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, DrawGuessActivity.class);
|
Intent intent = new Intent(context, DrawGuessActivity.class);
|
||||||
|
|
@ -25,15 +31,29 @@ public class DrawGuessActivity extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
setupRecyclerView();
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUI() {
|
private void setupUI() {
|
||||||
binding.backButton.setOnClickListener(v -> finish());
|
binding.backButton.setOnClickListener(v -> finish());
|
||||||
|
|
||||||
|
binding.fabPublish.setOnClickListener(v -> {
|
||||||
|
PublishPostHelper.showPublishDialog(this, CATEGORY, new PublishPostHelper.PublishCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Post post) {
|
||||||
|
postAdapter.addPost(post);
|
||||||
|
binding.recyclerPosts.scrollToPosition(0);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||||||
|
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNavigation);
|
UnreadMessageManager.updateBadge(bottomNavigation);
|
||||||
|
|
||||||
bottomNavigation.setOnItemSelectedListener(item -> {
|
bottomNavigation.setOnItemSelectedListener(item -> {
|
||||||
|
|
@ -61,6 +81,28 @@ public class DrawGuessActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
postAdapter = new PostAdapter();
|
||||||
|
binding.recyclerPosts.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.recyclerPosts.setAdapter(postAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPosts() {
|
||||||
|
List<Post> posts = PostManager.getPostsByCategory(this, CATEGORY);
|
||||||
|
postAdapter.setPosts(posts);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEmptyView() {
|
||||||
|
if (postAdapter.getItemCount() == 0) {
|
||||||
|
binding.emptyView.setVisibility(View.VISIBLE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyView.setVisibility(View.GONE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
@ -68,9 +110,8 @@ public class DrawGuessActivity extends AppCompatActivity {
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNav.setSelectedItemId(R.id.nav_friends);
|
bottomNav.setSelectedItemId(R.id.nav_friends);
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@ package com.example.livestreaming;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityFindGameBinding;
|
import com.example.livestreaming.databinding.ActivityFindGameBinding;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class FindGameActivity extends AppCompatActivity {
|
public class FindGameActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String CATEGORY = "找人玩游戏";
|
||||||
private ActivityFindGameBinding binding;
|
private ActivityFindGameBinding binding;
|
||||||
|
private PostAdapter postAdapter;
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, FindGameActivity.class);
|
Intent intent = new Intent(context, FindGameActivity.class);
|
||||||
|
|
@ -25,15 +31,29 @@ public class FindGameActivity extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
setupRecyclerView();
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUI() {
|
private void setupUI() {
|
||||||
binding.backButton.setOnClickListener(v -> finish());
|
binding.backButton.setOnClickListener(v -> finish());
|
||||||
|
|
||||||
|
binding.fabPublish.setOnClickListener(v -> {
|
||||||
|
PublishPostHelper.showPublishDialog(this, CATEGORY, new PublishPostHelper.PublishCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Post post) {
|
||||||
|
postAdapter.addPost(post);
|
||||||
|
binding.recyclerPosts.scrollToPosition(0);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||||||
|
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNavigation);
|
UnreadMessageManager.updateBadge(bottomNavigation);
|
||||||
|
|
||||||
bottomNavigation.setOnItemSelectedListener(item -> {
|
bottomNavigation.setOnItemSelectedListener(item -> {
|
||||||
|
|
@ -61,6 +81,28 @@ public class FindGameActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
postAdapter = new PostAdapter();
|
||||||
|
binding.recyclerPosts.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.recyclerPosts.setAdapter(postAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPosts() {
|
||||||
|
List<Post> posts = PostManager.getPostsByCategory(this, CATEGORY);
|
||||||
|
postAdapter.setPosts(posts);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEmptyView() {
|
||||||
|
if (postAdapter.getItemCount() == 0) {
|
||||||
|
binding.emptyView.setVisibility(View.VISIBLE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyView.setVisibility(View.GONE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
@ -68,9 +110,8 @@ public class FindGameActivity extends AppCompatActivity {
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNav.setSelectedItemId(R.id.nav_friends);
|
bottomNav.setSelectedItemId(R.id.nav_friends);
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@ package com.example.livestreaming;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityKtvTogetherBinding;
|
import com.example.livestreaming.databinding.ActivityKtvTogetherBinding;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class KTVTogetherActivity extends AppCompatActivity {
|
public class KTVTogetherActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String CATEGORY = "一起KTV";
|
||||||
private ActivityKtvTogetherBinding binding;
|
private ActivityKtvTogetherBinding binding;
|
||||||
|
private PostAdapter postAdapter;
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, KTVTogetherActivity.class);
|
Intent intent = new Intent(context, KTVTogetherActivity.class);
|
||||||
|
|
@ -25,15 +31,29 @@ public class KTVTogetherActivity extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
setupRecyclerView();
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUI() {
|
private void setupUI() {
|
||||||
binding.backButton.setOnClickListener(v -> finish());
|
binding.backButton.setOnClickListener(v -> finish());
|
||||||
|
|
||||||
|
binding.fabPublish.setOnClickListener(v -> {
|
||||||
|
PublishPostHelper.showPublishDialog(this, CATEGORY, new PublishPostHelper.PublishCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Post post) {
|
||||||
|
postAdapter.addPost(post);
|
||||||
|
binding.recyclerPosts.scrollToPosition(0);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||||||
|
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNavigation);
|
UnreadMessageManager.updateBadge(bottomNavigation);
|
||||||
|
|
||||||
bottomNavigation.setOnItemSelectedListener(item -> {
|
bottomNavigation.setOnItemSelectedListener(item -> {
|
||||||
|
|
@ -61,6 +81,28 @@ public class KTVTogetherActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
postAdapter = new PostAdapter();
|
||||||
|
binding.recyclerPosts.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.recyclerPosts.setAdapter(postAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPosts() {
|
||||||
|
List<Post> posts = PostManager.getPostsByCategory(this, CATEGORY);
|
||||||
|
postAdapter.setPosts(posts);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEmptyView() {
|
||||||
|
if (postAdapter.getItemCount() == 0) {
|
||||||
|
binding.emptyView.setVisibility(View.VISIBLE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyView.setVisibility(View.GONE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
@ -68,9 +110,8 @@ public class KTVTogetherActivity extends AppCompatActivity {
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNav.setSelectedItemId(R.id.nav_friends);
|
bottomNav.setSelectedItemId(R.id.nav_friends);
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@ package com.example.livestreaming;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityOnlineDatingBinding;
|
import com.example.livestreaming.databinding.ActivityOnlineDatingBinding;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class OnlineDatingActivity extends AppCompatActivity {
|
public class OnlineDatingActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String CATEGORY = "在线处对象";
|
||||||
private ActivityOnlineDatingBinding binding;
|
private ActivityOnlineDatingBinding binding;
|
||||||
|
private PostAdapter postAdapter;
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, OnlineDatingActivity.class);
|
Intent intent = new Intent(context, OnlineDatingActivity.class);
|
||||||
|
|
@ -25,11 +31,31 @@ public class OnlineDatingActivity extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
setupRecyclerView();
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUI() {
|
private void setupUI() {
|
||||||
binding.backButton.setOnClickListener(v -> finish());
|
binding.backButton.setOnClickListener(v -> finish());
|
||||||
|
|
||||||
|
// 发布动态按钮
|
||||||
|
binding.fabPublish.setOnClickListener(v -> {
|
||||||
|
PublishPostHelper.showPublishDialog(this, CATEGORY, new PublishPostHelper.PublishCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Post post) {
|
||||||
|
// 发布成功,添加到列表顶部
|
||||||
|
postAdapter.addPost(post);
|
||||||
|
binding.recyclerPosts.scrollToPosition(0);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
// 发布失败
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||||||
|
|
||||||
|
|
@ -61,6 +87,29 @@ public class OnlineDatingActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
postAdapter = new PostAdapter();
|
||||||
|
binding.recyclerPosts.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.recyclerPosts.setAdapter(postAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPosts() {
|
||||||
|
// 加载该分类的动态
|
||||||
|
List<Post> posts = PostManager.getPostsByCategory(this, CATEGORY);
|
||||||
|
postAdapter.setPosts(posts);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEmptyView() {
|
||||||
|
if (postAdapter.getItemCount() == 0) {
|
||||||
|
binding.emptyView.setVisibility(View.VISIBLE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyView.setVisibility(View.GONE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
@ -70,7 +119,8 @@ public class OnlineDatingActivity extends AppCompatActivity {
|
||||||
bottomNav.setSelectedItemId(R.id.nav_friends);
|
bottomNav.setSelectedItemId(R.id.nav_friends);
|
||||||
// 更新未读消息徽章
|
// 更新未读消息徽章
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
// 刷新动态列表
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@ package com.example.livestreaming;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityPeaceEliteBinding;
|
import com.example.livestreaming.databinding.ActivityPeaceEliteBinding;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class PeaceEliteActivity extends AppCompatActivity {
|
public class PeaceEliteActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String CATEGORY = "和平精英";
|
||||||
private ActivityPeaceEliteBinding binding;
|
private ActivityPeaceEliteBinding binding;
|
||||||
|
private PostAdapter postAdapter;
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, PeaceEliteActivity.class);
|
Intent intent = new Intent(context, PeaceEliteActivity.class);
|
||||||
|
|
@ -25,15 +31,29 @@ public class PeaceEliteActivity extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
setupRecyclerView();
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUI() {
|
private void setupUI() {
|
||||||
binding.backButton.setOnClickListener(v -> finish());
|
binding.backButton.setOnClickListener(v -> finish());
|
||||||
|
|
||||||
|
binding.fabPublish.setOnClickListener(v -> {
|
||||||
|
PublishPostHelper.showPublishDialog(this, CATEGORY, new PublishPostHelper.PublishCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Post post) {
|
||||||
|
postAdapter.addPost(post);
|
||||||
|
binding.recyclerPosts.scrollToPosition(0);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||||||
|
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNavigation);
|
UnreadMessageManager.updateBadge(bottomNavigation);
|
||||||
|
|
||||||
bottomNavigation.setOnItemSelectedListener(item -> {
|
bottomNavigation.setOnItemSelectedListener(item -> {
|
||||||
|
|
@ -61,6 +81,28 @@ public class PeaceEliteActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
postAdapter = new PostAdapter();
|
||||||
|
binding.recyclerPosts.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.recyclerPosts.setAdapter(postAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPosts() {
|
||||||
|
List<Post> posts = PostManager.getPostsByCategory(this, CATEGORY);
|
||||||
|
postAdapter.setPosts(posts);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEmptyView() {
|
||||||
|
if (postAdapter.getItemCount() == 0) {
|
||||||
|
binding.emptyView.setVisibility(View.VISIBLE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyView.setVisibility(View.GONE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
@ -68,9 +110,8 @@ public class PeaceEliteActivity extends AppCompatActivity {
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNav.setSelectedItemId(R.id.nav_friends);
|
bottomNav.setSelectedItemId(R.id.nav_friends);
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@ package com.example.livestreaming;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityTableGamesBinding;
|
import com.example.livestreaming.databinding.ActivityTableGamesBinding;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class TableGamesActivity extends AppCompatActivity {
|
public class TableGamesActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String CATEGORY = "桌子游戏";
|
||||||
private ActivityTableGamesBinding binding;
|
private ActivityTableGamesBinding binding;
|
||||||
|
private PostAdapter postAdapter;
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, TableGamesActivity.class);
|
Intent intent = new Intent(context, TableGamesActivity.class);
|
||||||
|
|
@ -25,15 +31,29 @@ public class TableGamesActivity extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
setupUI();
|
setupUI();
|
||||||
|
setupRecyclerView();
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUI() {
|
private void setupUI() {
|
||||||
binding.backButton.setOnClickListener(v -> finish());
|
binding.backButton.setOnClickListener(v -> finish());
|
||||||
|
|
||||||
|
binding.fabPublish.setOnClickListener(v -> {
|
||||||
|
PublishPostHelper.showPublishDialog(this, CATEGORY, new PublishPostHelper.PublishCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Post post) {
|
||||||
|
postAdapter.addPost(post);
|
||||||
|
binding.recyclerPosts.scrollToPosition(0);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
bottomNavigation.setSelectedItemId(R.id.nav_friends);
|
||||||
|
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNavigation);
|
UnreadMessageManager.updateBadge(bottomNavigation);
|
||||||
|
|
||||||
bottomNavigation.setOnItemSelectedListener(item -> {
|
bottomNavigation.setOnItemSelectedListener(item -> {
|
||||||
|
|
@ -61,6 +81,28 @@ public class TableGamesActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
postAdapter = new PostAdapter();
|
||||||
|
binding.recyclerPosts.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.recyclerPosts.setAdapter(postAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPosts() {
|
||||||
|
List<Post> posts = PostManager.getPostsByCategory(this, CATEGORY);
|
||||||
|
postAdapter.setPosts(posts);
|
||||||
|
updateEmptyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEmptyView() {
|
||||||
|
if (postAdapter.getItemCount() == 0) {
|
||||||
|
binding.emptyView.setVisibility(View.VISIBLE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.emptyView.setVisibility(View.GONE);
|
||||||
|
binding.recyclerPosts.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
@ -68,9 +110,8 @@ public class TableGamesActivity extends AppCompatActivity {
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
||||||
bottomNav.setSelectedItemId(R.id.nav_friends);
|
bottomNav.setSelectedItemId(R.id.nav_friends);
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
loadPosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
package com.example.livestreaming;
|
package com.example.livestreaming;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.example.livestreaming.databinding.ActivityWishTreeBinding;
|
import com.example.livestreaming.databinding.ActivityWishTreeBinding;
|
||||||
|
|
@ -20,101 +28,149 @@ import java.util.TimeZone;
|
||||||
public class WishTreeActivity extends AppCompatActivity {
|
public class WishTreeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private ActivityWishTreeBinding binding;
|
private ActivityWishTreeBinding binding;
|
||||||
|
|
||||||
private final Handler handler = new Handler(Looper.getMainLooper());
|
private final Handler handler = new Handler(Looper.getMainLooper());
|
||||||
private Runnable timerRunnable;
|
private Runnable timerRunnable;
|
||||||
|
private SharedPreferences prefs;
|
||||||
|
private String[] wishes = new String[7];
|
||||||
|
|
||||||
public static void start(Context context) {
|
public static void start(Context context) {
|
||||||
Intent intent = new Intent(context, WishTreeActivity.class);
|
context.startActivity(new Intent(context, WishTreeActivity.class));
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
startBannerCountdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
stopBannerCountdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startBannerCountdown() {
|
|
||||||
stopBannerCountdown();
|
|
||||||
timerRunnable = new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateBannerTimer();
|
|
||||||
handler.postDelayed(this, 1000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
handler.post(timerRunnable);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void stopBannerCountdown() {
|
|
||||||
if (timerRunnable != null) {
|
|
||||||
handler.removeCallbacks(timerRunnable);
|
|
||||||
timerRunnable = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateBannerTimer() {
|
|
||||||
if (binding == null) return;
|
|
||||||
try {
|
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
TimeZone tz = TimeZone.getDefault();
|
|
||||||
Calendar c = Calendar.getInstance(tz);
|
|
||||||
c.setTimeInMillis(now);
|
|
||||||
c.set(Calendar.HOUR_OF_DAY, 0);
|
|
||||||
c.set(Calendar.MINUTE, 0);
|
|
||||||
c.set(Calendar.SECOND, 0);
|
|
||||||
c.set(Calendar.MILLISECOND, 0);
|
|
||||||
c.add(Calendar.DAY_OF_MONTH, 1);
|
|
||||||
long nextMidnight = c.getTimeInMillis();
|
|
||||||
long diff = Math.max(0, nextMidnight - now);
|
|
||||||
|
|
||||||
long totalSeconds = diff / 1000;
|
|
||||||
long hours = totalSeconds / 3600;
|
|
||||||
long minutes = (totalSeconds % 3600) / 60;
|
|
||||||
long seconds = totalSeconds % 60;
|
|
||||||
|
|
||||||
SimpleDateFormat fmt = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
|
||||||
fmt.setTimeZone(tz);
|
|
||||||
String current = fmt.format(new Date(now));
|
|
||||||
String remain = String.format(Locale.getDefault(), "%02d:%02d:%02d", hours, minutes, seconds);
|
|
||||||
binding.bannerTimer.setText(current + " " + remain);
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
// TODO: 接入后端接口 - 获取愿望树相关数据
|
|
||||||
// 接口路径: GET /api/wish_tree/info
|
|
||||||
// 请求参数:
|
|
||||||
// - userId: 当前用户ID(从token中获取,可选)
|
|
||||||
// 返回数据格式: ApiResponse<WishTreeInfo>
|
|
||||||
// WishTreeInfo对象应包含: totalWishes, todayWishes, userWishCount, nextResetTime等字段
|
|
||||||
// 用于显示愿望树统计信息和倒计时
|
|
||||||
binding = ActivityWishTreeBinding.inflate(getLayoutInflater());
|
binding = ActivityWishTreeBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
startBannerCountdown();
|
prefs = getSharedPreferences("wishes", MODE_PRIVATE);
|
||||||
|
loadWishes();
|
||||||
|
|
||||||
BottomNavigationView bottomNavigation = binding.bottomNavInclude.bottomNavigation;
|
startBannerCountdown();
|
||||||
bottomNavigation.setSelectedItemId(R.id.nav_wish_tree);
|
setupBottomNav();
|
||||||
|
setupWishCards();
|
||||||
// 更新未读消息徽章
|
setupMakeWishButton();
|
||||||
UnreadMessageManager.updateBadge(bottomNavigation);
|
}
|
||||||
|
|
||||||
bottomNavigation.setOnItemSelectedListener(item -> {
|
private void loadWishes() {
|
||||||
int id = item.getItemId();
|
for (int i = 0; i < 7; i++) {
|
||||||
if (id == R.id.nav_wish_tree) {
|
wishes[i] = prefs.getString("wish_" + i, "");
|
||||||
return true;
|
}
|
||||||
|
updateWishCards();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveWish(int index, String wish) {
|
||||||
|
wishes[index] = wish;
|
||||||
|
prefs.edit().putString("wish_" + index, wish).apply();
|
||||||
|
updateWishCards();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateWishCards() {
|
||||||
|
TextView[] cards = {
|
||||||
|
binding.wishCard1, binding.wishCard2, binding.wishCard3,
|
||||||
|
binding.wishCard4, binding.wishCard5, binding.wishCard6, binding.wishCard7
|
||||||
|
};
|
||||||
|
for (int i = 0; i < cards.length; i++) {
|
||||||
|
if (wishes[i] != null && !wishes[i].isEmpty()) {
|
||||||
|
String text = wishes[i].length() > 8 ? wishes[i].substring(0, 8) + "..." : wishes[i];
|
||||||
|
cards[i].setText(text);
|
||||||
|
} else {
|
||||||
|
cards[i].setText("");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupWishCards() {
|
||||||
|
TextView[] cards = {
|
||||||
|
binding.wishCard1, binding.wishCard2, binding.wishCard3,
|
||||||
|
binding.wishCard4, binding.wishCard5, binding.wishCard6, binding.wishCard7
|
||||||
|
};
|
||||||
|
for (int i = 0; i < cards.length; i++) {
|
||||||
|
final int index = i;
|
||||||
|
cards[i].setOnClickListener(v -> onWishCardClick(index));
|
||||||
|
}
|
||||||
|
binding.addWishCard.setOnClickListener(v -> showMakeWishConfirmDialog(-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onWishCardClick(int index) {
|
||||||
|
if (wishes[index] != null && !wishes[index].isEmpty()) {
|
||||||
|
showViewWishDialog(index);
|
||||||
|
} else {
|
||||||
|
showMakeWishConfirmDialog(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showMakeWishConfirmDialog(int index) {
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle("许愿确认")
|
||||||
|
.setMessage("是否要在这里许下心愿?")
|
||||||
|
.setNegativeButton("取消", null)
|
||||||
|
.setPositiveButton("进行许愿", (d, w) -> showMakeWishInputDialog(index))
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showMakeWishInputDialog(int index) {
|
||||||
|
View view = getLayoutInflater().inflate(R.layout.dialog_make_wish, null);
|
||||||
|
EditText input = view.findViewById(R.id.editWish);
|
||||||
|
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle("写下你的心愿")
|
||||||
|
.setView(view)
|
||||||
|
.setNegativeButton("取消", null)
|
||||||
|
.setPositiveButton("确认", (d, w) -> {
|
||||||
|
String wish = input.getText().toString().trim();
|
||||||
|
if (!wish.isEmpty()) {
|
||||||
|
int saveIndex = index >= 0 ? index : findEmptySlot();
|
||||||
|
if (saveIndex >= 0) {
|
||||||
|
saveWish(saveIndex, wish);
|
||||||
|
showSuccessDialog();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "心愿牌已满", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int findEmptySlot() {
|
||||||
|
for (int i = 0; i < wishes.length; i++) {
|
||||||
|
if (wishes[i] == null || wishes[i].isEmpty()) return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showSuccessDialog() {
|
||||||
|
Dialog dialog = new Dialog(this);
|
||||||
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
dialog.setContentView(R.layout.dialog_wish_success);
|
||||||
|
dialog.show();
|
||||||
|
handler.postDelayed(dialog::dismiss, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showViewWishDialog(int index) {
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle("我的心愿")
|
||||||
|
.setMessage(wishes[index])
|
||||||
|
.setPositiveButton("关闭", null)
|
||||||
|
.setNegativeButton("删除心愿", (d, w) -> {
|
||||||
|
saveWish(index, "");
|
||||||
|
Toast.makeText(this, "心愿已删除", Toast.LENGTH_SHORT).show();
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupMakeWishButton() {
|
||||||
|
binding.btnMakeWish.setOnClickListener(v -> showMakeWishConfirmDialog(-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupBottomNav() {
|
||||||
|
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
||||||
|
bottomNav.setSelectedItemId(R.id.nav_wish_tree);
|
||||||
|
UnreadMessageManager.updateBadge(bottomNav);
|
||||||
|
|
||||||
|
bottomNav.setOnItemSelectedListener(item -> {
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == R.id.nav_wish_tree) return true;
|
||||||
if (id == R.id.nav_home) {
|
if (id == R.id.nav_home) {
|
||||||
startActivity(new Intent(this, MainActivity.class));
|
startActivity(new Intent(this, MainActivity.class));
|
||||||
finish();
|
finish();
|
||||||
|
|
@ -139,14 +195,62 @@ public class WishTreeActivity extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
startBannerCountdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
stopBannerCountdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startBannerCountdown() {
|
||||||
|
stopBannerCountdown();
|
||||||
|
timerRunnable = () -> {
|
||||||
|
updateBannerTimer();
|
||||||
|
handler.postDelayed(timerRunnable, 1000);
|
||||||
|
};
|
||||||
|
handler.post(timerRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopBannerCountdown() {
|
||||||
|
if (timerRunnable != null) {
|
||||||
|
handler.removeCallbacks(timerRunnable);
|
||||||
|
timerRunnable = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateBannerTimer() {
|
||||||
|
if (binding == null) return;
|
||||||
|
try {
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
TimeZone tz = TimeZone.getDefault();
|
||||||
|
Calendar c = Calendar.getInstance(tz);
|
||||||
|
c.setTimeInMillis(now);
|
||||||
|
c.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
c.set(Calendar.MINUTE, 0);
|
||||||
|
c.set(Calendar.SECOND, 0);
|
||||||
|
c.set(Calendar.MILLISECOND, 0);
|
||||||
|
c.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
long diff = Math.max(0, c.getTimeInMillis() - now);
|
||||||
|
long h = diff / 3600000;
|
||||||
|
long m = (diff % 3600000) / 60000;
|
||||||
|
long s = (diff % 60000) / 1000;
|
||||||
|
SimpleDateFormat fmt = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||||
|
fmt.setTimeZone(tz);
|
||||||
|
binding.bannerTimer.setText(fmt.format(new Date(now)) + " " + String.format(Locale.getDefault(), "%02d:%02d:%02d", h, m, s));
|
||||||
|
} catch (Exception ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
BottomNavigationView bottomNav = binding.bottomNavInclude.bottomNavigation;
|
binding.bottomNavInclude.bottomNavigation.setSelectedItemId(R.id.nav_wish_tree);
|
||||||
bottomNav.setSelectedItemId(R.id.nav_wish_tree);
|
UnreadMessageManager.updateBadge(binding.bottomNavInclude.bottomNavigation);
|
||||||
// 更新未读消息徽章
|
|
||||||
UnreadMessageManager.updateBadge(bottomNav);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFFFFF">
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/backButton"
|
android:id="@+id/backButton"
|
||||||
|
|
@ -30,11 +30,12 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/subtitleText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="发挥你的想象力,画出你的创意"
|
android:text="发挥你的想象力,画出你的创意"
|
||||||
android:textColor="#666666"
|
android:textColor="#666666"
|
||||||
|
|
@ -43,6 +44,61 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerPosts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="70dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/ic_chat_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="还没有动态,快来发布第一条吧~"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabPublish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:contentDescription="发布动态"
|
||||||
|
android:src="@drawable/ic_add_24"
|
||||||
|
app:backgroundTint="#9C27B0"
|
||||||
|
app:tint="#FFFFFF"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:elevation="6dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/bottomNavInclude"
|
android:id="@+id/bottomNavInclude"
|
||||||
layout="@layout/include_bottom_nav"
|
layout="@layout/include_bottom_nav"
|
||||||
|
|
@ -53,4 +109,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFFFFF">
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/backButton"
|
android:id="@+id/backButton"
|
||||||
|
|
@ -30,11 +30,12 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/subtitleText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="找到志同道合的游戏伙伴,一起开黑"
|
android:text="找到志同道合的游戏伙伴,一起开黑"
|
||||||
android:textColor="#666666"
|
android:textColor="#666666"
|
||||||
|
|
@ -43,6 +44,61 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerPosts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="70dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/ic_chat_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="还没有动态,快来发布第一条吧~"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabPublish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:contentDescription="发布动态"
|
||||||
|
android:src="@drawable/ic_add_24"
|
||||||
|
app:backgroundTint="#9C27B0"
|
||||||
|
app:tint="#FFFFFF"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:elevation="6dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/bottomNavInclude"
|
android:id="@+id/bottomNavInclude"
|
||||||
layout="@layout/include_bottom_nav"
|
layout="@layout/include_bottom_nav"
|
||||||
|
|
@ -53,4 +109,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFFFFF">
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/backButton"
|
android:id="@+id/backButton"
|
||||||
|
|
@ -30,11 +30,12 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/subtitleText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="和好友一起K歌,享受音乐时光"
|
android:text="和好友一起K歌,享受音乐时光"
|
||||||
android:textColor="#666666"
|
android:textColor="#666666"
|
||||||
|
|
@ -43,6 +44,61 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerPosts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="70dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/ic_chat_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="还没有动态,快来发布第一条吧~"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabPublish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:contentDescription="发布动态"
|
||||||
|
android:src="@drawable/ic_add_24"
|
||||||
|
app:backgroundTint="#9C27B0"
|
||||||
|
app:tint="#FFFFFF"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:elevation="6dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/bottomNavInclude"
|
android:id="@+id/bottomNavInclude"
|
||||||
layout="@layout/include_bottom_nav"
|
layout="@layout/include_bottom_nav"
|
||||||
|
|
@ -53,4 +109,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFFFFF">
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/backButton"
|
android:id="@+id/backButton"
|
||||||
|
|
@ -30,11 +30,12 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/subtitleText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="寻找你的另一半,开启一段美好的缘分"
|
android:text="寻找你的另一半,开启一段美好的缘分"
|
||||||
android:textColor="#666666"
|
android:textColor="#666666"
|
||||||
|
|
@ -43,6 +44,64 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<!-- 动态列表 -->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerPosts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="70dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText" />
|
||||||
|
|
||||||
|
<!-- 空状态提示 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/ic_chat_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="还没有动态,快来发布第一条吧~"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 发布动态按钮 -->
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabPublish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:contentDescription="发布动态"
|
||||||
|
android:src="@drawable/ic_add_24"
|
||||||
|
app:backgroundTint="#9C27B0"
|
||||||
|
app:tint="#FFFFFF"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:elevation="6dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/bottomNavInclude"
|
android:id="@+id/bottomNavInclude"
|
||||||
layout="@layout/include_bottom_nav"
|
layout="@layout/include_bottom_nav"
|
||||||
|
|
@ -53,4 +112,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFFFFF">
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/backButton"
|
android:id="@+id/backButton"
|
||||||
|
|
@ -30,11 +30,12 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/subtitleText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="组队开黑,一起吃鸡"
|
android:text="组队开黑,一起吃鸡"
|
||||||
android:textColor="#666666"
|
android:textColor="#666666"
|
||||||
|
|
@ -43,6 +44,61 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerPosts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="70dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/ic_chat_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="还没有动态,快来发布第一条吧~"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabPublish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:contentDescription="发布动态"
|
||||||
|
android:src="@drawable/ic_add_24"
|
||||||
|
app:backgroundTint="#9C27B0"
|
||||||
|
app:tint="#FFFFFF"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:elevation="6dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/bottomNavInclude"
|
android:id="@+id/bottomNavInclude"
|
||||||
layout="@layout/include_bottom_nav"
|
layout="@layout/include_bottom_nav"
|
||||||
|
|
@ -53,4 +109,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFFFFF">
|
android:background="#F5F5F5">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/backButton"
|
android:id="@+id/backButton"
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="桌子游"
|
android:text="桌子游戏"
|
||||||
android:textColor="#111111"
|
android:textColor="#111111"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|
@ -30,11 +30,12 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
app:layout_constraintTop_toBottomOf="@id/backButton" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/subtitleText"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="经典桌游,欢乐无限"
|
android:text="经典桌游,欢乐无限"
|
||||||
android:textColor="#666666"
|
android:textColor="#666666"
|
||||||
|
|
@ -43,6 +44,61 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
app:layout_constraintTop_toBottomOf="@id/titleText" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerPosts"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="70dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomNavInclude"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/subtitleText">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/ic_chat_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="还没有动态,快来发布第一条吧~"
|
||||||
|
android:textColor="#999999"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fabPublish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:contentDescription="发布动态"
|
||||||
|
android:src="@drawable/ic_add_24"
|
||||||
|
app:backgroundTint="#9C27B0"
|
||||||
|
app:tint="#FFFFFF"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:elevation="6dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/bottomNavInclude"
|
android:id="@+id/bottomNavInclude"
|
||||||
layout="@layout/include_bottom_nav"
|
layout="@layout/include_bottom_nav"
|
||||||
|
|
@ -53,4 +109,3 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white">
|
android:background="#1A0A1E">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/content"
|
android:id="@+id/content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FFF7F7"
|
android:paddingBottom="60dp">
|
||||||
android:paddingBottom="88dp">
|
|
||||||
|
|
||||||
|
<!-- 顶部栏 -->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/topBar"
|
android:id="@+id/topBar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|
@ -46,7 +46,8 @@
|
||||||
android:src="@drawable/ic_search_24"
|
android:src="@drawable/ic_search_24"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/notifyButton"
|
app:layout_constraintEnd_toStartOf="@id/notifyButton"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:tint="#FFFFFF" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/notifyButton"
|
android:id="@+id/notifyButton"
|
||||||
|
|
@ -58,10 +59,12 @@
|
||||||
android:src="@drawable/ic_notifications_24"
|
android:src="@drawable/ic_notifications_24"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:tint="#FFFFFF" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<!-- 活动横幅 -->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/banner"
|
android:id="@+id/banner"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|
@ -105,21 +108,230 @@
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<!-- 许愿树背景图 -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/wishTreeImage"
|
android:id="@+id/wishTreeImage"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="12dp"
|
android:clickable="false"
|
||||||
android:layout_marginStart="0dp"
|
android:focusable="false"
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="Wish Tree"
|
android:contentDescription="Wish Tree"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/wish_tree"
|
android:src="@drawable/wish_tree"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomArea"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/banner" />
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片1 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard1"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="80dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="8sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片2 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard2"
|
||||||
|
android:layout_width="58dp"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
android:layout_marginStart="95dp"
|
||||||
|
android:layout_marginTop="55dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="9sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片3 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard3"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:layout_marginEnd="35dp"
|
||||||
|
android:layout_marginTop="65dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="8sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片4 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard4"
|
||||||
|
android:layout_width="58dp"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
android:layout_marginStart="18dp"
|
||||||
|
android:layout_marginTop="155dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="9sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 添加心愿按钮 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/addWishCard"
|
||||||
|
android:layout_width="62dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_marginEnd="75dp"
|
||||||
|
android:layout_marginTop="130dp"
|
||||||
|
android:background="@drawable/bg_wish_card_add"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="心愿\n+"
|
||||||
|
android:textColor="#FF6D00"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片5 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard5"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
android:layout_marginTop="160dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="8sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片6 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard6"
|
||||||
|
android:layout_width="58dp"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginTop="230dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="9sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 心愿卡片7 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishCard7"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:layout_marginEnd="55dp"
|
||||||
|
android:layout_marginTop="240dp"
|
||||||
|
android:background="@drawable/bg_wish_card"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#5D4037"
|
||||||
|
android:textSize="8sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner" />
|
||||||
|
|
||||||
|
<!-- 树干上的金色竖向文字 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTrunkText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="100dp"
|
||||||
|
android:background="@drawable/bg_trunk_text"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lineSpacingExtra="8dp"
|
||||||
|
android:paddingHorizontal="12dp"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
|
android:text="元\n旦\n许\n愿\n树"
|
||||||
|
android:textColor="#FFD700"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:shadowColor="#000000"
|
||||||
|
android:shadowDx="1"
|
||||||
|
android:shadowDy="1"
|
||||||
|
android:shadowRadius="2"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/bottomArea"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<!-- 底部区域 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bottomArea"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#2D1B36"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingVertical="12dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvWishCount"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="祈愿值:0/100"
|
||||||
|
android:textColor="#FFD54F"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btnMakeWish"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:backgroundTint="#FF6D00"
|
||||||
|
android:text="前往祈愿"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:cornerRadius="24dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<include
|
<include
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user