TrianguloY / LightningLauncher

More than a simple Android launcher, Lightning is a fast, light and extremely customizable tool to build the perfect home screen. To build your home screen.
https://www.lightninglauncher.com/
MIT License
40 stars 4 forks source link

Migrate to AppCompat #10

Closed SnowVolf closed 10 months ago

SnowVolf commented 11 months ago

Added basic appcompat support. everyrhing is working except small flaws, like missing Toolbar in settings, etc. App Compat Integration needed for futute refactoring, replacing obsolete AsyncTasks, LiveData and ViewModel integration Next step: Main settings screen rewrite from deprecated preference activity to AppCompat PreferenceFragment

SnowVolf commented 10 months ago

@TrianguloY Fixed theme switching

TrianguloY commented 10 months ago

Important bug: in dark mode, some texts from the popups (when long pressing items) are white, which makes them almost-invisible with the default white background.

This is most noticeable in the properties dialog (long tap item > pencil icon > properties...):

Left: Before PR - Right: after PR

Note that the white background is something the original app had, but changing it to black/dark-grey is also a good 'fix', personally even preferred.

SnowVolf commented 10 months ago

@TrianguloY oh, this caused by 9.png drawables which used as background in some places... Okay, I'll try to fix it

SnowVolf commented 10 months ago

image image image @TrianguloY

SnowVolf commented 10 months ago

Force Pushed. Settings Fragment edited as well

SnowVolf commented 10 months ago

image image image

TrianguloY commented 10 months ago

Love the new dark background. Thanks!

Just a minor remark, on light mode (and a bit on dark too) the text seems to be pale, like washed.

Maybe it is better to use other color instead of ?colorControlNormal? What about ?android:colorForeground?

Left: ?colorControlNormal | Right: ?android:colorForeground image image image image

This also fixes the text appearing 'disabled' when the popup closes.

TrianguloY commented 10 months ago

There is also another bug :( the app crashes when you try to add a widget (long tap, press the [+] icon, choose widget:

2023-11-12 19:51:20.238 9689-9689 ThemeUtils net...ox.lightning_launcher_extreme E View class androidx.appcompat.widget.AppCompatButton is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).

FATAL EXCEPTION: main
Process: net.pierrox.lightning_launcher_extreme, PID: 9689
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:926)
    at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889)
    at androidx.appcompat.app.AppCompatDelegateImpl.onPostCreate(AppCompatDelegateImpl.java:585)
    at androidx.appcompat.app.AppCompatActivity.onPostCreate(AppCompatActivity.java:153)
    at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1491)
    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3697)
    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7872)
    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)
SnowVolf commented 10 months ago

@TrianguloY fixed. Also fixed widget inflating

TrianguloY commented 10 months ago

Played a bit with the version, and I don't see any more crashes or important issues (doesn't mean there aren't, but should be rare in that case).

I did notice some minor issues, but I'm going to create issues for those, to be tackled at some other time if necessary.

Merged! Many thanks!