source stringlengths 14 113 | code stringlengths 10 21.3k |
|---|---|
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-navigation.md | // The CustomNavigationUtils.ts file defines a utility class for managing custom animation parameters for different pages.
// Custom API to save the transition animation callback and parameters related to a page.
export interface AnimateCallback {
start: ((isPush: boolean, isExit: boolean) => void | undefined) | und... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-navrouter.md | // xxx.ets
@Entry
@Component
struct NavRouterExample {
@State isActiveWLAN: boolean = false
@State isActiveBluetooth: boolean = false
build() {
Navigation() {
NavRouter() {
Row() {
Row()
.width(30)
.height(30)
.borderRadius(30)
.margin({... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-nodecontainer.md | import { NodeController, BuilderNode, FrameNode, UIContext } from '@kit.ArkUI';
declare class Params {
text: string
}
@Builder
function buttonBuilder(params: Params) {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceEvenly }) {
Text(params.text)
.font... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-patternlock.md | // xxx.ets
@Entry
@Component
struct PatternLockExample {
@State passwords: Number[] = []
@State message: string = 'Enter password'
private patternLockController: PatternLockController = new PatternLockController()
build() {
Column() {
Text(this.message).textAlign(TextAlign.Center).margin(20).fontSize... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-patternlock.md | // xxx.ets
import { LengthUnit } from '@kit.ArkUI'
@Entry
@Component
struct PatternLockExample {
@State passwords: Number[] = []
@State message: string = 'please input password!'
private patternLockController: PatternLockController = new PatternLockController()
build() {
Column() {
Text(this.message... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-plugincomponent-sys.md | import plugin from "./plugin_component"
interface Info {
errcode: number,
msg: string
}
@Entry
@Component
struct PluginUserExample {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-plugincomponent-sys.md | import plugin from "./plugin_component"
@Entry
@Component
struct PluginProviderExample {
@State message: string = 'no click!'
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Button('Register Request Listener')
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | // xxx.ets
@Entry
@Component
struct ProgressExample {
build() {
Column({ space: 15 }) {
Text('Linear Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
Progress({ value: 10, type: ProgressType.Linear }).width(200)
Progress({ value: 20, total: 150, type: ProgressType.Linear }).color(Color.Gr... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | // xxx.ets
@Entry
@Component
struct ProgressExample {
private gradientColor: LinearGradient = new LinearGradient([{ color: Color.Yellow, offset: 0.5 },
{ color: Color.Orange, offset: 1.0 }])
build() {
Column({ space: 15 }) {
Text('Gradient Color').fontSize(9).fontColor(0xCCCCCC).width('90%')
Pr... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | // xxx.ets
@Entry
@Component
struct ProgressExample {
build() {
Column({ space: 15 }) {
Text('Loading Effect').fontSize(9).fontColor(0xCCCCCC).width('90%')
Progress({ value: 0, total: 100, type: ProgressType.Ring })
.width(100).color(Color.Blue)
.style({ strokeWidth: 20, status: Progre... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | // xxx.ets
@Entry
@Component
struct ProgressExample {
build() {
Column({ space: 15 }) {
Row({ space: 40 }) {
Progress({ value: 100, total: 100, type: ProgressType.Capsule }).width(100).height(50)
.style({
borderColor: Color.Blue,
borderWidth: 1,
content:... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | // xxx.ets
@Entry
@Component
struct Index {
@State value: number = 0
build() {
Column({ space: 10 }) {
Text('enableSmoothEffect: true')
.fontSize(9)
.fontColor(0xCCCCCC)
.width('90%')
.margin(5)
.margin({ top: 20 })
Progress({ value: this.value, total: 100, t... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | // xxx.ets
class MyProgressModifier implements ContentModifier<ProgressConfiguration> {
color: Color = Color.White
constructor(color: Color) {
this.color = color
}
applyContent(): WrappedBuilder<[ProgressConfiguration]> {
return wrapBuilder(myProgress)
}
}
@Builder
function myProgress(config: Progr... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | @Entry
@Component
struct ProgressExample {
build() {
Scroll() {
Column({ space: 15 }) {
Row() {
Progress({ value: 50, total: 100, type: ProgressType.Capsule }).width(100).height(50)
.style({
borderColor: Color.Blue,
borderWidth: 1,
cont... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-progress.md | import { LengthMetrics } from '@kit.ArkUI';
@Entry
@Component
struct ProgressExample {
build() {
Column({ space: 15 }) {
Text('Capsule Progress').fontSize(9).width('90%')
Row({ space: 15 }) {
Progress({ value: 30, total: 100, type: ProgressType.Capsule })
.style({ content: "Default ... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-qrcode.md | // xxx.ets
@Entry
@Component
struct QRCodeExample {
private value: string = 'hello world'
build() {
Column({ space: 5 }) {
Text('normal').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)
QRCode(this.value).width(140).height(140)
// Set the color of the QR code.
Text('color').f... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-radio.md | // xxx.ets
@Entry
@Component
struct RadioExample {
build() {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
Text('Radio1')
Radio({ value: 'Radio1', group: 'radioGroup' }).checked(true)
.radioStyle({
ch... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-radio.md | // xxx.ets
@Entry
@Component
struct RadioExample {
@Builder
indicatorBuilder() {
Image($r("app.media.star"))
}
build() {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
Text('Radio1')
Radio({ value: 'Radio1', grou... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-radio.md | class MyRadioStyle implements ContentModifier<RadioConfiguration> {
type: number = 0
selectedColor: ResourceColor = Color.Black
constructor(numberType: number, colorType: ResourceColor) {
this.type = numberType
this.selectedColor = colorType
}
applyContent(): WrappedBuilder<[RadioConfiguration]> {
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-rating.md | // xxx.ets
@Entry
@Component
struct RatingExample {
@State rating: number = 3.5
build() {
Column() {
Column() {
Rating({ rating: this.rating, indicator: false })
.stars(5)
.stepSize(0.5)
.margin({ top: 24 })
.onChange((value: number) => {
this.r... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-rating.md | // xxx.ets
@Entry
@Component
struct RatingExample {
@State rating: number = 3.5
build() {
Column() {
Rating({ rating: this.rating, indicator: false })
.stars(5)
.stepSize(0.5)
.starStyle({
backgroundUri: '/common/imag1.png', // The common folder is at the same level as p... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-rating.md | // xxx.ets
class MyRatingStyle implements ContentModifier<RatingConfiguration> {
name: string = ""
style: number = 0
constructor(value1: string, value2: number) {
this.name = value1
this.style = value2
}
applyContent() : WrappedBuilder<[RatingConfiguration]> {
return wrapBuilder(buildRating)
}
}... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-remotewindow-sys.md | // WindowAnimationControllerImpl.ets file
import { windowAnimationManager } from '@kit.ArkUI';
export default class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnimationController {
onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget,
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-remotewindow-sys.md | // RemoteWindowExample.ets file
import { windowAnimationManager } from '@kit.ArkUI';
import WindowAnimationControllerImpl from './WindowAnimationControllerImpl';
@Entry
@Component
export default struct RemoteWindowExample {
@State target:WindowAnimationTarget | undefined = undefined // Obtained through windowAnimati... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | color: '#ff007dff'
decoration:{
type: TextDecorationType.Underline,
color: '#ff007dff',
style: TextDecorationStyle.SOLID
} |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct Index {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
private start: number = -1;
private end: number = -1;
@State message: string = "[-1, -1]"
@State content: string = ""
build() {
Colu... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct RichEditorExample {
controller: RichEditorController = new RichEditorController()
// Create a custom keyboard component.
@Builder CustomKeyboardBuilder() {
Column() {
Grid() {
ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9, '*', 0, '#'], (item: number | string) => {
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
import { BusinessError, pasteboard } from '@kit.BasicServicesKit';
export interface SelectionMenuTheme {
imageSize: number;
buttonSize: number;
menuSpacing: number;
editorOptionMargin: number;
expandedOptionPadding: number;
defaultMenuWidth: number;
imageFillColor: Resource;
backGroundColor:... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct Index {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
private start: number = -1;
private end: number = -1;
@State message: string = "[-1, -1]"
@State content: string = ""
@State paddingVal: ... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct Index {
controller: RichEditorController = new RichEditorController()
options: RichEditorOptions = { controller: this.controller };
@State textFlag: string = "TextFlag";
build() {
Column() {
Column() {
Text(this.textFlag)
.copyOption(CopyOptions.I... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct Index {
controller: RichEditorController = new RichEditorController();
private spanParagraphs: RichEditorParagraphResult[] = [];
build() {
Column() {
RichEditor({ controller: this.controller })
.onReady(() => {
this.controller.addTextSpan("012345678... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
import { font } from '@kit.ArkUI'
const canvasWidth = 1000
const canvasHeight = 100
const Indentation = 40
class LeadingMarginCreator {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private offscreenCanvas: OffscreenCanvas = new OffscreenCanvas(canvasWidth, canvasHeight... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct TextExample7 {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
@State phoneNumber: string = '(86) (755) ********';
@State url: string = 'www.********.com';
@State email: string = '***@example.com';
@State a... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditorDemo03 {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
@State start: number = -1;
@State end: number = -1;
@State LH:number = 50
@State LS:number = 20
build() {
Column() {
Scroll(){... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditorDemo {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
build() {
Column({ space: 2 }) {
RichEditor(this.options)
.onReady(() => {
this.controller.addTextSpan('RichEditor pre... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditorExample {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
@State enableDataDetector: boolean = true;
@State types: TextDataDetectorType[] = [];
build() {
Row() {
Column() {
RichEdi... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditorExample {
controller: RichEditorController = new RichEditorController()
@State height1:string|number = '80%'
@State height2:number = 100
@State supportAvoidance:boolean = true;
// Create a custom keyboard component.
@Builder CustomKeyboardBuilder() {
Column() {
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditor_onEditingChange {
controller: RichEditorController = new RichEditorController()
@State controllerIsEditing: boolean = false
@Builder
build() {
Column() {
Row() {
Button("View Editing State: isEditing():").onClick(() => {
this.controllerIsEditing =... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditorExample {
controller: RichEditorController = new RichEditorController()
build() {
Column() {
RichEditor({ controller: this.controller })
.height(200)
.borderWidth(1)
.borderColor(Color.Red)
.width("100%")
.onReady(() => {
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct SoftKeyboardEnterTypeExample {
controller: RichEditorController = new RichEditorController()
build() {
Column() {
Button("Stop Editing").onClick(()=>{
this.controller.stopEditing()
})
RichEditor({ controller: this.controller })
.margin(10)
.b... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct LineBreakStrategyExample {
controller: RichEditorController = new RichEditorController();
private spanParagraphs: RichEditorParagraphResult[] = [];
@State lineBreakOptionStr: string[] = ['GREEDY', 'HIGH_QUALITY', 'BALANCED']
@State attributeValue: string = ""
@State testStr: string = ... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
import { LengthMetrics } from '@kit.ArkUI'
import { image } from '@kit.ImageKit'
@Entry
@Component
struct Index {
stringLength: number = 0;
imagePixelMap: image.PixelMap | undefined = undefined;
@State selection: string = "";
@State content: string = "";
@State range: string = "";
@State replace... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
export struct Index {
@State lineCount: string = ""
@State glyphPositionAtCoordinate: string = ""
@State lineMetrics: string = ""
controller: RichEditorController = new RichEditorController();
@State textStr: string =
'Hello World!'
build() {
Scroll() {
Column() {
Te... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct RichEditorExample {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller }
onCreateMenu(menuItems: Array<TextMenuItem>) {
console.log('menuItems size=' + menuItems.length);
menuItems.forEach((value, i... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
import { JSON } from '@kit.ArkTS';
@Entry
@Component
struct RichEditor_example {
controller: RichEditorController = new RichEditorController()
options: RichEditorOptions = { controller: this.controller };
controller1: RichEditorController = new RichEditorController()
options1: RichEditorOptions = {... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct Index {
controller: RichEditorController = new RichEditorController()
options: RichEditorOptions = { controller: this.controller };
@State caretRect: string = "not found";
build() {
Column() {
Button('get caret rect')
.onClick(() => {
let rectCare... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | @Entry
@Component
struct RichEditorExample {
@State text: string = "As the sun begins to set, casting a warm golden hue across the sky," +
"the world seems to slow down and breathe a sigh of relief. The sky is painted with hues of orange, " +
" pink, and lavender, creating a breathtaking tapestry that stretch... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
import { ColorMetrics } from '@kit.ArkUI';
@Entry
@Component
struct richEditorNew03 {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller }
build() {
Column({ space: 10 }) {
Column() {
RichEditor(this.options)
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richeditor.md | // xxx.ets
@Entry
@Component
struct RichEditorExample {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
styledStringController: RichEditorStyledStringController = new RichEditorStyledStringController();
styledStringOptions: RichEditor... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-richtext.md | // xxx.ets
@Entry
@Component
struct RichTextExample {
@State data: string = '<h1 style="text-align: center;">h1 heading</h1>' +
'<h1 style="text-align: center;"><i>h1 italic</i></h1>' +
'<h1 style="text-align: center;"><u>h1 underlined</u></h1>' +
'<h2 style="text-align: center;">h2 heading</h2>' +
'<h3 style... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-scrollbar.md | // xxx.ets
@Entry
@Component
struct ScrollBarExample {
private scroller: Scroller = new Scroller()
private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
build() {
Column() {
Stack({ alignContent: Alignment.End }) {
Scroll(this.scroller) {
Flex({ direction: Fle... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-scrollbar.md | @Entry
@Component
struct ScrollBarExample {
private scroller: Scroller = new Scroller()
private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
build() {
Column() {
Stack({ alignContent: Alignment.End }) {
Scroll(this.scroller) {
Flex({ direction: FlexDirection.... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-scrollbar.md | @Entry
@Component
struct StickyNestedScroll {
listScroller: Scroller = new Scroller();
@State array: number[] = []
@Styles
listCard() {
.backgroundColor(Color.White)
.height(72)
.width("100%")
.borderRadius(12)
}
build() {
Stack() {
Scroll() {
Column() {
Text('S... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
@State changeValue: string = ''
@State submitValue: string = ''
@State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 }
controller: SearchController = new SearchController()
build() {
Column({space: 10}) {
Text('onSubmit:' + this.submitValue).... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
@State changeValue: string = ''
@State submitValue: string = ''
build() {
Column() {
Text('onSubmit:' + this.submitValue).fontSize(18).margin(15)
Search({ value: this.changeValue, placeholder: 'Type to search...' })
.searchButton('SEARCH... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State inputValue: string = ""
// Create a custom keyboard component.
@Builder CustomKeyboardBuilder() {
Column() {
Button('x').onClick(() => {
// Disable the custom keyboard.
thi... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
@State text: string = ''
@State enterTypes: Array<EnterKeyType> = [EnterKeyType.Go, EnterKeyType.Search, EnterKeyType.Send, EnterKeyType.Done, EnterKeyType.Next, EnterKeyType.PREVIOUS, EnterKeyType.NEW_LINE]
@State index: number = 0
build() {
Column({ spac... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
build() {
Row() {
Column() {
Text('lineHeight').fontSize(9).fontColor(0xCCCCCC)
Search({value: 'lineHeight unset'})
.border({ width: 1 }).padding(10)
Search({value: 'lineHeight 15'})
.border({ width: 1 }).padding... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
@State text1: string = 'This is ss01 on : 0123456789'
@State text2: string = 'This is ss01 off: 0123456789'
build() {
Column(){
Search({value: this.text1})
.margin({top:200})
.fontFeature("\"ss01\" on")
Search({value: this.text2}... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State inputValue: string = ""
@State height1: string | number = '80%'
@State supportAvoidance: boolean = true
// Create a custom keyboard component.
@Builder
CustomKeyboardBuilder() {
Column() {... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
build() {
Row() {
Column() {
Text('adaptive font').fontSize(9).fontColor(0xCCCCCC)
Search({value: 'This is the text without the adaptive font'})
.width('80%').height(90).borderWidth(1)
Search({value: 'This is the text wit... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
@State insertValue: string = ""
@State deleteValue: string = ""
@State insertOffset: number = 0
@State deleteOffset: number = 0
@State deleteDirection: number = 0
build() {
Row() {
Column() {
Search({ value: "Insert callbacks are support... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
@State text: string = 'Search editMenuOptions'
onCreateMenu = (menuItems: Array<TextMenuItem>) => {
let item1: TextMenuItem = {
content: 'Custom 1',
icon: $r('app.media.startIcon'),
id: TextMenuItemId.of('custom1'),
}
let item2: TextM... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
import { SymbolGlyphModifier } from '@kit.ArkUI'
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State changeValue: string = ''
@State submitValue: string = ''
build() {
Column() {
Search({ value: this.changeValue, placeholder: 'Type to sear... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State copyValue: string = ''
@State cutValue: string = ''
build() {
Column({ space: 3 }) {
Text("copy: " + this.copyValue)
Text("cut:" + this.cutValue)
Search({ value: 'Search CopyO... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
build() {
Column({ space: 3 }) {
Search({ value: 'Search textAlign sample', controller: this.controller })
.width('95%')
.height(40)
.stopBackPress(true)
.textAlign(T... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State value: string = 'false'
build() {
Column({ space: 3 }) {
Text('editing: ' + this.value)
Search({ placeholder: 'please enter...', controller: this.controller })
.width('95%')
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
build() {
Column({ space: 3 }) {
Search({ value: '123456', controller: this.controller })
.width('95%')
.height(40)
.type(SearchType.NUMBER)
.selectionMenuHidden(true... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State filterValue: string = ''
build() {
Column({ space: 3 }) {
Text('Filter:' + this.filterValue)
Search({ placeholder: 'please enter...', controller: this.controller })
.width('95... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State startIndex: number = 0
@State endIndex: number = 0
build() {
Column({ space: 3 }) {
Text('Selection start:' + this.startIndex + ' end:' + this.endIndex)
Search({ value: 'Hello World... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | // xxx.ets
@Entry
@Component
struct SearchExample {
controller: SearchController = new SearchController()
@State offsetX: number = 0
@State offsetY: number = 0
build() {
Column({ space: 3 }) {
Text('offset x:' + this.offsetX + ' y:' + this.offsetY)
Search({ value: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | import { abilityManager, Configuration } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
// xxx.ets
@Entry
@Component
export struct TextAreaExample11 {
@State minFontScale: number = 0.85;
@State maxFontScale: number = 2;
@State changeValue: string = 'abcde';
build() {
Column... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | Create a new directory named profile in the following path: AppScope/resources/base.
Inside the newly created profile directory, create a file named configuration.json.
Add the following JSON code to the configuration.json file:
{
"configuration":{
"fontSizeScale": "followSystem",
"fontSizeMaxScale": "3.2"
}
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-search.md | Modify the app.json5 file in AppScope as follows:
{
"app": {
"bundleName": "com.example.myapplication",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"configuration": "$profile:configuration"
}
} |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-select.md | // xxx.ets
@Entry
@Component
struct SelectExample {
@State text: string = "TTTTT"
@State index: number = 2
@State space: number = 8
@State arrowPosition: ArrowPosition = ArrowPosition.END
build() {
Column() {
Select([{ value: 'aaa', icon: $r("app.media.selection") },
{ value: 'bbb', icon: $... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-select.md | // xxx.ets
import { SymbolGlyphModifier } from '@kit.ArkUI'
@Entry
@Component
struct SelectExample {
@State text: string = "TTTTT"
@State index: number = 2
@State space: number = 8
@State arrowPosition: ArrowPosition = ArrowPosition.END
@State symbolModifier1: SymbolGlyphModifier =
new SymbolGlyphModifie... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-select.md | import { SymbolGlyphModifier } from '@kit.ArkUI'
class MyMenuItemContentModifier implements ContentModifier<MenuItemConfiguration> {
modifierText: string = ""
constructor(text: string) {
this.modifierText = text;
}
applyContent(): WrappedBuilder<[MenuItemConfiguration]> {
return wrapBuilder(MenuItemB... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-select.md | // xxx.ets
@Entry
@Component
struct SelectExample {
@State text: string = "TTTTT"
@State index: number = -1
@State arrowPosition: ArrowPosition = ArrowPosition.END
build() {
Column() {
Select([{ value: 'aaa', icon: $r("app.media.icon") },
{ value: 'bbb', icon: $r("app.media.icon") },
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-select.md | // xxx.ets
@Entry
@Component
struct SelectExample {
@State text: string = "TTTTT"
@State index: number = -1
@State arrowPosition: ArrowPosition = ArrowPosition.END
build() {
Column() {
Select([{ value: 'aaa', icon: $r("app.media.icon") },
{ value: 'bbb', icon: $r("app.media.icon") },
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-slider.md | // xxx.ets
@Entry
@Component
struct SliderExample {
@State outSetValueOne: number = 40
@State inSetValueOne: number = 40
@State noneValueOne: number = 40
@State outSetValueTwo: number = 40
@State inSetValueTwo: number = 40
@State vOutSetValueOne: number = 40
@State vInSetValueOne: number = 40
@State vOu... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-slider.md | @Entry
@Component
struct SliderExample {
@State tipsValue: number = 40
build() {
Column({ space: 8 }) {
Text('block').fontSize(9).fontColor(0xCCCCCC).margin(15).width('90%')
Slider({ style: SliderStyle.OutSet, value: 40 })
.blockSize({ width: 40, height: 40 })
.blockBorderColor(Colo... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-slider.md | // xxx.ets
@Builder function buildSlider(config: SliderConfiguration) {
Row() {
Column({space: 30}) {
Progress({value: config.value, total: config.max, type:ProgressType.Ring})
.margin({ top:20 })
Button('Increase').onClick(() => {
config.value = config.value + config.step
co... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-span.md | // xxx.ets
@Entry
@Component
struct SpanExample {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) {
Text('Basic Usage').fontSize(9).fontColor(0xCCCCCC)
Text() {
Span('In Line')
Span(' Component')
Span(' !')
}
Text() {
Span('... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-span.md | // xxx.ets
import { LengthUnit, LengthMetrics } from '@kit.ArkUI';
@Entry
@Component
struct SpanExample {
build() {
Row() {
Column() {
Text() {
Span('SpanOne')
.fontSize(10)
.baselineOffset(new LengthMetrics(20, LengthUnit.VP))
Span('SpanTwo')
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-stepper.md | // xxx.ets
@Styles function itemStyle () {
.width(336)
.height(621)
.margin({ top: 48, left: 12 })
.borderRadius(24)
.backgroundColor('#FFFFFF')
}
@Extend(Text) function itemTextStyle () {
.fontColor('#182431')
.fontSize(36)
.fontWeight(500)
.opacity(0.4)
.margin({ top: 82, bottom: 40 })
}
@Entry
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-symbolGlyph.md | // xxx.ets
@Entry
@Component
struct Index {
build() {
Column() {
Row() {
Column() {
Text("Light")
SymbolGlyph($r('sys.symbol.ohos_trash'))
.fontWeight(FontWeight.Lighter)
.fontSize(96)
}
Column() {
Text("Normal")
Symbol... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-symbolGlyph.md | // xxx.ets
@Entry
@Component
struct Index {
@State isActive: boolean = true;
@State triggerValueReplace: number = 0;
replaceFlag: boolean = true;
build() {
Column() {
Row() {
Column() {
Text("Variable color animation")
SymbolGlyph($r('sys.symbol.ohos_wifi'))
.f... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-symbolSpan.md | // xxx.ets
@Entry
@Component
struct Index {
build() {
Column() {
Row() {
Column() {
Text("Light")
Text() {
SymbolSpan($r('sys.symbol.ohos_trash'))
.fontWeight(FontWeight.Lighter)
.fontSize(96)
}
}
Column() {
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | color: '#ff007dff'
decoration:{
type: TextDecorationType.Underline,
color: '#ff007dff',
style: TextDecorationStyle.SOLID
} |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Extend(Text)
function style(TextAlign: TextAlign) {
.textAlign(TextAlign)
.fontSize(12)
.border({ width: 1 })
.padding(10)
.width('100%')
.margin(5)
}
@Entry
@Component
struct TextExample1 {
@State changeTextAlignIndex: number = 0;
@State changeDecorationIndex: number = 0;
@State TextAlig... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | @Extend(Text)
function style() {
.font({ size: 12 })
.border({ width: 1 })
.padding(10)
.width('100%')
.margin(5)
}
@Entry
@Component
struct TextExample2 {
@State changeDecorationIndex: number = 0;
@State TextDecorationType: TextDecorationType[] =
[TextDecorationType.LineThrough, TextDecorationType.O... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | @Extend(Text)
function style() {
.textAlign(TextAlign.Center)
.fontSize(12)
.border({ width: 1 })
.padding(10)
.width('100%')
.margin(5)
}
@Entry
@Component
struct TextExample3 {
@State text: string =
'The text component is used to display a piece of textual information.Support universal attributes a... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Extend(Text)
function style() {
.fontSize(12)
.border({ width: 1 })
.padding(10)
.width('100%')
.margin(5)
}
@Entry
@Component
struct TextExample4 {
@State text: string =
'The text component is used to display a piece of textual information.Support universal attributes and universal text at... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Entry
@Component
struct TextExample5 {
@State onCopy: string = '';
@State text: string =
'This is set selection to Selection text content This is set selection to Selection text content.';
@State start: number = 0;
@State end: number = 20;
build() {
Flex({ direction: FlexDirection.Column,... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Extend(Text)
function style(HeightAdaptivePolicy: TextHeightAdaptivePolicy) {
.width('80%')
.height(90)
.borderWidth(1)
.minFontSize(10)
.maxFontSize(30)
.maxLines(2)
.margin(5)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.heightAdaptivePolicy(HeightAdaptivePolicy)
}
@Entry
@Compon... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Entry
@Component
struct TextExample7 {
@State phoneNumber: string = '(86) (755) ********';
@State url: string = 'www.********.com';
@State email: string = '***@example.com';
@State address: string = 'XX (province) XX (city) XX (county) XXXX';
@State datetime: string = 'XX-XX-XX XXXX';
@State ena... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Entry
@Component
struct TextExample8 {
controller: TextController = new TextController();
options: TextOptions = { controller: this.controller };
build() {
Column() {
Column() {
Text(undefined, this.options) {
Span('Hello World')
ImageSpan($r('app.media.icon'))
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
import { LengthMetrics } from '@kit.ArkUI'
@Extend(Text)
function style() {
.fontSize(12)
.border({ width: 1 })
.width('100%')
}
@Entry
@Component
struct TextExample9 {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
import { text } from '@kit.ArkGraphics2D'
@Entry
@Component
struct TextExample10 {
@State lineCount: string = "";
@State glyphPositionAtCoordinate: string = "";
@State lineMetrics: string = "";
@State rectsForRangeStr: string = "";
controller: TextController = new TextController();
@State textSt... |
application-dev\reference\apis-arkui\arkui-ts\ts-basic-components-text.md | // xxx.ets
@Entry
@Component
struct TextExample11 {
@State message: string =
'TextTextTextTextTextTextTextText' + 'TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText';
build() {
Column() {
Text(this.message)
.width(300)
.height(100)
.maxLines(5)
.fontColo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.