Skip to content

Add a floating button for the back menu#217

Merged
ClassicOldSong merged 16 commits intoClassicOldSong:moonlight-noirfrom
bonelag:moonlight-noir
May 21, 2025
Merged

Add a floating button for the back menu#217
ClassicOldSong merged 16 commits intoClassicOldSong:moonlight-noirfrom
bonelag:moonlight-noir

Conversation

@bonelag
Copy link
Copy Markdown

@bonelag bonelag commented May 17, 2025

My pull request

@ClassicOldSong
Copy link
Copy Markdown
Owner

Thank you , but if you try compile, it won't work. Please fix the above reviews.

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 17, 2025

Screenrecorder-2025-05-17-14-24-57-234.mp4

it work😅

@ClassicOldSong
Copy link
Copy Markdown
Owner

ClassicOldSong commented May 17, 2025

It won't work if you use the latest code. Just try compile the branch you're sending the PR from.

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 17, 2025

The version I tested is an older version than the current one, but the logic is still the same. I hope you can refer to it and apply it in the latest version.

@ClassicOldSong
Copy link
Copy Markdown
Owner

Yes, but I have modified parts in a recent commit there that you removed. Please add them back.

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 17, 2025

I don't quite understand what you mean, can you be more specific so I can provide what you need?

public static final String EXTRA_PORT = "Port";
public static final String EXTRA_HTTPS_PORT = "HttpsPort";
public static final String EXTRA_APP_NAME = "AppName";
public static final String EXTRA_APP_UUID = "AppUUID";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please don't remove the newly added parts.......


public static final String CLIPBOARD_IDENTIFIER = "ArtemisStreaming";

private String appUUID;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Same here

host = Game.this.getIntent().getStringExtra(EXTRA_HOST);
port = Game.this.getIntent().getIntExtra(EXTRA_PORT, NvHTTP.DEFAULT_HTTP_PORT);
httpsPort = Game.this.getIntent().getIntExtra(EXTRA_HTTPS_PORT, 0); // 0 is treated as unknown
appUUID = Game.this.getIntent().getStringExtra(EXTRA_APP_UUID);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Same here

byte[] derCertData = Game.this.getIntent().getByteArrayExtra(EXTRA_SERVER_CERT);

app = new NvApp(appName != null ? appName : "app", appUUID, appId, appSupportsHdr);
app = new NvApp(appName != null ? appName : "app", appId, appSupportsHdr);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Same here

.setVirtualDisplay(vDisplay)
.setResolutionScaleFactor(prefConfig.resolutionScaleFactor)
.setApp(app)
.setEnableUltraLowLatency(prefConfig.enableUltraLowLatency)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Same here

@ClassicOldSong
Copy link
Copy Markdown
Owner

Ah sorry, I didn't submit the reviews

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 17, 2025

oh i see, i copied and pasted the code of the old version so it caused an error, i will review it

Copy link
Copy Markdown
Owner

@ClassicOldSong ClassicOldSong left a comment

Choose a reason for hiding this comment

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

Also, can we add a preference option to toggle the floating button? If it can be toggled in the back menu dynamically it's even better.

private float dX, dY;
private boolean isMovingButton = false;
private static final float CLICK_ACTION_THRESHOLD = 5;
private float startX, startY;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Class member names should reflect what they're actually for. dX/dY, startX/startY are just too generic.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also here, please change them to a more specific name.

newX = getWindow().getDecorView().getWidth() - view.getWidth();
}
if (newY > getWindow().getDecorView().getHeight() - view.getHeight()) {
newY = getWindow().getDecorView().getHeight() - view.getHeight();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The same value can be stored in a local variable, no need to get and calcuoate them everytime. The original Moonlight code did this but let's keep this bad habbit out of our new codes.

@ClassicOldSong ClassicOldSong changed the title test Add a floating button for the back menu May 17, 2025
Copy link
Copy Markdown
Author

@bonelag bonelag left a comment

Choose a reason for hiding this comment

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

since I'm not very good at coding I merged it with the back menu's hide/show setting

streamView.setClipToOutline(true);
}
}
private void updateFloatingButtonVisibility() {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

since I'm not very good at coding I merged it with the back menu hide/show setting

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 17, 2025

I tested it because I needed to use it, so it's not very professional. If you have any ideas for changes, just do it to upgrade the app to be more complete.

README.md Outdated
Artemis is currently the best fork of Moonlight with loads of optimizations for office usage.

A more seamless experience with virtual display will be Artemis paired with [Apollo](https://github.com/ClassicOldSong/Apollo).
A more seamless experience with virtual display will be Artemis paired with [Artemis](https://github.com/ClassicOldSong/Artemis).
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Artemis paired with Artemis 🤣

It should remain Apollo, and all of the followings.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

haha i was a little confused

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Here this is still not fixed. You can just revert the edits to this file.

@ClassicOldSong
Copy link
Copy Markdown
Owner

It seems you have messed up all the Vietnamese translations... You got Apollo and Artemis swapped everywhere. I don't understand Vietnamese so you have to fix it yourself.

@ClassicOldSong
Copy link
Copy Markdown
Owner

Any updates?

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 18, 2025

i will fix this now

README.md Outdated
Artemis is currently the best fork of Moonlight with loads of optimizations for office usage.

A more seamless experience with virtual display will be Artemis paired with [Apollo](https://github.com/ClassicOldSong/Apollo).
A more seamless experience with virtual display will be Artemis paired with [Artemis](https://github.com/ClassicOldSong/Artemis).
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Here this is still not fixed. You can just revert the edits to this file.

private float dX, dY;
private boolean isMovingButton = false;
private static final float CLICK_ACTION_THRESHOLD = 5;
private float startX, startY;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also here, please change them to a more specific name.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please don't add CI yet... It causes sign key change and will force everyone to reinstall.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I just build to find bugs, please ignore it

@ClassicOldSong
Copy link
Copy Markdown
Owner

Please discuss first if you're adding anything, or I'll only cherry picking relvant commits.

@ClassicOldSong
Copy link
Copy Markdown
Owner

You can build locally to test, no need to rely on the CI and constantly push any minor changes.

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 18, 2025

i want to do that too but my pc is really bad

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 18, 2025

image

@ClassicOldSong
Copy link
Copy Markdown
Owner

😢

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 18, 2025

I will try running on android studio cloud
image

@bonelag
Copy link
Copy Markdown
Author

bonelag commented May 18, 2025

image
haha I actually control my real machine through a virtual machine

@ClassicOldSong ClassicOldSong merged commit 33aa14b into ClassicOldSong:moonlight-noir May 21, 2025
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.

2 participants