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

New Setting Customize for keys And New Functions #524

Merged
merged 31 commits into from
Feb 10, 2024

Conversation

RetrogisusDEV
Copy link
Contributor

What more?

@RetrogisusDEV
Copy link
Contributor Author

I need fix a problem in the styles 🙃

Copy link
Owner

@Julow Julow left a comment

Choose a reason for hiding this comment

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

There's a lot of good ideas, thanks!

You were based on a very old commit so I rebased your work on the latest version and pushed to your branch.
I've also fixed the missing imports and re-indented the code and xml files.

To get the same on your side, use these commands:

git fetch https://github.com/RetrogisusDEV/Unexpected-Keyboard master
git reset --hard FETCH_HEAD

<style name="appTheme" parent="@android:style/Theme.Material.Light">
<item name="android:textStyle">bold</item>
<item name="android:colorAccent">#ff2424ff</item>
<item name="android:colorBackground">#ffeeeeff</item>
Copy link
Owner

Choose a reason for hiding this comment

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

These colors don't look natural on my device. Why not use the default colors by not specifying them ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After meditating, I thought about the number of devices with different designs, and well, I thought about the topic more for new devices (Holo: I'm still alive), so I'm going to leave only the basic modifiers and leave the rest as default, for right, what api is your device?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The point of my changes is to make the keyboard with more universal modifications, for different people, I love flat designs, but others don't, that's why I have to think more global and less local

@RetrogisusDEV
Copy link
Contributor Author

There's a lot of good ideas, thanks!

You were based on a very old commit so I rebased your work on the latest version and pushed to your branch.
I've also fixed the missing imports and re-indented the code and xml files.

To get the same on your side, use these commands:

git fetch https://github.com/RetrogisusDEV/Unexpected-Keyboard master
git reset --hard FETCH_HEAD

Damn... well, I uploaded it stupidly because I wrote everything on the phone and well the format went on vacation...

Actually I did not base it on the previous work, I did everything from scratch, improving the integration and making it more efficient than the previous one, after the customize key thing, I have seen that when leaving the keyboard for a while it clicks and you have to disable it to to work again (the whole app) so I have to verify

Based on a proposal I read, I am trying to use an accessibility service (more specifically, the accessibility button in the navigation bar to invoke the keyboard at any time...

did I do the service? : Yeah
works? : No

I don't know how to insert the code without causing the service to self-disable (or explode)

@@ -46,5 +46,8 @@
<juloo.keyboard2.prefs.SlideBarPreference android:key="character_size" android:title="@string/pref_character_size_title" android:summary="@string/pref_character_size_summary" android:defaultValue="1.0" min="0.75" max="1.5"/>
<juloo.keyboard2.prefs.IntSlideBarPreference android:key="key_vertical_space" android:title="@string/pref_key_vertical_space" android:summary="%sdp" android:defaultValue="2" min="0" max="8"/>
<juloo.keyboard2.prefs.IntSlideBarPreference android:key="key_horizontal_space" android:title="@string/pref_key_horizontal_space" android:summary="%sdp" android:defaultValue="2" min="0" max="8"/>
<CheckBoxPreference android:key="border_config" android:title="@string/pref_border_config" android:summary="@string/pref_border_config_summary" android:defaultValue="false"/>
<juloo.keyboard2.prefs.IntSlideBarPreference android:key="border_radius" android:title="@string/pref_corners_radius" android:summary="%sdp" android:summaryOff="@string/pref_border_options_disabled" android:defaultValue="0" min="0" max="15" android:dependency="border_config"/>
<juloo.keyboard2.prefs.IntSlideBarPreference android:key="border_line_size" android:title="@string/pref_border_width" android:summaryOff="@string/pref_border_options_disabled" android:summary="%sdp" android:defaultValue="0" min="0" max="5" android:dependency="border_config"/>
Copy link
Owner

Choose a reason for hiding this comment

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

1dp is a lot, perhaps this option should be a juloo.keyboard2.prefs.SlideBarPreference that works with floating point numbers.

@@ -147,6 +150,10 @@ public void refresh(Resources res)
keyboardOpacity = _prefs.getInt("keyboard_opacity", 100) * 255 / 100;
keyOpacity = _prefs.getInt("key_opacity", 100) * 255 / 100;
keyActivatedOpacity = _prefs.getInt("key_activated_opacity", 100) * 255 / 100;
// keyboard border settings
borderConfig = _prefs.getBoolean("border_config", false);
borderRadius = _prefs.getInt("border_radius", 0);
Copy link
Owner

Choose a reason for hiding this comment

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

The preference contain numbers in the dp unit but borderRadius is in px unit. It must be converted like this:

Suggested change
borderRadius = _prefs.getInt("border_radius", 0);
borderRadius = get_dip_pref(dm, "border_radius", 0);

Same for borderLineSize.

@@ -59,6 +61,7 @@ public final class Config
public boolean autocapitalisation;
public boolean switch_input_immediate;
public boolean pin_entry_enabled;
public boolean borderConfig;
Copy link
Owner

Choose a reason for hiding this comment

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

This option might seem like a hack but is a foundation for a future "Custom theme" option. Ideally it would work by creating a Theme object and not by adding conditions in the rendering code. Is anyone interested in working on that?

@Julow
Copy link
Owner

Julow commented Jan 20, 2024

I merged the light/dark theme switch in a55506e. I did not include the customized text styles because they look non-native. Simpler is better.

@Julow Julow added this to the 1.27.0 milestone Feb 4, 2024
@Julow
Copy link
Owner

Julow commented Feb 10, 2024

I've made several changes and pushed to your branch. I'll merge!

@Julow Julow merged commit 93d8af4 into Julow:master Feb 10, 2024
3 checks passed
@RetrogisusDEV
Copy link
Contributor Author

@Julow Pipipi I haven't had an internet connection for a while, that's why I disappear and reappear 😭

@RetrogisusDEV
Copy link
Contributor Author

RetrogisusDEV commented Feb 10, 2024

Well I'm going to give you a summary of what I was doing

Custom Theme Adjustment / Default

Based on your suggestion, I made a adjustment to change all the settings for customizations or already default settings, and with the intention of adding other settings that work with this setting [Almost Ready]

Keyboard Background Adjustment Hex / RGB

A setting that is activated with the previous one, to be able to change the color of the keyboard background, using 3 sliders to change the values in base R . G. B , and then convert it into hex [the keyboard does not want to be multicolored, that's why it doesn't work xD ]

accessibility service to invoke the keyboard

because for something I read for there, it made me want (I already had ) to do and to be able to invoke the keyboard where be, and well, accessibility is the most shareable thing that occurred to me, which is using the accessibility button (the one who is a man in stand position [the joke takes fun if it were a 3D model]) and invoke the keyboard or close it, useful for games or Visual novels (they pass them to me, after a while I find out that it's porn and I'm playing that like it's swimming in public xD) that require the keyboard at a certain moment but sometimes the keyboard takes some things [the joke is that, if I did the service, but when you activate it, the button appears in the corner for 200 ms, and says: ehhh! a black! - Insert Sr. Pelo Animation. and it disappears, despite the fact that keyboard or anything is affected by bug or crash xD ]

fix a custom border error

well yes, said setting seemed something simple, but it is the devil disguised as a code, because when turning off the phone or Restart it, you realize that when trying to use the keyboard it does not start, and if you try to open the app it doesn't start either [it's really weird, I haven't achieved anything, but the keyboard restarts in a loop every 3 seconds or less, and yes, I have 1 week without the keyboard, I'm using the backup {see 1.23.x} it fixes reinstalling it from 0, but when you turn off the cel occurs again lol ]

@Julow
Copy link
Owner

Julow commented Feb 10, 2024

All that seems very nice :)
I've made several changes to your branch then merged. Make sure to start from the last version of the master branch of the right repository.

