Apps with 320x320 and square apps are not displayed properly.
View is truncated.
Resize the view to 320x320 so that maximum
possible view is displayed in visible area.
These kind of apps are identified by profile
tag.
---------------------------------------------
| SlNo| Profile | Value | Display |
---------------------------------------------
| 1 | Not Present | NA | 320x320 |
| 2 | Present | mobile | 320x320 |
| 3 | Present | NULL | 320x320 |
| 4 | Present | wearable | 360x360 |
---------------------------------------------
[Reference] http://slp-info.sec.samsung.net/gerrit/#/c/3119525/
Change-Id: I3b60cc73910b462becfa04e9112fe39f15203511
Signed-off-by: Guneet K <g.khosla@samsung.com>
Signed-off-by: deepti <d.saraswat@samsung.com>
return csp_report_info_;
}
+std::shared_ptr<const wgt::parse::ProfileTagInfo>
+ ApplicationData::profile_tag_info() const {
+ return profile_tag_info_;
+}
+
const std::string ApplicationData::pkg_id() const {
if (pkg_id_.empty()) {
app_info_h app_info;
widget_config_parser->GetManifestData(
wgt::parse::CSPInfo::Report_only_key()));
+ profile_tag_info_ =
+ std::static_pointer_cast<const wgt::parse::ProfileTagInfo>(
+ widget_config_parser->GetManifestData(
+ wgt::parse::ProfileTagInfo::Key()));
+
// Set default empty object
if (widget_info_.get() == NULL) {
widget_info_.reset(new wgt::parse::WidgetInfo);
#include <wgt_manifest_handlers/metadata_handler.h>
#include <wgt_manifest_handlers/navigation_handler.h>
#include <wgt_manifest_handlers/permissions_handler.h>
+#include <wgt_manifest_handlers/profile_tag_handler.h>
#include <wgt_manifest_handlers/service_handler.h>
#include <wgt_manifest_handlers/setting_handler.h>
#include <wgt_manifest_handlers/tizen_application_handler.h>
csp_info() const;
std::shared_ptr<const wgt::parse::CSPInfo>
csp_report_info() const;
+ std::shared_ptr<const wgt::parse::ProfileTagInfo>
+ profile_tag_info() const;
const std::string application_path() const { return application_path_; }
const std::string pkg_id() const;
csp_info_;
std::shared_ptr<const wgt::parse::CSPInfo>
csp_report_info_;
+
+ std::shared_ptr<const wgt::parse::ProfileTagInfo>
+ profile_tag_info_;
+
ApplicationData::AppType GetAppType();
std::string application_path_;
(common::getProfile() & ((common::kPROFILE_WEARABLE)))
#define TIZEN_FEATURE_rotary_event_support \
(common::getProfile() & ((common::kPROFILE_WEARABLE)))
+#define TIZEN_FEATURE_display_resize_support \
+ (common::getProfile() & ((common::kPROFILE_WEARABLE)))
extern enum _profile getProfile(void);
progressbar_(NULL),
top_layout_(NULL),
rotation_(0),
- handler_id_(0) {
+ handler_id_(0),
+ natural_orientation_(ScreenOrientation::PORTRAIT_PRIMARY),
+ display_shape_type_(Shape::STANDARD)
+ {
}
+
NativeWindow::~NativeWindow() {
if (window_)
evas_object_del(window_);
// top layout
Evas_Object* top_layout = elm_layout_add(conformant);
- elm_layout_file_set(top_layout, kEdjePath, "web-application");
+ if (display_shape_type_ == Shape::SQUARE) {
+ LOGGER(DEBUG) << "Device shape square";
+ elm_layout_file_set(top_layout, kEdjePath, "web-applicationsview");
+ } else {
+ LOGGER(DEBUG) << "Device shape standard";
+ elm_layout_file_set(top_layout, kEdjePath, "web-application");
+ }
+
EVAS_SIZE_EXPAND_FILL(top_layout);
elm_object_content_set(conformant, top_layout);
evas_object_show(top_layout);
NORMAL = 0,
NOTIFICATION = 1
};
+ enum class Shape {
+ STANDARD = 0,
+ SQUARE = 1
+ };
typedef std::function<void(int)> RotationHandler;
NativeWindow();
virtual ~NativeWindow();
Type type() const { return window_type_;}
void EnableManualRotation(bool enable);
void ManualRotationDone();
+ void SetDisplayShape(Shape disp_shape) { display_shape_type_ = disp_shape; }
+ Shape GetDisplayShape() { return display_shape_type_; }
void SignalEmit(const char* emission, const char* source);
void UpdateProgress(double value);
int rotation_;
int handler_id_;
ScreenOrientation natural_orientation_;
+ Shape display_shape_type_;
std::map<int, RotationHandler> handler_table_;
};
#include <EWebKit_internal.h>
#include <stdio.h>
+#include "common/platform_info.h"
#include "common/logger.h"
#include "runtime/browser/native_app_window.h"
#include "extensions/common/xwalk_extension_server.h"
ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH);
context = context; // To prevent build warning
cached_window_.reset(new NativeAppWindow());
- cached_window_->Initialize();
+ if (!TIZEN_FEATURE_display_resize_support)
+ cached_window_->Initialize();
}
NativeWindow* PreloadManager::GetCachedNativeWindow() {
#include "common/app_db.h"
#include "common/command_line.h"
#include "common/logger.h"
+#include "common/platform_info.h"
#include "common/profiler.h"
#include "runtime/common/constants.h"
#include "runtime/browser/native_app_window.h"
const char kCategoryAlwaysOnTop[] = "http://tizen.org/category/always_on_top";
-static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType) {
+static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType,
+ NativeWindow::Shape win_shape) {
SCOPE_PROFILE();
-
NativeWindow* window;
switch (windowType) {
}
break;
}
+ window->SetDisplayShape(win_shape);
window->Initialize();
return window;
return appcontrol->data("always_on_top") == "true";
}
+const char kConfigProfile[] = "mobile";
+NativeWindow::Shape GetWindowType(common::ApplicationData* app_data) {
+ // As profile tag is not present app will be treated as square app
+ if (!app_data->profile_tag_info()) {
+ return NativeWindow::Shape::SQUARE;
+ }
+ std::string type = app_data->profile_tag_info()->GetProfileType();
+ if (!type.compare(kConfigProfile)) {
+ return NativeWindow::Shape::SQUARE;
+ }
+ return NativeWindow::Shape::STANDARD;
+}
+
} // namespace
UiRuntime::UiRuntime(common::ApplicationData* app_data)
application_.reset();
native_window_.reset();
-
- native_window_.reset(CreateNativeWindow(windowType));
+ if (TIZEN_FEATURE_display_resize_support)
+ native_window_.reset(CreateNativeWindow(windowType, GetWindowType(app_data_)));
+ else native_window_.reset(CreateNativeWindow(windowType, NativeWindow::Shape::STANDARD));
LOGGER(DEBUG) << "runtime.cc Created native window";
application_.reset(new WebApplication(native_window_.get(),
app_data_,
namespace {
-static NativeWindow* CreateNativeWindow() {
+static NativeWindow* CreateNativeWindow(NativeWindow::Shape win_shape) {
SCOPE_PROFILE();
NativeWindow* window = NULL;
auto cached = PreloadManager::GetInstance()->GetCachedNativeWindow();
delete cached;
}
window = new NativeWatchWindow();
+ window->SetDisplayShape(win_shape);
window->Initialize();
return window;
}
+const char kConfigProfile[] = "mobile";
+NativeWindow::Shape GetWindowType(common::ApplicationData* app_data) {
+ // As profile tag is not present app will be treated as square app
+ if (!app_data->profile_tag_info()) {
+ return NativeWindow::Shape::SQUARE;
+ }
+ std::string type = app_data->profile_tag_info()->GetProfileType();
+ if (!type.compare(kConfigProfile)) {
+ return NativeWindow::Shape::SQUARE;
+ }
+ return NativeWindow::Shape::STANDARD;
+}
+
} // namespace
WatchRuntime::WatchRuntime(common::ApplicationData* app_data)
appdb->Remove(kAppDBRuntimeSection, kAppDBRuntimeBundle);
// Init WebApplication
- native_window_ = CreateNativeWindow();
+ native_window_ = CreateNativeWindow(GetWindowType(app_data_));
STEP_PROFILE_START("WebApplication Create");
application_ = new WebApplication(native_window_, app_data_);
STEP_PROFILE_END("WebApplication Create");
WebView* view = new WebView(window_, ewk_context_);
SetupWebView(view);
SetupWebViewCompatibilitySettings(view);
+ if (TIZEN_FEATURE_display_resize_support)
+ SetDisplayEffect(view);
std::unique_ptr<common::ResourceManager::Resource> res =
resource_manager_->GetStartResource(appcontrol.get());
}
}
+void WebApplication::SetDisplayEffect(WebView* view) {
+ if (window_->GetDisplayShape() == NativeWindow::Shape::SQUARE) {
+ // Currently blur effect API is called on view, which is not
+ // correct. Needs to be moved to context. Once new API is
+ // provided on context below code will get changed.
+ LOGGER(DEBUG) << "WebApplication::Set Blur effect";
+ ewk_view_mirrored_blur_set(view->evas_object(), true);
+ }
+}
+
bool WebApplication::OnDidNavigation(WebView* /*view*/,
const std::string& url) {
// scheme handling
void LaunchInspector(common::AppControl* appcontrol);
void SetupWebView(WebView* view);
void SetupWebViewCompatibilitySettings(WebView* view);
+ void SetDisplayEffect(WebView* view);
void RemoveWebViewFromStack(WebView* view);
void SetupTizenVersion();
type: SWALLOW;
description {
state: "default" 0.0;
- fixed: 1 1;
- rel1 { relative: 0.0 0.0; to: base; }
- rel2 { relative: 1.0 1.0; to: base; }
- align: 0.0 0.0;
-
}
/* ratio 1x1 (only for gear3) */
description {
}//end of group
group {
+ name: "web-applicationsview";
+ inherit: "web-application";
+ parts{
+ part {
+ name: "elm.swallow.content";
+ scale: 0;
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ //rel1 { offset: 20 20; }
+ //rel2 { offset: -20 -20; }
+ min: 320 320;
+ max: 320 320;
+ fixed: 1 1;
+ }
+ // Below code will also do the same
+ /*description {
+ state: "default" 0.0;
+ rel1 { offset: 20 20; }
+ rel2 { offset: -20 -20; }
+ }*/
+
+ /* ratio 1x1 (only for gear3) */
+ description {
+ state: "ratio1x1" 0.0;
+ fixed: 1 1;
+ aspect: 1 1;
+ aspect_preference: BOTH;
+ align: 0.5 0.5;
+ }
+ }
+ }
+ }
+
+ group {
name: "PopupTextEntrySet";
parts{
part {
'defines': ['TIZEN_PRODUCT_TV'],
}],
['tizen_model_formfactor == "circle"', {
- 'defines': ['MODEL_FORMFACTOR_CIRCLE'],
+ 'defines': ['MODEL_FORMFACTOR_CIRCLE',
+ 'DISPLAY_RESIZE_SUPPORT'],
}],
['tizen_feature_rotary_event_support == 1', {
'defines': ['ROTARY_EVENT_FEATURE_SUPPORT'],