pref: 移除依赖库 SearchView
This commit is contained in:
parent
4d72b8d8f1
commit
0b954e4f45
|
|
@ -142,7 +142,6 @@ dependencies {
|
|||
implementation 'cn.dreamtobe.kpswitch:library:1.6.2'
|
||||
implementation 'org.litepal.android:kotlin:3.0.0'
|
||||
implementation 'com.github.SheHuan:RecyclerViewAdapter:1.2.6'
|
||||
implementation 'com.lapism:searchview:27.1.1.0.0'
|
||||
implementation 'com.github.lygttpod:SuperTextView:2.1.8'
|
||||
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
|
||||
implementation 'com.bm.photoview:library:1.4.1'
|
||||
|
|
|
|||
|
|
@ -99,10 +99,6 @@
|
|||
android:name=".activities.UserActivity"
|
||||
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".activities.SearchActivity"
|
||||
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".activities.ForumActivity"
|
||||
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ import com.huanchengfly.tieba.post.utils.preload.PreloadUtil
|
|||
import com.huanchengfly.tieba.post.widgets.MyViewPager
|
||||
import com.huanchengfly.tieba.post.widgets.theme.TintProgressBar
|
||||
import com.huanchengfly.tieba.post.widgets.theme.TintToolbar
|
||||
import com.lapism.searchview.widget.SearchView
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
|
@ -90,9 +89,6 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener,
|
|||
lateinit var fab: FloatingActionButton
|
||||
private var historyHelper: HistoryHelper? = null
|
||||
|
||||
@BindView(R.id.toolbar_search_view)
|
||||
lateinit var searchView: SearchView
|
||||
|
||||
@BindView(R.id.loading_view)
|
||||
lateinit var loadingView: View
|
||||
|
||||
|
|
@ -258,7 +254,6 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener,
|
|||
refreshHeaderView()
|
||||
fab.hide()
|
||||
fab.supportImageTintList = ColorStateList.valueOf(resources.getColor(R.color.white))
|
||||
searchView.setHint(getString(R.string.hint_search_in_ba, forumName))
|
||||
setSupportActionBar(toolbar)
|
||||
val actionBar = supportActionBar
|
||||
actionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
|
@ -498,14 +493,10 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener,
|
|||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (searchView.isOpen) {
|
||||
searchView.close()
|
||||
} else {
|
||||
if (Jzvd.backPress()) {
|
||||
return
|
||||
}
|
||||
super.onBackPressed()
|
||||
if (Jzvd.backPress()) {
|
||||
return
|
||||
}
|
||||
super.onBackPressed()
|
||||
}
|
||||
|
||||
override fun onSuccess(forumPageBean: ForumPageBean) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.huanchengfly.tieba.post.activities
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.app.job.JobInfo
|
||||
import android.app.job.JobScheduler
|
||||
import android.content.*
|
||||
|
|
@ -29,7 +28,6 @@ import com.google.android.material.bottomnavigation.BottomNavigationView.OnNavig
|
|||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.huanchengfly.tieba.post.BaseApplication
|
||||
import com.huanchengfly.tieba.post.R
|
||||
import com.huanchengfly.tieba.post.adapters.MainSearchAdapter
|
||||
import com.huanchengfly.tieba.post.adapters.ViewPagerAdapter
|
||||
import com.huanchengfly.tieba.post.api.Error
|
||||
import com.huanchengfly.tieba.post.api.LiteApi.Companion.instance
|
||||
|
|
@ -45,15 +43,12 @@ import com.huanchengfly.tieba.post.getColorCompat
|
|||
import com.huanchengfly.tieba.post.goToActivity
|
||||
import com.huanchengfly.tieba.post.interfaces.Refreshable
|
||||
import com.huanchengfly.tieba.post.models.MyInfoBean
|
||||
import com.huanchengfly.tieba.post.models.database.SearchHistory
|
||||
import com.huanchengfly.tieba.post.services.NotifyJobService
|
||||
import com.huanchengfly.tieba.post.utils.*
|
||||
import com.huanchengfly.tieba.post.widgets.MyViewPager
|
||||
import com.huanchengfly.tieba.post.widgets.theme.TintToolbar
|
||||
import com.lapism.searchview.Search
|
||||
import com.lapism.searchview.widget.SearchView
|
||||
|
||||
open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemSelectedListener, MainSearchAdapter.OnSearchItemClickListener, OnNavigationItemReselectedListener {
|
||||
open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemSelectedListener, OnNavigationItemReselectedListener {
|
||||
var mAdapter: ViewPagerAdapter = ViewPagerAdapter(supportFragmentManager)
|
||||
|
||||
@BindView(R.id.toolbar)
|
||||
|
|
@ -66,8 +61,6 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
lateinit var mBottomNavigationView: BottomNavigationView
|
||||
private var menuView: BottomNavigationMenuView? = null
|
||||
|
||||
@BindView(R.id.toolbar_search_view)
|
||||
lateinit var mSearchView: SearchView
|
||||
private var lastTime: Long = 0
|
||||
private val navigationHelper: NavigationHelper = NavigationHelper.newInstance(this)
|
||||
private var hideExplore = false
|
||||
|
|
@ -77,7 +70,6 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
|
||||
@BindView(R.id.appbar)
|
||||
lateinit var appbar: FrameLayout
|
||||
private var mSearchAdapter: MainSearchAdapter? = null
|
||||
|
||||
public override fun onResume() {
|
||||
val reason = ThemeUtil.getSharedPreferences(this).getString(ThemeUtil.SP_SWITCH_REASON, null)
|
||||
|
|
@ -92,7 +84,6 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
}
|
||||
}
|
||||
super.onResume()
|
||||
refreshSearchView()
|
||||
ThemeUtil.setTranslucentThemeBackground(findViewById(R.id.background))
|
||||
if (ThemeUtil.THEME_TRANSLUCENT == ThemeUtil.getTheme(this)) {
|
||||
mBottomNavigationView.elevation = 0f
|
||||
|
|
@ -108,11 +99,6 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
}
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun openSearch(item: MenuItem? = null) {
|
||||
mSearchView.open(item)
|
||||
}
|
||||
|
||||
override fun onNavigationItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.navbar_home -> {
|
||||
|
|
@ -142,9 +128,6 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
}
|
||||
|
||||
protected fun initView() {
|
||||
mSearchAdapter = MainSearchAdapter(this)
|
||||
mSearchAdapter!!.onSearchItemClickListener = this
|
||||
mSearchView.adapter = mSearchAdapter
|
||||
val hideExploreItemView = menuView!!.getChildAt(if (hideExplore) 1 else 2) as BottomNavigationItemView
|
||||
val badge = layoutInflater.inflate(R.layout.layout_badge, hideExploreItemView, true)
|
||||
badgeTextView = badge.findViewById(R.id.tv_msg_count)
|
||||
|
|
@ -162,35 +145,11 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
mViewPager.isCanScroll = false
|
||||
mViewPager.adapter = mAdapter
|
||||
mViewPager.offscreenPageLimit = mAdapter.count
|
||||
refreshSearchView()
|
||||
}
|
||||
|
||||
override fun refreshGlobal(activity: Activity) {
|
||||
super.refreshGlobal(activity)
|
||||
refreshSearchView()
|
||||
}
|
||||
|
||||
private fun refreshSearchView() {
|
||||
if (mSearchView == null) {
|
||||
return
|
||||
}
|
||||
mSearchAdapter!!.refreshData()
|
||||
mSearchView.theme = if (ThemeUtil.isNightMode(this) || ThemeUtil.THEME_TRANSLUCENT == ThemeUtil.getTheme(this)) Search.Theme.DARK else Search.Theme.LIGHT
|
||||
}
|
||||
|
||||
protected fun initListener() {
|
||||
mBottomNavigationView.setOnNavigationItemSelectedListener(this)
|
||||
mBottomNavigationView.setOnNavigationItemReselectedListener(this)
|
||||
mSearchView.setOnQueryTextListener(object : Search.OnQueryTextListener {
|
||||
override fun onQueryTextChange(newText: CharSequence) {}
|
||||
override fun onQueryTextSubmit(key: CharSequence): Boolean {
|
||||
startActivity(Intent(this@MainActivity, SearchActivity::class.java)
|
||||
.putExtra(SearchActivity.EXTRA_KEYWORD, key.toString()))
|
||||
SearchHistory(key.toString())
|
||||
.saveOrUpdate("content = ?", key.toString())
|
||||
return true
|
||||
}
|
||||
})
|
||||
mViewPager.addOnPageChangeListener(object : OnPageChangeListener {
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
||||
|
||||
|
|
@ -414,21 +373,13 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
TiebaUtil.startSign(this@MainActivity)
|
||||
return true
|
||||
}
|
||||
R.id.action_search -> {
|
||||
mSearchView.open(item)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (mSearchView.isOpen) {
|
||||
mSearchView.close()
|
||||
} else {
|
||||
if (!HandleBackUtil.handleBackPress(this)) {
|
||||
exit()
|
||||
}
|
||||
if (!HandleBackUtil.handleBackPress(this)) {
|
||||
exit()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -446,14 +397,6 @@ open class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemS
|
|||
mToolbar.title = newTitle
|
||||
}
|
||||
|
||||
override fun onSearchItemClick(position: Int, content: CharSequence) {
|
||||
startActivity(Intent(this@MainActivity, SearchActivity::class.java)
|
||||
.putExtra(SearchActivity.EXTRA_KEYWORD, content.toString()))
|
||||
SearchHistory(content.toString())
|
||||
.saveOrUpdate("content = ?", content.toString())
|
||||
refreshSearchView()
|
||||
}
|
||||
|
||||
private inner class NewMessageReceiver : BroadcastReceiver() {
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
package com.huanchengfly.tieba.post.activities;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.huanchengfly.tieba.post.ui.theme.utils.ThemeUtils;
|
||||
import com.huanchengfly.tieba.post.R;
|
||||
import com.huanchengfly.tieba.post.adapters.FragmentTabViewPagerAdapter;
|
||||
import com.huanchengfly.tieba.post.fragments.SearchForumFragment;
|
||||
import com.huanchengfly.tieba.post.fragments.SearchThreadFragment;
|
||||
import com.huanchengfly.tieba.post.fragments.SearchUserFragment;
|
||||
import com.huanchengfly.tieba.post.models.database.SearchHistory;
|
||||
import com.huanchengfly.tieba.post.utils.ThemeUtil;
|
||||
import com.huanchengfly.tieba.post.widgets.MyViewPager;
|
||||
import com.lapism.searchview.Search;
|
||||
import com.lapism.searchview.widget.SearchView;
|
||||
|
||||
public class SearchActivity extends BaseActivity implements Search.OnQueryTextListener {
|
||||
public static final String TAG = SearchActivity.class.getSimpleName();
|
||||
public static final String EXTRA_KEYWORD = "keyword";
|
||||
|
||||
private String mKeyword;
|
||||
private TabLayout mTabLayout;
|
||||
private SearchForumFragment searchForumFragment;
|
||||
private SearchThreadFragment searchThreadFragment;
|
||||
private SearchUserFragment searchUserFragment;
|
||||
private SearchView mSearchView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_search);
|
||||
ThemeUtil.setTranslucentThemeBackground(findViewById(R.id.background));
|
||||
Intent intent = getIntent();
|
||||
mKeyword = intent.getStringExtra(EXTRA_KEYWORD);
|
||||
mSearchView = (SearchView) findViewById(R.id.toolbar_search_view);
|
||||
mSearchView.setTheme(ThemeUtil.isNightMode(this) ? Search.Theme.DARK : Search.Theme.LIGHT);
|
||||
mSearchView.setShadow(false);
|
||||
mSearchView.setBackgroundColor(ThemeUtils.getColorByAttr(this, R.attr.colorToolbar));
|
||||
mSearchView.setClearColor(ThemeUtils.getColorByAttr(this, R.attr.colorToolbarItem));
|
||||
mSearchView.setLogoColor(ThemeUtils.getColorByAttr(this, R.attr.colorToolbarItem));
|
||||
mSearchView.setTextColor(ThemeUtils.getColorByAttr(this, R.attr.colorToolbarItem));
|
||||
mSearchView.setHintColor(ThemeUtils.getColorByAttr(this, R.attr.color_toolbar_item_secondary));
|
||||
mTabLayout = (TabLayout) findViewById(R.id.tab);
|
||||
MyViewPager mViewPager = (MyViewPager) findViewById(R.id.view_pager);
|
||||
mViewPager.setOffscreenPageLimit(3);
|
||||
mSearchView.setQuery(mKeyword, false);
|
||||
mSearchView.setOnQueryTextListener(this);
|
||||
mSearchView.setOnLogoClickListener(this::finish);
|
||||
FragmentTabViewPagerAdapter mAdapter = new FragmentTabViewPagerAdapter(getSupportFragmentManager());
|
||||
searchForumFragment = SearchForumFragment.newInstance(mKeyword);
|
||||
searchThreadFragment = SearchThreadFragment.newInstance(mKeyword);
|
||||
searchUserFragment = SearchUserFragment.newInstance(mKeyword);
|
||||
mAdapter.addFragment(searchForumFragment, "吧");
|
||||
mAdapter.addFragment(searchThreadFragment, "贴");
|
||||
mAdapter.addFragment(searchUserFragment, "人");
|
||||
mViewPager.setAdapter(mAdapter);
|
||||
mTabLayout.setupWithViewPager(mViewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(CharSequence query) {
|
||||
setKeyword(query.toString());
|
||||
new SearchHistory(query.toString())
|
||||
.saveOrUpdate("content = ?", query.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setKeyword(String keyword) {
|
||||
if (TextUtils.equals(keyword, mKeyword)) {
|
||||
return;
|
||||
}
|
||||
mKeyword = keyword;
|
||||
searchForumFragment.setKeyword(keyword, mTabLayout.getSelectedTabPosition() == 0);
|
||||
searchThreadFragment.setKeyword(keyword, mTabLayout.getSelectedTabPosition() == 1);
|
||||
searchUserFragment.setKeyword(keyword, mTabLayout.getSelectedTabPosition() == 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueryTextChange(CharSequence newText) {
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ import com.huanchengfly.tieba.post.models.database.Account
|
|||
import com.huanchengfly.tieba.post.models.database.Block
|
||||
import com.huanchengfly.tieba.post.ui.theme.utils.ThemeUtils
|
||||
import com.huanchengfly.tieba.post.utils.*
|
||||
import com.lapism.searchview.database.SearchHistoryTable
|
||||
import java.util.*
|
||||
|
||||
class SettingsFragment : PreferencesFragment() {
|
||||
|
|
@ -74,11 +73,6 @@ class SettingsFragment : PreferencesFragment() {
|
|||
}
|
||||
true
|
||||
}
|
||||
findPreference<Preference>("clear_search_history")!!.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
SearchHistoryTable(attachContext).clearDatabase()
|
||||
if (view != null) Util.createSnackbar(view!!, R.string.toast_clear_success, Snackbar.LENGTH_SHORT).show()
|
||||
true
|
||||
}
|
||||
findPreference<Preference>("exit_account")!!.isEnabled = AccountUtil.isLoggedIn(attachContext)
|
||||
findPreference<Preference>("exit_account")!!.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
DialogUtil.build(attachContext)
|
||||
|
|
@ -132,7 +126,7 @@ class SettingsFragment : PreferencesFragment() {
|
|||
clearCache!!.summary = attachContext.getString(R.string.tip_cache, GlideCacheUtil.getInstance().getCacheSize(attachContext))
|
||||
clearCache.onPreferenceClickListener = Preference.OnPreferenceClickListener { preference: Preference ->
|
||||
GlideCacheUtil.getInstance().clearImageAllCache(attachContext)
|
||||
if (view != null) Util.createSnackbar(view!!, R.string.toast_clear_cache_success, Snackbar.LENGTH_SHORT).show()
|
||||
if (view != null) Util.createSnackbar(requireView(), R.string.toast_clear_cache_success, Snackbar.LENGTH_SHORT).show()
|
||||
preference.summary = attachContext.getString(R.string.tip_cache, "0.0B")
|
||||
true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,86 +0,0 @@
|
|||
package com.huanchengfly.tieba.post.widgets.theme;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.huanchengfly.tieba.post.ui.theme.interfaces.Tintable;
|
||||
import com.huanchengfly.tieba.post.ui.theme.utils.ThemeUtils;
|
||||
import com.huanchengfly.tieba.post.R;
|
||||
import com.lapism.searchview.widget.SearchView;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class TintSearchView extends SearchView implements Tintable {
|
||||
private int mBackgroundTintResId;
|
||||
private int mSearchItemColorResId;
|
||||
private int mHintColorResId;
|
||||
|
||||
public TintSearchView(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public TintSearchView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public TintSearchView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
public TintSearchView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
if (isInEditMode()) {
|
||||
return;
|
||||
}
|
||||
if (attrs == null) {
|
||||
mBackgroundTintResId = 0;
|
||||
mSearchItemColorResId = 0;
|
||||
mHintColorResId = 0;
|
||||
return;
|
||||
}
|
||||
TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.TintSearchView, defStyleAttr, 0);
|
||||
mBackgroundTintResId = array.getResourceId(R.styleable.TintSearchView_searchBackground, 0);
|
||||
mSearchItemColorResId = array.getResourceId(R.styleable.TintSearchView_searchItemColor, 0);
|
||||
mHintColorResId = array.getResourceId(R.styleable.TintSearchView_hintColor, 0);
|
||||
array.recycle();
|
||||
applyTintColor();
|
||||
}
|
||||
|
||||
private void applyTintColor() {
|
||||
if (mBackgroundTintResId != 0) {
|
||||
setBackgroundColor(ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
}
|
||||
if (mSearchItemColorResId != 0) {
|
||||
setLogoColor(ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
setMicColor(ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
setClearColor(ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
try {
|
||||
Method method = Class.forName("com.lapism.searchview.widget.SearchView").getDeclaredMethod("setMenuColor", int.class);
|
||||
method.setAccessible(true);
|
||||
method.invoke(this, ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
setTextColor(ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
}
|
||||
if (mHintColorResId != 0) {
|
||||
setHintColor(ThemeUtils.getColorById(getContext(), mBackgroundTintResId));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tint() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -332,13 +332,6 @@
|
|||
app:backgroundTint="@color/default_color_primary"
|
||||
app:borderWidth="0dp" />
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintSearchView
|
||||
style="@style/Widget.SearchBar"
|
||||
android:layout_gravity="top"
|
||||
android:id="@+id/toolbar_search_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<include
|
||||
android:id="@+id/loading_view"
|
||||
layout="@layout/layout_loading_view" />
|
||||
|
|
|
|||
|
|
@ -47,12 +47,4 @@
|
|||
app:labelVisibilityMode="unlabeled"
|
||||
app:menu="@menu/navbar_main" />
|
||||
|
||||
<com.lapism.searchview.widget.SearchView
|
||||
style="@style/Widget.SearchBar"
|
||||
android:layout_alignParentTop="true"
|
||||
app:search_hint="@string/hint_search"
|
||||
android:id="@+id/toolbar_search_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<?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:id="@+id/background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activities.SearchActivity">
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintAppBarLayout
|
||||
app:backgroundTint="@color/default_color_toolbar"
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stateListAnimator="@animator/appbar_elevation">
|
||||
<com.lapism.searchview.widget.SearchView
|
||||
style="@style/Widget.SearchBar.Flat"
|
||||
app:search_version_margins="toolbar"
|
||||
app:search_version="toolbar"
|
||||
android:id="@+id/toolbar_search_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintTabLayout
|
||||
style="@style/Widget.TabLayout.Fixed"
|
||||
android:id="@+id/tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintAppBarLayout>
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.MyViewPager
|
||||
android:id="@+id/view_pager"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintCoordinatorLayout>
|
||||
|
|
@ -125,12 +125,6 @@
|
|||
<attr name="textColor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TintSearchView">
|
||||
<attr name="searchBackground" format="color" />
|
||||
<attr name="searchItemColor" format="color" />
|
||||
<attr name="hintColor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TintTextInputLayout">
|
||||
<attr name="boxBackgroundColor" />
|
||||
<attr name="boxStrokeColor" />
|
||||
|
|
|
|||
|
|
@ -58,24 +58,6 @@
|
|||
|
||||
<style name="Widget" />
|
||||
|
||||
<style name="Widget.SearchBar">
|
||||
<item name="search_logo">arrow</item>
|
||||
<item name="search_shape">classic</item>
|
||||
<item name="search_version_margins">menu_item</item>
|
||||
<item name="search_version">menu_item</item>
|
||||
<item name="search_logo_color">@color/default_color_text</item>
|
||||
<item name="search_mic_color">@color/default_color_text</item>
|
||||
<item name="search_clear_color">@color/default_color_text</item>
|
||||
<item name="search_menu_color">@color/default_color_text</item>
|
||||
<item name="search_text_color">@color/default_color_text</item>
|
||||
<item name="search_background_color">@color/default_color_background</item>
|
||||
<item name="search_hint_color">@color/default_color_text_secondary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.SearchBar.Flat" parent="Widget.SearchBar">
|
||||
<item name="search_shadow">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Button.Flat.Dense" parent="Widget.MaterialComponents.Button.TextButton">
|
||||
<item name="android:minWidth">0dp</item>
|
||||
<item name="android:minHeight">0dp</item>
|
||||
|
|
@ -146,11 +128,6 @@
|
|||
<item name="tabMode">fixed</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.SearchView" parent="Widget.AppCompat.SearchView">
|
||||
<item name="searchHintIcon">@null</item>
|
||||
<item name="searchIcon">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="BottomSheetDialogStyle" parent="Theme.Design.BottomSheetDialog">
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
|
|
@ -411,7 +388,6 @@
|
|||
<item name="actionOverflowMenuStyle">@style/OverflowMenu</item>
|
||||
<item name="dialogCornerRadius">@dimen/radius</item>
|
||||
<item name="alertDialogStyle">@style/AlertDialog</item>
|
||||
<item name="searchViewStyle">@style/Widget.SearchView</item>
|
||||
<item name="preferenceTheme">@style/PreferenceTheme</item>
|
||||
<item name="android:listSeparatorTextViewStyle">@style/TextAppearance.ListTitle</item>
|
||||
<item name="android:colorPrimary">@color/colorPrimary</item>
|
||||
|
|
@ -443,7 +419,6 @@
|
|||
<item name="actionOverflowMenuStyle">@style/OverflowMenu.Dark</item>
|
||||
<item name="dialogCornerRadius">8dp</item>
|
||||
<item name="alertDialogStyle">@style/AlertDialog.Dark</item>
|
||||
<item name="searchViewStyle">@style/Widget.SearchView</item>
|
||||
<item name="preferenceTheme">@style/PreferenceTheme</item>
|
||||
<item name="android:listSeparatorTextViewStyle">@style/TextAppearance.ListTitle</item>
|
||||
<item name="android:colorPrimary">?attr/colorPrimary</item>
|
||||
|
|
|
|||
|
|
@ -215,11 +215,6 @@
|
|||
android:key="clear_cache"
|
||||
android:title="@string/title_clear_cache" />
|
||||
|
||||
<Preference
|
||||
android:icon="@drawable/ic_round_how_to_vote"
|
||||
android:key="clear_search_history"
|
||||
android:title="@string/title_clear_search_history" />
|
||||
|
||||
<Preference
|
||||
android:key="about"
|
||||
android:icon="@drawable/ic_round_info"
|
||||
|
|
|
|||
Loading…
Reference in New Issue