Invoking the keyboard is a popular feature request and I'm happy that you're looking into it!

For the crash, could you get the logs with adb logcat ?

@RetrogisusDEV
Copy link
Contributor Author

The problem is that uhh, I modified some things in Windows and now my phone doesn't detect it properly and uhh, I think ADB won't work for me 😕, I'll have to repair Windows

@Julow
Copy link
Owner

Julow commented Feb 10, 2024

Can you try the apps mentioned in the middle of this page ? https://f-droid.org/docs/Getting_logcat_messages_after_crash/
I couldn't reproduce the crash on my side.

@RetrogisusDEV
Copy link
Contributor Author

Can you try the apps mentioned in the middle of this page ? https://f-droid.org/docs/Getting_logcat_messages_after_crash/
I couldn't reproduce the crash on my side.

Tell you something funny? The joke is that there was never an error, the PC did recognize my phone (but not as pipipi storage) and I spent 1 hour looking at the ADB LOGCAT and well, an error as such never appeared, just a " Warning" of "The application forcibly closed the keyboard" and that's it xd

@RetrogisusDEV
Copy link
Contributor Author

RetrogisusDEV commented Feb 11, 2024

advance: I already made an option to change the colors of the keyboard [Keys/Background], separately, and depending on the color of the keys, (being some value greater than 150) it changes the color of the letters from black to white

[option for change color Default(Theme) / Custom (RGB value to HEX)]

Screenshot_20240211-175531.png

[Keyboard]

Screenshot_20240211-175710.png

@RetrogisusDEV RetrogisusDEV changed the title New Setting Customize for keys And New Style por Activitys New Setting Customize for keys And New Functions Feb 12, 2024
@Julow
Copy link
Owner

Julow commented Feb 14, 2024

Interesting, I'd be glad to review your PR.

@RetrogisusDEV
Copy link
Contributor Author

hey @Julow what function is it that updates the keyboard, I mean, it updates the color data, since I don't know what it is and well, I've been lazy these days (damn Touhou, I even see it at food)

@Julow
Copy link
Owner

Julow commented Feb 21, 2024

The keyboard view can be redrawn by first refreshing the global configuration then calling the reset method.

However, when changing the theme, the view must be re-created like here: https://github.com/Julow/Unexpected-Keyboard/blob/master/srcs/juloo.keyboard2/Keyboard2.java#L225C38-L225C50 (the inflate_view function is defined at the end).

@RetrogisusDEV
Copy link
Contributor Author

@Julow In a while I'm going to start making the PR of what I've done and send it to you, to revive the repo xD

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