mirror of
https://github.com/openharmony/applications_sample_camera.git
synced 2026-07-01 14:21:52 -04:00
!147 部件applications_sample_camera编译整改消除主干告警
Merge pull request !147 from tongkai0808fh/master
This commit is contained in:
@@ -113,54 +113,61 @@ void SwipeView::OnSetUpView()
|
||||
AddFirstViewGroup();
|
||||
AddViewGroup();
|
||||
AddViewGroup();
|
||||
double scale0 = 0.6;
|
||||
double scale1 = 0.69;
|
||||
// Reserved. Touch and hold to add a page.
|
||||
arrPage_[0]->SetMatrix(APP_ROW_COUNT, APP_COL_COUNT);
|
||||
arrPage_[0]->SetScale(0.6); // 0.6 blank/icon width
|
||||
arrPage_[0]->SetScale(scale0);
|
||||
for (int16_t i = 1; i < groupCount_; i++) {
|
||||
arrPage_[i]->SetMatrix(APP_ROW_COUNT, 2 * APP_COL_COUNT); // 2 scale of first view's col count
|
||||
arrPage_[i]->SetScale(0.69); // 0.69 blank/icon width
|
||||
arrPage_[i]->SetScale(scale1); // 0.69 blank/icon width
|
||||
}
|
||||
AppEvent::GetInstance(this);
|
||||
AppManage::SetViewGroup(AppEvent::ClickEvent, AppEvent::LongPressEvent, arrPage_, groupCount_);
|
||||
BundleInfo* pBundleInfos = nullptr;
|
||||
int count = 0;
|
||||
if (appManage_->LauncherApp(&pBundleInfos, count)) {
|
||||
for (int j = 0; j < count; j++) {
|
||||
for (int i = 0; i < groupCount_; i++) {
|
||||
if (memcmp(LAUNCHER_BUNDLE_NAME, pBundleInfos[j].bundleName, strlen(pBundleInfos[j].bundleName)) == 0) {
|
||||
break;
|
||||
}
|
||||
if (memcmp(SCREENSAVER_BUNDLE_NAME, pBundleInfos[j].bundleName, strlen(pBundleInfos[j].bundleName)) == 0) {
|
||||
break;
|
||||
}
|
||||
if (pBundleInfos[j].abilityInfos->abilityType == SERVICE) {
|
||||
break;
|
||||
}
|
||||
AppInfo* app = new AppInfo();
|
||||
app->funcclick_ = AppEvent::ClickEvent;
|
||||
app->funclPress_ = AppEvent::LongPressEvent;
|
||||
if (pBundleInfos[j].bundleName) {
|
||||
(void)memcpy_s(app->appName_, sizeof(app->appName_), pBundleInfos[j].bundleName,
|
||||
strlen(pBundleInfos[j].bundleName));
|
||||
app->appName_[strlen(pBundleInfos[j].bundleName)] = 0;
|
||||
}
|
||||
if (pBundleInfos[j].abilityInfos[0].name) {
|
||||
(void)memcpy_s(app->abilityName_, sizeof(app->abilityName_), pBundleInfos[j].abilityInfos[0].name,
|
||||
strlen(pBundleInfos[j].abilityInfos[0].name));
|
||||
app->abilityName_[strlen(pBundleInfos[j].abilityInfos[0].name)] = 0;
|
||||
}
|
||||
if (pBundleInfos[j].bigIconPath) {
|
||||
(void)memcpy_s(app->appIconDir_, sizeof(app->appIconDir_), pBundleInfos[j].bigIconPath,
|
||||
strlen(pBundleInfos[j].bigIconPath));
|
||||
app->appIconDir_[strlen(pBundleInfos[j].bigIconPath)] = 0;
|
||||
}
|
||||
if (arrPage_[i]->AddApp(app)) {
|
||||
break;
|
||||
}
|
||||
BundleInfoScan(pBundleInfos, count);
|
||||
}
|
||||
swipe_->SetCurrentPage(0);
|
||||
}
|
||||
|
||||
void SwipeView::BundleInfoScan(BundleInfo* pBundleInfos, int count)
|
||||
{
|
||||
for (int j = 0; j < count; j++) {
|
||||
for (int i = 0; i < groupCount_; i++) {
|
||||
if (memcmp(LAUNCHER_BUNDLE_NAME, pBundleInfos[j].bundleName, strlen(pBundleInfos[j].bundleName)) == 0) {
|
||||
break;
|
||||
}
|
||||
if (memcmp(SCREENSAVER_BUNDLE_NAME, pBundleInfos[j].bundleName, strlen(pBundleInfos[j].bundleName)) == 0) {
|
||||
break;
|
||||
}
|
||||
if (pBundleInfos[j].abilityInfos->abilityType == SERVICE) {
|
||||
break;
|
||||
}
|
||||
AppInfo* app = new AppInfo();
|
||||
app->funcclick_ = AppEvent::ClickEvent;
|
||||
app->funclPress_ = AppEvent::LongPressEvent;
|
||||
if (pBundleInfos[j].bundleName) {
|
||||
(void)memcpy_s(app->appName_, sizeof(app->appName_), pBundleInfos[j].bundleName,
|
||||
strlen(pBundleInfos[j].bundleName));
|
||||
app->appName_[strlen(pBundleInfos[j].bundleName)] = 0;
|
||||
}
|
||||
if (pBundleInfos[j].abilityInfos[0].name) {
|
||||
(void)memcpy_s(app->abilityName_, sizeof(app->abilityName_), pBundleInfos[j].abilityInfos[0].name,
|
||||
strlen(pBundleInfos[j].abilityInfos[0].name));
|
||||
app->abilityName_[strlen(pBundleInfos[j].abilityInfos[0].name)] = 0;
|
||||
}
|
||||
if (pBundleInfos[j].bigIconPath) {
|
||||
(void)memcpy_s(app->appIconDir_, sizeof(app->appIconDir_), pBundleInfos[j].bigIconPath,
|
||||
strlen(pBundleInfos[j].bigIconPath));
|
||||
app->appIconDir_[strlen(pBundleInfos[j].bigIconPath)] = 0;
|
||||
}
|
||||
if (arrPage_[i]->AddApp(app)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
swipe_->SetCurrentPage(0);
|
||||
}
|
||||
|
||||
void SwipeView::StartApp(AppInfo* app)
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
SwipeView(UILabel* titlellable, UILabel* taillable);
|
||||
virtual ~SwipeView();
|
||||
void OnSetUpView();
|
||||
void BundleInfoScan(BundleInfo* pBundleInfos, int count);
|
||||
void StartApp(AppInfo* app);
|
||||
void ShowLongPressView(AppInfo* app);
|
||||
void UninstallApp(AppInfo* app);
|
||||
|
||||
Reference in New Issue
Block a user