summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/eleven/utils
diff options
context:
space:
mode:
authorJoey Rizzoli <joey@cyanogenmoditalia.it>2016-01-25 18:11:46 -0800
committerjrizzoli <joey@cyanogenmoditalia.it>2016-04-15 21:39:02 +0200
commit120fc6ddb9efd1405154042aa1a8a90a0a5d8825 (patch)
treeee8f814102857c893a4ac179335f452ce065306a /src/com/cyanogenmod/eleven/utils
parent5b70660fddcb245ee48332f6633ca31269d2dd04 (diff)
downloadandroid_packages_apps_Eleven-120fc6ddb9efd1405154042aa1a8a90a0a5d8825.tar.gz
android_packages_apps_Eleven-120fc6ddb9efd1405154042aa1a8a90a0a5d8825.tar.bz2
android_packages_apps_Eleven-120fc6ddb9efd1405154042aa1a8a90a0a5d8825.zip
Eleven: much material
- Remove old font, let's use the system's - Vector drawables - Update colors Change-Id: I6c4335f388c88fd4ce6d10e4995692aaf0679a49 Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
Diffstat (limited to 'src/com/cyanogenmod/eleven/utils')
-rw-r--r--src/com/cyanogenmod/eleven/utils/CustomToast.java62
-rw-r--r--src/com/cyanogenmod/eleven/utils/MusicUtils.java11
-rw-r--r--src/com/cyanogenmod/eleven/utils/NavUtils.java5
-rw-r--r--src/com/cyanogenmod/eleven/utils/PreferenceUtils.java2
4 files changed, 10 insertions, 70 deletions
diff --git a/src/com/cyanogenmod/eleven/utils/CustomToast.java b/src/com/cyanogenmod/eleven/utils/CustomToast.java
deleted file mode 100644
index 11c567f..0000000
--- a/src/com/cyanogenmod/eleven/utils/CustomToast.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.cyanogenmod.eleven.utils;
-
-import android.app.Activity;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
-import android.widget.Toast;
-import com.cyanogenmod.eleven.R;
-
-/**
- * Ancillary utilities class to customize the appearance of Toast messages
- */
-public class CustomToast {
-
- public static final int LENGTH_LONG = Toast.LENGTH_LONG;
- public static final int LENGTH_SHORT = Toast.LENGTH_SHORT;
-
- private Toast mToast;
- private TextView mTextView;
-
- public CustomToast(Activity activity, String message) {
- mToast = new Toast( activity.getApplicationContext() );
- LayoutInflater layoutInflater = activity.getLayoutInflater();
- View toastView = layoutInflater.inflate(R.layout.custom_toast, null);
- mToast.setView(toastView);
-
- mTextView = (TextView) toastView.findViewById(R.id.toast_text_view);
- if (message != null) {
- mTextView.setText(message);
- }
-
- // set toast location
- // centered with an offset in y expressed as % of display height
- int displayHeight = activity.getWindow().getDecorView().getHeight();
- int heightOffset = (int)(0.30 * displayHeight);
- mToast.setGravity(Gravity.CENTER_HORIZONTAL, 0, heightOffset);
-
- }
-
- public static CustomToast makeText(Activity context, String text, int duration) {
- CustomToast customToast = new CustomToast(context, text);
- if (duration == CustomToast.LENGTH_LONG)
- customToast.setDuration(duration);
- else
- customToast.setDuration(CustomToast.LENGTH_SHORT);
-
- return customToast;
- }
-
- public void setDuration(int duration) {
- mToast.setDuration(duration);
- }
-
- public void setMessage(String message) {
- mTextView.setText(message);
- }
-
- public void show() {
- mToast.show();
- }
-}
diff --git a/src/com/cyanogenmod/eleven/utils/MusicUtils.java b/src/com/cyanogenmod/eleven/utils/MusicUtils.java
index c8292ef..396ae24 100644
--- a/src/com/cyanogenmod/eleven/utils/MusicUtils.java
+++ b/src/com/cyanogenmod/eleven/utils/MusicUtils.java
@@ -39,6 +39,7 @@ import android.provider.MediaStore.MediaColumns;
import android.provider.Settings;
import android.util.Log;
import android.view.Menu;
+import android.widget.Toast;
import com.cyanogenmod.eleven.Config.IdType;
import com.cyanogenmod.eleven.Config.SmartPlaylistType;
@@ -1148,7 +1149,7 @@ public final class MusicUtils {
}
final String message = context.getResources().getQuantityString(
R.plurals.NNNtrackstoplaylist, numinserted, numinserted);
- CustomToast.makeText((Activity)context, message, CustomToast.LENGTH_SHORT).show();
+ Toast.makeText((Activity)context, message, Toast.LENGTH_SHORT).show();
playlistChanged();
}
@@ -1167,7 +1168,7 @@ public final class MusicUtils {
});
final String message = context.getResources().getQuantityString(
R.plurals.NNNtracksfromplaylist, 1, 1);
- CustomToast.makeText((Activity)context, message, CustomToast.LENGTH_SHORT).show();
+ Toast.makeText((Activity)context, message, Toast.LENGTH_SHORT).show();
playlistChanged();
}
@@ -1183,7 +1184,7 @@ public final class MusicUtils {
try {
mService.enqueue(list, MusicPlaybackService.LAST, sourceId, sourceType.mId);
final String message = makeLabel(context, R.plurals.NNNtrackstoqueue, list.length);
- CustomToast.makeText((Activity) context, message, CustomToast.LENGTH_SHORT).show();
+ Toast.makeText((Activity) context, message, Toast.LENGTH_SHORT).show();
} catch (final RemoteException ignored) {
}
}
@@ -1217,7 +1218,7 @@ public final class MusicUtils {
Settings.System.putString(resolver, Settings.System.RINGTONE, uri.toString());
final String message = context.getString(R.string.set_as_ringtone,
cursor.getString(2));
- CustomToast.makeText((Activity)context, message, CustomToast.LENGTH_SHORT).show();
+ Toast.makeText((Activity)context, message, Toast.LENGTH_SHORT).show();
}
} finally {
if (cursor != null) {
@@ -1641,7 +1642,7 @@ public final class MusicUtils {
final String message = makeLabel(context, R.plurals.NNNtracksdeleted, list.length);
- CustomToast.makeText((Activity)context, message, CustomToast.LENGTH_SHORT).show();
+ Toast.makeText((Activity)context, message, Toast.LENGTH_SHORT).show();
// We deleted a number of tracks, which could affect any number of
// things
// in the media content domain, so update everything.
diff --git a/src/com/cyanogenmod/eleven/utils/NavUtils.java b/src/com/cyanogenmod/eleven/utils/NavUtils.java
index ab68fb0..0e74f47 100644
--- a/src/com/cyanogenmod/eleven/utils/NavUtils.java
+++ b/src/com/cyanogenmod/eleven/utils/NavUtils.java
@@ -23,6 +23,7 @@ import android.media.audiofx.AudioEffect;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
+import android.widget.Toast;
import com.cyanogenmod.eleven.Config;
import com.cyanogenmod.eleven.R;
@@ -135,8 +136,8 @@ public final class NavUtils {
// The google MusicFX apps need to be started using startActivityForResult
context.startActivityForResult(createEffectsIntent(), requestCode);
} catch (final ActivityNotFoundException notFound) {
- CustomToast.makeText(context, context.getString(R.string.no_effects_for_you),
- CustomToast.LENGTH_SHORT).show();
+ Toast.makeText(context, context.getString(R.string.no_effects_for_you),
+ Toast.LENGTH_SHORT).show();
}
}
diff --git a/src/com/cyanogenmod/eleven/utils/PreferenceUtils.java b/src/com/cyanogenmod/eleven/utils/PreferenceUtils.java
index 3932d12..7f4fd12 100644
--- a/src/com/cyanogenmod/eleven/utils/PreferenceUtils.java
+++ b/src/com/cyanogenmod/eleven/utils/PreferenceUtils.java
@@ -170,7 +170,7 @@ public final class PreferenceUtils {
*/
public final int getDefaultThemeColor(final Context context) {
return mPreferences.getInt(DEFAULT_THEME_COLOR,
- context.getResources().getColor(R.color.holo_blue_light));
+ context.getResources().getColor(R.color.blue));
}
/**