Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
obbimi committed Apr 18, 2020
1 parent 2b089f0 commit eebc0af
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 30 deletions.
30 changes: 24 additions & 6 deletions AndroidManifestRacketlon.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.doubleyellow.racketlon"
android:versionCode="235"
android:versionName="4.20">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="com.doubleyellow.racketlon"
android:versionName="${versionNameRacketlon}"
android:versionCode="${versionCodePrefix}${versionCodeSuffixRacketlon}">
<!--
<uses-feature android:name="android.permission.SEND_SMS" android:required="false" />
<uses-feature android:name="android.permission.INTERNET" android:required="true" />
Expand Down Expand Up @@ -30,19 +30,32 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- FOREGROUND_SERVICE is a normal permission, so the system automatically grants it to the requesting app. -->
<!--
<uses-feature android:name="android.permission.ACCESS_NETWORK_STATE" android:required="true" />
-->
<uses-sdk/>
-->

<!--<uses-feature android:name="android.hardware.type.watch" android:required="false"/>-->
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
<uses-feature android:name="android.hardware.audio.output" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<uses-feature android:name="android.hardware.wifi" android:required="false"/>

<!-- tools:overrideLibrary="androidx.wear" to be able to compile wearable functionality into non-wear app assuming it will not be invoked -->
<uses-sdk tools:overrideLibrary="androidx.wear"/>

<!--
<supports-screens
android:anyDensity="true"
android:xlargeScreens="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
-->

<application
android:theme="@style/SBTheme"
android:allowBackup="true"
android:usesCleartextTraffic="true"
android:resizeableActivity="true"
android:label="@string/app_name_short_brand_Racketlon"
android:icon="@drawable/logo_brand_racketlon">

Expand All @@ -51,6 +64,11 @@
-->
<service android:name="com.doubleyellow.scoreboard.cast.PresentationService" android:exported="false" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<!--
For ChromeCast (new)
-->
<meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.doubleyellow.scoreboard.cast.framework.CastOptionsProvider" />

