Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into haptic-feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Drumber committed Aug 12, 2023
2 parents 223c736 + 237bdc5 commit 8e5f51b
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 120 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ android {
enableSplit = false
}
}
namespace 'org.xbmc.kore'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
3 changes: 1 addition & 2 deletions app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.xbmc.kore">
xmlns:tools="http://schemas.android.com/tools">

<!-- For espresso testing purposes, this is removed in live builds, but not in dev builds -->
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.xbmc.kore">
xmlns:tools="http://schemas.android.com/tools">

<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
225 changes: 113 additions & 112 deletions app/src/main/java/org/xbmc/kore/eventclient/PacketBUTTON.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
*/

package org.xbmc.kore.eventclient;

/**
* XBMC Event Client Class
*
* <p>
* A button packet send a key press or release event to XBMC
* @author Stefan Agner
*
* @author Stefan Agner
*/
public class PacketBUTTON extends Packet {

protected final static byte BT_USE_NAME = 0x01;
protected final static byte BT_DOWN = 0x02;
protected final static byte BT_UP = 0x04;
Expand All @@ -36,122 +37,122 @@ public class PacketBUTTON extends Packet {
protected final static byte BT_AXIS = (byte)0x80;
protected final static byte BT_AXISSINGLE = (byte)0x100;

/**
* A button packet send a key press or release event to XBMC
* @param code raw button code (default: 0)
* @param repeat this key press should repeat until released (default: 1)
* Note that queued pressed cannot repeat.
* @param down if this is 1, it implies a press event, 0 implies a release
* event. (default: 1)
* @param queue a queued key press means that the button event is
* executed just once after which the next key press is processed.
* It can be used for macros. Currently there is no support for
* time delays between queued presses. (default: 0)
* @param amount unimplemented for now; in the future it will be used for
* specifying magnitude of analog key press events
* @param axis Axis
*/
public PacketBUTTON(short code, boolean repeat, boolean down, boolean queue, short amount, byte axis)
{
super(PT_BUTTON);
String map_name = "";
String button_name = "";
short flags = 0;
appendPayload(code, map_name, button_name, repeat, down, queue, amount, axis, flags);
}
/**
* A button packet send a key press or release event to XBMC
* @param map_name a combination of map_name and button_name refers to a
* mapping in the user's Keymap.xml or Lircmap.xml.
* map_name can be one of the following:
* <ul>
* <li>"KB" => standard keyboard map ( <keyboard> section )</li>
* <li>"XG" => xbox gamepad map ( <gamepad> section )</li>
* <li>"R1" => xbox remote map ( <remote> section )</li>
* <li>"R2" => xbox universal remote map ( <universalremote> section )</li>
* <li>"LI:devicename" => LIRC remote map where 'devicename' is the
* actual device's name</li></ul>
* @param button_name a button name defined in the map specified in map_name.
* For example, if map_name is "KB" refering to the <keyboard> section in Keymap.xml
* then, valid button_names include "printscreen", "minus", "x", etc.
* @param repeat this key press should repeat until released (default: 1)
* Note that queued pressed cannot repeat.
* @param down if this is 1, it implies a press event, 0 implies a release
* event. (default: 1)
* @param queue a queued key press means that the button event is
* executed just once after which the next key press is processed.
* It can be used for macros. Currently there is no support for
* time delays between queued presses. (default: 0)
* @param amount unimplemented for now; in the future it will be used for
* specifying magnitude of analog key press events
* @param axis Axis
*/
public PacketBUTTON(String map_name, String button_name, boolean repeat, boolean down, boolean queue, short amount, byte axis)
{
super(PT_BUTTON);
short code = 0;
short flags = BT_USE_NAME;
appendPayload(code, map_name, button_name, repeat, down, queue, amount, axis, flags);
}
/**
* Appends Payload for a Button Packet (this method is used by the different Constructors of this Packet)
* @param code raw button code (default: 0)
* @param map_name a combination of map_name and button_name refers to a
* mapping in the user's Keymap.xml or Lircmap.xml.
* map_name can be one of the following:
* <ul>
* <li>"KB" => standard keyboard map ( <keyboard> section )</li>
* <li>"XG" => xbox gamepad map ( <gamepad> section )</li>
* <li>"R1" => xbox remote map ( <remote> section )</li>
* <li>"R2" => xbox universal remote map ( <universalremote> section )</li>
* <li>"LI:devicename" => LIRC remote map where 'devicename' is the
* actual device's name</li></ul>
* @param button_name a button name defined in the map specified in map_name.
* For example, if map_name is "KB" refering to the <keyboard> section in Keymap.xml
* then, valid button_names include "printscreen", "minus", "x", etc.
* @param repeat this key press should repeat until released (default: 1)
* Note that queued pressed cannot repeat.
* @param down if this is 1, it implies a press event, 0 implies a release
* event. (default: 1)
* @param queue a queued key press means that the button event is
* executed just once after which the next key press is processed.
* It can be used for macros. Currently there is no support for
* time delays between queued presses. (default: 0)
* @param amount unimplemented for now; in the future it will be used for
* specifying magnitude of analog key press events
* @param axis Axis
* @param flags Packet specific flags
*/
private void appendPayload(short code, String map_name, String button_name, boolean repeat, boolean down, boolean queue, short amount, byte axis, short flags)
{
if(amount>0)
flags |= BT_USE_AMOUNT;
else
amount = 0;
if(down)
/**
* A button packet send a key press or release event to XBMC
*
* @param code raw button code (default: 0)
* @param repeat this key press should repeat until released (default: 1)
* Note that queued pressed cannot repeat.
* @param down if this is 1, it implies a press event, 0 implies a release
* event. (default: 1)
* @param queue a queued key press means that the button event is
* executed just once after which the next key press is processed.
* It can be used for macros. Currently there is no support for
* time delays between queued presses. (default: 0)
* @param amount unimplemented for now; in the future it will be used for
* specifying magnitude of analog key press events
* @param axis Axis
*/
public PacketBUTTON(short code, boolean repeat, boolean down, boolean queue, short amount, byte axis) {
super(PT_BUTTON);
String map_name = "";
String button_name = "";
short flags = 0;
appendPayload(code, map_name, button_name, repeat, down, queue, amount, axis, flags);
}

/**
* A button packet send a key press or release event to XBMC
*
* @param map_name a combination of map_name and button_name refers to a
* mapping in the user's Keymap.xml or Lircmap.xml.
* map_name can be one of the following:
* <ul>
* <li>"KB" => standard keyboard map ( <keyboard> section )</li>
* <li>"XG" => xbox gamepad map ( <gamepad> section )</li>
* <li>"R1" => xbox remote map ( <remote> section )</li>
* <li>"R2" => xbox universal remote map ( <universalremote> section )</li>
* <li>"LI:devicename" => LIRC remote map where 'devicename' is the
* actual device's name</li></ul>
* @param button_name a button name defined in the map specified in map_name.
* For example, if map_name is "KB" refering to the <keyboard> section in Keymap.xml
* then, valid button_names include "printscreen", "minus", "x", etc.
* @param repeat this key press should repeat until released (default: 1)
* Note that queued pressed cannot repeat.
* @param down if this is 1, it implies a press event, 0 implies a release
* event. (default: 1)
* @param queue a queued key press means that the button event is
* executed just once after which the next key press is processed.
* It can be used for macros. Currently there is no support for
* time delays between queued presses. (default: 0)
* @param amount unimplemented for now; in the future it will be used for
* specifying magnitude of analog key press events
* @param axis Axis
*/
public PacketBUTTON(String map_name, String button_name, boolean repeat, boolean down, boolean queue, short amount, byte axis) {
super(PT_BUTTON);
short code = 0;
short flags = BT_USE_NAME;
appendPayload(code, map_name, button_name, repeat, down, queue, amount, axis, flags);
}

/**
* Appends Payload for a Button Packet (this method is used by the different Constructors of this Packet)
*
* @param code raw button code (default: 0)
* @param map_name a combination of map_name and button_name refers to a
* mapping in the user's Keymap.xml or Lircmap.xml.
* map_name can be one of the following:
* <ul>
* <li>"KB" => standard keyboard map ( <keyboard> section )</li>
* <li>"XG" => xbox gamepad map ( <gamepad> section )</li>
* <li>"R1" => xbox remote map ( <remote> section )</li>
* <li>"R2" => xbox universal remote map ( <universalremote> section )</li>
* <li>"LI:devicename" => LIRC remote map where 'devicename' is the
* actual device's name</li></ul>
* @param button_name a button name defined in the map specified in map_name.
* For example, if map_name is "KB" refering to the <keyboard> section in Keymap.xml
* then, valid button_names include "printscreen", "minus", "x", etc.
* @param repeat this key press should repeat until released (default: 1)
* Note that queued pressed cannot repeat.
* @param down if this is 1, it implies a press event, 0 implies a release
* event. (default: 1)
* @param queue a queued key press means that the button event is
* executed just once after which the next key press is processed.
* It can be used for macros. Currently there is no support for
* time delays between queued presses. (default: 0)
* @param amount unimplemented for now; in the future it will be used for
* specifying magnitude of analog key press events
* @param axis Axis
* @param flags Packet specific flags
*/
private void appendPayload(short code, String map_name, String button_name, boolean repeat, boolean down, boolean queue, short amount, byte axis, short flags) {
if (amount > 0)
flags |= BT_USE_AMOUNT;
else
amount = 0;

if (down)
flags |= BT_DOWN;
else
flags |= BT_UP;
if(!repeat)

if (!repeat)
flags |= BT_NO_REPEAT;
if(queue)

if (queue)
flags |= BT_QUEUE;
if(axis == 1)

if (axis == 1)
flags |= BT_AXISSINGLE;
else if (axis == 2)
flags |= BT_AXIS;

appendPayload(code);
appendPayload(flags);
appendPayload(amount);
appendPayload(map_name);
appendPayload(button_name);
}

appendPayload(code);
appendPayload(flags);
appendPayload(amount);
appendPayload(map_name);
appendPayload(button_name);
}
}
4 changes: 2 additions & 2 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<string name="finish_after_send">Terminar después de enviar</string>
<string name="library_actions">Mantenimiento de biblioteca</string>
<string name="clean_video_library">Limpiar biblioteca de vídeos</string>
<string name="clean_audio_library">Limpiar biblioteca de música</string>
<string name="clean_audio_library">Limpiar biblioteca de audio</string>
<string name="update_video_library">Actualizar biblioteca de vídeo</string>
<string name="update_audio_library">Actualizar biblioteca de música</string>
<string name="toggle_fullscreen">Cambiar a pantalla completa</string>
Expand Down Expand Up @@ -119,7 +119,7 @@
<string name="pause">Pausa</string>
<string name="stop">Detener</string>
<string name="fast_forward">Avance rápido</string>
<string name="rewind">Retroceder</string>
<string name="rewind">Rebobinar</string>
<string name="repeat">Repetir</string>
<string name="shuffle">Aleatorio</string>
<string name="volume_up">Subir volumen</string>
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/res/values-sk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,28 @@
<string name="any_network">Ľubovoľné</string>
<string name="queue_action">Fronta</string>
<string name="download_action">Stiahnuť</string>
<string name="party_mode">Párty režim</string>
<string name="theme_color_yellow">Žltá ponorka</string>
<string name="always_sendtokodi_addon">Uprednostniť doplnok SendToKodi</string>
<string name="web_search">Webové vyhľadávanie</string>
<string name="not_connected">Nepripojené</string>
<string name="wizard_done">Všetko hotové!</string>
<string name="watched_status">Videné</string>
<string name="unwatched_status">Nevidené</string>
<string name="pinned_status">Pripnuté</string>
<string name="unpinned_status">Nepripnuté</string>
<string name="enabled_status">Povolené</string>
<string name="disabled_status">Nepovolené</string>
<string name="theme_default_dynamic">Dynamický deň/noc</string>
<string name="theme_color">Farebný motív</string>
<string name="theme_color_system_colors">Systémové farby</string>
<string name="theme_variant">Variant</string>
<string name="theme_variant_auto">Systémová</string>
<string name="theme_variant_light">Svetlá</string>
<string name="theme_variant_dark">Tmavá</string>
<string name="theme_color_green">Zelená míľa</string>
<string name="theme_color_purple">Fialový dážď</string>
<string name="use_hardware_volume_keys_never">Nikdy</string>
<string name="use_hardware_volume_keys_always">Vždy</string>
<string name="use_hardware_volume_keys_when_in_foreground">Ak je Kore na popredí</string>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.android.tools.build:gradle:7.4.2'

// NOTE: Do not place your application dependencies here;
// they belong in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 8e5f51b

Please sign in to comment.