MTK主題修改

2021-05-22 21:52:51 字數 4963 閱讀 9901

/*軟體版本0852*/

先看wgui 的初始化,在wgui.c 檔案wgui_init(void) 函式。裡面有

set_mmi_theme((mmi_theme*) mmi_themes[0]);

gui_initialize_default_themes();

下面是一些常用主題修改時要修改的一些變數:

ui_filled_area *scrollbar_background_filler;//

滾動條背景

ui_filled_area *scrollbar_indicator_filler;//

滾動條

ui_filled_area *list_selected_item_filler;//57screen

選擇框等控制項

ui_filled_area *popup_description_background_filler;//list

選單hint 框

ui_filled_area *inline_edit_focussed_filler;//57screen

編輯框

ui_filled_area *pin_inputbox_background_filler;//pin

輸入框

ui_filled_area *small_list_menu_normal_filler;//

級聯選單(pop-up 式選單, 即選項選單) 背景

ui_filled_area *small_list_screen_border_filler;//

級聯選單(pop-up 式選單, 即選項選單) 邊框

ui_filled_area *menuitem_single_line_highlight_filler;//2

級選單情景模式螢幕+3 級和多級選單高亮,不包括相簿螢幕、彈出式選單等

ui_filled_area *menuitem_two_line_highlight_filler;//

ui_filled_area *menuitem_multirow_highlight_filler;//

通話中心、多**等二級選單高亮( 不包括情景模式screen)

ui_filled_area *menuitem_thick_highlight_filler;//

ui_filled_area *main_menu_bkg_filler;//

主選單背景

ui_filled_area *sub_menu_bkg_filler;//

二級及多級選單背景

pu8 popup_bkg_image;//pop-up

螢幕背景

color

*popup_text_color;//pop-up

螢幕文字顏色

ui_filled_area *cascade_menu_highlight_filler;//

級聯選單(pop-up 式選單, 即選項選單) 高亮

ui_filled_area *softkey_bar_bkg_filler;//softkey bar 背景

還有一些修改顏色的變數,大多都見名知意啦。

選單高亮: gui_list_effect_slide_draw_highlight_filler----gui_menu_oem.c

參考**:

#ifdef __mmi_themes_v2_support__

extern theme_details_struct *mmi_themes;

#else

extern mmi_theme **mmi_themes;

#endif

extern mmi_theme *current_mmi_theme;

color red = ;

color green = ;

color black = ;

ui_filled_area filler = ;

int i = 0;

#ifndef __mtk_target__

#ifdef __mmi_themes_v2_support__

memcpy(temp_theme, mmi_themes[0].theme, sizeof(mmi_theme));

#else

memcpy(temp_theme, mmi_themes[0], sizeof(mmi_theme));

#endif

//scroll bar

test_theme.scrollbar_background_filler = &test_scrollbar_bg_filler;

test_theme.scrollbar_indicator_filler = &test_scrollbar_indicator_filler;

//mainmenu&sub menu background

test_theme.main_menu_bkg_filler = /

test_theme.sub_menu_bkg_filler = &idle_main_menu_bkg_filler_test;

//menu highlight

test_theme.menuitem_single_line_highlight_filler = /

test_theme.menuitem_two_line_highlight_filler = /

test_theme.menuitem_multirow_highlight_filler= /

test_theme.cascade_menu_highlight_filler = /

test_theme.menuitem_thick_highlight_filler= &idle_sub_menu_bkg_filler_test;

//級聯選單(pop-up 式選單, 即選項選單) 背景& 邊框

test_theme.small_list_menu_normal_filler = /

test_theme.small_list_screen_border_filler = &idle_main_menu_bkg_filler_test;

//softkey

test_theme.softkey_lsk_down_filler = /

test_theme.softkey_lsk_up_filler = /

test_theme.softkey_rsk_down_filler = /

test_theme.softkey_rsk_up_filler = /

test_theme.popup_softkey_bar_filler = /

test_theme.softkey_bar_bkg_filler = &test_softkey_bkg_filler;

//pop-up ;

color popup_border = ;

test_theme.popup_screen_background_color = &popup_bg;

test_theme.popup_screen_border_color = &popup_border;

test_theme.popup_text_color = &black;

test_theme.popup_bkg_image = (pu8)testpopupbg; }

#endif

set_mmi_theme(&test_theme);

其中彈出式螢幕選單和pop-up 螢幕softkey 不會變,原因請檢視wgui_softkey_oem.c--show_softkey_background_with_clipping() 函式。

下面說下電池電量和訊號圖示的顯示 :

mtk會把電池電量icon( 路徑mainlcd/idlescreen/statusicons/battery/si_bat) 資料夾下的幾個icon 檔案編譯成乙個資源資料陣列__mainlcd__idlescreen__statusicons__battery__si_bat ,mtk 會在資料前面加相應的頭。例如:

0x02, 0x04, 0x00, 0x00, 0x00, 0x11, 0x20, 0x01,

0x08, 0x00, 0x00, 0x00, 0x8a, 0x05, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,

0x94, 0x05, 0x00, 0x00, 0x8a, 0x05, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,

0x20, 0x0b, 0x00, 0x00, 0x8a, 0x05, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,

0xac, 0x10, 0x00, 0x00, 0x8a, 0x05, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00,

0x42, 0x4d, 0x8a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x04, 0x00, 0x00, 0x28, 0x00,…………………

主頭:8 個位元組:1 位元組為標示即型別,gdi_const.h 檔案中有定義,此為gdi_image_type_bmp_sequence(2) ,則第乙個位元組為0x02 ; 2

副頭:即為每個要加個頭,即每個檔案的資訊,用來讀取每個檔案的。每個副頭12 個位元組,所以總共是數*12 。例子中為4 張,則4 行副頭。

1-4位元組為第一張的偏移為8 個位元組( 主頭的大小) ,這裡用4 個位元組表示,所以是0x08, 0x00, 0x00, 0x00

5-8位元組為大小,4 個位元組表示,小點表示法。

9-12

為佇列的間距,用意不明確,有所在資料夾下的interval.txt 文字檔案決定,幀數也是從此檔案中讀出的( 根據檔案內容有幾段數字,此數字即為間距,9-12 位元組) ,此資料不影響顯示。

每段的副頭有以上說明位元組組成,1-4 偏移量則是上一偏移+ 檔案大小

資料結構就是這樣,顯示的時候,會根據引數計算出要顯示哪一幀。

關於mtk主題大致就這樣了,如有錯誤知錯請指出,謝謝!

MTK主題風格追蹤

剛接觸mtk的人也許會感覺到它的主題風格很神奇,感覺只要稍微的改一些東西就可以改變使其風格 迥異,控制風格的這些東西何去何從呢?雖然不知道路徑也不會影響任何的工作,可是知道還是好一 些,畢竟心裡亮堂一些。以前曾經查過它的路徑,可是當時感覺亂亂的,後來因為有事就放在一邊了 今天閒來無事,就找了一下,沒...

MTK鈴聲修改方法

名稱對應資源陣列獲取範圍函式增 減鈴聲數目需修改定義備註 開 關機 mtk resource sounds custom get fixed sound range min snd id max snd id 可以修改資源陣列替換該鈴聲 簡訊mtk resource message sounds c...

MTK 修改FM門限

可以通過adb pull來快速修改驗證 利用adb pull在system vendor firmware下可將fm cust.cfg拿出來修改門限值,再用adb push到system vendor firmware目錄下,重啟手機後,新門限值即可生效。rssi門限 表示電台的訊號強度 smg 表...