<!-- only for shared libraries, mine is not -->
<!--<uses-library android:name="com.doubleyellow.android"/>-->
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'com.android.tools.build:gradle:3.6.3'
}
}
// Run ./gradlew -q :dependencies
Expand Down Expand Up @@ -51,6 +51,7 @@ android {
,versionNameBadminton : "4.32", versionCodeSuffixBadminton : "0435"
,versionNameTennisPadel: "4.33", versionCodeSuffixTennisPadel: "0436"
,versionNameSquore : "4.32", versionCodeSuffixSquore : "0435"
,versionNameRacketlon : "4.32", versionCodeSuffixRacketlon : "0435"
]
}
sourceSets {
Expand Down
27 changes: 10 additions & 17 deletions change.R.package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ if [[ "${tobranded}" = "-h" ]]; then
fi

cd src
if [[ "$tobranded" = "ASB" ]]; then
printf "Change to '${tobranded}'\n"
for f in $(egrep -irl 'com.doubleyellow.scoreboard.R[^a-z]' *); do
printf "File %-72s to %s \n" $f $tobranded
sed -i 's~com.doubleyellow.scoreboard.R\([^a-z]\)~com.doubleyellow.asbsquore.R\1~' ${f}
#exit 1
done
elif [[ "$tobranded" = "Racketlon" ]]; then
if [[ "$tobranded" = "Racketlon" ]]; then
printf "Change to '${tobranded}'\n"
for f in $(egrep -irl 'com.doubleyellow.scoreboard.R[^a-z]' *); do
printf "File %-72s to %s \n" $f $tobranded
Expand Down Expand Up @@ -93,28 +86,28 @@ fi
# change some defaults in xml files (in java is/should be taken care of by means of code)
cd ../res
if [[ "$tobranded" = "Racketlon" ]]; then
for f in $(egrep -rl '@string.*_(Squash|Tabletennis)"'); do
for f in $(egrep -rl '@string.*_Squash"'); do
printf "File %-30s to %s strings\n" $f $tobranded
sed -i 's~_\(Squash\|Tabletennis\|Badminton\|TennisPadel\)"~_Racketlon"~' ${f}
sed -i 's~_Squash"~_Racketlon"~' ${f}
done
elif [[ "$tobranded" = "Tabletennis" ]]; then
for f in $(egrep -rl '@string.*_(Squash|Racketlon)"'); do
for f in $(egrep -rl '@string.*_Squash"'); do
printf "File %-30s to %s strings\n" $f $tobranded
sed -i 's~_\(Squash\|Racketlon\|Badminton\|TennisPadel\)"~_Tabletennis"~' ${f}
sed -i 's~_Squash"~_Tabletennis"~' ${f}
done
elif [[ "$tobranded" = "Badminton" ]]; then
for f in $(egrep -rl '@string.*_(Squash|Racketlon)"'); do
for f in $(egrep -rl '@string.*_Squash"'); do
printf "File %-30s to %s strings\n" $f $tobranded
sed -i 's~_\(Squash\|Racketlon\|Tabletennis\|TennisPadel\)"~_Badminton"~' ${f}
sed -i 's~_Squash"~_Badminton"~' ${f}
done
elif [[ "$tobranded" = "TennisPadel" ]]; then
for f in $(egrep -rl '@string.*_(Squash|Racketlon)"'); do
for f in $(egrep -rl '@string.*_Squash"'); do
printf "File %-30s to %s strings\n" $f $tobranded
sed -i 's~_\(Squash\|Racketlon\|Tabletennis\|Badminton\)"~_TennisPadel"~' ${f}
sed -i 's~_Squash"~_TennisPadel"~' ${f}
done
else
# Squore
for f in $(egrep -rl '@string.*_(Racketlon|Tabletennis|Badminton|TennisPadel)"'); do
for f in $(egrep -rl '@(string|fraction).*_(Racketlon|Tabletennis|Badminton|TennisPadel)"'); do
printf "File %-30s to %s strings\n" $f $tobranded
sed -i 's~_\(Racketlon\|Tabletennis\|Badminton\|TennisPadel\)"~_Squash"~' ${f}
done
Expand Down
2 changes: 0 additions & 2 deletions res/layout/match_simplelayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
android:hint="@string/lbl_player_A"
android:textSize="@dimen/txt_large"
android:textCursorDrawable="@null"
android:paddingLeft="@dimen/sb_playername_leftpadding"
android:paddingStart="@dimen/sb_playername_leftpadding"
android:background="@drawable/button_dark"
android:tag="item"
Expand All @@ -46,7 +45,6 @@
android:hint="@string/lbl_player_B"
android:textSize="@dimen/txt_large"
android:textCursorDrawable="@null"
android:paddingLeft="@dimen/sb_playername_leftpadding"
android:paddingStart="@dimen/sb_playername_leftpadding"
android:background="@drawable/button_dark"
android:tag="item"
Expand Down
1 change: 0 additions & 1 deletion res/menu/floaters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<!-- menu items not actually used as menu. Just here to have a unique id for floating buttons -->
<!--
<item android:id="@+id/float_undo_last" android:visible="false" android:title="@string/uc_undo" />
<item android:id="@+id/float_end_game" android:visible="false" android:title="@string/end_game_Squash" />
-->
<item android:id="@+id/float_timer" android:visible="false" android:title="@string/sb_timer"/>
<item android:id="@+id/float_toss" android:visible="false" android:title="@string/sb_cmd_toss"/>
Expand Down
2 changes: 1 addition & 1 deletion src/com/doubleyellow/scoreboard/model/SportType.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
* A different version of the code may be for different sports.
* For now Racketlon (Score Racketlon), Table Tennis (Score Table Tennis), Badminton (Score Badminton) and Squash (all others) are supported.
* For now TennisPadel, Racketlon (Score Racketlon), Table Tennis (Score Table Tennis), Badminton (Score Badminton) and Squash (all others) are supported.
*/
public enum SportType {
Squash,
Expand Down
2 changes: 1 addition & 1 deletion src/com/doubleyellow/scoreboard/vico/IBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ private void setBackgroundAndBorder(View view, Integer iBgColor, Integer iBorder
GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, colors);
// gd.setShape(GradientDrawable.RECTANGLE); // RECTANGLE is the default
//gd.setCornerRadius(getResources().getDimension(R.dimen.sb_button_radius));
gd.setCornerRadius(getScreenHeightWidthMinimumFraction(R.fraction.player_button_corner_radius));
gd.setCornerRadius(getScreenHeightWidthMinimumFraction(R.fraction.player_button_corner_radius)); // if we do not set this, screen elements no longer have rounded corners
int viewId = view.getId();
if ( iBorderColor != null ) {
gd.setStroke(getScreenHeightWidthMinimumFraction(R.fraction.player_button_colorborder_thickness), iBorderColor);
Expand Down
2 changes: 1 addition & 1 deletion src/com/doubleyellow/scoreboard/wear/WearableHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public void sendMessageToWearables(Context context, String sMessage) {
if ( sMessage.startsWith(BTMethods.requestCompleteJsonOfMatch.toString() ) ) {
// independent of current wearable role, send anyways
} else if ( m_wearableRole.equals(WearRole.AppRunningOnBoth) == false ) {
Log.d(TAG, "App not running on both devices. Not sending: " + sMessage);
//Log.d(TAG, "App not running on both devices. Not sending: " + sMessage);
return;
}
new SendMessageToWearableTask(context).execute(BRAND_PATH, sMessage);
Expand Down

0 comments on commit eebc0af

Please sign in to comment.