Commit c07a94daf783389207a0025b5e4807541f1b2043

Authored by Victor Cebollada
2 parents 8393ca01 0f2922ab

[dali_1.2.26] Merge branch 'devel/master'

Change-Id: I0acfce9dd4de7fa42b4de312af9ac8437401ab00
demo/dali-table-view.cpp
... ... @@ -108,7 +108,6 @@ const float BUBBLE_MAX_Z = 0.0f;
108 108 // The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
109 109 const char* FRAGMENT_SHADER_TEXTURED = DALI_COMPOSE_SHADER(
110 110 varying mediump vec2 vTexCoord;
111   - varying mediump vec3 vIllumination;
112 111 uniform lowp vec4 uColor;
113 112 uniform sampler2D sTexture;
114 113 uniform mediump vec3 uCustomPosition;
... ... @@ -266,7 +265,7 @@ void DaliTableView::Initialize( Application& application )
266 265 Stage::GetCurrent().Add( mRootActor );
267 266  
268 267 // Add logo
269   - ImageView logo = CreateLogo( LOGO_PATH );
  268 + ImageView logo = ImageView::New( LOGO_PATH );
270 269 logo.SetName( "LOGO_IMAGE" );
271 270 logo.SetAnchorPoint( AnchorPoint::TOP_CENTER );
272 271 logo.SetParentOrigin( Vector3( 0.5f, 0.1f, 0.5f ) );
... ... @@ -517,18 +516,20 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
517 516 tileContent.SetAnchorPoint( AnchorPoint::CENTER );
518 517 tileContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
519 518  
520   - // Add the image via the property first.
521   - tileContent.SetProperty( Toolkit::ImageView::Property::IMAGE, TILE_BACKGROUND_ALPHA );
522   - // Register a property with the ImageView. This allows us to inject the scroll-view position into the shader.
  519 + // Register a property with the ImageView. This allows us to inject the scroll-view position into the shader.
523 520 Property::Value value = Vector3( 0.0f, 0.0f, 0.0f );
524 521 Property::Index propertyIndex = tileContent.RegisterProperty( "uCustomPosition", value );
525 522  
526 523 // Add a shader to the image (details in shader source).
527   - Property::Map map;
528 524 Property::Map customShader;
529 525 customShader[ Visual::Shader::Property::FRAGMENT_SHADER ] = FRAGMENT_SHADER_TEXTURED;
530   - map[ Visual::Property::SHADER ] = customShader;
531   - tileContent.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
  526 +
  527 + // Set the Image URL and the custom shader
  528 + Property::Map imageMap;
  529 + imageMap.Add( ImageVisual::Property::URL, TILE_BACKGROUND_ALPHA );
  530 + imageMap.Add( Visual::Property::SHADER, customShader );
  531 + tileContent.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
  532 +
532 533 tileContent.SetColor( TILE_COLOR );
533 534  
534 535 // We create a constraint to perform a precalculation on the scroll-view X offset
... ... @@ -782,12 +783,18 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count )
782 783 {
783 784 float randSize = Random::Range( 10.0f, 400.0f );
784 785 int shapeType = static_cast<int>( Random::Range( 0.0f, NUMBER_OF_SHAPE_IMAGES - 1 ) + 0.5f );
785   - ImageView dfActor = ImageView::New( SHAPE_IMAGE_TABLE[ shapeType ] );
  786 +
  787 + ImageView dfActor = ImageView::New();
786 788 dfActor.SetSize( Vector2( randSize, randSize ) );
787 789 dfActor.SetParentOrigin( ParentOrigin::CENTER );
788 790  
  791 + // Set the Image URL and the custom shader at the same time
789 792 Dali::Property::Map effect = Toolkit::CreateDistanceFieldEffect();
790   - dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, effect );
  793 + Property::Map imageMap;
  794 + imageMap.Add( ImageVisual::Property::URL, SHAPE_IMAGE_TABLE[ shapeType ] );
  795 + imageMap.Add( Visual::Property::SHADER, effect );
  796 + dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
  797 +
