Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WidgetSmall redesign with material you dynamic color #17654

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Rdkang
Copy link

@Rdkang Rdkang commented Dec 24, 2024

Purpose / Description

The current small widget doesn't fit the style of the application or current versions of android material you theme

Fixes

Approach

Redesigned the widget and uses material you colors to fit

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration (SDK version(s), emulator or physical, etc)

Virtual pixel 3 on SDK 28 and pixel 7 on SDK 35

Learning (optional, can help others)

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Screenshots

  1. Widget
  1. Widget when there are no cards to review it will be darker
  1. Widget with monochrome material you theme chosen and themed icons
  1. Widget with orange material you theme chosen and themed icons
  1. Widget with green material you theme chosen and themed icons

Improvements

  1. Better icon for the estimated time
  2. Make the circle background for the numbers evenly padded around the text

Any feedback on the designs of the notification bubbles would be greatly appreciated :)

Copy link

welcome bot commented Dec 24, 2024

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - looks like most of the work is in the icon specification?
Is there some way to preserve the visible difference between dev build and prod build like we have now with the red icon color vs the blue icon color?

Obviously the point of the change is to have the colors match theming - perhaps there is a way to badge the icon by layering a dev "sash" over it, similar to the badging plugin used by fastlane (underlying implementation here: https://github.com/HazAT/badge - perhaps it could be run during debug builds as a gradle step? Perhaps the generated badge could be in the debug src/res tree ? I'm not sure what is best)

<solid android:color="@android:color/system_accent1_600" />
</shape>

<!--<padding android:left="7dp"-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why there are commented out implementation lines in a new file?
Historically we don't keep commented out code in the codebase ever, that's what git history is for, and we definitely don't add new files with commented out implementation lines

import com.ichi2.anki.AnkiDroidApp

class EmptyApplication : Application() {
override fun onCreate() {
super.onCreate()

DynamicColors.applyToActivitiesIfAvailable(this)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value does this provide in the testutils EmptyApplication class ? (it may just need a comment but I'm curious if it does anything at all really? Does it make these things testable somehow?)

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Dec 24, 2024
@david-allison
Copy link
Member

@mikehardy just to note: the red isn't a beta feature, it's an indicator of "you have pending reviews".

@mikehardy
Copy link
Member

@mikehardy just to note: the red isn't a beta feature, it's an indicator of "you have pending reviews".

Ah interesting - that means that for the widgets at least there is currently no way to differentiate between "widgets built for the .debug build and connected to your .debug install (or perhaps parallel install!) vs the main / production ones?

That whole sentence reads like an assertion but the question mark is key - I'm not sure

@david-allison
Copy link
Member

david-allison commented Dec 24, 2024

I don't believe there is a difference for the widgets between beta and stable.

I am concerned that we lose the distinction between 'done' and 'not done' with this PR. Some users love it:

Screenshot 2024-12-24 at 14 50 45

https://www.reddit.com/r/Anki/comments/1h81z48/comment/m0rcsuq/?context=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Has Conflicts Needs Author Reply Waiting for a reply from the original author New contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Themed Widgets
4 participants