Commit graph

31 commits

Author SHA1 Message Date
Nik Clayton 7fe4c9f317
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
UlrichKu cf50d0563f
3416: Call the list activity when list list empty (#3426)
* 3416: Call the list activity when empty; show failure on loading

* 3416: Revert include grouping

* 3416: Remove faulty include after merge

* 3416: Added a list loading progress

* 3416: Add proper padding to progress

* 3416: Show a text if there are no lists, do not change dialog title

* 3416: Center things in layout

* 3416: Appease linter (?)

* 3416: Do not hide manage lists button

* 3416: Use ThemeUtils
2023-03-30 21:23:08 +02:00
Konrad Pozniak 321d17f5de
Remove Rx from EventHub and TimelineCases (#3446)
* remove Rx from EventHub and TimelineCases

* fix tests

* fix AccountViewModel.unblockDomain

* remove debug logging
2023-03-18 10:11:47 +01:00
Konrad Pozniak 3bb92d51bf
remove Rx from TabPreferenceActivity (#3444) 2023-03-13 13:16:58 +01:00
Konrad Pozniak d839f18267
update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
Goooler 43ea59ab2f
Replace DefaultTextWatcher with extensions in core-ktx (#3401)
* Replace DefaultTextWatcher with extensions in core-ktx

* Fix positiveButton.isEnabled

* editable!! for highlightSpans

* Fix style

* Put noteWatcher back
2023-03-10 20:27:24 +01:00
Goooler 6cc79c8d75
Use unsafeLazy to simplify thread unsafe lazy initializations (#3276) 2023-02-20 20:14:54 +01:00
David Edwards 98e5363692
Add trending tags (#3149)
* Add initial feature for viewing trending graphs. Currently only views hash tag trends.

Contains API additions, tab additions and a set of trending components.

* Add clickable system through a LinkListener. Duplicates a little code from SFragment.

* Add accessibility description.

* The background for the graph should match the background for black theme too.

* Add error handling through a state flow system using existing code as an example.

* Graphing: Use a primary and a secondary line. Remove under line fill. Apply line thickness. Dotted end of line.

* Trending changes: New layout for trending: Cell. Use ViewBinding. Add padding to RecyclerView to stop the FAB from hiding content. Multiple bugs in GraphView resolved. Wide (landscape, for example) will show 4 columns, portrait will show 2. Remove unused base holder class. ViewModel invalidate scoping changed. Some renaming to variables made. For uses and accounts, use longs. These could be big numbers eventually. TagViewHolder renamed to TrendingTagViewHolder.

* Trending changes: Remove old layout. Update cell textsizes and use proper string. Remove bad comment.

* Trending changes: Refresh the main drawer when the tabs are edited. This will allow the trending item to toggle.

* Trending changes: Add a trending activity to be able to view the trending data from the main drawer.

* Trending changes: The title text should be changed to Trending Hashtags.

* Trending changes: Add meta color to draw axis etc. Draw the date boundaries on the graph. Remove dates from each cell and place them in the list as a header. Graphs should be proportional to the highest historical value. Add a new interface to control whether the FAB should be visible (important when switching tabs, the state is lost). Add header to the adapter and viewdata structures. Add QOL extensions for getting the dates from history.

* Trending changes: Refresh FAB through the main activity and FabFragment interface. Trending has no FAB.

* Trending changes: Make graph proportional to the highest usage value. Fixes to the graph ratio calculations.

* Trending changes: KtLintFix

* Trending changes: Remove accidental build gradle change. Remove trending cases. Remove unused progress. Set drawer button addition explicitly to false, leaving the code there for future issue #3010. Remove unnecessary arguments for intent. Remove media preview preferences, there is nothing to preview. No padding between hashtag symbol and text. Do not ellipsize hashtags.

* Trending changes: Use bottomsheet slide in animation helper for opening the hashtag intent. Remove explicit layout height from the XML and apply it to the view holder itself. The height was not being respected in XML.

* Use some platform standards for styling

- Align on an 8dp grid
- Use android:attr for paddingStart and paddingEnd
- Use textAppearanceListItem variants
- Adjust constraints to handle different size containers

* Correct lineWidth calculations

Previous code didn't convert the value to pixels, so it was always displaying
as a hairline stroke, irrespective of the value in the layout file.

While I'm here, rename from lineThickness to lineWidth, to be consistent
with parameters like strokeWidth.

* Does not need to inherit from FabFragment

* Rename to TrendingAdapter

"Paging" in the adapter name is a misnomer here

* Clean up comments, use full class name as tag

* Simplify TrendingViewModel

- Remove unncessary properties
- Fetch tags and map in invalidate()
- emptyList() instead of listOf() for clarity

* Remove line dividers, use X-axis to separate content

Experiment with UI -- instead of dividers between each item, draw an explicit
x-axis for each chart, and add a little more vertical padding, to see if that
provides a cleaner separation between the content

* Adjust date format

- Show day and year
- Use platform attributes for size

* Locale-aware format of numbers

Format numbers < 100,000 by inserting locale-aware separators. Numbers larger
are scaled and have K, M, G, ... etc suffix appended.

* Prevent a crash if viewData is empty

Don't access viewData without first checking if it's empty. This can be the
case if the server returned an empty list for some reason, or the data has
been filtered.

* Filter out tags the user has filtered from their home timeline

Invalidate the list if the user's preferences change, as that may indicate
they've changed their filters.

* Experiment with alternative layout

* Set chart height to 160dp to align to an 8dp grid

* Draw ticks that are 5% the height of the x-axis

* Legend adjustments

- Use tuskyblue for the ticks
- Wrap legend components in a layout so they can have a dedicated background
- Use a 60% transparent background for the legend to retain legibility
  if lines go under it

* Bezier curves, shorter cell height

* More tweaks

- List tags in order of popularity, most popular first
- Make it clear that uses/accounts in the legend are totals, not current
- Show current values at end of the chart

* Hide FAB

* Fix crash, it's not always hosted in an ActionButtonActivity

* Arrange totals vertically in landscape layout

* Always add the Trending drawer menu if it's not a tab

* Revert unrelated whitespace changes

* One more whitespace revert

---------

Co-authored-by: Nik Clayton <nik@ngo.org.uk>
2023-02-14 19:52:11 +01:00
Konrad Pozniak d17a0c43ab
Api 33 support (#2719)
* update to Api 33, fix some deprecations

* fix deprecated serializable/parcelable methods

* ask for notification permission

* fix code formatting

* add back comment in PreferencesActivity
2022-11-04 19:22:38 +01:00
Konrad Pozniak e1c8461423
replace kotlin-result-calladapter with networkresult-calladapter (#2569)
* replace kotlin-result-calladapter with networkresult-calladapter

* fix tests
2022-05-30 20:03:40 +02:00
Konrad Pozniak 5abb82004a
migrate Lists from RxJava to Kotlin coroutines (#2537)
* migrate Lists from RxJava to Kotlin coroutines

* use DROP_OLDEST when creating MutableSharedFlow
2022-05-18 18:45:35 +02:00
Konrad Pozniak 16ffcca748
add ktlint plugin to project and apply default code style (#2209)
* add ktlint plugin to project and apply default code style

* some manual adjustments, fix wildcard imports

* update CONTRIBUTING.md

* fix formatting
2021-06-28 21:13:24 +02:00
Konrad Pozniak 40b24cd242
migrate to RxJava3 (#2146)
* migrate to RxJava3

* remove unused import
2021-05-16 19:53:27 +02:00
Konrad Pozniak dee6a3a160
always show follow requests in main menu (#1809)
* always show follow requests in main menu

* update recyclerview to v1.2.0

* fix bug that shows follow requests info to wrong users
2021-04-10 20:30:44 +02:00
Konrad Pozniak 0b86f58139
convert some regular strings to plural strings (#2100)
* convert some regular strings to plural strings

* convert hint_describe_for_visually_impaired from string to plurals

* fix ukrainian strings
2021-03-07 19:43:25 +01:00
Konrad Pozniak ff69a2ad0d
migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
Konrad Pozniak 483beaa957
move onOptionsItemSelected to BaseActivity (#2059)
* move onOptionsItemSelected to BaseActivity

* revert change in ComposeActivity
2021-01-31 20:27:02 +01:00
Konrad Pozniak 53bd081802
use MaterialContainerTransform for ActionButton animation (#1961)
* use MaterialContainerTransform for ActionButton animation

* fix back button in TabPreferenceActivity
2020-10-19 14:57:55 +02:00
Konrad Pozniak 67225dd4c0
fix various bugs when creating tab with multiple hashtags (#1925) 2020-09-02 12:28:13 +02:00
Konrad Pozniak df8dc3a198
enable multiple hashtags in one hashtag tab (#1790)
* enable multiple hashtags in one hashtag tab

* add comment explaining the code in TabAdapter

* delete unused drawables

* add padding to EditText in dialog
2020-05-15 22:10:29 +02:00
Konrad Pozniak c80fa68dbe
upgrade dependencies, fix some warnings (#1747)
* upgrade dependencies, fix some warnings

* fix tests
2020-04-06 11:46:38 +02:00
Konrad Pozniak 8767d2ed3d
Theme refactoring (#1656)
* Theme refactoring

* disable the automatic tinting of surfaces with elevation in dark mode

* make the media warning visible again with the dark theme

* fix nav bar on api 27+

* use correct color for all media warnings
2020-01-30 21:37:28 +01:00
Mélanie Chauvel (ariasuni) 54b3d1f8cd Add close icon to tabs in Tabs account preferences page (#1588)
* Add close icon to tabs in Tabs account preferences page

* Improve code according to code review
2019-12-19 18:35:55 +01:00
kyori19 d6ae071a09 List tabs (#1570)
* List tabs

* Add comment

* Move decoder part to TabData.createTabDataFromId

* Fix drawable tint

* Use dedicated view for list picker

* Error log

* Fix logging

Co-Authored-By: Konrad Pozniak <connyduck@users.noreply.github.com>

* Fix tint color

Co-Authored-By: Konrad Pozniak <connyduck@users.noreply.github.com>

* Fix missing import

* Move encoding part too

* Fix comment

* Fix decoder

* Revert "Fix decoder"

This reverts commit fdc45aac9c113348f8740e6692d2d8e9ace14f7f.

* Revert "Fix comment"

This reverts commit 704b4e6d2e5545d5f2d20c9bc6bc276d6257d119.

* Revert "Move encoding part too"

This reverts commit 32e77346ff98ae1133e76ab6dfd880b26171005e.

* Revert "Move decoder part to TabData.createTabDataFromId"

This reverts commit d1cd2070ab564d2e33874225272a71f0904d681e.
2019-12-02 16:53:24 +01:00
Konrad Pozniak 546cb4bacc
upgrade autodispose (#1490)
* upgrade autodispose

* set AutoDisposePlugins.setHideProxies to false
2019-09-22 08:19:44 +02:00
Konrad Pozniak 29455d5ccd
prevent empty hashtag in TabPreferenceActivity (#1160) 2019-03-28 21:10:53 +01:00
Konrad Pozniak 0c48dcf06c
add hashtag tabs (#1145)
* add hashtag tabs

* address review feedback
2019-03-24 08:59:55 +01:00
Konrad Pozniak 08c1bbd253
fix crash in NotificationsFragment (#1119)
* fix crash in NotificationsFragment

* don't reload notifications

* add updateAdapter()
2019-03-13 09:32:59 +01:00
Conny Duck f4ac9b3da6 make max tabs reached message translateable 2019-02-15 21:35:14 +01:00
Konrad Pozniak fc95903866
call db operation on background thread in TabPreferenceActivity (#1036) 2019-02-13 19:20:43 +01:00
Konrad Pozniak e371fa0e24
Tab customization & direct messages tab (#1012)
* custom tabs

* custom tabs interface

* implement custom tab functionality

* add database migration

* fix bugs, improve ThemeUtils nullability handling

* implement conversationsfragment

* setup ConversationViewHolder

* implement favs

* add button functionality

* revert 10.json

* revert item_status_notification.xml

* implement more menu, replying, fix stuff, clean up

* fix tests

* fix bug with expanding statuses

* min and max number of tabs

* settings support, fix bugs

* database migration

* fix scrolling to top after refresh

* fix                                 bugs

* fix warning in item_conversation
2019-02-12 19:22:37 +01:00