-
-
Notifications
You must be signed in to change notification settings - Fork 7
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 #244 from newhinton/feature/noid/markdownblocks
Feature/noid/markdownblocks
- Loading branch information
Showing
2 changed files
with
123 additions
and
2 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
36 changes: 36 additions & 0 deletions
36
markdown/src/main/java/it/niedermann/android/markdown/remoteviews/RemoteViewElement.kt
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,36 @@ | ||
package it.niedermann.android.markdown.remoteviews | ||
|
||
import java.util.ArrayList | ||
|
||
class RemoteViewElement( | ||
val type: Int, | ||
val currentLineBlock: String, | ||
val blockStartsInLine: Int, | ||
val blockEndsInLine: Int | ||
) { | ||
|
||
companion object { | ||
const val TYPE_TEXT = 0 | ||
const val TYPE_CHECKBOX_CHECKED = 1 | ||
const val TYPE_CHECKBOX_UNCHECKED = 2 | ||
} | ||
|
||
override fun toString(): String { | ||
var elements = StringBuilder() | ||
|
||
if(type == TYPE_TEXT) { | ||
elements.append("TYPE_TEXT").append("\n") | ||
} | ||
if(type == TYPE_CHECKBOX_CHECKED) { | ||
elements.append("TYPE_CHECKBOX_CHECKED").append("\n") | ||
} | ||
if(type == TYPE_CHECKBOX_UNCHECKED) { | ||
elements.append("TYPE_CHECKBOX_UNCHECKED").append("\n") | ||
} | ||
|
||
elements.append("Content:").append("\n") | ||
elements.append(currentLineBlock).append("\n") | ||
elements.append("Started from $blockStartsInLine to $blockEndsInLine").append("\n") | ||
return elements.toString() | ||
} | ||
} |