Skip to content

Commit

Permalink
removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
DevLuuk committed Aug 29, 2018
1 parent 65616c4 commit 7731968
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions app/src/main/java/nl/devluuk/sleepywifi/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
Expand All @@ -33,6 +31,7 @@ protected void onCreate(Bundle savedInstanceState) {

final ImageView imageButton = findViewById(R.id.powerButton);
getStatus();
playOrPauseService(imageButton);
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -50,7 +49,7 @@ public void playOrPauseService(ImageView image) {
stopService(new Intent(this, BackgroundService.class));

grayIcon = getResources().getDrawable(R.drawable.ic_launcher_round_gray, null);
makeGrayIcon(grayIcon);
makeGrayIcon(grayIcon, 0);
image.setImageDrawable(grayIcon);

stateText.setText("Current state is: " + setState());
Expand All @@ -75,9 +74,9 @@ private boolean isMyServiceRunning(Class<?> serviceClass) {
return false;
}

private Drawable makeGrayIcon(Drawable icon){
private Drawable makeGrayIcon(Drawable icon, int colorID) {
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
matrix.setSaturation(colorID);

ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
icon.setColorFilter(filter);
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/nl/devluuk/sleepywifi/OnStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.Intent;
import android.util.Log;


public class OnStart extends BroadcastReceiver {

private static final String TAG = OnStart.class.getSimpleName();
Expand Down

0 comments on commit 7731968

Please sign in to comment.