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

Print trait improvements #718

Merged
merged 14 commits into from
Sep 25, 2023
Merged

Print trait improvements #718

merged 14 commits into from
Sep 25, 2023

Conversation

bellerbrock
Copy link
Collaborator

@bellerbrock bellerbrock commented Aug 25, 2023

Description

Provide a summary of your changes including motivation and context.
If these changes fix a bug or resolves a feature request, be sure to link to that issue.

Fixes problem where printing would require re-selecting the printer with each new entry
Adds connection button to layout to allow changing printers
Fixes handing of long text in label print spinners

Closes #174

Type of change

What type of changes does your code introduce? Put an x in boxes that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated relevant documentation

Changelog entry

Please add a one-line changelog entry below. This will be copied to the changelog file during the release process.

Fix for label print repeat connnections

@trife trife requested a review from chaneylc August 28, 2023 10:20
@trife
Copy link
Member

trife commented Aug 28, 2023

Still needs to address long column names

@bellerbrock
Copy link
Collaborator Author

@trife, yep still working on that and a few other refinements. I opened the pr to give Russell access to an apk with the initial fixes, but the build action keeps failing with a git server 502 error when trying to PUT the built apk. Not sure how to best troubleshoot that, but in the meantime I'll set this to draft and share a manually built apk.

@bellerbrock bellerbrock marked this pull request as draft August 28, 2023 15:56
@chaneylc
Copy link
Member

chaneylc commented Aug 30, 2023

On Pixel 6 API 33 I get this when opening print trait, crashes app:

FATAL EXCEPTION: main Process: com.fieldbook.tracker, PID: 20980 android.view.InflateException: Binary XML file line #66 in com.fieldbook.tracker:layout/trait_labelprint: Binary XML file line #66 in com.fieldbook.tracker:layout/trait_labelprint: Error inflating class ImageButton Caused by: android.view.InflateException: Binary XML file line #66 in com.fieldbook.tracker:layout/trait_labelprint: Error inflating class ImageButton Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 3: TypedValue{t=0x2/d=0x1010095 a=-1}, theme={InheritanceMap=[id=0x7f15014acom.fieldbook.tracker:style/BaseAppTheme.MediumTextTheme, id=0x7f15012ecom.fieldbook.tracker:style/BaseAppTheme, id=0x7f1502a7com.fieldbook.tracker:style/Theme.AppCompat.DayNight.NoActionBar, id=0x7f1502b3com.fieldbook.tracker:style/Theme.AppCompat.Light.NoActionBar, id=0x7f1502adcom.fieldbook.tracker:style/Theme.AppCompat.Light, id=0x7f150065com.fieldbook.tracker:style/Base.Theme.AppCompat.Light, id=0x7f1500c8com.fieldbook.tracker:style/Base.V28.Theme.AppCompat.Light, id=0x7f1500c5com.fieldbook.tracker:style/Base.V26.Theme.AppCompat.Light, id=0x7f1500bfcom.fieldbook.tracker:style/Base.V23.Theme.AppCompat.Light, id=0x7f1500bdcom.fieldbook.tracker:style/Base.V22.Theme.AppCompat.Light, id=0x7f1500b2com.fieldbook.tracker:style/Base.V21.Theme.AppCompat.Light, id=0x7f1500cbcom.fieldbook.tracker:style/Base.V7.Theme.AppCompat.Light, id=0x7f15019dcom.fieldbook.tracker:style/Platform.AppCompat.Light, id=0x7f1501a8com.fieldbook.tracker:style/Platform.V25.AppCompat.Light, id=0x1030241android:style/Theme.Material.Light.NoActionBar, id=0x1030237android:style/Theme.Material.Light, id=0x103000candroid:style/Theme.Light, id=0x1030005android:style/Theme], Themes=[com.fieldbook.tracker:style/BaseAppTheme.MediumTextTheme, forced, com.fieldbook.tracker:style/BaseAppTheme, forced, com.fieldbook.tracker:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]} at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:789) at android.widget.ImageView.<init>(ImageView.java:214) at android.widget.ImageButton.<init>(ImageButton.java:86) at android.widget.ImageButton.<init>(ImageButton.java:82) at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:78) at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:73) at androidx.appcompat.app.AppCompatViewInflater.createImageButton(AppCompatViewInflater.java:253) at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:168) at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1678) at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1729) at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1065) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1001) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.inflate(LayoutInflater.java:686) at android.view.LayoutInflater.inflate(LayoutInflater.java:538) at android.view.LayoutInflater.inflate(LayoutInflater.java:485) at com.fieldbook.tracker.activities.CollectActivity.inflateTrait(CollectActivity.java:2046) at com.fieldbook.tracker.views.TraitBoxView$initTraitType$1.onItemSelected(TraitBoxView.kt:187) 2023-08-30 10:17:37.337 20980-20980 AndroidRuntime com.fieldbook.tracker E at android.widget.AdapterView.fireOnSelected(AdapterView.java:957) at android.widget.AdapterView.dispatchOnItemSelected(AdapterView.java:946) at android.widget.AdapterView.-$$Nest$mdispatchOnItemSelected(Unknown Source:0) at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:910) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7918) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@bellerbrock
Copy link
Collaborator Author

@chaney thanks for the heads up. I pushed a partial change to the trait layout to let a user better manage the printer connection, looks like that's what is causing the error. But after talking to Trevor I'm changing the approach somewhat. I'll leave the PR as a draft until it's ready for more testing.

@bellerbrock bellerbrock marked this pull request as ready for review September 20, 2023 16:49
Copy link
Member

@chaneylc chaneylc left a comment

Choose a reason for hiding this comment

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

Looks good. The only small thing I noticed was that when "blank" was chosen for the barcode, it still prints a barcode.

@trife trife merged commit 8698c22 into main Sep 25, 2023
1 check passed
@trife trife deleted the print_trait_improvements branch September 25, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Improve/Fix Print trait layout
3 participants