YasuakiHonda / Maxima-on-Android-AS

Maxima on Android imported to Android Studio
23 stars 13 forks source link

Several improvements #1

Closed liushuyu closed 7 years ago

liushuyu commented 7 years ago

Hi there,

Because I have loved this project, so I tried to make some improvements to it. The changes include:

  1. Removed files that may reveal some of your private data, if you still have concerns please do a git filter-branch to erase them from the whole git history database.
  2. Removed files that shouldn't be shared (build files and gradle binaries)
  3. Updated build SDK to 25 (That's Android 7.1 level), and made changes that required to migrate to this newer SDK: 3.1. Changed Activity to AppCompatActivity 3.2. Switch to using Android support library to provide backward compatibility 3.3. Because of 3.1 and 3.2, minimum Android level bumped to API Level 9 (Android 2.3) now, according to Google's statistics, if an app supports Android 2.3 ~ 7.1, it should be able to run on 99.99% of the current devices around the world.
  4. I made a new material theme for MoA to match material design of Android.
  5. Prepare for i18n support, I moved UI strings to dedicated XML resource file (values/strings.xml)

If you have any problems, don't hesitate to leave comments below or contact me.

Thanks, liushuyu


This change is Reviewable

YasuakiHonda commented 7 years ago

Thanks for your working on this project. I am reviewing your changes. The first commit of 'Clean up' seems OK. The second one 'Several tweaks' takes some more time for review.

Actually I am a newbie on Github and don't know the easy way to test your changes before merge. If you can instruct me the easiest way to test your code, I would truly appreciate it.

Anyway, I will continue to review your code.

Thanks!!

liushuyu commented 7 years ago

Actually I am a newbie on Github and don't know the easy way to test your changes before merge.

Everyone starts from new, isn't it? That's not a problem :smile:

If you can instruct me the easiest way to test your code, I would truly appreciate it.

See #2

Anyway, I will continue to review your code.

Thanks for volunteer your time to write and maintain this awesome project!

Thanks, liushuyu

YasuakiHonda commented 7 years ago

I have tested the changes with API 10 emulator and API 9 pantech phone (Android 2.3.3). Both did not show the menu button in upper blue part on the main activity. I would truly appreciate if you can fix this.

There is no issue other than above. I will merge once above is fixed.

Many thanks!! Yasuaki Honda

liushuyu commented 7 years ago

I have tested the changes with API 10 emulator and API 9 pantech phone (Android 2.3.3). Both did not show the menu button in upper blue part on the main activity. I would truly appreciate if you can fix this.

I have investigated this problem. According to some source , it seems like your API 9 pantech phone (Android 2.3.3) has physical menu button, and for emulator, it is assumed that there's a physical menu and search button "installed" on the device. Therefore, there's no virtual menu button on the action bar.

However, if you really want to get that three-dot menu button, it will involve drawing one ourselves, it will be a little bit difficult, but still doable.

Please let me know your decision.

Thanks!

liushuyu commented 7 years ago

Ahh, and I found some problems myself:

  1. TextEdit will misbehave when device is Android 5.1 or later, this one is easy to fix though. Fixed in commit 81746cf
  2. Possible XSS attack against MathJax. You can do a simple test by long-pressing on rendered output , select About MathJax click on any link to "escape" the page and you can now browse the Internet, but there is no way back, you have to restart the application to make it work it correctly again. A very simple hack is to disable the context menu of MathJax by adding showMathMenu: false to the config when initializing MathJax.
  3. [Not a severe problem] Maybe we could consider translate the app, as I added basic i18n support in this PR, it's very easy to add a new language.
YasuakiHonda commented 7 years ago

Thanks for the comment on menu button issue. I confirmed that menu button on pantech worked fine. The emulator on Mac OS X has Command-M which also shows the menu. I am OK with this.

One more question: commit 81746cf, you have deleted only textMultiLine, leaving textFilter. I don't think we need textFilter as we don't filter anything by ourselves. Any specific intention to have textFilter here?

YasuakiHonda commented 7 years ago

Once textFilter issue is resolved, I will merge your pull request. After that, I am planning to edit the .gitignore file according to https://www.gitignore.io/api/androidstudio . Please suspend your commit if you plan to do so until .gitignore change happens.

liushuyu commented 7 years ago

I don't think we need textFilter as we don't filter anything by ourselves. Any specific intention to have textFilter here?

This is a little trick to make IME and software keyboard not to auto correct and make word completion. Although they are useful when you are writing text messages or articles on phone, but it will often "correct" some commands to what it thinks to be "correct phrases", this is annoying, so I just add textFilter to trick IME to think the input will be filtered, and I am not permitted to do corrections.

YasuakiHonda commented 7 years ago

Thanks a lot for the explanation!! I got it! I will merge your pull request, edit .gitignore and do things to take effect. For the disabling of MathJax menu, I will commit after these changes.

best regards

liushuyu commented 7 years ago

Oh, BTW, MathJax is reached 2.7.0, maybe update the bundled MathJax to that version? https://github.com/mathjax/MathJax/archive/2.7.0.tar.gz