Merge pull request #4263 from k9mail/remove_unused_code

Remove unused code
This commit is contained in:
cketti 2019-11-18 16:55:06 +01:00 committed by GitHub
commit 1303430e73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 131 deletions

View file

@ -1,17 +0,0 @@
package com.fsck.k9.helper;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
public class ContactItem implements Serializable {
private static final long serialVersionUID = 4893328130147843375L;
public final String displayName;
public final List<String> emailAddresses;
public ContactItem(String displayName, List<String> emailAddresses) {
this.displayName = displayName;
this.emailAddresses = Collections.unmodifiableList(emailAddresses);
}
}

View file

@ -1,43 +0,0 @@
package com.fsck.k9.activity
import com.fsck.k9.Account
import com.fsck.k9.view.ColorChip
internal class ColorChipProvider {
val cache = mutableMapOf<String, ColorChipHolder>()
fun getColorChip(account: Account, flagged: Boolean): ColorChip {
val chipHolder = getChipHolder(account)
return with(chipHolder) {
if (flagged) flaggedColorChip else unreadColorChip
}
}
private fun getChipHolder(account: Account): ColorChipHolder {
val colorChipHolder = cache[account.uuid]
if (colorChipHolder?.chipColor == account.chipColor) {
return colorChipHolder
}
val newColorChipHolder = createColorChipHolder(account)
cache[account.uuid] = newColorChipHolder
return newColorChipHolder
}
private fun createColorChipHolder(account: Account): ColorChipHolder {
val chipColor = account.chipColor
return ColorChipHolder(
chipColor = chipColor,
unreadColorChip = ColorChip(chipColor, ColorChip.CIRCULAR),
flaggedColorChip = ColorChip(chipColor, ColorChip.STAR)
)
}
data class ColorChipHolder(
val chipColor: Int,
val unreadColorChip: ColorChip,
val flaggedColorChip: ColorChip
)
}

View file

@ -3,6 +3,5 @@ package com.fsck.k9.activity
import org.koin.dsl.module.applicationContext
val activityModule = applicationContext {
bean { ColorChipProvider() }
bean { MessageLoaderHelperFactory(get(), get()) }
}

View file

@ -1,70 +0,0 @@
package com.fsck.k9.view;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.PathShape;
public class ColorChip {
public static final Path CIRCULAR = new Path();
public static final Path LEFT_POINTING = new Path();
public static final Path RIGHT_POINTING = new Path();
public static final Path RIGHT_NOTCH = new Path();
public static final Path STAR = new Path();
static {
CIRCULAR.addCircle(160, 160, 70f, Path.Direction.CW);
CIRCULAR.close();
RIGHT_POINTING.addArc(new RectF(80f, 80f, 240f, 240f), 90, 180);
RIGHT_POINTING.arcTo(new RectF(160f, 0f, 320f, 160f), 180, -90);
RIGHT_POINTING.arcTo(new RectF(160f, 160f, 320f, 320f), 270, -90);
RIGHT_POINTING.close();
RIGHT_NOTCH.addArc(new RectF(80f, 80f, 240f, 240f), 90, 180);
RIGHT_NOTCH.arcTo(new RectF(160f, 0f, 320f, 160f), 180, -90);
RIGHT_NOTCH.arcTo(new RectF(160f, 160f, 320f, 320f), 270, -90);
RIGHT_NOTCH.close();
LEFT_POINTING.addArc(new RectF(80f, 80f, 240f, 240f), 90, -180);
LEFT_POINTING.arcTo(new RectF(00f, 00f, 160f, 160f), 0, 90);
LEFT_POINTING.arcTo(new RectF(00f, 160f, 160f, 320f), 270, 90);
LEFT_POINTING.close();
STAR.moveTo(140f, 60f);
STAR.lineTo(170f, 110f);
STAR.lineTo(220f, 120f);
STAR.lineTo(180f, 160f);
STAR.lineTo(200f, 220f);
STAR.lineTo(140f, 190f);
STAR.lineTo(80f, 220f);
STAR.lineTo(100f, 160f);
STAR.lineTo(60f, 120f);
STAR.lineTo(110f, 110f);
STAR.lineTo(140f, 60f);
STAR.close();
}
private ShapeDrawable mDrawable;
public ColorChip(int color, Path shape) {
if (shape.equals(STAR)) {
mDrawable = new ShapeDrawable(new PathShape(shape, 280f, 280f));
} else {
mDrawable = new ShapeDrawable(new PathShape(shape, 320f, 320f));
}
mDrawable.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);
mDrawable.getPaint().setStrokeWidth(20);
mDrawable.getPaint().setColor(color);
}
public ShapeDrawable drawable() {
return mDrawable;
}
}