791 798 dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] );
792 799  
793 800 layer.Add( dfActor );
... ... @@ -797,16 +804,6 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count )
797 804 layer.OnRelayoutSignal().Connect( this, &DaliTableView::InitialiseBackgroundActors );
798 805 }
799 806  
800   -ImageView DaliTableView::CreateLogo( std::string imagePath )
801   -{
802   - ImageView logo = ImageView::New( imagePath );
803   -
804   - logo.SetAnchorPoint( AnchorPoint::CENTER );
805   - logo.SetParentOrigin( ParentOrigin::CENTER );
806   -
807   - return logo;
808   -}
809   -
810 807 bool DaliTableView::PauseBackgroundAnimation()
811 808 {
812 809 PauseAnimation();
... ...
demo/dali-table-view.h
... ... @@ -266,15 +266,6 @@ private: // Application callbacks &amp; implementation
266 266 void AddBackgroundActors( Dali::Actor layer, int count );
267 267  
268 268 /**
269   - * Creates the logo.
270   - *
271   - * @param[in] imagePath The path to the image file to load
272   - *
273   - * @return The created image actor
274   - */
275   - Dali::Toolkit::ImageView CreateLogo( std::string imagePath );
276   -
277   - /**
278 269 * Timer handler for ending background animation
279 270 *
280 271 * @return Return value for timer handler
... ...
examples/progress-bar/progress-bar-example.cpp
... ... @@ -53,6 +53,8 @@ public:
53 53 {
54 54 // Connect to the Application's Init signal
55 55 mProgressValue = 0.0f;
  56 + mSecondaryProgressValue = 0.1f;
  57 + isDefaultTheme = true;
56 58 mApplication.InitSignal().Connect( this, &ProgressBarExample::Create );
57 59 }
58 60  
... ... @@ -80,20 +82,7 @@ private:
80 82 mProgressBarDefault.SetAnchorPoint(AnchorPoint::TOP_CENTER);
81 83 mProgressBarDefault.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
82 84 mProgressBarDefault.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
83   -
84   - mProgressBarCustomStyle1 = ProgressBar::New();
85   - mProgressBarCustomStyle1.SetStyleName( "ProgressBarCustomStyle1" );
86   - mProgressBarCustomStyle1.SetParentOrigin(ParentOrigin::TOP_CENTER);
87   - mProgressBarCustomStyle1.SetAnchorPoint(AnchorPoint::TOP_CENTER);
88   - mProgressBarCustomStyle1.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
89   - mProgressBarCustomStyle1.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
90   -
91   - mProgressBarCustomStyle2 = ProgressBar::New();
92   - mProgressBarCustomStyle2.SetStyleName( "ProgressBarCustomStyle2" );
93   - mProgressBarCustomStyle2.SetParentOrigin(ParentOrigin::TOP_CENTER);
94   - mProgressBarCustomStyle2.SetAnchorPoint(AnchorPoint::TOP_CENTER);
95   - mProgressBarCustomStyle2.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
96   - mProgressBarCustomStyle2.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
  85 + mProgressBarDefault.ValueChangedSignal().Connect( this, &ProgressBarExample::OnValueChanged );
97 86  
98 87 Toolkit::TableView contentTable = Toolkit::TableView::New(2, 1);
99 88 contentTable.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
... ... @@ -111,7 +100,7 @@ private:
111 100 mContentLayer.Add( contentTable );
112 101  
113 102 // Image selector for progress bar
114   - Toolkit::TableView progressBackground = Toolkit::TableView::New( 3, 1 );
  103 + Toolkit::TableView progressBackground = Toolkit::TableView::New( 1, 1 );
115 104 progressBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
116 105 progressBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
117 106 progressBackground.SetBackgroundColor( BACKGROUND_COLOUR );
... ... @@ -125,11 +114,9 @@ private:
125 114  
126 115 contentTable.Add( progressBackground );
127 116 progressBackground.Add( mProgressBarDefault );
128   - progressBackground.Add( mProgressBarCustomStyle1 );
129   - progressBackground.Add( mProgressBarCustomStyle2 );
130 117  
131 118 // Create buttons
132   - Toolkit::TableView buttonBackground = Toolkit::TableView::New( 1, 1 );
  119 + Toolkit::TableView buttonBackground = Toolkit::TableView::New( 3, 1 );
133 120 buttonBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
134 121 buttonBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
135 122 buttonBackground.SetBackgroundColor( BACKGROUND_COLOUR );
... ... @@ -150,6 +137,22 @@ private:
150 137  
151 138 buttonBackground.Add( mResetProgressButton );
152 139  
  140 + mSetIndeterminateButton = Toolkit::PushButton::New();
  141 + mSetIndeterminateButton.SetProperty( Toolkit::Button::Property::LABEL, "Toggle Indeterminate" );
  142 + mSetIndeterminateButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
  143 + mSetIndeterminateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
  144 + mSetIndeterminateButton.ClickedSignal().Connect( this, &ProgressBarExample::OnSetIndeterminateButtonSelected );
  145 +
  146 + buttonBackground.Add( mSetIndeterminateButton );
  147 +
  148 + mChangeThemeButton = Toolkit::PushButton::New();
  149 + mChangeThemeButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Theme" );
  150 + mChangeThemeButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
  151 + mChangeThemeButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
  152 + mChangeThemeButton.ClickedSignal().Connect( this, &ProgressBarExample::OnChangeThemeButtonSelected );
  153 +
  154 + buttonBackground.Add( mChangeThemeButton );
  155 +
153 156 // Create a timer to update the progress of all progress bars
154 157 mTimer = Timer::New( TIMER_TIMEOUT_TIME );
155 158 mTimer.TickSignal().Connect( this, &ProgressBarExample::OnTimerTick );
... ... @@ -159,9 +162,9 @@ private:
159 162 bool OnTimerTick()
160 163 {
161 164 mProgressValue += PROGRESS_INCREMENT_VALUE;
  165 + mSecondaryProgressValue = mProgressValue + 0.1f;
162 166 mProgressBarDefault.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
163   - mProgressBarCustomStyle1.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
164   - mProgressBarCustomStyle2.SetProperty(ProgressBar::Property::PROGRESS_VALUE, mProgressValue);
  167 + mProgressBarDefault.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, mSecondaryProgressValue);
165 168  
166 169 return ( mProgressValue < 1.0f ); // Only call again if progress has NOT got to the end
167 170 }
... ... @@ -169,13 +172,51 @@ private:
169 172 bool OnResetProgressButtonSelected( Toolkit::Button button )
170 173 {
171 174 mProgressValue = 0.0f;
  175 + mSecondaryProgressValue = 0.1f;
172 176 mProgressBarDefault.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
173   - mProgressBarCustomStyle1.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
174   - mProgressBarCustomStyle2.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.0f);
  177 + mProgressBarDefault.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.1f);
175 178 mTimer.Start();
176 179 return true;
177 180 }
178 181  
  182 + void OnValueChanged( ProgressBar progressBar, float value, float secondaryValue )
  183 + {
  184 + std::stringstream newLabel;
  185 + newLabel.precision( 2 );
  186 + newLabel << std::fixed << "current : " << value << " / loaded : " << secondaryValue;
  187 +
  188 + mProgressBarDefault.SetProperty(ProgressBar::Property::LABEL_VISUAL, newLabel.str() );
  189 + }
  190 +
  191 + bool OnSetIndeterminateButtonSelected( Toolkit::Button button )
  192 + {
  193 + if( mProgressBarDefault.GetProperty<bool>(ProgressBar::Property::INDETERMINATE))
  194 + {
  195 + mProgressBarDefault.SetProperty(ProgressBar::Property::INDETERMINATE, false);
  196 + }
  197 + else
  198 + {
  199 + mProgressBarDefault.SetProperty(ProgressBar::Property::INDETERMINATE, true);
  200 + }
  201 + return true;
  202 + }
  203 +
  204 + bool OnChangeThemeButtonSelected( Toolkit::Button button )
  205 + {
  206 + StyleManager styleManager = StyleManager::Get();
  207 +
  208 + if( isDefaultTheme )
  209 + {
  210 + styleManager.ApplyTheme( THEME_PATH );
  211 + isDefaultTheme = false;
  212 + }
  213 + else
  214 + {
  215 + styleManager.ApplyDefaultTheme();
  216 + isDefaultTheme = true;
  217 + }
  218 + return true;
  219 + }
179 220 void OnKeyEvent( const KeyEvent& event )
180 221 {
181 222 if( event.state == KeyEvent::Down )
... ... @@ -196,15 +237,17 @@ private:
196 237 Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
197 238 Layer mContentLayer; ///< Content layer.
198 239 ProgressBar mProgressBarDefault;
199   - ProgressBar mProgressBarCustomStyle1;
200   - ProgressBar mProgressBarCustomStyle2;
201 240 Toolkit::PushButton mResetProgressButton;
  241 + Toolkit::PushButton mSetIndeterminateButton;
  242 + Toolkit::PushButton mChangeThemeButton;
202 243 float mProgressValue;
  244 + float mSecondaryProgressValue;
  245 + bool isDefaultTheme;
203 246 };
204 247  
205 248 int DALI_EXPORT_API main( int argc, char **argv )
206 249 {
207   - Application application = Application::New( &argc, &argv, THEME_PATH );
  250 + Application application = Application::New( &argc, &argv );
208 251 ProgressBarExample test( application );
209 252 application.MainLoop();
210 253 return 0;
... ...
examples/transitions/transition-application.cpp
... ... @@ -57,6 +57,7 @@ TransitionApplication::TransitionApplication( Application&amp; application )
57 57 mTitle(),
58 58 mShadowButton(),
59 59 mActionButtons(),
  60 + mVisualIndex( Property::INVALID_INDEX ),
60 61 mActionIndex( Property::INVALID_INDEX )
61 62 {
62 63 application.InitSignal().Connect( this, &TransitionApplication::Create );
... ...
packaging/com.samsung.dali-demo.spec
... ... @@ -2,7 +2,7 @@
2 2  
3 3 Name: com.samsung.dali-demo
4 4 Summary: The OpenGLES Canvas Core Demo
5   -Version: 1.2.25
  5 +Version: 1.2.26
6 6 Release: 1
7 7 Group: System/Libraries
8 8 License: Apache-2.0
... ...
resources/images/progress-bar-progress.9.png renamed to resources/images/new-progress-bar-progress.9.png

199 Bytes

resources/images/new-progress-bar-secondary-progress.9.png 0 → 100644

126 Bytes

resources/images/progress-bar.9.png renamed to resources/images/new-progress-bar-track.9.png

182 Bytes

resources/images/progress-bar-2.9.png deleted

177 Bytes

resources/images/progress-bar-progress-2.9.png deleted

182 Bytes

resources/scripts/shader-effect-ripple.json
... ... @@ -16,7 +16,21 @@
16 16 "desiredWidth": 400,
17 17 "desiredHeight": 400,
18 18 "shader": {
19   - "fragmentShader": "precision mediump float;\nuniform sampler2D sTexture;\nuniform vec4 uColor;\nuniform float uAmplitude;\nuniform float uTime;\nvarying vec2 vTexCoord;\nvoid main()\n{\n highp vec2 pos = -1.0 + 2.0 * vTexCoord;\n highp float len = length(pos);\n highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\n gl_FragColor = texture2D(sTexture, texCoord) * uColor;}\n\n"
  19 + "fragmentShader": [
  20 + "precision mediump float;",
  21 + "uniform sampler2D sTexture;",
  22 + "uniform vec4 uColor;",
  23 + "uniform float uAmplitude;",
  24 + "uniform float uTime;",
  25 + "varying vec2 vTexCoord;",
  26 + "void main()",
  27 + "{",
  28 + " highp vec2 pos = -1.0 + 2.0 * vTexCoord;",
  29 + " highp float len = length(pos);",
  30 + " highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;",
  31 + " gl_FragColor = texture2D(sTexture, texCoord) * uColor;",
  32 + "}"
  33 + ]
20 34 }
21 35 },
22 36 "animatableProperties": {
... ...
resources/style/mobile/progress-bar-example-theme.json.in
... ... @@ -14,33 +14,19 @@
14 14 * limitations under the License.
15 15 *
16 16 */
17   -
18 17 {
19 18 "styles":
20 19 {
21   - "ProgressBarCustomStyle1":
  20 + "ProgressBar":
22 21 {
23   - "progressValue": 0,
24 22 "trackVisual":{
25   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar.9.png",
26   - "size":[5,24]
  23 + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-track.9.png"
27 24 },
28 25 "progressVisual":{
29   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress.9.png",
30   - "size":[5,24]
31   - }
32   - },
33   -
34   - "ProgressBarCustomStyle2":
35   - {
36   - "progressValue": 0,
37   - "trackVisual":{
38   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-2.9.png",
39   - "size":[5,7]
  26 + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-progress.9.png"
40 27 },
41   - "progressVisual":{
42   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress-2.9.png",
43   - "size":[5,7]
  28 + "secondaryProgressVisual":{
  29 + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-secondary-progress.9.png"
44 30 }
45 31 }
46 32 }
... ...
resources/style/progress-bar-example-theme.json.in
... ... @@ -18,29 +18,16 @@
18 18 {
19 19 "styles":
20 20 {
21   - "ProgressBarCustomStyle1":
  21 + "ProgressBar":
22 22 {
23   - "progressValue": 0,
24 23 "trackVisual":{
25   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar.9.png",
26   - "size":[5,24]
  24 + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-track.9.png"
27 25 },
28 26 "progressVisual":{
29   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress.9.png",
30   - "size":[5,24]
31   - }
32   - },
33   -
34   - "ProgressBarCustomStyle2":
35   - {
36   - "progressValue": 0,
37   - "trackVisual":{
38   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-2.9.png",
39   - "size":[5,7]
  27 + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-progress.9.png"
40 28 },
41   - "progressVisual":{
42   - "url":"{APPLICATION_RESOURCE_PATH}/images/progress-bar-progress-2.9.png",
43   - "size":[5,7]
  29 + "secondaryProgressVisual":{
  30 + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-secondary-progress.9.png"
44 31 }
45 32 }
46 33 }
... ...
shared/multi-language-strings.h
... ... @@ -186,9 +186,29 @@ namespace MultiLanguageStrings
186 186 "(Chinese)",
187 187 "若要重新排列页面,您需要将视图类型更改为可自定义网格。"
188 188 },
  189 + {
  190 + "ꦧꦱꦗꦮ, basa Jawa",
  191 + "(Javanese)",
  192 + "ꦧꦱꦗꦮ ꦕꦫꦗꦮ ꦲꦏ꧀ꦱꦫꦗꦮ ꦲꦤꦕꦫꦏ ꧋ꦱꦧꦼꦤ꧀ꦲꦸꦮꦺꦴꦁꦏꦭꦲꦶꦫꦏꦺꦏꦤ꧀ꦛꦶꦩꦂꦢꦶꦏꦭꦤ꧀ꦢꦂꦧꦺꦩꦂꦠꦧꦠ꧀ꦭꦤ꧀ꦲꦏ꧀ꦲꦏ꧀ꦏꦁꦥꦝ꧉"
  193 + },
  194 + {
  195 + "Basa Sunda, ᮘᮞ ᮞᮥᮔ᮪ᮓ",
  196 + "(Sundanese)",
  197 + "ᮃᮊ᮪ᮞᮛ ᮞᮥᮔ᮪ᮓ ᮀᮁᮂᮃᮄᮅᮆᮇᮈᮉᮊᮋᮌᮍᮎᮏᮐᮑᮒᮓᮔᮕᮖᮗᮘᮙᮚᮛᮜᮝᮞᮟᮠᮡᮢᮣᮤᮥᮦᮧᮨᮩ᮪᮫ᮬᮭᮮᮯ᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹ᮺᮻᮼᮽᮾᮿ᳀᳁᳂᳃᳄᳅᳆᳇"
  198 + },
  199 + {
  200 + "isiZulu",
  201 + "(Zulu)",
  202 + "Sawubona Mhlaba"
  203 + },
  204 + {
  205 + "isiXhosa",
  206 + "(Xhosa)",
  207 + "Molo Lizwe"
  208 + },
189 209 };
190 210  
191   - const unsigned int NUMBER_OF_LANGUAGES = 31u;
  211 + const unsigned int NUMBER_OF_LANGUAGES = 35u;
192 212  
193 213 } // MultiLanguageStrings
194 214  
... ...