mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 09:33:33 +00:00
fix: corrected the and updated the string message for the toast. got the build working. It was not pretty.
This commit is contained in:
parent
d32d2bcf31
commit
6703704f22
8 changed files with 20 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -14,3 +14,4 @@
|
||||||
.cxx
|
.cxx
|
||||||
/.idea/
|
/.idea/
|
||||||
.env
|
.env
|
||||||
|
.vscode/settings.json
|
||||||
|
|
|
||||||
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
|
|
@ -192,6 +192,7 @@
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ android {
|
||||||
targetSdk 35
|
targetSdk 35
|
||||||
|
|
||||||
versionCode 26
|
versionCode 26
|
||||||
versionName '3.9.0'
|
versionName '3.9.3'
|
||||||
|
|
||||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
|
|
||||||
|
|
@ -107,4 +107,9 @@ dependencies {
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.14'
|
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.14'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
|
||||||
|
}
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(17)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
package com.cappielloantonio.tempo.repository;
|
package com.cappielloantonio.tempo.repository;
|
||||||
|
|
||||||
|
import static android.provider.Settings.System.getString;
|
||||||
|
|
||||||
|
import android.provider.Settings;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
@ -23,6 +26,7 @@ import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
public class PlaylistRepository {
|
public class PlaylistRepository {
|
||||||
|
@androidx.media3.common.util.UnstableApi
|
||||||
private final PlaylistDao playlistDao = AppDatabase.getInstance().playlistDao();
|
private final PlaylistDao playlistDao = AppDatabase.getInstance().playlistDao();
|
||||||
public MutableLiveData<List<Playlist>> getPlaylists(boolean random, int size) {
|
public MutableLiveData<List<Playlist>> getPlaylists(boolean random, int size) {
|
||||||
MutableLiveData<List<Playlist>> listLivePlaylists = new MutableLiveData<>(new ArrayList<>());
|
MutableLiveData<List<Playlist>> listLivePlaylists = new MutableLiveData<>(new ArrayList<>());
|
||||||
|
|
@ -83,12 +87,12 @@ public class PlaylistRepository {
|
||||||
.enqueue(new Callback<ApiResponse>() {
|
.enqueue(new Callback<ApiResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull Response<ApiResponse> response) {
|
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull Response<ApiResponse> response) {
|
||||||
Toast.makeText(App.getContext(), getString(R.string.playlist_chooser_dialog_toast_add_success), Toast.LENGTH_SHORT).show();
|
Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_add_success), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<ApiResponse> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<ApiResponse> call, @NonNull Throwable t) {
|
||||||
Toast.makeText(App.getContext(), getString(R.string.playlist_chooser_dialog_toast_add_failure), Toast.LENGTH_SHORT).show();
|
Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_add_failure), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -160,17 +164,19 @@ public class PlaylistRepository {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@androidx.media3.common.util.UnstableApi
|
||||||
public LiveData<List<Playlist>> getPinnedPlaylists() {
|
public LiveData<List<Playlist>> getPinnedPlaylists() {
|
||||||
return playlistDao.getAll();
|
return playlistDao.getAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@androidx.media3.common.util.UnstableApi
|
||||||
public void insert(Playlist playlist) {
|
public void insert(Playlist playlist) {
|
||||||
InsertThreadSafe insert = new InsertThreadSafe(playlistDao, playlist);
|
InsertThreadSafe insert = new InsertThreadSafe(playlistDao, playlist);
|
||||||
Thread thread = new Thread(insert);
|
Thread thread = new Thread(insert);
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@androidx.media3.common.util.UnstableApi
|
||||||
public void delete(Playlist playlist) {
|
public void delete(Playlist playlist) {
|
||||||
DeleteThreadSafe delete = new DeleteThreadSafe(playlistDao, playlist);
|
DeleteThreadSafe delete = new DeleteThreadSafe(playlistDao, playlist);
|
||||||
Thread thread = new Thread(delete);
|
Thread thread = new Thread(delete);
|
||||||
|
|
|
||||||
|
|
@ -159,8 +159,6 @@
|
||||||
<string name="playlist_chooser_dialog_negative_button">Annuler</string>
|
<string name="playlist_chooser_dialog_negative_button">Annuler</string>
|
||||||
<string name="playlist_chooser_dialog_neutral_button">Créer</string>
|
<string name="playlist_chooser_dialog_neutral_button">Créer</string>
|
||||||
<string name="playlist_chooser_dialog_title">Ajouter à une playlist</string>
|
<string name="playlist_chooser_dialog_title">Ajouter à une playlist</string>
|
||||||
<string name="playlist_chooser_dialog_toast_add_success">Ajout d'une chanson à la playlist</string>
|
|
||||||
<string name="playlist_chooser_dialog_toast_add_failure">Échec de l'ajout d'une chanson à la playlist</string>
|
|
||||||
<string name="playlist_counted_tracks">%1$d titres • %2$s</string>
|
<string name="playlist_counted_tracks">%1$d titres • %2$s</string>
|
||||||
<string name="playlist_duration">Durée • %1$s</string>
|
<string name="playlist_duration">Durée • %1$s</string>
|
||||||
<string name="playlist_editor_dialog_hint_name">Nom de la playlist</string>
|
<string name="playlist_editor_dialog_hint_name">Nom de la playlist</string>
|
||||||
|
|
|
||||||
0
gradlew
vendored
Normal file → Executable file
0
gradlew
vendored
Normal file → Executable file
|
|
@ -1,2 +1,5 @@
|
||||||
|
plugins {
|
||||||
|
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
|
||||||
|
}
|
||||||
include ':app'
|
include ':app'
|
||||||
rootProject.name = "Tempo"
|
rootProject.name = "Tempo"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue