mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 18:45:19 +00:00
daa98107c3
Closes #3506 // FREEBIE
69 lines
1.6 KiB
Java
69 lines
1.6 KiB
Java
package org.thoughtcrime.securesms;
|
|
|
|
import android.support.annotation.DrawableRes;
|
|
|
|
import org.thoughtcrime.securesms.util.CharacterCalculator;
|
|
import org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState;
|
|
|
|
public class TransportOption {
|
|
|
|
public enum Type {
|
|
SMS,
|
|
TEXTSECURE
|
|
}
|
|
|
|
private int drawable;
|
|
private int backgroundColor;
|
|
private String text;
|
|
private Type type;
|
|
private String composeHint;
|
|
private CharacterCalculator characterCalculator;
|
|
|
|
public TransportOption(Type type,
|
|
@DrawableRes int drawable,
|
|
int backgroundColor,
|
|
String text,
|
|
String composeHint,
|
|
CharacterCalculator characterCalculator)
|
|
{
|
|
this.type = type;
|
|
this.drawable = drawable;
|
|
this.backgroundColor = backgroundColor;
|
|
this.text = text;
|
|
this.composeHint = composeHint;
|
|
this.characterCalculator = characterCalculator;
|
|
}
|
|
|
|
public Type getType() {
|
|
return type;
|
|
}
|
|
|
|
public boolean isType(Type type) {
|
|
return this.type == type;
|
|
}
|
|
|
|
public boolean isSms() {
|
|
return type == Type.SMS;
|
|
}
|
|
|
|
public CharacterState calculateCharacters(int charactersSpent) {
|
|
return characterCalculator.calculateCharacters(charactersSpent);
|
|
}
|
|
|
|
public @DrawableRes int getDrawable() {
|
|
return drawable;
|
|
}
|
|
|
|
public int getBackgroundColor() {
|
|
return backgroundColor;
|
|
}
|
|
|
|
public String getComposeHint() {
|
|
return composeHint;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return text;
|
|
}
|
|
}
|