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

better legacy icons, append application suffix to debug version, diff… #275

Merged
merged 4 commits into from
Dec 16, 2020

Conversation

pazos
Copy link
Member

@pazos pazos commented Dec 15, 2020

… by icon color

Idea cherry picked from ildar@db92ce2

Adding app suffix makes possible to have the release and debug version installed at the same time. Until now one was called KOReader and the other KOReader-debug. Log names changed the same way and I was always puzzled until I realized I need to do adb logcat KOReader-debug:D in debug versions.

Now both are called "KOReader" but the debug version has a red icon instead.

The release version keep its package name org.koreader.launcher and the debug version has a package named org.koreader.launcher.debug

preview

Also improved legacy icons, so they keep their original shape and are not squarefied.

pre-commit

icon-pre

post-commit

icon-post


This change is Reviewable

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

Sure, why not :-)

@pazos
Copy link
Member Author

pazos commented Dec 16, 2020

Adaptative icons need some love too.

Are these ok?
adaptative

They're basically (here goes a white image without background :p)
ko

with a color background. Didn't manage to get the vertical white line on the right because that's made with 2 overlapped figures.

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2020

I don't quite understand why we need all of those? But that aside, sure.

@pazos
Copy link
Member Author

pazos commented Dec 16, 2020

I don't quite understand why we need all of those? But that aside, sure.

Because we can provide better icons than some random launcher that enforces specific shapes using as a base the legacy icon. Normally apps can't do a good job and just scale the icon to fit in the shape and apply the primary color of the icon as a background.

Do note that apps cannot enforce how their icons look. It is up to the apps that are presenting them to pick adaptative, legacy or custom shape icons for each app they're listing.

@pazos
Copy link
Member Author

pazos commented Dec 16, 2020

@Frenzie: IIRC git mv doesn't preserve the history of moved files, so there's nobody to blame besides me 😄 . If that's fine I would like the refactor, as it makes possible to add unit tests and other stuff without cluttering gradle files.

The two exceptions that are still outside default paths are jni ( -> app/src/main/cpp) and assets ( -> app/src/main/assets). These are fine as is and there's no need to change them.

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2020

IIRC git mv doesn't preserve the history of moved files

Er, that's what it's for?

$ git mv reader.lua bla.lua
$ git commit -m "moved stuff"
[bla 160f8376] moved stuff
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename reader.lua => bla.lua (100%)

@pazos
Copy link
Member Author

pazos commented Dec 16, 2020

Cool. TBH I didn't test git blame, which works fine.

git blame app/src/main/java/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt

a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  1) package org.koreader.launcher.device.epd.qualcomm
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  2) 
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  3) import android.util.Log
bbe22a84 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Martín Fdez 2020-11-09 22:17:59 +0100  4) import android.view.View
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  5) import org.koreader.launcher.interfaces.EPDInterface
bbe22a84 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Martín Fdez 2020-11-09 22:17:59 +0100  6) import java.util.*
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  7) 
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  8) // More information including epd mode values
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100  9) // https://github.com/koreader/android-luajit-launcher/pull/250#issuecomment-711443457
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 10) abstract class QualcommEPDController : EPDInterface {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 11)     companion object  {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 12)         private const val TAG = "epd"
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 13) 
bbe22a84 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Martín Fdez 2020-11-09 22:17:59 +0100 14)         private fun preventSystemRefresh() : Boolean{
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 15)             // Sets UpdateMode and UpdateScheme to None
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 16)             // this function is called EpdController.setSystemUpdateModeAndScheme in onyxsdk
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 17)             return try{
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 18)                 Class.forName("android.view.View").getMethod("setWaveformAndScheme",
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 19)                     Integer.TYPE,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 20)                     Integer.TYPE,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 21)                     Integer.TYPE).invoke(null, 5, 1, 0)
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 22)                 true
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 23)             } catch (e: Exception) {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 24)                 Log.e(TAG, e.toString())
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 25)                 false
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 26)             }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 27)         }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 28) 
bbe22a84 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Martín Fdez 2020-11-09 22:17:59 +0100 29)         fun requestEpdMode(targetView: View,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 30)                                 mode: Int, delay: Long,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 31)                                 x: Int, y: Int, width: Int, height: Int) : Boolean
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 32)         {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 33)             return try{
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 34)                 // We need to always call this, not sure why, if it's not called before
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 35)                 // system will refresh after us, it'll refresh anyway if user set
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 36)                 // Normal mode, or Regal mode works flawlessly otherwise
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 37)                 preventSystemRefresh()
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 38)                 // EpdController.refreshScreenRegion in onyxsdk
bbe22a84 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Martín Fdez 2020-11-09 22:17:59 +0100 39)                 val refreshScreen = Class.forName("android.view.View").getMethod("refreshScreen",
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 40)                                         Integer.TYPE,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 41)                                         Integer.TYPE,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 42)                                         Integer.TYPE,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 43)                                         Integer.TYPE,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 44)                                         Integer.TYPE)
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 45)                 object: Thread(){
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 46)                     override fun run(){
bbe22a84 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Martín Fdez 2020-11-09 22:17:59 +0100 47)                         sleep(delay)
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 48)                         try {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 49)                             refreshScreen.invoke(targetView, x, y, width, height, mode)
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 50)                             Log.i(TAG, String.format(Locale.US,
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 51)                                 "requested eink refresh, type: %d x:%d y:%d w:%d h:%d",
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 52)                                 mode, x, y, width, height))
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 53)                         } catch(e: Exception) {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 54)                             Log.e(TAG, e.toString())
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 55)                         }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 56)                     }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 57)                 }.start()
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 58)                 true
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 59)             } catch(e: Exception) {
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 60)                 false
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 61)             }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 62)         }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 63)     }
a21e94e3 app/src/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt (Galunid     2020-11-03 18:58:21 +0100 64) }

It is probably a github thingy, which doesn't preserve history: see for the same file: https://github.com/pazos/android-luajit-launcher/commits/refactor_flavors/app/src/main/java/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt

@Frenzie
Copy link
Member

Frenzie commented Dec 16, 2020

Blame works fine though, also on the GH UI.
https://github.com/pazos/android-luajit-launcher/blame/31974a9ecb91568b457e878f842688623af122fa/app/src/main/java/org/koreader/launcher/device/epd/qualcomm/QualcommEPDController.kt

Anyway, so assuming you used git mv for all files, not a problem.

@pazos pazos merged commit 9e852e0 into koreader:master Dec 16, 2020
@pazos pazos deleted the refactor_flavors branch December 16, 2020 19:28
NiLuJe added a commit to koreader/koreader that referenced this pull request Dec 24, 2020
* Android: Don't mark the platform as should_restrict_JIT

And see how much stuff breaks \o/

* Prevent Android users from disabling the C blitter, regardless of the
restrict flag

* Update android-luajit-launcher

koreader/android-luajit-launcher#278
koreader/android-luajit-launcher#275
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.

None yet

2 participants