mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-05-06 02:26:42 +00:00
Started Implementing the Introduction, still a lot missing,
This commit is contained in:
parent
57f721b6cf
commit
43dd39951c
|
@ -37,7 +37,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<afterSyncTasks>
|
||||
|
@ -20,7 +19,7 @@
|
|||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
|
||||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||
<option name="LIBRARY_PROJECT" value="true" />
|
||||
<option name="PROJECT_TYPE" value="1" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
|
@ -48,7 +47,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||
|
@ -56,7 +54,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||
|
@ -64,7 +61,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
|
@ -72,7 +68,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
|
@ -80,7 +75,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<afterSyncTasks>
|
||||
|
@ -23,7 +22,7 @@
|
|||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
|
||||
<exclude-output />
|
||||
|
@ -47,7 +46,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||
|
@ -55,7 +53,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||
|
@ -63,25 +60,22 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||
|
@ -98,10 +92,13 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/25.1.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.1.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/transition/25.1.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.paolorotolo/appintro/4.1.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/packaged" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||
|
@ -126,6 +123,7 @@
|
|||
<orderEntry type="library" exported="" name="appcompat-v7-25.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-25.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-core-utils-25.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appintro-4.1.0" level="project" />
|
||||
<orderEntry type="module" module-name="playmusiclib" exported="" />
|
||||
<orderEntry type="module" module-name="framework" exported="" />
|
||||
<orderEntry type="library" exported="" name="mp3agic-0.8.4" level="project" />
|
||||
|
|
|
@ -48,11 +48,15 @@
|
|||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".activities.MusicContainerListActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.Intro"
|
||||
android:label="Play Music Exporter Intro"/>
|
||||
|
||||
<service android:name=".services.ExportService" />
|
||||
<service android:name=".services.ExportAllService" />
|
||||
<service android:name=".services.ExportAllJob"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"/>
|
||||
<service
|
||||
android:name=".services.ExportAllJob"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE" />
|
||||
|
||||
<meta-data
|
||||
android:name="crashhandler.email"
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
package re.jcg.playmusicexporter.activities;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.Log;
|
||||
|
||||
import com.github.paolorotolo.appintro.AppIntro;
|
||||
import com.github.paolorotolo.appintro.AppIntroFragment;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import de.arcus.framework.superuser.SuperUser;
|
||||
import re.jcg.playmusicexporter.R;
|
||||
import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences;
|
||||
|
||||
public class Intro extends AppIntro {
|
||||
private static final String TAG = "PME_Intro";
|
||||
Fragment welcome;
|
||||
Fragment warning;
|
||||
Fragment storage;
|
||||
Fragment internet;
|
||||
Fragment superuser;
|
||||
Fragment finish;
|
||||
|
||||
private void initFragments() {
|
||||
welcome = AppIntroFragment.newInstance(
|
||||
"Welcome!",
|
||||
"This is the Play Music Exporter. It can export songs from Play Music " +
|
||||
"and save them as MP3 files where you want them to be.",
|
||||
R.drawable.ic_launcher_transparent,
|
||||
Color.parseColor("#ef6c00"));
|
||||
warning = AppIntroFragment.newInstance(
|
||||
"Warning!",
|
||||
"You are responsible for what you do with this app. Depending on where you live " +
|
||||
"it might be illegal to use this app. We discourage piracy of music " +
|
||||
"and other intellectual property. Sharing music you exported with " +
|
||||
"this tool might be a very bad idea, Google could put an invisible " +
|
||||
"watermark on the music, so that people can trace the MP3s back to " +
|
||||
"the owner of the Google account that was used.",
|
||||
R.drawable.ic_warning_white,
|
||||
Color.parseColor("#ef6c00"));
|
||||
storage = AppIntroFragment.newInstance(
|
||||
"We need access to your storage.",
|
||||
"We need to access the external storage, " +
|
||||
"for copying the Play Music database to a folder," +
|
||||
"where we have the right to work with it. " +
|
||||
"We also need access to the external storage," +
|
||||
"to finish up the MP3s, from encrypted without ID3 tags," +
|
||||
"to decrypted with ID3 tags, before we save them to your export path.",
|
||||
R.drawable.ic_folder_white,
|
||||
Color.parseColor("#ef6c00"));
|
||||
|
||||
//Internet Access is granted automatically, asking for it is automatically granted,
|
||||
//which is unacceptable in my opinion, but why should Google care.
|
||||
internet = AppIntroFragment.newInstance(
|
||||
"We might need internet access.",
|
||||
"It happens that we can not find the cover of a song locally. " +
|
||||
"In these cases, we can, if you grant us permission to use the internet, " +
|
||||
"download the cover from online. " +
|
||||
"If you don't grant us permission to use the internet, " +
|
||||
"we can still export songs, but the cover will be " +
|
||||
"missing on some songs.",
|
||||
R.drawable.ic_cloud_download_white,
|
||||
Color.parseColor("#ef6c00"));
|
||||
superuser = AppIntroFragment.newInstance(
|
||||
"We need root access.",
|
||||
"Some of the files we need to access are in the private folders of Play Music. " +
|
||||
"Android prevents apps from accessing the private folders " +
|
||||
"of other apps, but luckily, you can circumvent this protection " +
|
||||
"with root access. Without root access this app can't do anything.",
|
||||
R.drawable.ic_superuser,
|
||||
Color.parseColor("#ef6c00"));
|
||||
finish = AppIntroFragment.newInstance(
|
||||
"Tutorial finished!",
|
||||
"One note: Should you revoke any of these permission, the tutorial will be " +
|
||||
"shown again on the next launch.",
|
||||
R.drawable.ic_launcher_transparent,
|
||||
Color.parseColor("#ef6c00"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (getSupportActionBar() != null) getSupportActionBar().hide();
|
||||
showSkipButton(false);
|
||||
|
||||
initFragments();
|
||||
|
||||
addSlide(welcome);
|
||||
addSlide(warning);
|
||||
addSlide(storage);
|
||||
addSlide(superuser);
|
||||
addSlide(finish);
|
||||
|
||||
askForPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 3);
|
||||
|
||||
pager.setPagingEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
|
||||
super.onSlideChanged(oldFragment, newFragment);
|
||||
logSlideChanged(oldFragment, newFragment);
|
||||
if (warning.equals(oldFragment) && storage.equals(newFragment)) {
|
||||
promptAcceptWarning();
|
||||
} else if (superuser.equals(oldFragment) && finish.equals(newFragment)) {
|
||||
SuperUser.askForPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
private void promptAcceptWarning() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("Understood?");
|
||||
builder.setMessage("Have you read and understood this?");
|
||||
builder.setCancelable(false);
|
||||
builder.setNegativeButton("No", ((dialog, which)
|
||||
-> pager.setCurrentItem(pager.getCurrentItem() - 1)));
|
||||
builder.setPositiveButton("Yes", (((dialog, which) -> dialog.dismiss())));
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void logSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
// Optional.ofNullable requires API level 24, and I won't do manual null checks.
|
||||
Log.i(TAG, "Fragment switched from {" +
|
||||
Optional.ofNullable(oldFragment).map(Fragment::toString).orElse("") +
|
||||
"} to {" +
|
||||
Optional.ofNullable(newFragment).map(Fragment::toString).orElse("") +
|
||||
"}.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDonePressed(Fragment currentFragment) {
|
||||
PlayMusicExporterPreferences.init(this);
|
||||
PlayMusicExporterPreferences.setSetupDone(true);
|
||||
startActivity(new Intent(this, MusicContainerListActivity.class));
|
||||
}
|
||||
}
|
|
@ -23,7 +23,6 @@
|
|||
package re.jcg.playmusicexporter.activities;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
|
@ -55,6 +54,7 @@ import de.arcus.playmusiclib.datasources.ArtistDataSource;
|
|||
import de.arcus.playmusiclib.datasources.PlaylistDataSource;
|
||||
import de.arcus.playmusiclib.enums.ID3v2Version;
|
||||
import de.arcus.playmusiclib.items.MusicTrackList;
|
||||
import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences;
|
||||
|
||||
/**
|
||||
* An activity representing a list of Tracks. This activity
|
||||
|
@ -104,59 +104,68 @@ public class MusicContainerListActivity extends AppCompatActivity
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_track_list);
|
||||
|
||||
//Adds the crash handler to this class
|
||||
CrashHandler.addCrashHandler(this);
|
||||
|
||||
Logger.getInstance().logVerbose("Activity", "onCreate(" + this.getLocalClassName() + ")");
|
||||
PlayMusicExporterPreferences.init(this);
|
||||
if (!PlayMusicExporterPreferences.getSetupDone()) {
|
||||
startActivity(new Intent(this, Intro.class));
|
||||
finish();
|
||||
} else {
|
||||
|
||||
// Setup ActionBar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setTitle(R.string.app_name);
|
||||
setContentView(R.layout.activity_track_list);
|
||||
|
||||
|
||||
Logger.getInstance().logVerbose("Activity", "onCreate(" + this.getLocalClassName() + ")");
|
||||
|
||||
// Setup ActionBar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setTitle(R.string.app_name);
|
||||
}
|
||||
|
||||
|
||||
mNavigationDrawerFragment = (NavigationDrawerFragment)
|
||||
getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
|
||||
|
||||
mNavigationDrawerFragment.setOnListViewChanged(this);
|
||||
|
||||
// Set up the drawer.
|
||||
mNavigationDrawerFragment.setUp(
|
||||
R.id.navigation_drawer,
|
||||
(DrawerLayout) findViewById(R.id.drawer_layout));
|
||||
|
||||
if (findViewById(R.id.track_detail_container) != null) {
|
||||
// The detail container view will be present only in the
|
||||
// large-screen layouts (res/values-large and
|
||||
// res/values-sw600dp). If this view is present, then the
|
||||
// activity should be in two-pane mode.
|
||||
mTwoPane = true;
|
||||
|
||||
// In two-pane mode, list items should be given the
|
||||
// 'activated' state when touched.
|
||||
((MusicContainerListFragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.fragment_main))
|
||||
.setActivateOnItemClick(true);
|
||||
}
|
||||
|
||||
boolean waitForPermissions = false;
|
||||
|
||||
// Check file system permissions
|
||||
if (ContextCompat.checkSelfPermission(this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
|
||||
waitForPermissions = true;
|
||||
}
|
||||
|
||||
if (!waitForPermissions)
|
||||
loadPlayMusicExporter();
|
||||
}
|
||||
|
||||
|
||||
mNavigationDrawerFragment = (NavigationDrawerFragment)
|
||||
getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
|
||||
|
||||
mNavigationDrawerFragment.setOnListViewChanged(this);
|
||||
|
||||
// Set up the drawer.
|
||||
mNavigationDrawerFragment.setUp(
|
||||
R.id.navigation_drawer,
|
||||
(DrawerLayout) findViewById(R.id.drawer_layout));
|
||||
|
||||
if (findViewById(R.id.track_detail_container) != null) {
|
||||
// The detail container view will be present only in the
|
||||
// large-screen layouts (res/values-large and
|
||||
// res/values-sw600dp). If this view is present, then the
|
||||
// activity should be in two-pane mode.
|
||||
mTwoPane = true;
|
||||
|
||||
// In two-pane mode, list items should be given the
|
||||
// 'activated' state when touched.
|
||||
((MusicContainerListFragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.fragment_main))
|
||||
.setActivateOnItemClick(true);
|
||||
}
|
||||
|
||||
boolean waitForPermissions = false;
|
||||
|
||||
// Check file system permissions
|
||||
if (ContextCompat.checkSelfPermission(this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
|
||||
waitForPermissions = true;
|
||||
}
|
||||
|
||||
if (!waitForPermissions)
|
||||
loadPlayMusicExporter();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -205,8 +214,8 @@ public class MusicContainerListActivity extends AppCompatActivity
|
|||
mPlayMusicManager.setID3EnableArtwork(true);
|
||||
mPlayMusicManager.setID3EnableFallback(true);
|
||||
mPlayMusicManager.setID3v2Version(ID3v2Version.ID3v23);
|
||||
mPlayMusicManager.setID3ArtworkFormat(Bitmap.CompressFormat.JPEG);
|
||||
mPlayMusicManager.setID3ArtworkMaximumSize(512);
|
||||
mPlayMusicManager.setID3ArtworkFormat(Bitmap.CompressFormat.PNG);
|
||||
mPlayMusicManager.setID3ArtworkMaximumSize(PlayMusicExporterPreferences.getAlbumArtSize());
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.getInstance().logError("SetupPlayMusicExporter", e.toString());
|
||||
|
|
|
@ -34,11 +34,17 @@ public class PlayMusicExporterPreferences {
|
|||
private static final String GROUPS_EXPORT_STRUCTURE = "preference_groups_export_structure";
|
||||
private static final String EXPORT_STRUCTURE_DEFAULT = "{album-artist}/{album}/{disc=CD $}/{no=$$.} {title}.mp3";
|
||||
|
||||
private static final String EXPORT_ALBUM_ART_SIZE = "preference_id3_artwork_size";
|
||||
private static final int EXPORT_ALBUM_ART_SIZE_DEFAULT = 512;
|
||||
|
||||
private static final String DRAWER_LEARNED = "pref_drawer_learned";
|
||||
private static final boolean DRAWER_LEARNED_DEFAULT = false;
|
||||
private static final String DRAWER_SELECTED_TYPE = "pref_drawer_selected_type";
|
||||
private static final String DRAWER_SELECTED_TYPE_DEFAULT = "Album";
|
||||
|
||||
private static final String SETUP_DONE = "preference_setup_done";
|
||||
private static final boolean SETUP_DONE_DEFAULT = false;
|
||||
|
||||
|
||||
private PlayMusicExporterPreferences() {
|
||||
}
|
||||
|
@ -141,4 +147,20 @@ public class PlayMusicExporterPreferences {
|
|||
public static boolean getAutoExportRequireCharging() {
|
||||
return preferences.getBoolean(AUTO_EXPORT_REQUIRE_CHARGING, AUTO_EXPORT_REQUIRE_CONDITION_DEFAULT);
|
||||
}
|
||||
|
||||
public static boolean getSetupDone() {
|
||||
return preferences.getBoolean(SETUP_DONE, SETUP_DONE_DEFAULT);
|
||||
}
|
||||
|
||||
public static void setSetupDone(boolean done) {
|
||||
preferences.edit().putBoolean(SETUP_DONE, done).apply();
|
||||
}
|
||||
|
||||
public static int getAlbumArtSize() {
|
||||
return Integer.parseInt(preferences.getString(EXPORT_ALBUM_ART_SIZE, "" + EXPORT_ALBUM_ART_SIZE_DEFAULT));
|
||||
}
|
||||
|
||||
public static void setAlbumArtSize(int size) {
|
||||
preferences.edit().putString(EXPORT_ALBUM_ART_SIZE, "" + size).apply();
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
playmusicexporter/src/main/res/drawable/ic_folder_white.png
Normal file
BIN
playmusicexporter/src/main/res/drawable/ic_folder_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 366 KiB |
BIN
playmusicexporter/src/main/res/drawable/ic_superuser.png
Normal file
BIN
playmusicexporter/src/main/res/drawable/ic_superuser.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
BIN
playmusicexporter/src/main/res/drawable/ic_warning_white.png
Normal file
BIN
playmusicexporter/src/main/res/drawable/ic_warning_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -9,7 +9,6 @@
|
|||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<afterSyncTasks>
|
||||
|
@ -20,7 +19,7 @@
|
|||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
|
||||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||
<option name="LIBRARY_PROJECT" value="true" />
|
||||
<option name="PROJECT_TYPE" value="1" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
|
@ -48,7 +47,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||
|
@ -56,7 +54,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||
|
@ -64,25 +61,22 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
|
||||
|
|
Loading…
Reference in a new issue