feat: 增加本吧信息入口
This commit is contained in:
parent
b91c8ab99a
commit
ef17d8c675
|
|
@ -230,7 +230,15 @@
|
||||||
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||||
android:theme="@style/AppTheme.Intro"
|
android:theme="@style/AppTheme.Intro"
|
||||||
android:windowSoftInputMode="adjustResize" />
|
android:windowSoftInputMode="adjustResize" />
|
||||||
<activity android:name=".activities.TranslucentThemeActivity" />
|
<activity
|
||||||
|
android:name=".activities.TranslucentThemeActivity"
|
||||||
|
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||||
|
android:windowSoftInputMode="adjustResize" />
|
||||||
|
<activity
|
||||||
|
android:name=".activities.ForumInfoActivity"
|
||||||
|
android:label="@string/title_forum_info"
|
||||||
|
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||||
|
android:windowSoftInputMode="adjustResize" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.yalantis.ucrop.UCropActivity"
|
android:name="com.yalantis.ucrop.UCropActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
|
|
||||||
|
|
@ -308,6 +308,9 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener,
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
|
R.id.menu_forum_info -> {
|
||||||
|
ForumInfoActivity.launch(this, forumName ?: "")
|
||||||
|
}
|
||||||
R.id.menu_unfollow -> {
|
R.id.menu_unfollow -> {
|
||||||
if (mDataBean != null) {
|
if (mDataBean != null) {
|
||||||
DialogUtil.build(this@ForumActivity)
|
DialogUtil.build(this@ForumActivity)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.huanchengfly.tieba.post.activities
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.appcompat.widget.Toolbar
|
||||||
|
import butterknife.BindView
|
||||||
|
import com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
|
import com.huanchengfly.tieba.post.R
|
||||||
|
import com.huanchengfly.tieba.post.fragments.ForumInfoFragment
|
||||||
|
import com.huanchengfly.tieba.post.goToActivity
|
||||||
|
import com.huanchengfly.tieba.post.utils.ThemeUtil
|
||||||
|
|
||||||
|
class ForumInfoActivity : BaseActivity() {
|
||||||
|
@BindView(R.id.toolbar)
|
||||||
|
lateinit var toolbar: Toolbar
|
||||||
|
|
||||||
|
@BindView(R.id.collapsing_toolbar)
|
||||||
|
lateinit var collapsingToolbar: CollapsingToolbarLayout
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
ThemeUtil.setTranslucentThemeBackground(findViewById(R.id.background))
|
||||||
|
setSupportActionBar(toolbar)
|
||||||
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
supportActionBar?.title = title
|
||||||
|
collapsingToolbar.title = title
|
||||||
|
|
||||||
|
val forumName = intent.getStringExtra(EXTRA_FORUM_NAME)
|
||||||
|
if (forumName.isNullOrEmpty()) {
|
||||||
|
finish()
|
||||||
|
} else {
|
||||||
|
supportFragmentManager.beginTransaction()
|
||||||
|
.replace(R.id.container, ForumInfoFragment.newInstance(forumName), "ForumInfoFragment")
|
||||||
|
.commit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getLayoutId(): Int {
|
||||||
|
return R.layout.activity_forum_info
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val EXTRA_FORUM_NAME = "forum_name"
|
||||||
|
|
||||||
|
fun launch(
|
||||||
|
context: Context,
|
||||||
|
forumName: String
|
||||||
|
) {
|
||||||
|
context.goToActivity<ForumInfoActivity> {
|
||||||
|
putExtra(EXTRA_FORUM_NAME, forumName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -67,10 +67,12 @@ public class ForumInfoFragment extends BaseFragment implements Refreshable, Scro
|
||||||
View mManagersView;
|
View mManagersView;
|
||||||
@BindView(R.id.friend_forums_view)
|
@BindView(R.id.friend_forums_view)
|
||||||
RecyclerView friendForumsRecyclerView;
|
RecyclerView friendForumsRecyclerView;
|
||||||
|
@BindView(R.id.refresh)
|
||||||
|
SwipeRefreshLayout mRefreshLayout;
|
||||||
|
|
||||||
private String forumName;
|
private String forumName;
|
||||||
private ForumPageBean mDataBean;
|
private ForumPageBean mDataBean;
|
||||||
private View content;
|
private View content;
|
||||||
private SwipeRefreshLayout mRefreshLayout;
|
|
||||||
|
|
||||||
public ForumInfoFragment() {
|
public ForumInfoFragment() {
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +116,6 @@ public class ForumInfoFragment extends BaseFragment implements Refreshable, Scro
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
mRefreshLayout = (SwipeRefreshLayout) view;
|
|
||||||
ThemeUtil.setThemeForSwipeRefreshLayout(mRefreshLayout);
|
ThemeUtil.setThemeForSwipeRefreshLayout(mRefreshLayout);
|
||||||
mRefreshLayout.setOnRefreshListener(this::refresh);
|
mRefreshLayout.setOnRefreshListener(this::refresh);
|
||||||
content = view.findViewById(R.id.content);
|
content = view.findViewById(R.id.content);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<com.huanchengfly.tieba.post.widgets.theme.TintCoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:backgroundTint="@color/default_color_window_background"
|
||||||
|
android:id="@+id/background"
|
||||||
|
tools:context=".activities.ForumInfoActivity">
|
||||||
|
|
||||||
|
<include layout="@layout/layout_new_appbar" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
</com.huanchengfly.tieba.post.widgets.theme.TintCoordinatorLayout>
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/refresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,5 @@
|
||||||
android:stateListAnimator="@animator/appbar_elevation">
|
android:stateListAnimator="@animator/appbar_elevation">
|
||||||
|
|
||||||
<include layout="@layout/layout_new_toolbar" />
|
<include layout="@layout/layout_new_toolbar" />
|
||||||
|
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintAppBarLayout>
|
</com.huanchengfly.tieba.post.widgets.theme.TintAppBarLayout>
|
||||||
|
|
@ -25,13 +25,18 @@
|
||||||
android:title="@string/title_unfollow"
|
android:title="@string/title_unfollow"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_refresh"
|
android:id="@+id/menu_forum_info"
|
||||||
android:orderInCategory="4"
|
android:orderInCategory="4"
|
||||||
|
android:title="@string/title_forum_info"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_refresh"
|
||||||
|
android:orderInCategory="5"
|
||||||
android:title="@string/title_refresh"
|
android:title="@string/title_refresh"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_exit"
|
android:id="@+id/menu_exit"
|
||||||
android:orderInCategory="5"
|
android:orderInCategory="6"
|
||||||
android:title="@string/sidebar_exit"
|
android:title="@string/sidebar_exit"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
@ -445,4 +445,5 @@
|
||||||
<string name="text_please_wait">请稍候……</string>
|
<string name="text_please_wait">请稍候……</string>
|
||||||
<string name="title_fetching_forum_list">正在获取吧列表</string>
|
<string name="title_fetching_forum_list">正在获取吧列表</string>
|
||||||
<string name="text_oksign_no_signable">没有可签到的吧</string>
|
<string name="text_oksign_no_signable">没有可签到的吧</string>
|
||||||
|
<string name="title_forum_info">关于本吧</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue