Skip to content

Commit

Permalink
+ version up: 0.9.5(137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anrimian committed Oct 23, 2022
1 parent 24f42e5 commit cdc6a20
Show file tree
Hide file tree
Showing 523 changed files with 17,163 additions and 12,127 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ android {
testInstrumentationRunnerArguments["runnerBuilder"] = config.testJunit5Builder

vectorDrawables.useSupportLibrary = true

resConfigs "en", "be", "cs", "de", "el", "es", "fr", "pt", "ru", "tr", "uk"
}
buildTypes {
release {
Expand Down Expand Up @@ -63,6 +65,8 @@ dependencies {
implementation project(':domain')
implementation project(':data')

implementation project(':libs:filesync:core')

def deps = rootProject.ext

implementation kotlinStdLib
Expand All @@ -78,8 +82,6 @@ dependencies {
implementation deps.rxAndroid
implementation deps.rxPermissions

debugImplementation deps.acraReportDialog

implementation deps.moxy
implementation deps.moxyAppcompat
implementation deps.moxyMaterial
Expand Down
12 changes: 7 additions & 5 deletions app/lite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ android {
minSdkVersion config.androidMinSdkVersion
targetSdkVersion config.androidTargetSdkVersion

applicationId config.androidApplicationId
versionCode config.androidVersionCode
versionName config.androidVersionName
applicationId 'com.github.anrimian.musicplayer'
versionCode 137
versionName "0.9.5"
testInstrumentationRunner config.testInstrumentationRunner
testApplicationId config.testApplicationId
archivesBaseName = "$applicationId-v$versionCode($versionName)"
testApplicationId "${applicationId}.test"
archivesBaseName = "$applicationId-v$versionName($versionCode)"
vectorDrawables.useSupportLibrary = true
}

Expand Down Expand Up @@ -80,6 +80,8 @@ dependencies {
implementation project(':data')
implementation project(':app')

implementation project(':libs:filesync:core')

def deps = rootProject.ext

implementation deps.appCompat
Expand Down
3 changes: 3 additions & 0 deletions app/lite/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.github.anrimian.musicplayer.lite">

<!--remove permission from glide because we don't use internet for covers-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove"/>

<application
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.github.anrimian.musicplayer.di.app.AppComponent;
import com.github.anrimian.musicplayer.di.app.AppModule;
import com.github.anrimian.musicplayer.di.app.DbModule;
import com.github.anrimian.musicplayer.di.app.ErrorModule;
import com.github.anrimian.musicplayer.di.app.MusicModule;
import com.github.anrimian.musicplayer.di.app.PlayListsModule;
import com.github.anrimian.musicplayer.di.app.SchedulerModule;
Expand All @@ -18,7 +17,6 @@
@Component(modules = {
AppModule.class,
SchedulerModule.class,
ErrorModule.class,
MusicModule.class,
DbModule.class,
StorageModule.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
package com.github.anrimian.musicplayer.lite.di.app

import android.content.Context
import com.github.anrimian.filesync.SyncInteractor
import com.github.anrimian.filesync.stubs.StubSyncInteractor
import com.github.anrimian.musicplayer.data.controllers.music.error.PlayerErrorParserImpl
import com.github.anrimian.musicplayer.data.controllers.music.players.utils.ExoPlayerMediaItemBuilder
import com.github.anrimian.musicplayer.data.controllers.music.players.utils.MediaPlayerDataSourceBuilder
import com.github.anrimian.musicplayer.data.storage.providers.music.StorageMusicProvider
import com.github.anrimian.musicplayer.data.storage.source.ContentSourceHelper
import com.github.anrimian.musicplayer.domain.interactors.analytics.Analytics
import com.github.anrimian.musicplayer.domain.interactors.player.PlayerErrorParser
import com.github.anrimian.musicplayer.lite.ui.SpecialNavigationImpl
import com.github.anrimian.musicplayer.ui.common.error.parser.DefaultErrorParser
import com.github.anrimian.musicplayer.ui.common.error.parser.ErrorParser
import com.github.anrimian.musicplayer.ui.common.navigation.SpecialNavigation
import dagger.Module
import dagger.Provides
Expand All @@ -13,4 +25,40 @@ class LiteAppModule {
@Singleton
fun navigation(): SpecialNavigation = SpecialNavigationImpl()

@Provides
@Singleton
fun syncInteractor(): SyncInteractor<*, *, Long> = StubSyncInteractor<Any, Any, Long>()

@Provides
@Singleton
fun exoPlayerMediaItemBuilder() = ExoPlayerMediaItemBuilder()

@Provides
@Singleton
fun contentSourceUriBuilder(
storageMusicProvider: StorageMusicProvider
) = ContentSourceHelper(storageMusicProvider)

@Provides
@Singleton
fun mediaPlayerDataSourceBuilder(
context: Context,
storageMusicProvider: StorageMusicProvider
) = MediaPlayerDataSourceBuilder(
context,
storageMusicProvider
)

@Provides
@Singleton
fun playerErrorParser(analytics: Analytics): PlayerErrorParser {
return PlayerErrorParserImpl(analytics)
}

@Provides
@Singleton
fun provideErrorParser(context: Context, analytics: Analytics): ErrorParser {
return DefaultErrorParser(context, analytics)
}

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.github.anrimian.musicplayer.lite.ui

import androidx.fragment.app.FragmentManager
import androidx.fragment.app.Fragment
import com.github.anrimian.musicplayer.ui.common.navigation.SpecialNavigation

class SpecialNavigationImpl: SpecialNavigation {

override fun attachShortSyncStateFragment(
fm: FragmentManager,
containerId: Int,
) {
override fun getDrawerHeaderFragment(): Fragment? = null

}
}
1 change: 1 addition & 0 deletions app/lite/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.github.anrimian.musicplayer.domain.interactors.analytics.Analytics;
import com.github.anrimian.musicplayer.utils.logger.FileLog;

import javax.annotation.Nullable;

public class AnalyticsImpl implements Analytics {

private final FileLog fileLog;
Expand All @@ -13,10 +15,17 @@ public AnalyticsImpl(FileLog fileLog) {
this.fileLog = fileLog;
}

@Override
public void processNonFatalError(Throwable throwable) {
processNonFatalError(throwable, null);
}

@Override
public void processNonFatalError(Throwable throwable, @Nullable String message) {
if (message != null) {
Log.d("UNEXPECTED", message);
}
throwable.printStackTrace();
fileLog.writeException(throwable);
fileLog.writeException(throwable, message);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.github.anrimian.musicplayer.domain.interactors.analytics.Analytics;
import com.github.anrimian.musicplayer.utils.logger.FileLog;

import javax.annotation.Nullable;

public class AnalyticsImpl implements Analytics {

private final FileLog fileLog;
Expand All @@ -15,8 +17,16 @@ public AnalyticsImpl(FileLog fileLog) {

@Override
public void processNonFatalError(Throwable throwable) {
processNonFatalError(throwable, null);
}

@Override
public void processNonFatalError(Throwable throwable, @Nullable String message) {
if (message != null) {
Log.d("UNEXPECTED", message);
}
throwable.printStackTrace();
fileLog.writeException(throwable);
fileLog.writeException(throwable, message);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package com.github.anrimian.musicplayer.utils;

import android.app.Application;
import android.os.Build;

import com.github.anrimian.acrareportdialog.AcraReportDialog;

public class DevTools {

public static void run(Application application) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {//not works in android 11
AcraReportDialog.setupCrashDialog(application);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name" translatable="false">(D)Music Player</string>
<string name="file_provider_authorities" translatable="false">
com.github.anrimian.simplemusicplayer.share_file_provider(debug)
Expand All @@ -7,4 +9,4 @@
com.github.anrimian.simplemusicplayer.covers_file_provider(debug)
</string>

</resources>
</resources>
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.github.anrimian.musicplayer">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.BLUETOOTH" />
Expand All @@ -17,9 +20,6 @@
<!--prevent rare crash on some devices with notification display-->
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<!--remove permission from glide because we don't use internet for covers-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove"/>

<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>

<!-- support for tablets -->
Expand All @@ -37,6 +37,7 @@
android:allowBackup="false"
android:fullBackupContent="false"
android:requestLegacyExternalStorage="true"
android:localeConfig="@xml/locales_config"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
tools:replace="android:allowBackup">

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/github/anrimian/musicplayer/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

import androidx.appcompat.app.AppCompatDelegate;

import com.github.anrimian.musicplayer.data.utils.Permissions;
import com.github.anrimian.musicplayer.di.Components;
import com.github.anrimian.musicplayer.di.app.AppComponent;
import com.github.anrimian.musicplayer.domain.utils.rx.RxJavaErrorConsumer;
import com.github.anrimian.musicplayer.utils.Permissions;
import com.github.anrimian.musicplayer.utils.DevTools;

import io.reactivex.rxjava3.plugins.RxJavaPlugins;

Expand All @@ -25,7 +26,7 @@ public void onCreate() {

initComponents();

// DevTools.run(this);
DevTools.run(this);

AppComponent appComponent = Components.getAppComponent();
appComponent.appLogger().initFatalErrorRecorder();
Expand Down
20 changes: 13 additions & 7 deletions app/src/main/java/com/github/anrimian/musicplayer/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ interface Arguments {
String PLAY_LIST_ID_ARG = "play_list_id_arg";
String ID_ARG = "id_arg";//we can replace other `id_arg`
String STATUS_BAR_COLOR_ATTR_ARG = "status_bar_color_attr";
String OPEN_PLAY_QUEUE_ARG = "open_play_queue_arg";
String OPEN_PLAYER_PANEL_ARG = "open_player_panel_arg";
String COMPOSITION_NAME_ARG = "composition_name_arg";
String COMPOSITION_AUTHOR_ARG = "composition_author_arg";
String COMPOSITION_ID_ARG = "composition_id_arg";
String COMPOSITION_UPDATE_TIME_ARG = "composition_update_time_arg";
String COMPOSITION_SIZE = "composition_size_arg";
String COMPOSITION_IS_FILE_EXISTS_ARG = "composition_is_file_exists_arg";
String ALBUM_ID_ARG = "album_id_arg";
String PLAY_ARG = "play_arg";
String QUEUE_SIZE_ARG = "queue_size_arg";
Expand All @@ -37,21 +39,23 @@ interface Arguments {
String EXTRA_DATA_ARG = "extra_data_arg";
String COMPOSITION_ARG = "composition_arg";
String MENU_ARG = "menu_arg";
String POSITION_ARG = "position_arg";
String HINTS_ARG = "hints_arg";
String PLAYLIST_ARG = "playlist_arg";
String RANDOM_PLAY_ARG = "random_play_arg";
String REPEAT_ARG = "repeat_arg";
String COVERS_ENABLED_ARG = "covers_enabled_arg";
String FILE_NAME_SETTING_ARG = "file_name_setting_arg";
String HIGHLIGHT_COMPOSITION_ID = "highlight_composition_id";
String IDS_ARG = "ids_arg";
String NAME_ARG = "name_arg";
String LAUNCH_PREPARE_ARG = "launch_prepare_arg";
}

interface Tags {
String ORDER_TAG = "order_tag";
String SELECT_PLAYLIST_TAG = "select_playlist_tag";
String SELECT_PLAYLIST_FOR_FOLDER_TAG = "select_playlist_for_folder_tag";
String CREATE_PLAYLIST_TAG = "create_playlist_tag";
String COMPOSITION_ACTION_TAG = "composition_action_tag";
String AUTHOR_TAG = "author_tag";
String NAME_TAG = "name_tag";
String TITLE_TAG = "title_tag";
Expand All @@ -72,11 +76,13 @@ interface Tags {
String ENABLED_MEDIA_PLAYERS = "enabled_media_players";
}

interface RequestCodes {
int PICK_IMAGE_REQUEST_CODE = 1;
}

interface Animation {
int TOOLBAR_ARROW_ANIMATION_TIME = 200;
}

interface RemoteViewPlayerState {
int PLAY = 1;
int PLAY_LOADING = 2;
int PAUSE = 3;
}
}
Loading

0 comments on commit cdc6a20

Please sign in to comment.