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

Migration to AndroidX, General improvements & Bug fixes #65

Merged
merged 17 commits into from
May 24, 2020

Conversation

Electric1447
Copy link
Collaborator

@Electric1447 Electric1447 commented May 10, 2020

Changes:

  • Migrated code to AndroidX
  • Updated compile SDK to 29 and fixed the workaround for SDK 29.
  • Upadted to Java 8
  • Fixed charging status being reversed sometimes
  • Fixed warning in the code
  • Replaced some images with vectors
  • Changed proper rtl support.
  • Hebrew translation.
  • Dark mode
  • Better charging sybmol.
  • Low battery sybol on when battery is 15% or lower.

Pull requests and Issues adressed in this PR:

@adolfintel
Copy link
Owner

That's a big PR, thank you.
Just a couple of things:

  • Violating google play policies was intentional, people were uploading modified versions of this app with ads, etc. and I needed some way to stop it
  • Using SDK 23 was done for the same reason. Changing it to 29 will break the way the service is kept in background, it will stop working after a while unless you change it

@Electric1447
Copy link
Collaborator Author

I understand both of the points.

I'm trying to work on a workaround for api 29.

And on another note, I'm trying to implement dark theme while I'm at it.

@adolfintel
Copy link
Owner

adolfintel commented May 11, 2020 via email

@Electric1447
Copy link
Collaborator Author

👍

@Electric1447
Copy link
Collaborator Author

Okay, I think I found a workaround for SDK 29.
I'm currently doing more testing to see if it really fixed it.

Improved charging indicator.
Added support for dark theme.
Added proper support for RTL.
Added Hebrew translation.
Merged changes from https://github.com/Domi04151309/OpenPods/tree/general-improvements.
@Electric1447
Copy link
Collaborator Author

I added a few thinks and also merged the changes from #46 :

  • Workaround for API 29.
  • Added support for dark theme.
  • Added proper support for RTL.
  • Added Hebrew translation.

I also re-enabled ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS

@Electric1447 Electric1447 changed the title Migration to AndroidX & General code cleaning and reformating Migration to AndroidX & General improvements May 11, 2020
@Electric1447 Electric1447 changed the title Migration to AndroidX & General improvements Migration to AndroidX, General improvements & Bug fixes May 12, 2020
@adolfintel
Copy link
Owner

Flipped shouldn't be a user preference as fas as I know, whether it is flipped or not is sent by the airpods.

@Electric1447
Copy link
Collaborator Author

I fixed a bug where the charging symbol would sometimes be flipped.
In PodsService.java:

String a = decodeHex(result.getScanRecord().getManufacturerSpecificData(76));

if (isFlipped(a)) {
	str = "" + a.charAt(12);
	str2 = "" + a.charAt(13);
} else {
	str = "" + a.charAt(13);
	str2 = "" + a.charAt(12);
}

chargeL = (chargeStatus & 0b00000001) != 0;
chargeR = (chargeStatus & 0b00000010) != 0;

As you can see above only the battery status are being fliped and not the charge status

String a = decodeHex(Objects.requireNonNull(Objects.requireNonNull(result.getScanRecord()).getManufacturerSpecificData(76)));
boolean flip = isFlipped(a);

if (prefs.getBoolean("flipPods", false))
	flip = !flip;

if (flip) {
	leftAirpodStr = "" + a.charAt(12);
	rightAirpodStr = "" + a.charAt(13);
} else {
	leftAirpodStr = "" + a.charAt(13);
	rightAirpodStr = "" + a.charAt(12);
}

if (flip) {
	chargeL = (chargeStatus & 0b00000010) != 0;
	chargeR = (chargeStatus & 0b00000001) != 0;
} else {
	chargeL = (chargeStatus & 0b00000001) != 0;
	chargeR = (chargeStatus & 0b00000010) != 0;
}

I've fixed it in here

@Electric1447
Copy link
Collaborator Author

Flipped shouldn't be a user preference as fas as I know, whether it is flipped or not is sent by the airpods.

The option is disabled by default, the user will only activate it if he want to flip them again.
I don't think it would be bad to keep this feature.

@Electric1447
Copy link
Collaborator Author

Also I noticed that I made a mistake while migrating to AndroidX which broke SharedPreferences.
I fixed it in a284bda

@adolfintel
Copy link
Owner

I don't think it would be bad to keep this feature.

Why though? Are there circumstances in which isFlipped doesn't work as intended?

@Electric1447
Copy link
Collaborator Author

I don't know of any circumstances in which it shouldn't work as indicated.

However, l think it would be useful just in case it doesn't work as indicated.

At the end it is your app, so if you think I should remove it le me know.

@adolfintel
Copy link
Owner

I would remove it, it's kinda confusing if you don't know how the app works internally.

Btw, you're doing a great job, you did everything I wanted to do for version 1.4 and more. If you contact me at info@fdossena.com there is another thing I'd like to discuss privately. Thank you

@Electric1447
Copy link
Collaborator Author

Btw my changes also include PR #46 & Issue #33 , so you can close them after the merge.

@Electric1447
Copy link
Collaborator Author

I also fixed issue #64
I'm updating the 1st comment to add issues and pull requests to close once you merge.

@adolfintel adolfintel merged commit 57121a8 into adolfintel:master May 24, 2020
@Electric1447 Electric1447 added bugfix Bugfixes Dark Mode Anything related to Dark Mode enhancement New feature or request translation Add/Improve translations. labels Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bugfixes Dark Mode Anything related to Dark Mode enhancement New feature or request translation Add/Improve translations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants