// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
__pBrightnessSlider->SetRange(1,10);
__pBrightnessSlider->SetValue(sliderValue);
__pBrightnessSlider->AddSliderEventListener(*this);
+ __pBrightnessSlider->AddAdjustmentEventListener(*this);
GetFooter()->AddActionEventListener(*this);
return r;
AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry();
String sliderKey("SliderValue");
String tabKey("TabButton");
- int sliderValue = 0;
+ int sliderValue = 10;
int tabValue = 0;
r = pAppRegistry->Get(sliderKey, sliderValue);
{
__pBrightnessSlider->SetEnabled(true);
AppLog("BatteryLvl %d",PowerManager::GetScreenBrightness());
- __pBrightnessSlider->SetValue(PowerManager::GetScreenBrightness());
+ __pBrightnessSlider->SetValue(sliderValue);
__pBrightnessSlider->Invalidate(true);
}
if (__manualBrightness == true)
{
PowerManager::SetScreenBrightness(value);
+ AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry();
+ String sliderKey("SliderValue");
+ if (pAppRegistry)
+ {
+ pAppRegistry->Set(sliderKey,value);
+ }
+ }
+}
+void
+BrightnessForm::OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment)
+{
+ if(source.Equals(*__pBrightnessSlider) == true)
+ {
+ AppLog("coming to OnSliderBarMoved");
+ if (__manualBrightness == true)
+ {
+ PowerManager::SetScreenBrightness(adjustment);
+ AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry();
+ String sliderKey("SliderValue");
+ if (pAppRegistry)
+ {
+ pAppRegistry->Set(sliderKey,adjustment);
+ }
+ }
}
}
r = pAppRegistry->Set(sliderKey,sliderValue);
FooterItemStatus footerStatus;
GetFooter()->GetItemStatus(0,footerStatus);
- if (footerStatus == FOOTER_ITEM_STATUS_SELECTED)
+ if (footerStatus == FOOTER_ITEM_STATUS_SELECTED || footerStatus == FOOTER_ITEM_STATUS_HIGHLIGHTED)
{
r = pAppRegistry->Set(tabKey,0);
}
void
BrightnessForm::OnActionPerformed(const Control& source, int actionId)
{
+ result r = E_SUCCESS;
switch (actionId)
{
case IDA_AUTOBTN_CLICKED:
__manualBrightness = false;
-// __pBrightnessSlider->SetValue(6);
+ __pBrightnessSlider->SetValue(6);
// __pBrightnessSlider->SetShowState(false);
PowerManager::SetScreenBrightness(6);
__pBrightnessSlider->SetEnabled(false);
default:
break;
}
+ // save the slider value
+ // save the tab button
+ AppRegistry* pAppRegistry = App::GetInstance()->GetAppRegistry();
+ String sliderKey("SliderValue");
+ String tabKey("TabButton");
+ int sliderValue = __pBrightnessSlider->GetValue();
+ r = pAppRegistry->Set(sliderKey,sliderValue);
+ FooterItemStatus footerStatus;
+ GetFooter()->GetItemStatus(0,footerStatus);
+ if (footerStatus == FOOTER_ITEM_STATUS_SELECTED || footerStatus == FOOTER_ITEM_STATUS_HIGHLIGHTED)
+ {
+ r = pAppRegistry->Set(tabKey,0);
+ }
+ else
+ {
+ r = pAppRegistry->Set(tabKey,1);
+ }
+ pAppRegistry->Save();
}
void