Compare commits

...

12 Commits

Author SHA1 Message Date
7e6c0b90e2 Merge pull request 'Volume Seekbar Fixes' (#3) from dev into main
Reviewed-on: #3
2025-08-17 08:49:15 -07:00
84c75f6be7 No need to call something in onCreate which is called in onResume. 2025-08-17 08:41:29 -07:00
1b3ca8c8af Only change the seekbar if it differs so that the volume sidebar does not show up on every open. 2025-08-17 08:40:56 -07:00
f83a8b41e4 Ensure volume bar is accurate if the app is minimized and the volume is modified before the app is reopened. 2025-08-17 08:35:13 -07:00
bc433b4185 Correctly add a space between "Volume" and the status. 2025-08-17 08:33:00 -07:00
34b13473c9 Show the article URL for proper accreditation. 2025-07-19 15:54:00 -07:00
a642b51532 Increment version for future development. 2025-07-19 15:52:02 -07:00
a5490b98c7 Hide release files (APKs and JSON) from Git. 2025-07-19 15:51:05 -07:00
140350012b Fix URL. 2025-07-19 15:50:40 -07:00
d610bfd40b Merge pull request 'v1.1.0 - Update Targeted Version + Enhancements + Bugfixes' (#1) from dev into main
# Enhancements
- Target Android 36 and update theme so that the app may be used properly on current and future versions of Android.
- Volume slider for easy viewing and changing of current settings.
- Add a default sound for devices lacking notification sounds.
- Add a rounded icon.

# Bugfixes
- App opening with Start already pressed.
- Large intervals (hundreds of hours) causing odd behavior.
2025-07-19 15:25:33 -07:00
b1c2dfaa6f Add a Spanish string resource. 2025-07-19 15:00:47 -07:00
e79ee82193 Add textview for volume control. 2025-07-19 15:00:26 -07:00
7 changed files with 89 additions and 20 deletions

2
.gitignore vendored
View File

@@ -33,3 +33,5 @@ google-services.json
# Android Profiling
*.hprof
# Release Files
app/release/*

View File

@@ -5,8 +5,8 @@ Timer which loops over the specified interval, playing your default notification
## Update Notes
### 2025-07-11
(This article)[https://sijus.medium.com/resurrecting-a-5-year-old-android-app-a-developers-journey-59d8f5689e5b]
was very helpful in getting this app updated from SDK 25 to 36.
This article was very helpful in getting this app updated from SDK 25 to 36.
- https://sijus.medium.com/resurrecting-a-5-year-old-android-app-a-developers-journey-59d8f5689e5b
## Licenses
Chime sound byte came free from here:

View File

@@ -7,8 +7,8 @@ android {
applicationId "com.hyperling.apps.infinitetimer"
minSdkVersion 14
targetSdkVersion 36
versionCode 8
versionName "1.1.0"
versionCode 9
versionName "1.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {

View File

@@ -56,6 +56,7 @@ public class MainActivity extends AppCompatActivity {
SeekBar seekBar;
AudioManager audioManager;
TextView tvSeekBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -210,29 +211,31 @@ public class MainActivity extends AppCompatActivity {
//(ViewManager) etMillis.getParent().remove
seekBar = findViewById(R.id.seekBar);
audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
syncVolume();
audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
seekBar.setMax(maxVolume);
tvSeekBar = findViewById(R.id.tvSeekbar);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, i, AudioManager.FLAG_SHOW_UI);
syncVolume();
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// Do Nothing
syncVolume();
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// Do Nothing
syncVolume();
}
});
setVolumeControlStream(AudioManager.STREAM_MUSIC);
recoverScreen();
if (DEBUG) Log.d(tag, "Finished");
}
@@ -685,11 +688,18 @@ public class MainActivity extends AppCompatActivity {
}
public void syncVolume() {
int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
seekBar.setMax(maxVolume);
String tag = TAG + "syncVolume";
if (DEBUG) Log.d(tag, "Starting");
int currVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
seekBar.setProgress(currVolume);
if (currVolume != seekBar.getProgress()) {
seekBar.setProgress(currVolume);
}
String volume = getString(R.string.tvSeekBar) + " " + seekBar.getProgress() + "/" + seekBar.getMax();
tvSeekBar.setText(volume);
if (DEBUG) Log.d(tag, "Finished");
}
@Override
@@ -725,6 +735,7 @@ public class MainActivity extends AppCompatActivity {
sharedPreferences.edit().putBoolean(keyServiceRunning, false).apply();
recoverScreen();
syncVolume();
if (DEBUG) Log.d(tag, "Finished");
}

View File

@@ -158,13 +158,27 @@
</TableLayout>
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tblButtons"
android:layout_alignParentBottom="true"
android:layout_marginVertical="@dimen/activity_vertical_margin"
android:layout_centerHorizontal="true"/>
android:layout_alignParentBottom="true">
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/activity_vertical_margin"
android:layout_centerInParent="true"
android:indeterminate="false"/>
<TextView
android:id="@+id/tvSeekbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/seekBar"
android:layout_centerHorizontal="true"
android:text="@string/tvSeekBar"
android:textSize="14sp" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -0,0 +1,40 @@
<resources>
<!-- App details -->
<string name="appName">Infinite Timer</string>
<string name="appVersion">v20250711</string>
<string name="TAG">com.hyperling.apps.infinitetimer</string>
<!-- Keys -->
<string name="keySharedPreferences">InfiniteTimer</string>
<string name="keyDebug">DEBUG</string>
<string name="keyChronometerTime">ChronometerTime</string>
<string name="keyLoopInterval">LoopInterval</string>
<string name="keyStartStop">StartStop</string>
<string name="keyAppOpen">AppOpen</string>
<string name="keyServiceRunning">ServiceRunning</string>
<!-- UI Text -->
<string name="btnStart">Empezar</string>
<string name="btnStop">Terminar</string>
<string name="btnChooseTime">Elige un Tiempo</string>
<string name="btnReset">Reiniciar</string>
<string name="btnPause">Pausa</string>
<string name="btnResume">Seguir</string>
<string name="chronometerDefault">00:00:00</string>
<string name="tvHoursHint">Horas</string>
<string name="tvMinutesHint">Minutos</string>
<string name="tvSecondsHint">Segundos</string>
<string name="tvMillisHint">Millis</string>
<string name="tvDot">.</string>
<string name="tvUpperLabel"><b>Tiempo entre notificaciones:</b></string>
<string name="tvLowerLabel"><b>Cuenta regresiva hasta notificación:</b></string>
<string name="action_millis">Enable Millisecs</string>
<string name="action_enable_ads">Enable Ads</string>
<string name="action_exit">Exit</string>
<string name="tvSeekBar">Volumen: </string>
</resources>

View File

@@ -35,4 +35,6 @@
<string name="action_millis">Enable Millisecs</string>
<string name="action_enable_ads">Enable Ads</string>
<string name="action_exit">Exit</string>
<string name="tvSeekBar">Media Volume:</string>
</resources>