Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ needs them.
Google Play app. (The old `com.backyardbrains.bybremote` Play listing is tied to a signing key
we no longer have, so it is not used.)
3. **The app is BYB Backpack** (the iOS counterpart is called BYB Remote). The default look is
the board picture and "Find Signal Generator". The classic RoboRoach skin (roach and backpack
the board picture and "Find Signal Generator". **Retro mode** (the 1.x roach and backpack
pictures, "Find RoboRoach") is a switch in Settings, off by default and remembered between
launches. Protocol names (for example `ROBOROACH_FREQUENCY` and the advertised device name) stay
launches. The store listing does not mention Retro mode. Protocol names (for example `ROBOROACH_FREQUENCY` and the advertised device name) stay
as the firmware defines them.
4. **`targetSdk` meets Google Play's current requirement** (API 36 since 2026-08-31; Google raises
it every August). Raising it is its own PR with emulator smoke screenshots checked.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BYB Backpack is the Bluetooth remote for the Backyard Brains RoboRoach backpack (a tiny signal
generator): find the nearest one, swipe left or right to send a pulse train, and set frequency,
pulse width, duration, gain and random mode. Settings has a **RoboRoach skin** switch for the
pulse width, duration, gain and random mode. Settings has a **Retro mode** switch for the
classic roach-and-backpack look. Package `com.backyardbrains.bybbackpack`.

The iOS counterpart is called BYB Remote
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class MainActivity extends AppCompatActivity implements RemoteManagerCall
private static final int SCREEN_SETTINGS = 1;

private static final String PREFS = "byb_remote";
private static final String PREF_ROBOROACH_SKIN = "roboroach_skin";
private static final String PREF_RETRO_MODE = "retro_mode";

boolean mScanning = false;
boolean mTurning = false;
Expand All @@ -78,7 +78,7 @@ public class MainActivity extends AppCompatActivity implements RemoteManagerCall
private OnBackPressedCallback mSettingsBackCallback;

/* the pictures for the current skin: always-on base, and the overlay that lights up when connected */
private boolean mRoboRoachSkin = false;
private boolean mRetroMode = false;
private ImageView mBaseImage;
private ImageView mConnectedImage;

Expand Down Expand Up @@ -141,10 +141,10 @@ public class MainActivity extends AppCompatActivity implements RemoteManagerCall
if (getSupportActionBar() != null) getSupportActionBar().setDisplayShowTitleEnabled(false);

final SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE);
applySkin(prefs.getBoolean(PREF_ROBOROACH_SKIN, false));
viewHolder.RoboRoachSkin.setChecked(mRoboRoachSkin);
viewHolder.RoboRoachSkin.setOnCheckedChangeListener((buttonView, isChecked) -> {
prefs.edit().putBoolean(PREF_ROBOROACH_SKIN, isChecked).apply();
applySkin(prefs.getBoolean(PREF_RETRO_MODE, false));
viewHolder.RetroMode.setChecked(mRetroMode);
viewHolder.RetroMode.setOnCheckedChangeListener((buttonView, isChecked) -> {
prefs.edit().putBoolean(PREF_RETRO_MODE, isChecked).apply();
applySkin(isChecked);
});
viewHolder.goLeftText.setVisibility(View.INVISIBLE);
Expand Down Expand Up @@ -303,7 +303,7 @@ public void onClick(View v) {

@Override public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
menu.findItem(R.id.menu_scan).setTitle(mRoboRoachSkin ? R.string.menu_scan_roboroach : R.string.menu_scan);
menu.findItem(R.id.menu_scan).setTitle(mRetroMode ? R.string.menu_scan_roboroach : R.string.menu_scan);
if (mRemoteManager.isConnected()) {
menu.findItem(R.id.menu_stop).setVisible(false);
menu.findItem(R.id.menu_scan).setVisible(false);
Expand Down Expand Up @@ -516,14 +516,14 @@ private void updateSettingsEnabled() {
viewHolder.PulseWidth.setEnabled(connected && !random);
}

/* BYB Backpack board (default) or the classic RoboRoach pictures; keeps the current connection look */
private void applySkin(boolean roboRoach) {
/* BYB Backpack board (default) or Retro mode (the 1.x roach pictures); keeps the current connection look */
private void applySkin(boolean retro) {
final ImageView oldOverlay = mConnectedImage;
mRoboRoachSkin = roboRoach;
mBaseImage = roboRoach ? viewHolder.roachImage : viewHolder.boardImage;
mConnectedImage = roboRoach ? viewHolder.backpackImage : viewHolder.boardConnectedImage;
final ImageView otherBase = roboRoach ? viewHolder.boardImage : viewHolder.roachImage;
final ImageView otherOverlay = roboRoach ? viewHolder.boardConnectedImage : viewHolder.backpackImage;
mRetroMode = retro;
mBaseImage = retro ? viewHolder.roachImage : viewHolder.boardImage;
mConnectedImage = retro ? viewHolder.backpackImage : viewHolder.boardConnectedImage;
final ImageView otherBase = retro ? viewHolder.boardImage : viewHolder.roachImage;
final ImageView otherOverlay = retro ? viewHolder.boardConnectedImage : viewHolder.backpackImage;

mBaseImage.setVisibility(View.VISIBLE);
otherBase.setVisibility(View.GONE);
Expand Down Expand Up @@ -647,7 +647,7 @@ static class ViewHolder {
SeekBar PulseWidth;
SeekBar Gain;
SwitchCompat RandomMode;
SwitchCompat RoboRoachSkin;
SwitchCompat RetroMode;

// Binds UI elements to local variables
void bind(@NonNull Activity activity) {
Expand All @@ -667,7 +667,7 @@ void bind(@NonNull Activity activity) {
Frequecy = activity.findViewById(R.id.sbFrequency);
PulseWidth = activity.findViewById(R.id.sbPulseWidth);
RandomMode = activity.findViewById(R.id.swRandomMode);
RoboRoachSkin = activity.findViewById(R.id.swRoboRoachSkin);
RetroMode = activity.findViewById(R.id.swRetroMode);
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout-land/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
android:src="@drawable/board_connected"
android:visibility="invisible"/>

<!-- RoboRoach skin (Settings): the 1.x pictures, scaled to 75% to fit landscape. -->
<!-- Retro mode (Settings): the 1.x pictures, scaled to 75% to fit landscape. -->
<ImageView
android:id="@+id/imageRoach"
android:layout_width="90dp"
Expand Down Expand Up @@ -232,11 +232,11 @@
android:layout_height="wrap_content">

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swRoboRoachSkin"
android:id="@+id/swRetroMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="@string/label_roboroach_skin"
android:text="@string/label_retro_mode"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</TableRow>

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
android:src="@drawable/board_connected"
android:visibility="invisible"/>

<!-- RoboRoach skin (Settings): the 1.x pictures. -->
<!-- Retro mode (Settings): the 1.x pictures. -->
<ImageView
android:id="@+id/imageRoach"
android:layout_width="120dp"
Expand Down Expand Up @@ -221,11 +221,11 @@
android:layout_height="wrap_content">

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swRoboRoachSkin"
android:id="@+id/swRetroMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="@string/label_roboroach_skin"
android:text="@string/label_retro_mode"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</TableRow>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<string name="label_random_mode">Random Mode</string>
<string name="label_frequency">Frequency</string>
<string name="label_pulse_width">Pulse Width</string>
<string name="label_roboroach_skin">RoboRoach skin</string>
<string name="label_retro_mode">Retro mode</string>
<string name="action_ok">OK</string>

</resources>
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Do you have a project that requires TTL signals? Are you tired of having to plug

Using this app and the BYB Backpack, our lightweight, portable two-channel Bluetooth signal generator, you can remotely enable TTL signals! Simply connect to the standard 0.1" header, and you can control two independent square-wave pulse trains with a swipe of your finger on your phone. The BYB Backpack is a great addition to your electronics workbench!

Using this app, you choose the type of signal to generate: frequency, pulse width, duration, gain, and a random mode. Prefer the classic look? Turn on the RoboRoach skin in Settings.
Using this app, you choose the type of signal to generate: frequency, pulse width, duration, gain, and a random mode.

Note: you need the BYB Backpack hardware from Backyard Brains to use this app.

Expand Down
8 changes: 4 additions & 4 deletions tool/emulator_smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ if ! adb shell pidof "$PKG" > /dev/null; then
exit 1
fi

# 3. Settings are reachable before connecting; turn on the RoboRoach skin and go back.
# 3. Settings are reachable before connecting; turn on Retro mode and go back.
tap_node 'text="Settings"' || { tap_node 'content-desc="More options"' && tap_node 'text="Settings"'; } \
|| { echo "::error::Could not open Settings (API $sdk)"; exit 1; }
shot 3-settings
tap_node 'text="RoboRoach skin"' || { echo "::error::No RoboRoach skin switch in Settings (API $sdk)"; exit 1; }
tap_node 'text="Retro mode"' || { echo "::error::No Retro mode switch in Settings (API $sdk)"; exit 1; }
adb shell input keyevent KEYCODE_BACK
shot 4-roboroach-skin
shot 4-retro-mode

# 5. Landscape layout (RoboRoach skin is still on: the choice is saved).
# 5. Landscape layout (Retro mode is still on: the choice is saved).
adb shell settings put system accelerometer_rotation 0
adb shell settings put system user_rotation 1
shot 5-landscape
Expand Down
Loading