Cleanups and beautifies
parent
e4720c077c
commit
589750a4f7
|
@ -2,7 +2,6 @@ package max.music_cyclon;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
@ -37,7 +36,7 @@ public class RenameDialogFragment extends DialogFragment {
|
||||||
newName = new EditText(getActivity());
|
newName = new EditText(getActivity());
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
|
||||||
.setTitle("Rename")
|
.setTitle(getActivity().getString(R.string.rename))
|
||||||
.setView(newName)
|
.setView(newName)
|
||||||
.setPositiveButton(android.R.string.ok, new ApplyRename())
|
.setPositiveButton(android.R.string.ok, new ApplyRename())
|
||||||
.setNegativeButton(android.R.string.cancel, STUB_CLICK);
|
.setNegativeButton(android.R.string.cancel, STUB_CLICK);
|
||||||
|
|
|
@ -61,6 +61,8 @@ import max.music_cyclon.service.LibraryService;
|
||||||
*/
|
*/
|
||||||
public class SynchronizeActivity extends AppCompatActivity {
|
public class SynchronizeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
public static final String DEFAULT_CONFIG_PATH = "configs.json";
|
||||||
|
|
||||||
private PagerAdapter pagerAdapter;
|
private PagerAdapter pagerAdapter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,7 +82,9 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
/**
|
/**
|
||||||
* Target we publish for clients to send messages to IncomingHandler.
|
* Target we publish for clients to send messages to IncomingHandler.
|
||||||
*/
|
*/
|
||||||
private final Messenger mMessenger = new Messenger(new IncomingHandler(new WeakReference<>(this)));
|
private final Messenger mMessenger = new Messenger(
|
||||||
|
new IncomingHandler(new WeakReference<>(this))
|
||||||
|
);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -92,7 +96,7 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
List<SynchronizeConfig> configs = Collections.emptyList();
|
List<SynchronizeConfig> configs = Collections.emptyList();
|
||||||
try {
|
try {
|
||||||
FileInputStream in = openFileInput("configs.json");
|
FileInputStream in = openFileInput(DEFAULT_CONFIG_PATH);
|
||||||
configs = SynchronizeConfig.load(in);
|
configs = SynchronizeConfig.load(in);
|
||||||
in.close();
|
in.close();
|
||||||
} catch (IOException | JSONException e) {
|
} catch (IOException | JSONException e) {
|
||||||
|
@ -102,7 +106,7 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
pagerAdapter = new PagerAdapter(configs, getSupportFragmentManager());
|
pagerAdapter = new PagerAdapter(configs, getSupportFragmentManager());
|
||||||
|
|
||||||
if (pagerAdapter.getCount() == 0) {
|
if (pagerAdapter.getCount() == 0) {
|
||||||
pagerAdapter.add("Default");
|
pagerAdapter.add(getString(R.string.default_config_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
final ViewPager pager = (ViewPager) findViewById(R.id.container);
|
final ViewPager pager = (ViewPager) findViewById(R.id.container);
|
||||||
|
@ -176,7 +180,7 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
unbindLibraryService();
|
unbindLibraryService();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FileOutputStream fos = openFileOutput("configs.json", Context.MODE_PRIVATE);
|
FileOutputStream fos = openFileOutput(DEFAULT_CONFIG_PATH, Context.MODE_PRIVATE);
|
||||||
getPagerAdapter().save(fos);
|
getPagerAdapter().save(fos);
|
||||||
fos.close();
|
fos.close();
|
||||||
} catch (IOException | JSONException e) {
|
} catch (IOException | JSONException e) {
|
||||||
|
@ -217,7 +221,7 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
break;
|
break;
|
||||||
case R.id.action_sync:
|
case R.id.action_sync:
|
||||||
if (isServiceRunning(LibraryService.class)) {
|
if (isServiceRunning(LibraryService.class)) {
|
||||||
Toast.makeText(this, "Already synchronizing!", Toast.LENGTH_LONG).show();
|
Toast.makeText(this, R.string.already_synchronizing, Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,15 +231,18 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
// Show sync control dialog
|
// Show sync control dialog
|
||||||
syncProgress = new ProgressDialog(SynchronizeActivity.this);
|
syncProgress = new ProgressDialog(SynchronizeActivity.this);
|
||||||
syncProgress.setMessage("Synchronizing");
|
syncProgress.setMessage(getString(R.string.synchronizing));
|
||||||
syncProgress.setCancelable(false);
|
syncProgress.setCancelable(false);
|
||||||
syncProgress.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() {
|
// syncProgress.setButton(
|
||||||
@Override
|
// DialogInterface.BUTTON_NEGATIVE,
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
// getString(android.R.string.cancel),
|
||||||
dialog.dismiss();
|
// new DialogInterface.OnClickListener() {
|
||||||
}
|
// @Override
|
||||||
});
|
// public void onClick(DialogInterface dialog, int which) {
|
||||||
syncProgress.show();
|
// dialog.dismiss();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// syncProgress.show();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
|
@ -257,16 +264,21 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
|
SynchronizeActivity activity = this.activity.get();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case LibraryService.MSG_FINISHED:
|
case LibraryService.MSG_FINISHED:
|
||||||
SynchronizeActivity activity = this.activity.get();
|
activity.unbindLibraryService();
|
||||||
if (activity != null) {
|
|
||||||
Dialog dialog = activity.getSyncProgress();
|
Dialog dialog = activity.getSyncProgress();
|
||||||
if (dialog != null) {
|
if (dialog != null) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
activity.clearSyncProgress();
|
activity.clearSyncProgress();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
super.handleMessage(msg);
|
super.handleMessage(msg);
|
||||||
|
@ -301,17 +313,30 @@ public class SynchronizeActivity extends AppCompatActivity {
|
||||||
private void startLibraryService() {
|
private void startLibraryService() {
|
||||||
Intent intent = new Intent(SynchronizeActivity.this, LibraryService.class);
|
Intent intent = new Intent(SynchronizeActivity.this, LibraryService.class);
|
||||||
List<SynchronizeConfig> configs = getPagerAdapter().getConfigs();
|
List<SynchronizeConfig> configs = getPagerAdapter().getConfigs();
|
||||||
intent.putExtra("configs", configs.toArray(new SynchronizeConfig[configs.size()]));
|
|
||||||
|
// Update last updated
|
||||||
|
for (SynchronizeConfig config : configs) {
|
||||||
|
config.updateLastUpdated(); // fixme the result of LibraryService does not affect this (for example: Remote not available)
|
||||||
|
}
|
||||||
|
|
||||||
|
intent.putExtra(
|
||||||
|
LibraryService.ARGUMENT_CONFIGS,
|
||||||
|
configs.toArray(new SynchronizeConfig[configs.size()])
|
||||||
|
);
|
||||||
startService(intent);
|
startService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isServiceRunning(Class<?> serviceClass) {
|
private boolean isServiceRunning(Class<?> serviceClass) {
|
||||||
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
|
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
|
List<ActivityManager.RunningServiceInfo> services =
|
||||||
|
manager.getRunningServices(Integer.MAX_VALUE);
|
||||||
|
|
||||||
|
for (ActivityManager.RunningServiceInfo service : services) {
|
||||||
if (serviceClass.getName().equals(service.service.getClassName())) {
|
if (serviceClass.getName().equals(service.service.getClassName())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,16 @@ import java.util.Scanner;
|
||||||
*/
|
*/
|
||||||
public class SynchronizeConfig implements Parcelable {
|
public class SynchronizeConfig implements Parcelable {
|
||||||
|
|
||||||
public static final Random RANDOM = new Random();
|
private static final Random RANDOM = new Random();
|
||||||
|
|
||||||
|
private static final String ID_KEY = "id";
|
||||||
|
private static final String SIZE_KEY = "size";
|
||||||
|
private static final String RANDOM_KEY = "random";
|
||||||
|
private static final String ALBUM_KEY = "use_albums";
|
||||||
|
private static final String QUERY_KEY = "query";
|
||||||
|
private static final String START_CHARGING_KEY = "start_charging";
|
||||||
|
private static final String DOWNLOAD_INTERVAL_KEY = "download_interval";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of this config
|
* The name of this config
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +49,7 @@ public class SynchronizeConfig implements Parcelable {
|
||||||
public SynchronizeConfig(String name, long id) {
|
public SynchronizeConfig(String name, long id) {
|
||||||
this(name, new JSONObject());
|
this(name, new JSONObject());
|
||||||
try {
|
try {
|
||||||
json.put("id", id);
|
json.put(ID_KEY, id);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException("Failed setting id!");
|
throw new RuntimeException("Failed setting id!");
|
||||||
}
|
}
|
||||||
|
@ -52,7 +61,7 @@ public class SynchronizeConfig implements Parcelable {
|
||||||
|
|
||||||
public long getID() {
|
public long getID() {
|
||||||
try {
|
try {
|
||||||
return json.getLong("id");
|
return json.getLong(ID_KEY);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException("Config has no id!");
|
throw new RuntimeException("Config has no id!");
|
||||||
}
|
}
|
||||||
|
@ -66,28 +75,41 @@ public class SynchronizeConfig implements Parcelable {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getLastUpdated() {
|
||||||
|
return json.optLong("last_update", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateLastUpdated() {
|
||||||
|
try {
|
||||||
|
json.put("last_update", System.currentTimeMillis());
|
||||||
|
} catch (JSONException ignored) {
|
||||||
|
throw new RuntimeException("Failed to set last_update!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getSize(Resources resources) {
|
public int getSize(Resources resources) {
|
||||||
return json.optInt("size", resources.getInteger(R.integer.size));
|
return json.optInt(SIZE_KEY, resources.getInteger(R.integer.size));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRandom(Resources resources) {
|
public boolean isRandom(Resources resources) {
|
||||||
return json.optBoolean("size", resources.getBoolean(R.bool.random));
|
return json.optBoolean(RANDOM_KEY, resources.getBoolean(R.bool.random));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAlbum(Resources resources) {
|
public boolean isAlbum(Resources resources) {
|
||||||
return json.optBoolean("use_albums", resources.getBoolean(R.bool.use_albums));
|
return json.optBoolean(ALBUM_KEY, resources.getBoolean(R.bool.use_albums));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getQuery(Resources resources) {
|
public String getQuery(Resources resources) {
|
||||||
return json.optString("query", resources.getString(R.string.query));
|
return json.optString(QUERY_KEY, resources.getString(R.string.query));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStartCharging(Resources resources) {
|
public boolean isStartCharging(Resources resources) {
|
||||||
return json.optBoolean("start_charging", resources.getBoolean(R.bool.start_charging));
|
return json.optBoolean(START_CHARGING_KEY, resources.getBoolean(R.bool.start_charging));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDownloadInterval(Resources resources) {
|
public int getDownloadInterval(Resources resources) {
|
||||||
return json.optInt("download_interval", resources.getInteger(R.integer.download_interval));
|
return json.optInt(DOWNLOAD_INTERVAL_KEY,
|
||||||
|
resources.getInteger(R.integer.download_interval));
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONObject getJson() {
|
public JSONObject getJson() {
|
||||||
|
@ -105,19 +127,7 @@ public class SynchronizeConfig implements Parcelable {
|
||||||
dest.writeString(json.toString());
|
dest.writeString(json.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<SynchronizeConfig> CREATOR = new Parcelable.Creator<SynchronizeConfig>() {
|
public static final Creator<SynchronizeConfig> CREATOR = new SynchronizeConfigCreator();
|
||||||
public SynchronizeConfig createFromParcel(Parcel in) {
|
|
||||||
try {
|
|
||||||
return new SynchronizeConfig(in.readString(), new JSONObject(in.readString()));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
return new SynchronizeConfig("none");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public SynchronizeConfig[] newArray(int size) {
|
|
||||||
return new SynchronizeConfig[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static List<SynchronizeConfig> load(InputStream in) throws JSONException {
|
public static List<SynchronizeConfig> load(InputStream in) throws JSONException {
|
||||||
String data = convertStreamToString(in);
|
String data = convertStreamToString(in);
|
||||||
|
@ -160,4 +170,17 @@ public class SynchronizeConfig implements Parcelable {
|
||||||
return s.hasNext() ? s.next() : "";
|
return s.hasNext() ? s.next() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class SynchronizeConfigCreator implements Creator<SynchronizeConfig> {
|
||||||
|
public SynchronizeConfig createFromParcel(Parcel in) {
|
||||||
|
try {
|
||||||
|
return new SynchronizeConfig(in.readString(), new JSONObject(in.readString()));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
return new SynchronizeConfig("none");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SynchronizeConfig[] newArray(int size) {
|
||||||
|
return new SynchronizeConfig[size];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class BeetsFetcher {
|
||||||
String tag = reader.nextName();
|
String tag = reader.nextName();
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case "id":
|
case "id":
|
||||||
item.setId(reader.nextInt());
|
item.setID(reader.nextInt());
|
||||||
break;
|
break;
|
||||||
case "path":
|
case "path":
|
||||||
item.setPath(reader.nextString());
|
item.setPath(reader.nextString());
|
||||||
|
|
|
@ -9,7 +9,6 @@ import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URI;
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.zip.Adler32;
|
import java.util.zip.Adler32;
|
||||||
|
|
||||||
|
@ -22,18 +21,19 @@ import okhttp3.Response;
|
||||||
public class DownloadTask implements Runnable {
|
public class DownloadTask implements Runnable {
|
||||||
|
|
||||||
private final SynchronizeConfig config;
|
private final SynchronizeConfig config;
|
||||||
private final URI uri;
|
private final String url;
|
||||||
private final String itemPath;
|
private final String itemPath;
|
||||||
|
|
||||||
private final FileTracker tracker;
|
private final FileTracker tracker;
|
||||||
private final ProgressUpdater progressUpdater;
|
private final ProgressUpdater progressUpdater;
|
||||||
private CountDownLatch itemsLeftLatch;
|
private CountDownLatch itemsLeftLatch;
|
||||||
|
public static final OkHttpClient CLIENT = new OkHttpClient();
|
||||||
|
|
||||||
|
|
||||||
public DownloadTask(SynchronizeConfig config, URI uri, String itemPath,
|
public DownloadTask(SynchronizeConfig config, String url, String itemPath,
|
||||||
FileTracker tracker, ProgressUpdater progressUpdater) {
|
FileTracker tracker, ProgressUpdater progressUpdater) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.uri = uri;
|
this.url = url;
|
||||||
this.itemPath = itemPath;
|
this.itemPath = itemPath;
|
||||||
|
|
||||||
this.tracker = tracker;
|
this.tracker = tracker;
|
||||||
|
@ -41,13 +41,11 @@ public class DownloadTask implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputStream prepareConnection() throws IOException {
|
private InputStream prepareConnection() throws IOException {
|
||||||
OkHttpClient client = new OkHttpClient();
|
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(uri.toURL())
|
.url(url)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Response response = client.newCall(request).execute();
|
Response response = CLIENT.newCall(request).execute();
|
||||||
|
|
||||||
if (response.code() != 200) {
|
if (response.code() != 200) {
|
||||||
Log.e("ERROR", "Server returned HTTP " + response.message());
|
Log.e("ERROR", "Server returned HTTP " + response.message());
|
||||||
|
|
|
@ -5,11 +5,11 @@ public class Item {
|
||||||
private int id;
|
private int id;
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
public int getId() {
|
public int getID() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(int id) {
|
public void setID(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,15 +26,28 @@ public class ProgressUpdater {
|
||||||
this.notificationManager = NotificationManagerCompat.from(context);
|
this.notificationManager = NotificationManagerCompat.from(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMessage(String message, boolean persist, Object... args) {
|
public void showMessage(String message, Object... args) {
|
||||||
showMessage(String.format(message, args), persist);
|
showMessage(String.format(message, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMessage(String message, boolean persist) {
|
public void showMessage(String message) {
|
||||||
NotificationCompat.Builder builder = notificationBuilder();
|
NotificationCompat.Builder builder = notificationBuilder();
|
||||||
builder.setContentTitle(message);
|
builder.setContentTitle(message);
|
||||||
builder.setContentText("");
|
|
||||||
builder.setProgress(0, 0, !persist);
|
updateNotification(builder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showOngoingMessage(String message, Object... args) {
|
||||||
|
showOngoingMessage(String.format(message, args));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void showOngoingMessage(String message) {
|
||||||
|
NotificationCompat.Builder builder = notificationBuilder();
|
||||||
|
builder.setContentTitle(message);
|
||||||
|
builder.setProgress(0, 0, true);
|
||||||
|
builder.setOngoing(true);
|
||||||
|
|
||||||
updateNotification(builder);
|
updateNotification(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +58,7 @@ public class ProgressUpdater {
|
||||||
builder.setContentTitle("Aktualisiere Musik");
|
builder.setContentTitle("Aktualisiere Musik");
|
||||||
builder.setContentText(downloadCount + "/" + maximum);
|
builder.setContentText(downloadCount + "/" + maximum);
|
||||||
builder.setProgress(maximum, downloadCount, false);
|
builder.setProgress(maximum, downloadCount, false);
|
||||||
|
builder.setOngoing(true);
|
||||||
updateNotification(builder);
|
updateNotification(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,13 +66,13 @@ public class ProgressUpdater {
|
||||||
this.maximum = maximum;
|
this.maximum = maximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateNotification(NotificationCompat.Builder builder) {
|
public void updateNotification(NotificationCompat.Builder builder) {
|
||||||
notificationManager.notify(NOTIFICATION_ID, builder.build());
|
notificationManager.notify(NOTIFICATION_ID, builder.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private NotificationCompat.Builder notificationBuilder() {
|
public NotificationCompat.Builder notificationBuilder() {
|
||||||
return new NotificationCompat.Builder(context)
|
return new NotificationCompat.Builder(context)
|
||||||
.setSmallIcon(R.mipmap.ic_launcher);
|
.setSmallIcon(R.drawable.ic_sync_white_24dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private NotificationCompat.Builder progressNotificationBuilder() {
|
private NotificationCompat.Builder progressNotificationBuilder() {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
android:id="@+id/tabs"
|
android:id="@+id/tabs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="#FF9800" />
|
android:background="@color/colorPrimary" />
|
||||||
|
|
||||||
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
|
|
||||||
<item android:id="@+id/action_settings"
|
<item android:id="@+id/action_settings"
|
||||||
android:title="Settings"
|
android:title="@string/settings"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never"/>
|
||||||
|
|
||||||
<item android:id="@+id/action_help"
|
<item android:id="@+id/action_help"
|
||||||
android:title="Hilfe"
|
android:title="@string/help"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never"/>
|
||||||
|
|
||||||
<item android:id="@+id/action_version"
|
<item android:id="@+id/action_version"
|
||||||
android:title="Version"
|
android:title="@string/version"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never"/>
|
||||||
</menu>
|
</menu>
|
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="accentColor">#607D8B</color>
|
<color name="accentColor">#607D8B</color>
|
||||||
|
<color name="colorPrimary">#FF9800</color>
|
||||||
</resources>
|
</resources>
|
|
@ -2,4 +2,11 @@
|
||||||
<string name="app_name">music-cyclon</string>
|
<string name="app_name">music-cyclon</string>
|
||||||
<string name="title_activity_synchronize">Synchronizing</string>
|
<string name="title_activity_synchronize">Synchronizing</string>
|
||||||
<string name="synchronize">Synchronize</string>
|
<string name="synchronize">Synchronize</string>
|
||||||
|
<string name="settings">Settings</string>
|
||||||
|
<string name="help">Help</string>
|
||||||
|
<string name="version">Version</string>
|
||||||
|
<string name="synchronizing">Synchronizing</string>
|
||||||
|
<string name="already_synchronizing">Already synchronizing!</string>
|
||||||
|
<string name="default_config_name">Default</string>
|
||||||
|
<string name="rename">Rename</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<style name="AppTheme" parent="@style/PreferenceFixTheme.Light.NoActionBar">
|
<style name="AppTheme" parent="@style/PreferenceFixTheme.Light.NoActionBar">
|
||||||
<!-- Main theme colors -->
|
<!-- Main theme colors -->
|
||||||
<!-- your app branding color for the app bar -->
|
<!-- your app branding color for the app bar -->
|
||||||
<item name="colorPrimary">#FF9800</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<!-- darker variant for the status bar and contextual app bars -->
|
<!-- darker variant for the status bar and contextual app bars -->
|
||||||
<item name="colorPrimaryDark">#F57C00</item>
|
<item name="colorPrimaryDark">#F57C00</item>
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
android:summary="The amount of tracks or albums to download"
|
android:summary="The amount of tracks or albums to download"
|
||||||
android:title="Number of items" />
|
android:title="Number of items" />
|
||||||
|
|
||||||
<!--<SwitchPreference-->
|
<SwitchPreference
|
||||||
<!--android:persistent="false"-->
|
android:defaultValue="@bool/random"
|
||||||
<!--android:defaultValue="@bool/random"-->
|
android:key="random"
|
||||||
<!--android:key="random"-->
|
android:persistent="false"
|
||||||
<!--android:summary=""-->
|
android:summary="Select title/albums randomly"
|
||||||
<!--android:title="Select title/albums randomly" />-->
|
android:title="Random" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="@bool/use_albums"
|
android:defaultValue="@bool/use_albums"
|
||||||
|
|
Loading…
Reference in New Issue