-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from PatilShreyas/hotfix/v2.2.2
[Hotfix] Release v2.2.2
- Loading branch information
Showing
10 changed files
with
110 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/model/DialogMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package dev.shreyaspatil.MaterialDialog.model; | ||
|
||
import android.text.Spanned; | ||
|
||
public abstract class DialogMessage<T extends CharSequence> { | ||
private final TextAlignment textAlignment; | ||
|
||
private DialogMessage(TextAlignment textAlignment) { | ||
this.textAlignment = textAlignment; | ||
} | ||
|
||
public static SpannedMessage spanned(Spanned text, TextAlignment alignment) { | ||
return new SpannedMessage(text, alignment); | ||
} | ||
|
||
public static TextMessage text(String text, TextAlignment alignment) { | ||
return new TextMessage(text, alignment); | ||
} | ||
|
||
public TextAlignment getTextAlignment() { | ||
return textAlignment; | ||
} | ||
|
||
public abstract T getText(); | ||
|
||
public static class SpannedMessage extends DialogMessage<Spanned> { | ||
|
||
private final Spanned text; | ||
|
||
SpannedMessage(Spanned text, TextAlignment textAlignment) { | ||
super(textAlignment); | ||
this.text = text; | ||
} | ||
|
||
@Override | ||
public Spanned getText() { | ||
return text; | ||
} | ||
} | ||
|
||
public static class TextMessage extends DialogMessage<String> { | ||
|
||
private final String text; | ||
|
||
TextMessage(String text, TextAlignment textAlignment) { | ||
super(textAlignment); | ||
this.text = text; | ||
} | ||
|
||
@Override | ||
public String getText() { | ||
return text; | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...atil/MaterialDialog/model/DialogText.java → ...til/MaterialDialog/model/DialogTitle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters