Commit e3b22ba2 authored by luca020400's avatar luca020400

Jelly: Fix some lint warnings

Change-Id: Ia8912af5dba3c806ebc4c97ec377e86630896fc2
parent 2d1bdcdb
......@@ -530,7 +530,7 @@ public class MainActivity extends WebViewExtActivity implements View.OnTouchList
Bitmap icon = mUrlIcon == null ?
BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher) : mUrlIcon;
Bitmap launcherIcon = UiUtils.getShortcutIcon(this, icon, getThemeColorWithFallback());
Bitmap launcherIcon = UiUtils.getShortcutIcon(icon, getThemeColorWithFallback());
Intent addIntent = new Intent();
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, mWebView.getTitle());
......
......@@ -95,7 +95,7 @@ public class FavoriteActivity extends AppCompatActivity {
}
}
boolean editItem(Favorite item) {
void editItem(Favorite item) {
View view = LayoutInflater.from(this)
.inflate(R.layout.dialog_favorite_edit, new LinearLayout(this));
EditText titleEdit = (EditText) view.findViewById(R.id.favorite_edit_title);
......@@ -151,7 +151,6 @@ public class FavoriteActivity extends AppCompatActivity {
.setNegativeButton(android.R.string.cancel,
(dialog, which) -> dialog.dismiss())
.show();
return true;
}
}
......@@ -53,6 +53,9 @@ class FavoriteHolder extends RecyclerView.ViewHolder {
context.startActivity(intent);
});
mCard.setOnLongClickListener(v -> ((FavoriteActivity) context).editItem(item));
mCard.setOnLongClickListener(v -> {
((FavoriteActivity) context).editItem(item);
return true;
});
}
}
......@@ -161,9 +161,7 @@ public class HistoryActivity extends AppCompatActivity {
@Override
protected void onPostExecute(Boolean param) {
new Handler().postDelayed(() -> {
dialog.dismiss();
}, 1000);
new Handler().postDelayed(dialog::dismiss, 1000);
}
}.execute();
}
......
......@@ -15,7 +15,6 @@
*/
package org.lineageos.jelly.utils;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
......@@ -49,7 +48,7 @@ public final class UiUtils {
return incognito ? palette.getMutedColor(fallback) : palette.getVibrantColor(fallback);
}
public static Bitmap getShortcutIcon(Context context, Bitmap bitmap, int themeColor) {
public static Bitmap getShortcutIcon(Bitmap bitmap, int themeColor) {
Bitmap out = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getWidth(),
Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(out);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment