2021-06-17 18:54:56 +02:00
|
|
|
/* Copyright 2021 Tusky Contributors
|
2019-07-19 20:10:20 +02:00
|
|
|
*
|
|
|
|
* This file is a part of Tusky.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
|
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
|
|
* Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with Tusky; if not,
|
|
|
|
* see <http://www.gnu.org/licenses>. */
|
|
|
|
|
|
|
|
package com.keylesspalace.tusky.components.search.fragments
|
|
|
|
|
Adjust list UX for platform consistency (#3142)
Most lists in the app use (explicitly or implicitly) platform metrics for dimensions, text size, colour, and so on, possibly via styles.
A few don't, inadvertently using the user's setting for status text size
Fix these, and simplify code where possible.
- Use android attributes for padding and height, for consistent UX.
- Remove explicit usage of app:tabTextAppearance, rely on the style.
- Remove ListSelectionAdapter and item_picker_list.xml, and adjust TabPreferenceActivity to use an ArrayAdapter with simple_list_item_1.xml
- Simplify item_followed_hashtag.xml, consistent with item_list.xml.
Fixes https://github.com/tuskyapp/Tusky/issues/3131
2023-06-29 18:36:19 +02:00
|
|
|
import android.os.Bundle
|
|
|
|
import android.view.View
|
2021-06-17 18:54:56 +02:00
|
|
|
import androidx.paging.PagingData
|
|
|
|
import androidx.paging.PagingDataAdapter
|
Adjust list UX for platform consistency (#3142)
Most lists in the app use (explicitly or implicitly) platform metrics for dimensions, text size, colour, and so on, possibly via styles.
A few don't, inadvertently using the user's setting for status text size
Fix these, and simplify code where possible.
- Use android attributes for padding and height, for consistent UX.
- Remove explicit usage of app:tabTextAppearance, rely on the style.
- Remove ListSelectionAdapter and item_picker_list.xml, and adjust TabPreferenceActivity to use an ArrayAdapter with simple_list_item_1.xml
- Simplify item_followed_hashtag.xml, consistent with item_list.xml.
Fixes https://github.com/tuskyapp/Tusky/issues/3131
2023-06-29 18:36:19 +02:00
|
|
|
import androidx.recyclerview.widget.DividerItemDecoration
|
2019-07-19 20:10:20 +02:00
|
|
|
import com.keylesspalace.tusky.components.search.adapter.SearchHashtagsAdapter
|
|
|
|
import com.keylesspalace.tusky.entity.HashTag
|
2021-06-17 18:54:56 +02:00
|
|
|
import kotlinx.coroutines.flow.Flow
|
2019-07-19 20:10:20 +02:00
|
|
|
|
|
|
|
class SearchHashtagsFragment : SearchFragment<HashTag>() {
|
|
|
|
|
2021-06-17 18:54:56 +02:00
|
|
|
override val data: Flow<PagingData<HashTag>>
|
|
|
|
get() = viewModel.hashtagsFlow
|
|
|
|
|
Adjust list UX for platform consistency (#3142)
Most lists in the app use (explicitly or implicitly) platform metrics for dimensions, text size, colour, and so on, possibly via styles.
A few don't, inadvertently using the user's setting for status text size
Fix these, and simplify code where possible.
- Use android attributes for padding and height, for consistent UX.
- Remove explicit usage of app:tabTextAppearance, rely on the style.
- Remove ListSelectionAdapter and item_picker_list.xml, and adjust TabPreferenceActivity to use an ArrayAdapter with simple_list_item_1.xml
- Simplify item_followed_hashtag.xml, consistent with item_list.xml.
Fixes https://github.com/tuskyapp/Tusky/issues/3131
2023-06-29 18:36:19 +02:00
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
|
|
super.onViewCreated(view, savedInstanceState)
|
|
|
|
binding.searchRecyclerView.addItemDecoration(
|
|
|
|
DividerItemDecoration(
|
|
|
|
binding.searchRecyclerView.context,
|
|
|
|
DividerItemDecoration.VERTICAL
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-06-17 18:54:56 +02:00
|
|
|
override fun createAdapter(): PagingDataAdapter<HashTag, *> = SearchHashtagsAdapter(this)
|
2019-07-19 20:10:20 +02:00
|
|
|
|
|
|
|
companion object {
|
|
|
|
fun newInstance() = SearchHashtagsFragment()
|
|
|
|
}
|
|
|
|
}
|