This document is deprecated, please go to Tuya Developer Documentation Center to view the latest version: Tuya Smart Doc - Android SDK

1.1. Timeline View

When the timeline component uses video playback or cloud storage video playback, it linearly displays the video recording time points that can be played. You can slide the timeline to accurately locate the time point and segment to start playing.

Timeline View

1.1.1. Integrate

dependencies {
    implementation 'com.tuya.smart:tuyasmart-ipc-camera-timeline:1.0.0'
}

Class and Interface

Class(Interface) Description
TuyaTimelineView Timeline view
OnBarMoveListener Timeline drag listener
OnSelectedTimeListener Timeline select listener

1.2. Introduction

1.2.1. TuyaTimelineView

Attrs

Name Description
topTextMargin Margin top of text
bottomTextMargin Margin bottom of text
smallRulerHeight Height of short tick mark
timeScaleColor Color of time text string
linesColor Color of tick mark
bubbleColor Background color of bubble
bubbleTextColor Color of bubble text
landscapeBgColor Background color in landscape
portraitBgColor Background color in portrait

Declaration

Set the colors of the data rendering in the timeline

void setContentShader(Shader contentShader)

Declaration

Set time zone

void setTimeZone(TimeZone zone)

Declaration

There will be a bubble text showing the current time When dragging

Set whether to display bubble text

void setShowBubbleWhenDrag(boolean show)

Declaration

Set the width of a time unit in px, two long tick marks represent a time unit

void setSpacePerUnit(int spacePerUnit)

Declaration

Time unit mode, currently there are three, one time unit is 60 seconds, 600 seconds, 3600 seconds

void setUnitMode(TimelineUnitMode mode)

Parameters

Enum Description
TimelineUnitMode.Mode_60 one time unit is 60 seconds
TimelineUnitMode.Mode_600 one time unit is 600 seconds
TimelineUnitMode.Mode_3600 one time unit is 3600 seconds

Declaration

Set whether to display time text

void setShowTimeText(boolean showTimeText)

Declaration

Set whether to show short tick marks

void setShowShortMark(boolean showShortMark)

Declaration

Selection mode switch

void showSelectTimeArea(boolean open)

Declaration

Set the length of time that the selection box can be selected

void setSelectTimeAreaRange(long min, long max)
Parameter Description
min The minimum length of time
max The maximum length of time

Declaration

Set the background color of the timeline selection box

void setSelectionBoxColor(int color)

Declaration

Set the color of the vertical line of the timeline selection box

void setSelectCenterColor(int selectCenterColor)

Declaration

Is in selection mode

boolean isSelectionEnabled()

Declaration

timeline Config,

void setCurrentTimeConfig(long currentTimeInMillisecond)

Declaration

Set the current time of the timeline in ms

void setCurrentTimeInMillisecond(long currentTimeInMillisecond)

Declaration

Set am/pm string of bubble text in 12-hour format

void setTimeAmPmString(String timeAmString, String timePmString)

Declaration

Set the timeline source data array

void setRecordDataExistTimeClipsList(List<TimeBean> source)

Declaration

Turn on automatically find the next segment to play

public void setCanQueryData()

Declaration

Set whether to allow searching for the next segment

public synchronized void setQueryNewVideoData(boolean var1)

1.2.2. OnBarMoveListener

Declaration

Callback when dragging starts

void onBarActionDown()

Declaration

Callback when dragging

void onBarMove(long screenLeftTime, long screenRightTime, long currentTime)

Parameters

Parameter Description
screenLeftTime The time represented on the far left of the screen
screenRightTime The time represented on the far right of the screen
currentTime Current time

Declaration

Callback when the timeline drag is over, when the drag is over, it will automatically find the segment data that can be played

void onBarMoveFinish(long startTime, long endTime, long currentTime)

Parameters

Parameter Description
startTime The start time of the fragment data, if there is no fragment data, it will return -1
endTime The end time of the fragment data, if there is no fragment data, it will return -1
currentTime Time when dragging stopped, if there is no fragment data, it will return -1

1.2.3. OnSelectedTimeListener

Declaration

Callback when dragging in selection mode

void onDragging(long selectStartTime, long selectEndTime)

Parameters

Parameter Description
selectStartTime Selected start time
selectEndTime Selected end time

results matching ""

    No results matching ""