Comments (1)
Text color, or theme color, can be configured via the SurveyTheme
supplied on SurveyView.start(task, <SurveyTheme>
.
Heavy customization like the justification of content should be done by implementing your own Step
.
class CustomStep : Step {
override val isOptional: Boolean = true
override val id: StepIdentifier =
StepIdentifier()
val tmp = id
override fun createView(context: Context, stepResult: StepResult?): StepView {
return object : StepView(context, id, isOptional) {
override fun setupViews() = Unit
val root = View.inflate(context, R.layout.custom_step, this)
override fun createResults(): QuestionResult =
CustomResult(
root.findViewById<EditText>(R.id.input).text.toString(),
"stringIdentifier",
id,
Date(),
Date()
)
override fun isValidInput(): Boolean = this@CustomStep.isOptional
override var isOptional: Boolean = this@CustomStep.isOptional
override val id: StepIdentifier = tmp
override fun style(surveyTheme: SurveyTheme) {
// do styling here
}
init {
root.findViewById<Button>(R.id.continue_button)
.setOnClickListener { onNextListener(createResults()) }
root.findViewById<Button>(R.id.back_button)
.setOnClickListener { onBackListener(createResults()) }
root.findViewById<Button>(R.id.close_button)
.setOnClickListener { onCloseListener(createResults(), FinishReason.Completed) }
root.findViewById<Button>(R.id.skip_button)
.setOnClickListener { onSkipListener() }
root.findViewById<EditText>(R.id.input).setText(
(stepResult?.results?.firstOrNull() as? CustomResult)?.customData ?: ""
)
}
}
}
}
@Parcelize
data class CustomResult(
val customData: String,
override val stringIdentifier: String,
override val id: Identifier,
override val startDate: Date,
override var endDate: Date
) : QuestionResult, Parcelable
Taken from the exampe/MainActivity
from surveykit.
Related Issues (20)
- First page should not have a back button
- Can not create Form Step HOT 1
- Resume survey from last question HOT 1
- How can I just get the integer answers from my survey so I can calculate a score? HOT 1
- AbortDialogConfig Not Accessible HOT 1
- "Submit Survey" button not clickable after click one time HOT 6
- Unable to change theme colour. HOT 4
- Add publish script in github actions.
- Update README with instructions to help developers fix CI issues.
- How to use in Jetpack Compose only navigation
- Survey kit is lagging when used in a compose only navigation
- Adding CustomStep on First App Crash HOT 1
- Java version HOT 1
- Incorrect Library Setup in readme file HOT 1
- Text Configuration HOT 1
- json schema
- Customize "Cancel, Next" Button and Alert "Cancel"
- In result how to get the original ids or position of all yes and no click position
- Move to GitHub actions
- Conditional rule does not trigger when selecting multiple answer (JSON TASK)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surveykit.