change the remaining icons and colors
|
@ -12,6 +12,7 @@ import android.content.pm.PackageManager;
|
|||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
|
@ -208,11 +209,11 @@ public class MusicService extends Service
|
|||
private void createNotificationButtons() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Resources res = getResources();
|
||||
prevBitmap = Utils.getColoredIcon(res, Color.BLACK, R.mipmap.previous_white);
|
||||
playBitmap = Utils.getColoredIcon(res, Color.BLACK, R.mipmap.play_white);
|
||||
pauseBitmap = Utils.getColoredIcon(res, Color.BLACK, R.mipmap.pause_white);
|
||||
nextBitmap = Utils.getColoredIcon(res, Color.BLACK, R.mipmap.next_white);
|
||||
closeBitmap = Utils.getColoredIcon(res, Color.BLACK, R.mipmap.close_white);
|
||||
prevBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.previous);
|
||||
playBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.play);
|
||||
pauseBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.pause);
|
||||
nextBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.next);
|
||||
closeBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.close);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -274,9 +275,9 @@ public class MusicService extends Service
|
|||
}
|
||||
|
||||
private void updatePlayPauseButton(RemoteViews remoteViews) {
|
||||
int playPauseIcon = R.mipmap.play_white;
|
||||
int playPauseIcon = R.mipmap.play;
|
||||
if (isPlaying())
|
||||
playPauseIcon = R.mipmap.pause_white;
|
||||
playPauseIcon = R.mipmap.pause;
|
||||
|
||||
remoteViews.setImageViewResource(R.id.playPauseBtn, playPauseIcon);
|
||||
}
|
||||
|
|
|
@ -122,18 +122,21 @@ public class MyWidgetProvider extends AppWidgetProvider {
|
|||
final int newBgColor = prefs.getInt(Constants.WIDGET_BG_COLOR, defaultColor);
|
||||
final int newTextColor = prefs.getInt(Constants.WIDGET_TEXT_COLOR, Color.WHITE);
|
||||
|
||||
if (remoteViews == null)
|
||||
initVariables(context);
|
||||
|
||||
remoteViews.setInt(R.id.widget_holder, "setBackgroundColor", newBgColor);
|
||||
|
||||
remoteViews.setInt(R.id.songTitle, "setTextColor", newTextColor);
|
||||
remoteViews.setInt(R.id.songArtist, "setTextColor", newTextColor);
|
||||
|
||||
Bitmap bmp = Utils.getColoredIcon(res, newTextColor, R.mipmap.previous_white);
|
||||
Bitmap bmp = Utils.getColoredIcon(res, newTextColor, R.mipmap.previous);
|
||||
remoteViews.setImageViewBitmap(R.id.previousBtn, bmp);
|
||||
|
||||
playBitmap = Utils.getColoredIcon(res, newTextColor, R.mipmap.play_white);
|
||||
pauseBitmap = Utils.getColoredIcon(res, newTextColor, R.mipmap.pause_white);
|
||||
playBitmap = Utils.getColoredIcon(res, newTextColor, R.mipmap.play);
|
||||
pauseBitmap = Utils.getColoredIcon(res, newTextColor, R.mipmap.pause);
|
||||
|
||||
bmp = Utils.getColoredIcon(res, newTextColor, R.mipmap.next_white);
|
||||
bmp = Utils.getColoredIcon(res, newTextColor, R.mipmap.next);
|
||||
remoteViews.setImageViewBitmap(R.id.nextBtn, bmp);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ import android.graphics.Bitmap;
|
|||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.LightingColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -24,7 +25,7 @@ public class Utils {
|
|||
options.inMutable = true;
|
||||
final Bitmap bmp = BitmapFactory.decodeResource(res, id, options);
|
||||
final Paint paint = new Paint();
|
||||
final ColorFilter filter = new LightingColorFilter(newTextColor, 1);
|
||||
final ColorFilter filter = new PorterDuffColorFilter(newTextColor, PorterDuff.Mode.SRC_IN);
|
||||
paint.setColorFilter(filter);
|
||||
final Canvas canvas = new Canvas(bmp);
|
||||
canvas.drawBitmap(bmp, 0, 0, paint);
|
||||
|
|
|
@ -53,8 +53,10 @@
|
|||
android:layout_marginBottom="@dimen/song_item_padding"
|
||||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:layout_marginTop="@dimen/activity_margin"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp"/>
|
||||
|
||||
<TextView
|
||||
|
@ -63,8 +65,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/songTitle"
|
||||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
android:layout_alignParentRight="true"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/close_white"
|
||||
android:src="@mipmap/close"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<TextView
|
||||
android:id="@+id/songTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Song Title"
|
||||
android:textColor="@android:color/black"
|
||||
|
@ -22,6 +23,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/songArtist"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Song Artist"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:layout_marginTop="@dimen/medium_padding"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:textColor="@android:color/white"
|
||||
|
@ -29,6 +30,7 @@
|
|||
android:layout_marginLeft="@dimen/activity_margin"
|
||||
android:layout_marginRight="@dimen/activity_margin"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:textColor="@android:color/white"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/previous_white"/>
|
||||
android:src="@mipmap/previous"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/playPauseBtn"
|
||||
|
@ -24,7 +24,7 @@
|
|||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/play_white"/>
|
||||
android:src="@mipmap/play"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/nextBtn"
|
||||
|
@ -34,6 +34,6 @@
|
|||
android:layout_weight="1"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:src="@mipmap/next_white"/>
|
||||
android:src="@mipmap/next"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
BIN
app/src/main/res/mipmap-hdpi/close.png
Normal file
After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 826 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 109 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-mdpi/close.png
Normal file
After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/close.png
Normal file
After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/close.png
Normal file
After Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/close.png
Normal file
After Width: | Height: | Size: 665 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 515 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 839 B After Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 1 KiB |