mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 12:35:17 +00:00
a4e18c515c
Closes #2647 // FREEBIE
67 lines
1.6 KiB
Java
67 lines
1.6 KiB
Java
package org.thoughtcrime.securesms;
|
|
|
|
import org.thoughtcrime.securesms.util.CharacterCalculator;
|
|
import org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState;
|
|
import org.thoughtcrime.securesms.util.EncryptedSmsCharacterCalculator;
|
|
import org.thoughtcrime.securesms.util.PushCharacterCalculator;
|
|
import org.thoughtcrime.securesms.util.SmsCharacterCalculator;
|
|
|
|
public class TransportOption {
|
|
|
|
public enum Type {
|
|
SMS,
|
|
TEXTSECURE
|
|
}
|
|
|
|
private int drawable;
|
|
private String text;
|
|
private Type type;
|
|
private String composeHint;
|
|
private CharacterCalculator characterCalculator;
|
|
|
|
public TransportOption(Type type,
|
|
int drawable,
|
|
String text,
|
|
String composeHint,
|
|
CharacterCalculator characterCalculator)
|
|
{
|
|
this.type = type;
|
|
this.drawable = drawable;
|
|
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 isPlaintext() {
|
|
return type == Type.SMS;
|
|
}
|
|
|
|
public boolean isSms() {
|
|
return type == Type.SMS;
|
|
}
|
|
|
|
public CharacterState calculateCharacters(int charactersSpent) {
|
|
return characterCalculator.calculateCharacters(charactersSpent);
|
|
}
|
|
|
|
public int getDrawable() {
|
|
return drawable;
|
|
}
|
|
|
|
public String getComposeHint() {
|
|
return composeHint;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return text;
|
|
}
|
|
}
|