mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-03 12:37:43 +08:00
add list view horizontal
This commit is contained in:
parent
fa2f4957b8
commit
fc96174c9c
@ -731,4 +731,4 @@ const unsigned char image_3[] = {
|
||||
0x2c,0x94,0xeb,0x8b,0xe7,0x6a,0xa6,0x6a,0xa6,0x6a,0x85,0x62,0xc6,0x6a,0x06,0x73,0x07,0x73,0x28,0x73,
|
||||
0x49,0x73,0x28,0x73,0xc7,0x62,0x69,0x73,0xaa,0x7b,0x69,0x73,0x49,0x73,0x28,0x73,0x49,0x73,0x49,0x73,
|
||||
0x29,0x73,0x49,0x73,0x69,0x73,0x49,0x73,0x69,0x73,0x69,0x73,0x48,0x73,0xe7,0x6a,0x00,0x00,0x00,0x00,
|
||||
0xa7,0xa8,0xa9,0xa9,};/*14644*/
|
||||
0x00,0x00,0x00,0x00,};/*14644*/
|
||||
|
@ -116,4 +116,4 @@ const unsigned char image_arrow_right_p[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||
0x00,0x00,0x00,0x00,0x10,0x21,0xe0,0x1b,};/*2348*/
|
||||
|
@ -116,4 +116,4 @@ const unsigned char image_arrow_up_p[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||
0x00,0x00,0x00,0x00,0x50,0x26,0x40,0xd9,};/*2348*/
|
||||
|
@ -116,4 +116,4 @@ const unsigned char image_checked[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x20,0x06,0x50,0xa3,};/*2348*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||
|
@ -116,4 +116,4 @@ const unsigned char image_edit_clear_n[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x24,0xc0,0x11,};/*2348*/
|
||||
0x00,0x00,0x00,0x00,0x31,0x00,0x00,0x00,};/*2348*/
|
||||
|
@ -116,4 +116,4 @@ const unsigned char image_left_on[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||
0x00,0x00,0x00,0x00,0xe0,0x07,0xc0,0xe2,};/*2348*/
|
||||
|
@ -116,4 +116,4 @@ const unsigned char image_question[] = {
|
||||
0x12,0x96,0xdb,0xb4,0x12,0x96,0xdb,0xe2,0x12,0x96,0xdb,0xfb,0x12,0x96,0xdb,0xff,0x12,0x96,0xdb,0xe7,
|
||||
0x12,0x96,0xdb,0xb9,0x11,0x96,0xdb,0x73,0x0e,0x91,0xda,0x0d,0x00,0x00,0x00,0x00,0x10,0x8f,0xdf,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||
0x00,0x00,0x00,0x00,0x60,0xb2,0x35,0x75,};/*2348*/
|
||||
|
@ -91,4 +91,4 @@ const unsigned char image_rgb[] = {
|
||||
0x00,0xf8,0x00,0xf8,0x00,0xf8,0x00,0xf8,0x00,0xf8,0x00,0xf8,0x00,0xf8,0x00,0xf8,0xe0,0x07,0xe0,0x07,
|
||||
0xe0,0x07,0xe0,0x07,0xe0,0x07,0xe0,0x07,0xe0,0x07,0xe0,0x07,0xe0,0x07,0xe0,0x07,0x1f,0x00,0x1f,0x00,
|
||||
0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,
|
||||
0x90,0x2e,0x33,0x73,};/*1844*/
|
||||
0x00,0x00,0x00,0x00,};/*1844*/
|
||||
|
@ -181,4 +181,4 @@ const unsigned char image_rgba[] = {
|
||||
0x00,0xff,0x00,0xea,0x00,0xff,0x00,0xc7,0x00,0xff,0x00,0x94,0x00,0xff,0x00,0x50,0x00,0x00,0xff,0x00,
|
||||
0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,
|
||||
0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,
|
||||
0x78,0x9c,0x36,0x75,};/*3644*/
|
||||
0x00,0x00,0x00,0x00,};/*3644*/
|
||||
|
@ -52,4 +52,4 @@ const unsigned char image_shift[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x60,0x20,0x50,0x60,};/*1068*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*1068*/
|
||||
|
@ -40,4 +40,4 @@ const unsigned char theme_button[] = {
|
||||
0x00,0x0d,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x01,0x00,0x00,
|
||||
0x00,0x0c,0x00,0x00,0x00,0x70,0x6c,0x61,0x79,0x5f,0x70,0x00,0x02,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,
|
||||
0x02,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x01,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,
|
||||
0x70,0x6c,0x61,0x79,0x5f,0x6f,0x00,0x41,0xdd,0x7f,0x00,};/*831*/
|
||||
0x70,0x6c,0x61,0x79,0x5f,0x6f,0x00,0x6b,0xe9,0x7f,0x00,};/*831*/
|
||||
|
@ -10,5 +10,5 @@ const unsigned char theme_calibration[] = {
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xf0,0xf0,0xf0,0xff,0x01,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,
|
||||
0x63,0x72,0x6f,0x73,0x73,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xff,0x01,0x00,
|
||||
0x00,0x00,0x0e,0x00,0x00,0x00,0x63,0x72,0x6f,0x73,0x73,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0xe0,0xe0,0xe0,0xff,0x01,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x63,0x72,0x6f,0x73,0x73,0x00,0x00,0x60,
|
||||
0xe0,0xe0,0xe0,0xff,0x01,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x63,0x72,0x6f,0x73,0x73,0x00,0x00,0xd0,
|
||||
0x02,0x00,};/*242*/
|
||||
|
@ -406,19 +406,19 @@ const unsigned char theme_default[] = {
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xc0,0xc0,0xc0,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0x11,0x8b,0xd6,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0x00,0xf0,0xf0,0xf0,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xf5,0xf5,0xf5,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xc0,0xc0,0xc0,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0x11,0x8b,0xd6,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0x00,0xf5,0xf5,0xf5,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xea,0xea,0xea,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xc0,0xc0,0xc0,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0x11,0x8b,0xd6,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0x00,0xea,0xea,0xea,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xf5,0xf5,0xf5,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
@ -431,4 +431,4 @@ const unsigned char theme_default[] = {
|
||||
0x00,0xea,0xea,0xea,0xff,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0xa0,0xa0,
|
||||
0xff,0x0b,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x00,0x00,
|
||||
0x00,0xea,0xea,0xea,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*8657*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6f,0x6e,0x00,0x00,};/*8657*/
|
||||
|
@ -34,4 +34,4 @@ const unsigned char theme_dialog[] = {
|
||||
0x00,0x00,0x02,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x0d,0x00,0x00,0x00,0x0b,0x00,
|
||||
0x00,0x00,0x02,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x69,0x6e,0x66,0x6f,0x00,0x0c,0x00,0x00,0x00,0x64,
|
||||
0x69,0x61,0x6c,0x6f,0x67,0x5f,0x74,0x69,0x74,0x6c,0x65,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0xed,0xed,0xed,0xff,0x0a,0x00,0x00,0x00,0xbe,0xbe,0xbe,0xff,0x00,0x00,0x00,0x00,0x6c,0x65,0x3e,0x0a,};/*720*/
|
||||
0xed,0xed,0xed,0xff,0x0a,0x00,0x00,0x00,0xbe,0xbe,0xbe,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*720*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
const unsigned char ui_list_view[] = {
|
||||
0x04,0x00,0x01,0x01,0x9c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x69,0x73,0x74,0x5f,0x76,0x69,0x65,
|
||||
0x04,0x00,0x01,0x01,0xec,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x69,0x73,0x74,0x5f,0x76,0x69,0x65,
|
||||
0x77,0x00,0x64,0x61,0x74,0x61,0x00,0x00,0x12,0x12,0x22,0x11,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6d,0x61,0x69,
|
||||
@ -20,5 +20,9 @@ const unsigned char ui_list_view[] = {
|
||||
0x69,0x61,0x62,0x6c,0x65,0x20,0x48,0x65,0x69,0x67,0x68,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
|
||||
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,
|
||||
0x6f,0x70,0x65,0x6e,0x3a,0x6c,0x69,0x73,0x74,0x5f,0x76,0x69,0x65,0x77,0x5f,0x68,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0x48,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x74,0x61,0x6c,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
|
||||
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,
|
||||
0x63,0x6c,0x6f,0x73,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,};/*444*/
|
||||
0x00,0x00,0x00,0x00,};/*524*/
|
||||
|
93
demos/res/inc/ui/list_view_h.data
Normal file
93
demos/res/inc/ui/list_view_h.data
Normal file
@ -0,0 +1,93 @@
|
||||
const unsigned char ui_list_view_h[] = {
|
||||
0x04,0x00,0x01,0x01,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x69,0x73,0x74,0x5f,0x76,0x69,0x65,
|
||||
0x77,0x5f,0x68,0x00,0x64,0x61,0x74,0x00,0x12,0x12,0x22,0x11,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6d,0x61,0x69,
|
||||
0x6e,0x00,0x61,0x6e,0x69,0x6d,0x5f,0x68,0x69,0x6e,0x74,0x00,0x68,0x74,0x72,0x61,0x6e,0x73,0x6c,0x61,
|
||||
0x74,0x65,0x00,0x00,0x6c,0x69,0x73,0x74,0x5f,0x76,0x69,0x65,0x77,0x5f,0x68,0x00,0x00,0x00,0x00,0x00,
|
||||
0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x5a,0x00,0x00,0x00,0x64,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x69,0x74,0x65,0x6d,0x5f,0x77,0x69,0x64,0x74,0x68,0x00,0x32,0x30,0x30,0x00,0x73,
|
||||
0x70,0x61,0x63,0x69,0x6e,0x67,0x00,0x35,0x00,0x00,0x73,0x63,0x72,0x6f,0x6c,0x6c,0x5f,0x76,0x69,0x65,
|
||||
0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,
|
||||
0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x76,0x69,0x65,0x77,0x00,
|
||||
0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,
|
||||
0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x31,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0x31,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,
|
||||
0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,
|
||||
0x32,0x00,0x74,0x65,0x78,0x74,0x00,0x32,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,
|
||||
0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,
|
||||
0x6d,0x61,0x67,0x65,0x00,0x33,0x00,0x74,0x65,0x78,0x74,0x00,0x33,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,
|
||||
0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,
|
||||
0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,
|
||||
0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x31,0x00,0x74,0x65,0x78,0x74,0x00,0x34,0x00,0x00,
|
||||
0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,
|
||||
0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x32,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0x35,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,
|
||||
0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,
|
||||
0x33,0x00,0x74,0x65,0x78,0x74,0x00,0x36,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,
|
||||
0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,
|
||||
0x6d,0x61,0x67,0x65,0x00,0x31,0x00,0x74,0x65,0x78,0x74,0x00,0x37,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,
|
||||
0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,
|
||||
0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,
|
||||
0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x32,0x00,0x74,0x65,0x78,0x74,0x00,0x38,0x00,0x00,
|
||||
0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,
|
||||
0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x33,0x00,0x74,0x65,0x78,
|
||||
0x74,0x00,0x39,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,
|
||||
0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,
|
||||
0x31,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x30,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,
|
||||
0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,
|
||||
0x69,0x6d,0x61,0x67,0x65,0x00,0x32,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x31,0x00,0x00,0x00,0x69,0x6d,
|
||||
0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,
|
||||
0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,
|
||||
0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x33,0x00,0x74,0x65,0x78,0x74,0x00,0x31,
|
||||
0x32,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,
|
||||
0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x31,0x00,
|
||||
0x74,0x65,0x78,0x74,0x00,0x31,0x33,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,
|
||||
0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,
|
||||
0x61,0x67,0x65,0x00,0x32,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x34,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,
|
||||
0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,
|
||||
0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,
|
||||
0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x33,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x35,0x00,
|
||||
0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,
|
||||
0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x31,0x00,0x74,0x65,
|
||||
0x78,0x74,0x00,0x31,0x36,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6f,0x72,0x64,0x65,0x72,
|
||||
0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,0x6f,0x00,0x69,0x6d,0x61,0x67,
|
||||
0x65,0x00,0x32,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x37,0x00,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,
|
||||
0x62,0x6f,0x72,0x64,0x65,0x72,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,0x00,0x61,0x75,0x74,
|
||||
0x6f,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x33,0x00,0x74,0x65,0x78,0x74,0x00,0x31,0x38,0x00,0x00,0x00,
|
||||
0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x03,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x63,0x6c,
|
||||
0x6f,0x73,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*1831*/
|
@ -20,4 +20,4 @@ const unsigned char ui_memtest[] = {
|
||||
0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x5a,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,
|
||||
0x6d,0x65,0x00,0x6d,0x65,0x6d,0x63,0x70,0x79,0x00,0x74,0x65,0x78,0x74,0x00,0x6e,0x2f,0x61,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xe8,0xa6,};/*426*/
|
||||
0x00,0x00,0x00,0x00,0xe8,0xd6,};/*426*/
|
||||
|
Binary file not shown.
@ -256,17 +256,17 @@
|
||||
<style name="default" border_color="#a0a0a0" border="bottom" text_color="black">
|
||||
<normal bg_color="#f0f0f0" />
|
||||
<pressed bg_color="#c0c0c0" />
|
||||
<over bg_color="#118bd6" />
|
||||
<over bg_color="#f0f0f0" />
|
||||
</style>
|
||||
<style name="odd_clickable" border_color="#a0a0a0" border="bottom" text_color="black">
|
||||
<normal bg_color="#f5f5f5" />
|
||||
<pressed bg_color="#c0c0c0" />
|
||||
<over bg_color="#118bd6" />
|
||||
<over bg_color="#f5f5f5" />
|
||||
</style>
|
||||
<style name="even_clickable" border_color="#a0a0a0" border="bottom" text_color="black">
|
||||
<normal bg_color="#eaeaea" />
|
||||
<pressed bg_color="#c0c0c0" />
|
||||
<over bg_color="#118bd6" />
|
||||
<over bg_color="#eaeaea" />
|
||||
</style>
|
||||
<style name="odd" border_color="#a0a0a0" border="bottom" text_color="black">
|
||||
<normal bg_color="#f5f5f5" />
|
||||
|
Binary file not shown.
@ -2,5 +2,6 @@
|
||||
<button name="open:list_view_d" text="Desktop Style"/>
|
||||
<button name="open:list_view_m" text="Mobile Style"/>
|
||||
<button name="open:list_view_vh" text="Variable Height"/>
|
||||
<button name="open:list_view_h" text="Horizontal"/>
|
||||
<button name="close" text="Close"/>
|
||||
</window>
|
||||
|
BIN
demos/res/raw/ui/list_view_h.bin
Normal file
BIN
demos/res/raw/ui/list_view_h.bin
Normal file
Binary file not shown.
25
demos/res/raw/ui/list_view_h.xml
Normal file
25
demos/res/raw/ui/list_view_h.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<window name="main" anim_hint="htranslate">
|
||||
<list_view_h x="center" y="10" w="90%" h="100" item_width="200" spacing="5">
|
||||
<scroll_view name="view" w="100%" h="100%">
|
||||
<image style="border" draw_type="auto" image="1" text="1"/>
|
||||
<image style="border" draw_type="auto" image="2" text="2"/>
|
||||
<image style="border" draw_type="auto" image="3" text="3"/>
|
||||
<image style="border" draw_type="auto" image="1" text="4"/>
|
||||
<image style="border" draw_type="auto" image="2" text="5"/>
|
||||
<image style="border" draw_type="auto" image="3" text="6"/>
|
||||
<image style="border" draw_type="auto" image="1" text="7"/>
|
||||
<image style="border" draw_type="auto" image="2" text="8"/>
|
||||
<image style="border" draw_type="auto" image="3" text="9"/>
|
||||
<image style="border" draw_type="auto" image="1" text="10"/>
|
||||
<image style="border" draw_type="auto" image="2" text="11"/>
|
||||
<image style="border" draw_type="auto" image="3" text="12"/>
|
||||
<image style="border" draw_type="auto" image="1" text="13"/>
|
||||
<image style="border" draw_type="auto" image="2" text="14"/>
|
||||
<image style="border" draw_type="auto" image="3" text="15"/>
|
||||
<image style="border" draw_type="auto" image="1" text="16"/>
|
||||
<image style="border" draw_type="auto" image="2" text="17"/>
|
||||
<image style="border" draw_type="auto" image="3" text="18"/>
|
||||
</scroll_view>
|
||||
</list_view_h>
|
||||
<button name="close" x="center" y="bottom:10" w="50%" h="30" text="close"/>
|
||||
</window>
|
@ -33,6 +33,7 @@
|
||||
#include "res/inc/ui/keyboard.data"
|
||||
#include "res/inc/ui/list_view.data"
|
||||
#include "res/inc/ui/list_view_d.data"
|
||||
#include "res/inc/ui/list_view_h.data"
|
||||
#include "res/inc/ui/list_view_m.data"
|
||||
#include "res/inc/ui/list_view_vh.data"
|
||||
#include "res/inc/ui/locale.data"
|
||||
@ -291,6 +292,7 @@ ret_t resource_init(void) {
|
||||
resource_manager_add(rm, ui_keyboard);
|
||||
resource_manager_add(rm, ui_list_view);
|
||||
resource_manager_add(rm, ui_list_view_d);
|
||||
resource_manager_add(rm, ui_list_view_h);
|
||||
resource_manager_add(rm, ui_list_view_m);
|
||||
resource_manager_add(rm, ui_list_view_vh);
|
||||
resource_manager_add(rm, ui_locale);
|
||||
|
@ -58,6 +58,7 @@ static const key_type_value_t widget_type_value[] = {
|
||||
{WIDGET_TYPE_SCROLL_BAR_DESKTOP, 0, WIDGET_SCROLL_BAR_DESKTOP},
|
||||
{WIDGET_TYPE_SCROLL_VIEW, 0, WIDGET_SCROLL_VIEW},
|
||||
{WIDGET_TYPE_LIST_VIEW, 0, WIDGET_LIST_VIEW},
|
||||
{WIDGET_TYPE_LIST_VIEW_H, 0, WIDGET_LIST_VIEW_H},
|
||||
{WIDGET_TYPE_LIST_ITEM, 0, WIDGET_LIST_ITEM},
|
||||
{WIDGET_TYPE_DIALOG_CLIENT, 0, WIDGET_DIALOG_CLIENT}};
|
||||
|
||||
|
@ -59,8 +59,8 @@ static ret_t image_on_paint_self(widget_t* widget, canvas_t* c) {
|
||||
dst = rect_init(0, 0, widget->w, widget->h);
|
||||
canvas_draw_image_ex(c, bitmap, image->draw_type, &dst);
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
|
||||
return widget_paint_helper(widget, c, NULL, NULL);
|
||||
}
|
||||
|
||||
static ret_t image_get_prop(widget_t* widget, const char* name, value_t* v) {
|
||||
|
168
src/base/list_view_h.c
Normal file
168
src/base/list_view_h.c
Normal file
@ -0,0 +1,168 @@
|
||||
/**
|
||||
* File: list_view_h.h
|
||||
* Author: AWTK Develop Team
|
||||
* Brief: list_view_h
|
||||
*
|
||||
* Copyright (c) 2018 - 2018 Guangzhou ZHIYUAN Electronics Co.,Ltd.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* License file for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* History:
|
||||
* ================================================================
|
||||
* 2018-07-04 Li XianJing <xianjimli@hotmail.com> created
|
||||
*
|
||||
*/
|
||||
|
||||
#include "base/mem.h"
|
||||
#include "base/utils.h"
|
||||
#include "base/layout.h"
|
||||
#include "base/list_view_h.h"
|
||||
#include "base/scroll_view.h"
|
||||
|
||||
static ret_t list_view_h_on_add_child(widget_t* widget, widget_t* child);
|
||||
|
||||
static ret_t list_view_h_on_paint_self(widget_t* widget, canvas_t* c) {
|
||||
return widget_paint_helper(widget, c, NULL, NULL);
|
||||
}
|
||||
|
||||
static ret_t list_view_h_get_prop(widget_t* widget, const char* name, value_t* v) {
|
||||
list_view_h_t* list_view_h = LIST_VIEW_H(widget);
|
||||
return_value_if_fail(widget != NULL && name != NULL && v != NULL, RET_BAD_PARAMS);
|
||||
|
||||
if (tk_str_eq(name, WIDGET_PROP_ITEM_WIDTH)) {
|
||||
value_set_int(v, list_view_h->item_width);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(name, WIDGET_PROP_SPACING)) {
|
||||
value_set_bool(v, list_view_h->spacing);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
return RET_NOT_FOUND;
|
||||
}
|
||||
|
||||
static ret_t list_view_h_set_prop(widget_t* widget, const char* name, const value_t* v) {
|
||||
list_view_h_t* list_view_h = LIST_VIEW_H(widget);
|
||||
return_value_if_fail(widget != NULL && name != NULL && v != NULL, RET_BAD_PARAMS);
|
||||
|
||||
if (tk_str_eq(name, WIDGET_PROP_ITEM_WIDTH)) {
|
||||
list_view_h->item_width = value_int(v);
|
||||
return RET_OK;
|
||||
} else if (tk_str_eq(name, WIDGET_PROP_SPACING)) {
|
||||
list_view_h->spacing = value_bool(v);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
return RET_NOT_FOUND;
|
||||
}
|
||||
|
||||
static ret_t list_view_h_on_event(widget_t* widget, event_t* e) {
|
||||
uint16_t type = e->type;
|
||||
list_view_h_t* list_view = LIST_VIEW_H(widget);
|
||||
|
||||
switch (type) {
|
||||
case EVT_POINTER_DOWN:
|
||||
widget_layout(list_view->scroll_view);
|
||||
break;
|
||||
case EVT_POINTER_UP:
|
||||
widget_layout(list_view->scroll_view);
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static const widget_vtable_t s_list_view_h_vtable = {.type_name = WIDGET_TYPE_LIST_VIEW_H,
|
||||
.set_prop = list_view_h_set_prop,
|
||||
.get_prop = list_view_h_get_prop,
|
||||
.on_event = list_view_h_on_event,
|
||||
.on_add_child = list_view_h_on_add_child,
|
||||
.on_paint_self = list_view_h_on_paint_self};
|
||||
|
||||
static ret_t list_view_h_on_scroll_view_layout_children(widget_t* widget) {
|
||||
int32_t virtual_w = widget->w;
|
||||
list_view_h_t* list_view_h = LIST_VIEW_H(widget->parent);
|
||||
int32_t spacing = list_view_h->spacing;
|
||||
int32_t item_width = list_view_h->item_width;
|
||||
|
||||
if (widget->children != NULL) {
|
||||
int32_t i = 0;
|
||||
int32_t x = 0;
|
||||
int32_t y = 0;
|
||||
int32_t w = item_width;
|
||||
int32_t h = widget->h;
|
||||
int32_t n = widget->children->size;
|
||||
widget_t** children = (widget_t**)(widget->children->elms);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
widget_t* iter = children[i];
|
||||
|
||||
widget_move_resize(iter, x, y, w, h);
|
||||
widget_layout(iter);
|
||||
|
||||
x = iter->x + iter->w + spacing;
|
||||
}
|
||||
|
||||
if(x > virtual_w) {
|
||||
virtual_w = x;
|
||||
}
|
||||
}
|
||||
|
||||
scroll_view_set_virtual_w(list_view_h->scroll_view, virtual_w);
|
||||
scroll_view_set_xslidable(list_view_h->scroll_view, TRUE);
|
||||
scroll_view_set_yslidable(list_view_h->scroll_view, FALSE);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
static ret_t list_view_h_on_add_child(widget_t* widget, widget_t* child) {
|
||||
list_view_h_t* list_view_h = LIST_VIEW_H(widget);
|
||||
|
||||
if (child->type == WIDGET_SCROLL_VIEW) {
|
||||
scroll_view_t* scroll_view = SCROLL_VIEW(child);
|
||||
|
||||
list_view_h->scroll_view = child;
|
||||
scroll_view->on_layout_children = list_view_h_on_scroll_view_layout_children;
|
||||
}
|
||||
|
||||
return RET_CONTINUE;
|
||||
}
|
||||
|
||||
widget_t* list_view_h_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h) {
|
||||
widget_t* widget = NULL;
|
||||
list_view_h_t* list_view_h = TKMEM_ZALLOC(list_view_h_t);
|
||||
return_value_if_fail(list_view_h != NULL, NULL);
|
||||
|
||||
widget = WIDGET(list_view_h);
|
||||
widget->vt = &s_list_view_h_vtable;
|
||||
widget_init(widget, parent, WIDGET_LIST_VIEW_H);
|
||||
widget_move_resize(widget, x, y, w, h);
|
||||
|
||||
widget_set_state(widget, WIDGET_STATE_NORMAL);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
ret_t list_view_h_set_item_width(widget_t* widget, int32_t item_width) {
|
||||
list_view_h_t* list_view_h = LIST_VIEW_H(widget);
|
||||
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
|
||||
|
||||
list_view_h->item_width = item_width;
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
ret_t list_view_h_set_spacing(widget_t* widget, bool_t spacing) {
|
||||
list_view_h_t* list_view_h = LIST_VIEW_H(widget);
|
||||
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
|
||||
|
||||
list_view_h->spacing = spacing;
|
||||
|
||||
return RET_OK;
|
||||
}
|
102
src/base/list_view_h.h
Normal file
102
src/base/list_view_h.h
Normal file
@ -0,0 +1,102 @@
|
||||
/**
|
||||
* File: list_view_h.h
|
||||
* Author: AWTK Develop Team
|
||||
* Brief: list_view_h
|
||||
*
|
||||
* Copyright (c) 2018 - 2018 Guangzhou ZHIYUAN Electronics Co.,Ltd.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* License file for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* History:
|
||||
* ================================================================
|
||||
* 2018-07-17 Li XianJing <xianjimli@hotmail.com> created
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TK_LIST_VIEW_H_H
|
||||
#define TK_LIST_VIEW_H_H
|
||||
|
||||
#include "base/widget.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* @class list_view_h_t
|
||||
* @parent widget_t
|
||||
* @scriptable
|
||||
* 水平ListView控件。
|
||||
*/
|
||||
typedef struct _list_view_h_t {
|
||||
widget_t widget;
|
||||
/**
|
||||
* @property {int32_t} item_width
|
||||
* @readonly
|
||||
* 列表项的宽度。
|
||||
*/
|
||||
int32_t item_width;
|
||||
/**
|
||||
* @property {int32_t} spacing
|
||||
* @readonly
|
||||
* 间距。
|
||||
*/
|
||||
int32_t spacing;
|
||||
|
||||
/*private*/
|
||||
widget_t* scroll_view;
|
||||
} list_view_h_t;
|
||||
|
||||
/**
|
||||
* @method list_view_h_create
|
||||
* @constructor
|
||||
* 创建list_view_h对象
|
||||
* @param {widget_t*} parent 父控件
|
||||
* @param {xy_t} x x坐标
|
||||
* @param {xy_t} y y坐标
|
||||
* @param {wh_t} w 宽度
|
||||
* @param {wh_t} h 高度
|
||||
*
|
||||
* @return {widget_t*} 对象。
|
||||
*/
|
||||
widget_t* list_view_h_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
||||
|
||||
/**
|
||||
* @method list_view_h_set_item_width
|
||||
* 设置列表项的宽度。
|
||||
* @param {widget_t*} widget 控件对象。
|
||||
* @param {int32_t} item_width 列表项的宽度。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t list_view_h_set_item_width(widget_t* widget, int32_t item_width);
|
||||
|
||||
/**
|
||||
* @method list_view_h_set_margin
|
||||
* 设置列表项的边距。
|
||||
* @param {widget_t*} widget 控件对象。
|
||||
* @param {int32_t} margin 列表项的边距。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t list_view_h_set_margin(widget_t* widget, int32_t margin);
|
||||
|
||||
/**
|
||||
* @method list_view_h_set_spacing
|
||||
* 设置列表项的间距。
|
||||
* @param {widget_t*} widget 控件对象。
|
||||
* @param {int32_t} spacing 列表项的间距。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t list_view_h_set_spacing(widget_t* widget, bool_t spacing);
|
||||
|
||||
#define LIST_VIEW_H(widget) ((list_view_h_t*)(widget))
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /*TK_LIST_VIEW_H_H*/
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "base/mem.h"
|
||||
#include "base/time.h"
|
||||
#include "base/utils.h"
|
||||
#include "base/layout.h"
|
||||
#include "base/velocity.h"
|
||||
@ -155,14 +156,6 @@ ret_t scroll_view_scroll_to(widget_t* widget, int32_t xoffset_end, int32_t yoffs
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
if (scroll_view->wa != NULL) {
|
||||
widget_animator_destroy(scroll_view->wa);
|
||||
scroll_view->wa = NULL;
|
||||
}
|
||||
|
||||
scroll_view->wa = widget_animator_scroll_create(widget, ANIMATING_TIME, 0, EASING_SIN_INOUT);
|
||||
return_value_if_fail(scroll_view->wa != NULL, RET_OOM);
|
||||
|
||||
scroll_view->xoffset_end = xoffset_end;
|
||||
scroll_view->yoffset_end = yoffset_end;
|
||||
if (scroll_view->fix_end_offset) {
|
||||
@ -175,9 +168,31 @@ ret_t scroll_view_scroll_to(widget_t* widget, int32_t xoffset_end, int32_t yoffs
|
||||
scroll_view->on_scroll_to(widget, xoffset_end, yoffset_end, duration);
|
||||
}
|
||||
|
||||
widget_animator_scroll_set_params(scroll_view->wa, xoffset, yoffset, xoffset_end, yoffset_end);
|
||||
widget_animator_on(scroll_view->wa, EVT_ANIM_END, scroll_view_on_scroll_done, scroll_view);
|
||||
widget_animator_start(scroll_view->wa);
|
||||
if (scroll_view->wa != NULL) {
|
||||
widget_animator_scroll_t* wa = (widget_animator_scroll_t*)scroll_view->wa;
|
||||
if(scroll_view->xslidable) {
|
||||
if(wa->x_to > 0 && wa->x_to < (scroll_view->virtual_w - widget->w)) {
|
||||
wa->x_to = xoffset_end;
|
||||
wa->x_from = scroll_view->xoffset;
|
||||
}
|
||||
}
|
||||
|
||||
if(scroll_view->yslidable) {
|
||||
if(wa->y_to > 0 && wa->y_to < (scroll_view->virtual_h - widget->h)) {
|
||||
wa->y_to = yoffset_end;
|
||||
wa->y_from = scroll_view->yoffset;
|
||||
}
|
||||
}
|
||||
|
||||
wa->base.start_time = time_now_ms();
|
||||
} else {
|
||||
scroll_view->wa = widget_animator_scroll_create(widget, ANIMATING_TIME, 0, EASING_SIN_INOUT);
|
||||
return_value_if_fail(scroll_view->wa != NULL, RET_OOM);
|
||||
|
||||
widget_animator_scroll_set_params(scroll_view->wa, xoffset, yoffset, xoffset_end, yoffset_end);
|
||||
widget_animator_on(scroll_view->wa, EVT_ANIM_END, scroll_view_on_scroll_done, scroll_view);
|
||||
widget_animator_start(scroll_view->wa);
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
@ -190,14 +205,25 @@ static ret_t scroll_view_on_pointer_up(scroll_view_t* scroll_view, pointer_event
|
||||
if (scroll_view->xslidable || scroll_view->yslidable) {
|
||||
int yv = v->yv;
|
||||
int xv = v->xv;
|
||||
|
||||
if (scroll_view->wa != NULL) {
|
||||
widget_animator_scroll_t* wa = (widget_animator_scroll_t*)scroll_view->wa;
|
||||
int32_t dx = wa->x_to - scroll_view->xoffset;
|
||||
int32_t dy = wa->y_to - scroll_view->yoffset;
|
||||
xv -= dx;
|
||||
yv -= dy;
|
||||
log_debug("dx=%d xv=%d\n", dx, xv);
|
||||
}
|
||||
|
||||
if (scroll_view->xslidable) {
|
||||
if (scroll_view->xslidable && xv) {
|
||||
xv = xv < 0 ? tk_min(xv, -widget->w) : tk_max(xv, widget->w);
|
||||
scroll_view->xoffset_end = scroll_view->xoffset - xv;
|
||||
} else {
|
||||
scroll_view->xoffset_end = scroll_view->xoffset;
|
||||
}
|
||||
|
||||
if (scroll_view->yslidable) {
|
||||
yv = yv < 0 ? tk_min(yv, -widget->h) : tk_max(yv, widget->h);
|
||||
scroll_view->yoffset_end = scroll_view->yoffset - yv;
|
||||
} else {
|
||||
scroll_view->yoffset_end = scroll_view->yoffset;
|
||||
@ -217,16 +243,18 @@ static ret_t scroll_view_on_pointer_move(scroll_view_t* scroll_view, pointer_eve
|
||||
int32_t dy = e->y - scroll_view->down.y;
|
||||
velocity_update(v, e->e.time, e->x, e->y);
|
||||
|
||||
if (scroll_view->xslidable) {
|
||||
scroll_view->xoffset = scroll_view->xoffset_save - dx;
|
||||
}
|
||||
if(scroll_view->wa == NULL) {
|
||||
if (scroll_view->xslidable) {
|
||||
scroll_view->xoffset = scroll_view->xoffset_save - dx;
|
||||
}
|
||||
|
||||
if (scroll_view->yslidable) {
|
||||
scroll_view->yoffset = scroll_view->yoffset_save - dy;
|
||||
}
|
||||
if (scroll_view->yslidable) {
|
||||
scroll_view->yoffset = scroll_view->yoffset_save - dy;
|
||||
}
|
||||
|
||||
if (scroll_view->on_scroll) {
|
||||
scroll_view->on_scroll(widget, scroll_view->xoffset, scroll_view->yoffset);
|
||||
if (scroll_view->on_scroll) {
|
||||
scroll_view->on_scroll(widget, scroll_view->xoffset, scroll_view->yoffset);
|
||||
}
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
|
@ -42,6 +42,7 @@ BEGIN_C_DECLS
|
||||
#define WIDGET_PROP_STYLE "style"
|
||||
#define WIDGET_PROP_ENABLE "enable"
|
||||
#define WIDGET_PROP_MARGIN "margin"
|
||||
#define WIDGET_PROP_SPACING "spacing"
|
||||
#define WIDGET_PROP_LEFT_MARGIN "left_margin"
|
||||
#define WIDGET_PROP_RIGHT_MARGIN "right_margin"
|
||||
#define WIDGET_PROP_TOP_MARGIN "top_margin"
|
||||
@ -71,6 +72,7 @@ BEGIN_C_DECLS
|
||||
#define WIDGET_PROP_ROW "row"
|
||||
#define WIDGET_PROP_THEME "theme"
|
||||
#define WIDGET_PROP_SCRIPT "script"
|
||||
#define WIDGET_PROP_ITEM_WIDTH "item_width"
|
||||
#define WIDGET_PROP_ITEM_HEIGHT "item_height"
|
||||
#define WIDGET_PROP_DEFAULT_ITEM_HEIGHT "default_item_height"
|
||||
#define WIDGET_PROP_XSLIDABLE "xslidable"
|
||||
@ -113,6 +115,7 @@ BEGIN_C_DECLS
|
||||
#define WIDGET_TYPE_SCROLL_BAR_MOBILE "scroll_bar_m"
|
||||
#define WIDGET_TYPE_SCROLL_VIEW "scroll_view"
|
||||
#define WIDGET_TYPE_LIST_VIEW "list_view"
|
||||
#define WIDGET_TYPE_LIST_VIEW_H "list_view_h"
|
||||
#define WIDGET_TYPE_LIST_ITEM "list_item"
|
||||
|
||||
/**
|
||||
@ -276,6 +279,11 @@ typedef enum _widget_type_t {
|
||||
* List View。
|
||||
*/
|
||||
WIDGET_LIST_VIEW,
|
||||
/**
|
||||
* @const WIDGET_LIST_VIEW_H
|
||||
* List View Horizontal。
|
||||
*/
|
||||
WIDGET_LIST_VIEW_H,
|
||||
/**
|
||||
* @const WIDGET_LIST_ITEM
|
||||
* List Item。
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "base/scroll_view.h"
|
||||
#include "base/list_item.h"
|
||||
#include "base/list_view.h"
|
||||
#include "base/list_view_h.h"
|
||||
#include "base/slide_view.h"
|
||||
#include "base/dialog_title.h"
|
||||
#include "base/dialog_client.h"
|
||||
@ -75,6 +76,7 @@ static const creator_item_t s_builtin_creators[] = {
|
||||
#ifndef WITH_LOW_RES
|
||||
{WIDGET_TYPE_SCROLL_VIEW, scroll_view_create},
|
||||
{WIDGET_TYPE_LIST_VIEW, list_view_create},
|
||||
{WIDGET_TYPE_LIST_VIEW_H, list_view_h_create},
|
||||
{WIDGET_TYPE_LIST_ITEM, list_item_create},
|
||||
{WIDGET_TYPE_SCROLL_BAR, scroll_bar_create},
|
||||
{WIDGET_TYPE_SCROLL_BAR_DESKTOP, scroll_bar_create_desktop},
|
||||
|
@ -133,8 +133,6 @@ ret_t window_manager_open_window(widget_t* widget, widget_t* window) {
|
||||
window_manager_t* wm = WINDOW_MANAGER(widget);
|
||||
return_value_if_fail(widget != NULL && window != NULL, RET_BAD_PARAMS);
|
||||
|
||||
window_manger_layout_child(widget, window);
|
||||
|
||||
if (wm->animator != NULL) {
|
||||
wm->pending_open_window = window;
|
||||
} else {
|
||||
@ -142,6 +140,8 @@ ret_t window_manager_open_window(widget_t* widget, widget_t* window) {
|
||||
}
|
||||
|
||||
ret = widget_add_child(widget, window);
|
||||
window_manger_layout_child(widget, window);
|
||||
|
||||
if (ret == RET_OK) {
|
||||
widget->target = window;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user