diff --git a/app/src/main/java/com/community/pocket/ui/main/MainFragment.java b/app/src/main/java/com/community/pocket/ui/main/MainFragment.java
index 3e78a2a..354e61d 100644
--- a/app/src/main/java/com/community/pocket/ui/main/MainFragment.java
+++ b/app/src/main/java/com/community/pocket/ui/main/MainFragment.java
@@ -5,7 +5,6 @@ import android.view.View;
import android.widget.Button;
import androidx.annotation.RequiresApi;
-import androidx.core.content.ContextCompat;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
@@ -38,17 +37,17 @@ public abstract class MainFragment extends BaseFragment {
/**
* 点击按钮改变字体颜色
*/
- @RequiresApi(api = Build.VERSION_CODES.KITKAT)
protected void changeColor(View view) {
- int color = ContextCompat.getColor(requireContext(), R.color.button_unchecked);
- for (int id : buttonIds()) {
- View v = requireActivity().findViewById(id);
- v.setBackgroundColor(color);
- }
-
- if (view instanceof Button) {
- Button button = (Button) view;
- button.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.colorAccent));
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
+ for (int id : buttonIds()) {
+ Button button = requireActivity().findViewById(id);
+ button.setTextAppearance(R.style.Button_unselect);
+ }
+
+ if (view instanceof Button) {
+ Button button = (Button) view;
+ button.setTextAppearance(R.style.Button_select);
+ }
}
}
diff --git a/app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumPost.java b/app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumPost.java
index b1ef71c..aa7b105 100644
--- a/app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumPost.java
+++ b/app/src/main/java/com/community/pocket/ui/main/ui/forum/ForumPost.java
@@ -20,6 +20,7 @@ import androidx.lifecycle.MutableLiveData;
import com.community.pocket.R;
import com.community.pocket.data.main.info.InfoRequest;
import com.community.pocket.data.model.Forum;
+import com.community.pocket.data.model.ForumStatus;
import com.community.pocket.data.model.Page;
import com.community.pocket.ui.BaseFragment;
import com.community.pocket.ui.main.ui.forum.data.ForumDataActivity;
@@ -55,7 +56,7 @@ public abstract class ForumPost extends BaseFragment {
for (int i = 0; i < forumList.getList().size(); i++) {
final Forum forum = forumList.getList().get(i);
- View childView = View.inflate(getContext(), R.layout.post, null);
+ View childView = View.inflate(getContext(), R.layout.forum_list, null);
TextView status = childView.findViewById(R.id.check_status);
status.setVisibility(showStatus());
switch (forum.getStatus()) {
@@ -95,11 +96,15 @@ public abstract class ForumPost extends BaseFragment {
//打开帖子
Button button = childView.findViewById(R.id.showAll);
- button.setOnClickListener(v -> {
- Intent intent = new Intent(getContext(), ForumDataActivity.class);
- intent.putExtra(Param.forumId.name(), forum.getId());
- startActivityForResult(intent, 1);
- });
+ if (forum.getStatus() == ForumStatus.ok) {
+ button.setOnClickListener(v -> {
+ Intent intent = new Intent(getContext(), ForumDataActivity.class);
+ intent.putExtra(Param.forumId.name(), forum.getId());
+ startActivityForResult(intent, 1);
+ });
+ } else {
+ button.setVisibility(View.GONE);
+ }
layout.addView(childView);
diff --git a/app/src/main/res/layout/main/layout/forum/layout/form_titlebar.xml b/app/src/main/res/layout/main/layout/forum/layout/form_titlebar.xml
index 1f0cf71..14b2bb3 100644
--- a/app/src/main/res/layout/main/layout/forum/layout/form_titlebar.xml
+++ b/app/src/main/res/layout/main/layout/forum/layout/form_titlebar.xml
@@ -7,11 +7,10 @@
diff --git a/app/src/main/res/layout/main/layout/forum/layout/forum_data_content.xml b/app/src/main/res/layout/main/layout/forum/layout/forum_data_content.xml
index 55fad85..832c8a2 100644
--- a/app/src/main/res/layout/main/layout/forum/layout/forum_data_content.xml
+++ b/app/src/main/res/layout/main/layout/forum/layout/forum_data_content.xml
@@ -62,17 +62,6 @@
app:layout_constraintStart_toEndOf="@+id/headimg"
app:layout_constraintTop_toBottomOf="@id/time" />
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent">
+ android:layout_height="wrap_content">
diff --git a/app/src/main/res/layout/main/layout/visitor/layout/visitor.xml b/app/src/main/res/layout/main/layout/visitor/layout/visitor.xml
index b9896ef..2bebabf 100644
--- a/app/src/main/res/layout/main/layout/visitor/layout/visitor.xml
+++ b/app/src/main/res/layout/main/layout/visitor/layout/visitor.xml
@@ -32,7 +32,6 @@
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/colorAccent"
app:defaultNavHost="true"
app:navGraph="@navigation/visitor_navigation" />
diff --git a/app/src/main/res/layout/main/layout/visitor/layout/visitor_appointment_fragment.xml b/app/src/main/res/layout/main/layout/visitor/layout/visitor_appointment_fragment.xml
index a727077..873b0b5 100644
--- a/app/src/main/res/layout/main/layout/visitor/layout/visitor_appointment_fragment.xml
+++ b/app/src/main/res/layout/main/layout/visitor/layout/visitor_appointment_fragment.xml
@@ -124,6 +124,7 @@
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 624d4a9..fbf0472 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -6,4 +6,10 @@
#000000
#00BCD4
#FFEB3B
+
+
+ #2d87d2
+
+
+ #FFFFFF
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index d6e55c5..1f3fe55 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,40 +1,28 @@
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-