Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White ago
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kuxulei
PDF Viewer Scanner White ago
Commits
8217742d
Commit
8217742d
authored
Sep 26, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
8c245b6a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
207 additions
and
258 deletions
+207
-258
ExcelActivity.kt
.../pdfviewerscannerwhite/ui/document/excel/ExcelActivity.kt
+11
-1
MainActivity.kt
...va/com/base/pdfviewerscannerwhite/ui/main/MainActivity.kt
+0
-1
ExcelView.java
.../java/com/cherry/lib/doc/office/ss/control/ExcelView.java
+1
-1
SSControl.java
.../java/com/cherry/lib/doc/office/ss/control/SSControl.java
+188
-255
AEventManage.java
.../com/cherry/lib/doc/office/system/beans/AEventManage.java
+1
-0
bg_test_ss_sheetbar_bg.xml
library/src/main/res/drawable/bg_test_ss_sheetbar_bg.xml
+6
-0
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/excel/ExcelActivity.kt
View file @
8217742d
...
@@ -10,6 +10,7 @@ import android.view.animation.TranslateAnimation
...
@@ -10,6 +10,7 @@ import android.view.animation.TranslateAnimation
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.EditorInfo
import
androidx.activity.addCallback
import
androidx.activity.addCallback
import
androidx.core.widget.addTextChangedListener
import
androidx.core.widget.addTextChangedListener
import
androidx.lifecycle.lifecycleScope
import
com.base.pdfviewerscannerwhite.bean.DocumentBean
import
com.base.pdfviewerscannerwhite.bean.DocumentBean
import
com.base.pdfviewerscannerwhite.databinding.ActivityExcelBinding
import
com.base.pdfviewerscannerwhite.databinding.ActivityExcelBinding
import
com.base.pdfviewerscannerwhite.helper.BaseActivity
import
com.base.pdfviewerscannerwhite.helper.BaseActivity
...
@@ -18,9 +19,13 @@ import com.base.pdfviewerscannerwhite.utils.KeyBoardUtils.hideKeyboard
...
@@ -18,9 +19,13 @@ import com.base.pdfviewerscannerwhite.utils.KeyBoardUtils.hideKeyboard
import
com.base.pdfviewerscannerwhite.utils.KeyBoardUtils.showKeyBoard
import
com.base.pdfviewerscannerwhite.utils.KeyBoardUtils.showKeyBoard
import
com.base.pdfviewerscannerwhite.utils.LogEx
import
com.base.pdfviewerscannerwhite.utils.LogEx
import
com.cherry.lib.doc.bean.DocEngine
import
com.cherry.lib.doc.bean.DocEngine
import
com.cherry.lib.doc.office.constant.EventConstant
import
com.cherry.lib.doc.office.ss.control.SSControl
import
com.cherry.lib.doc.office.ss.control.SSControl
import
com.cherry.lib.doc.office.ss.control.Spreadsheet
import
com.cherry.lib.doc.office.ss.control.Spreadsheet
import
com.cherry.lib.doc.office.ss.sheetbar.SheetBar
import
com.cherry.lib.doc.util.Constant
import
com.cherry.lib.doc.util.Constant
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
java.io.File
import
java.io.File
class
ExcelActivity
:
BaseActivity
<
ActivityExcelBinding
>()
{
class
ExcelActivity
:
BaseActivity
<
ActivityExcelBinding
>()
{
...
@@ -114,7 +119,12 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
...
@@ -114,7 +119,12 @@ class ExcelActivity : BaseActivity<ActivityExcelBinding>() {
binding
.
flNext
.
setOnClickListener
{
binding
.
flNext
.
setOnClickListener
{
getSpreadsheet
().
findForward
()
getSpreadsheet
().
findForward
()
}
}
lifecycleScope
.
launch
{
delay
(
3000
)
val
ssControl
:
SSControl
=
(
binding
.
mDocView
.
iOffice
?.
control
?.
appControl
as
SSControl
)
val
sheetBar
:
SheetBar
=
ssControl
.
excelView
.
bar
ssControl
.
actionEvent
(
EventConstant
.
SS_SHOW_SHEET
,
0
)
}
}
}
private
fun
getSpreadsheet
():
Spreadsheet
{
private
fun
getSpreadsheet
():
Spreadsheet
{
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/main/MainActivity.kt
View file @
8217742d
...
@@ -93,7 +93,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), MainView {
...
@@ -93,7 +93,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), MainView {
showStoragePermission
(
launcher
)
showStoragePermission
(
launcher
)
updateMediaStore
()
updateMediaStore
()
}
}
}
}
private
fun
initTabLayout
()
{
private
fun
initTabLayout
()
{
...
...
library/src/main/java/com/cherry/lib/doc/office/ss/control/ExcelView.java
View file @
8217742d
...
@@ -185,7 +185,7 @@ public class ExcelView extends RelativeLayout
...
@@ -185,7 +185,7 @@ public class ExcelView extends RelativeLayout
//
//
private
Spreadsheet
ss
;
private
Spreadsheet
ss
;
//
//
p
rivate
SheetBar
bar
;
p
ublic
SheetBar
bar
;
//
//
private
IControl
control
;
private
IControl
control
;
...
...
library/src/main/java/com/cherry/lib/doc/office/ss/control/SSControl.java
View file @
8217742d
/*
/*
* 文件名称: SSControl.java
* 文件名称: SSControl.java
*
*
* 编译器: android2.2
* 编译器: android2.2
* 时间: 下午3:49:55
* 时间: 下午3:49:55
*/
*/
...
@@ -46,19 +46,16 @@ import org.jetbrains.annotations.Nullable;
...
@@ -46,19 +46,16 @@ import org.jetbrains.annotations.Nullable;
* <p>
* <p>
* 负责人: ljj8494
* 负责人: ljj8494
* <p>
* <p>
* 负责小组:
* 负责小组:
* <p>
* <p>
* <p>
* <p>
*/
*/
public
class
SSControl
extends
AbstractControl
public
class
SSControl
extends
AbstractControl
{
{
/**
/**
*
* @param
* @param
* @param filepath
* @param filepath
*/
*/
public
SSControl
(
IControl
mainControl
,
Workbook
book
,
String
filepath
)
public
SSControl
(
IControl
mainControl
,
Workbook
book
,
String
filepath
)
{
{
this
.
mainControl
=
mainControl
;
this
.
mainControl
=
mainControl
;
this
.
excelView
=
new
ExcelView
(
getMainFrame
().
getActivity
(),
filepath
,
book
,
this
);
this
.
excelView
=
new
ExcelView
(
getMainFrame
().
getActivity
(),
filepath
,
book
,
this
);
this
.
spreadSheet
=
excelView
.
getSpreadsheet
();
this
.
spreadSheet
=
excelView
.
getSpreadsheet
();
...
@@ -66,473 +63,409 @@ public class SSControl extends AbstractControl
...
@@ -66,473 +63,409 @@ public class SSControl extends AbstractControl
/**
/**
* 布局视图
* 布局视图
*
* @param x
* @param x
* @param y
* @param y
* @param w
* @param w
* @param h
* @param h
*/
*/
public
void
layoutView
(
int
x
,
int
y
,
int
w
,
int
h
)
public
void
layoutView
(
int
x
,
int
y
,
int
w
,
int
h
)
{
{
}
}
/**
/**
* action派发
* action派发
* @param actionID 动作ID
*
* @param obj 动作ID的Value
* @param actionID 动作ID
* @param obj 动作ID的Value
*/
*/
public
void
actionEvent
(
int
actionID
,
final
@Nullable
Object
obj
)
public
void
actionEvent
(
int
actionID
,
final
@Nullable
Object
obj
)
{
{
Intent
intent
;
Intent
intent
;
switch
(
actionID
)
switch
(
actionID
)
{
{
case
EventConstant
.
SYS_SET_PROGRESS_BAR_ID
:
case
EventConstant
.
SYS_SET_PROGRESS_BAR_ID
:
if
(
spreadSheet
.
getParent
()
!=
null
)
if
(
spreadSheet
.
getParent
()
!=
null
)
{
{
spreadSheet
.
post
(
new
Runnable
()
{
spreadSheet
.
post
(
new
Runnable
()
{
/**
/**
*
*
*/
*/
public
void
run
()
public
void
run
()
{
{
if
(!
isDispose
)
{
if
(!
isDispose
)
{
//getActivity().setProgressBarIndeterminateVisibility((Boolean)obj);
//getActivity().setProgressBarIndeterminateVisibility((Boolean)obj);
mainControl
.
getMainFrame
().
showProgressBar
((
Boolean
)
obj
);
mainControl
.
getMainFrame
().
showProgressBar
((
Boolean
)
obj
);
}
}
}
}
});
});
}
}
break
;
break
;
case
EventConstant
.
SYS_VECTORGRAPH_PROGRESS
:
case
EventConstant
.
SYS_VECTORGRAPH_PROGRESS
:
if
(
spreadSheet
.
getParent
()
!=
null
)
if
(
spreadSheet
.
getParent
()
!=
null
)
{
{
spreadSheet
.
post
(
new
Runnable
()
{
spreadSheet
.
post
(
new
Runnable
()
{
/**
/**
*
*
*/
*/
public
void
run
()
public
void
run
()
{
{
if
(!
isDispose
)
{
if
(!
isDispose
)
mainControl
.
getMainFrame
().
updateViewImages
((
List
<
Integer
>)
obj
);
{
mainControl
.
getMainFrame
().
updateViewImages
((
List
<
Integer
>)
obj
);
}
}
}
}
});
});
}
}
else
{
else
new
Thread
()
{
{
/**
new
Thread
()
*
{
*/
/**
public
void
run
()
{
*
if
(!
isDispose
)
{
*/
mainControl
.
getMainFrame
().
updateViewImages
((
List
<
Integer
>)
obj
);
public
void
run
()
}
{
}
if
(!
isDispose
)
}.
start
();
{
}
mainControl
.
getMainFrame
().
updateViewImages
((
List
<
Integer
>)
obj
);
break
;
}
}
}.
start
();
}
break
;
case
EventConstant
.
SYS_INIT_ID
:
case
EventConstant
.
SYS_INIT_ID
:
excelView
.
init
();
excelView
.
init
();
break
;
break
;
case
EventConstant
.
SS_SHOW_SHEET
:
case
EventConstant
.
SS_SHOW_SHEET
:
excelView
.
showSheet
((
Integer
)
obj
);
excelView
.
showSheet
((
Integer
)
obj
);
break
;
break
;
case
EventConstant
.
TEST_REPAINT_ID
:
case
EventConstant
.
TEST_REPAINT_ID
:
spreadSheet
.
postInvalidate
();
spreadSheet
.
postInvalidate
();
break
;
break
;
case
EventConstant
.
SS_SHEET_CHANGE
:
case
EventConstant
.
SS_SHEET_CHANGE
:
// getMainFrame().getActivity().setTitle((String)obj);
// getMainFrame().getActivity().setTitle((String)obj);
break
;
break
;
case
EventConstant
.
APP_ZOOM_ID
:
case
EventConstant
.
APP_ZOOM_ID
:
int
[]
params
=
(
int
[])
obj
;
int
[]
params
=
(
int
[])
obj
;
spreadSheet
.
setZoom
(
params
[
0
]
/
(
float
)
MainConstant
.
STANDARD_RATE
);
//zoom
spreadSheet
.
setZoom
(
params
[
0
]
/
(
float
)
MainConstant
.
STANDARD_RATE
);
//zoom
spreadSheet
.
post
(
new
Runnable
()
spreadSheet
.
post
(
new
Runnable
()
{
{
@Override
@
Override
public
void
run
()
{
public
void
run
()
if
(!
isDispose
)
{
{
if
(!
isDispose
)
{
getMainFrame
().
changeZoom
();
getMainFrame
().
changeZoom
();
updateStatus
();
updateStatus
();
}
}
}
}
});
});
break
;
break
;
case
EventConstant
.
APP_CONTENT_SELECTED
:
case
EventConstant
.
APP_CONTENT_SELECTED
:
updateStatus
();
updateStatus
();
break
;
break
;
case
EventConstant
.
FILE_COPY_ID
:
//copy
case
EventConstant
.
FILE_COPY_ID
:
//copy
ClipboardManager
clip
=
(
ClipboardManager
)
getMainFrame
().
getActivity
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
ClipboardManager
clip
=
(
ClipboardManager
)
getMainFrame
().
getActivity
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
clip
.
setText
(
spreadSheet
.
getActiveCellContent
());
clip
.
setText
(
spreadSheet
.
getActiveCellContent
());
break
;
break
;
case
EventConstant
.
APP_HYPERLINK
:
//hyperlink
case
EventConstant
.
APP_HYPERLINK
:
//hyperlink
Hyperlink
hyperlink
=
spreadSheet
.
getActiveCellHyperlink
();
Hyperlink
hyperlink
=
spreadSheet
.
getActiveCellHyperlink
();
if
(
hyperlink
!=
null
)
if
(
hyperlink
!=
null
)
{
{
try
{
try
if
(
hyperlink
.
getLinkType
()
==
Hyperlink
.
LINK_DOCUMENT
)
{
{
if
(
hyperlink
.
getLinkType
()
==
Hyperlink
.
LINK_DOCUMENT
)
{
String
addr
=
hyperlink
.
getAddress
();
String
addr
=
hyperlink
.
getAddress
();
int
index
=
addr
.
indexOf
(
"!"
);
int
index
=
addr
.
indexOf
(
"!"
);
String
sheetName
=
addr
.
substring
(
0
,
index
).
replace
(
"'"
,
""
);
String
sheetName
=
addr
.
substring
(
0
,
index
).
replace
(
"'"
,
""
);
String
ref
=
addr
.
substring
(
index
+
1
,
addr
.
length
());
String
ref
=
addr
.
substring
(
index
+
1
,
addr
.
length
());
int
rowIndex
=
ReferenceUtil
.
instance
().
getRowIndex
(
ref
);
int
rowIndex
=
ReferenceUtil
.
instance
().
getRowIndex
(
ref
);
int
columnIndex
=
ReferenceUtil
.
instance
().
getColumnIndex
(
ref
);
int
columnIndex
=
ReferenceUtil
.
instance
().
getColumnIndex
(
ref
);
Sheet
sheet
=
spreadSheet
.
getWorkbook
().
getSheet
(
sheetName
);
Sheet
sheet
=
spreadSheet
.
getWorkbook
().
getSheet
(
sheetName
);
sheet
.
setActiveCellRowCol
(
rowIndex
,
columnIndex
);
sheet
.
setActiveCellRowCol
(
rowIndex
,
columnIndex
);
excelView
.
showSheet
(
sheetName
);
excelView
.
showSheet
(
sheetName
);
rowIndex
-=
1
;
rowIndex
-=
1
;
columnIndex
-=
1
;
columnIndex
-=
1
;
spreadSheet
.
getSheetView
().
goToCell
(
rowIndex
>=
0
?
rowIndex
:
0
,
columnIndex
>=
0
?
columnIndex
:
0
);
spreadSheet
.
getSheetView
().
goToCell
(
rowIndex
>=
0
?
rowIndex
:
0
,
columnIndex
>=
0
?
columnIndex
:
0
);
getMainFrame
().
doActionEvent
(
EventConstant
.
SYS_UPDATE_TOOLSBAR_BUTTON_STATUS
,
null
);
getMainFrame
().
doActionEvent
(
EventConstant
.
SYS_UPDATE_TOOLSBAR_BUTTON_STATUS
,
null
);
spreadSheet
.
postInvalidate
();
spreadSheet
.
postInvalidate
();
}
}
else
if
(
hyperlink
.
getLinkType
()
==
Hyperlink
.
LINK_EMAIL
else
if
(
hyperlink
.
getLinkType
()
==
Hyperlink
.
LINK_EMAIL
||
hyperlink
.
getLinkType
()
==
Hyperlink
.
LINK_URL
)
{
||
hyperlink
.
getLinkType
()
==
Hyperlink
.
LINK_URL
)
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
{
Uri
.
parse
(
hyperlink
.
getAddress
()));
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
hyperlink
.
getAddress
()));
getMainFrame
().
getActivity
().
startActivity
(
intent
);
getMainFrame
().
getActivity
().
startActivity
(
intent
);
}
}
else
{
else
{
//file hyperlink
//file hyperlink
mainControl
.
actionEvent
(
EventConstant
.
SYS_SHOW_TOOLTIP
,
"not supported hyperlink!"
);
mainControl
.
actionEvent
(
EventConstant
.
SYS_SHOW_TOOLTIP
,
"not supported hyperlink!"
);
}
}
}
catch
(
Exception
e
)
{
}
}
catch
(
Exception
e
)
}
{
}
}
break
;
break
;
case
EventConstant
.
APP_INTERNET_SEARCH_ID
:
//internet search
case
EventConstant
.
APP_INTERNET_SEARCH_ID
:
//internet search
getSysKit
().
internetSearch
(
spreadSheet
.
getActiveCellContent
(),
getMainFrame
().
getActivity
());
getSysKit
().
internetSearch
(
spreadSheet
.
getActiveCellContent
(),
getMainFrame
().
getActivity
());
break
;
break
;
case
EventConstant
.
SYS_AUTO_TEST_FINISH_ID
:
// 布局完成
case
EventConstant
.
SYS_AUTO_TEST_FINISH_ID
:
// 布局完成
if
(
mainControl
.
isAutoTest
())
if
(
mainControl
.
isAutoTest
())
{
{
getMainFrame
().
getActivity
().
onBackPressed
();
getMainFrame
().
getActivity
().
onBackPressed
();
}
}
break
;
break
;
case
EventConstant
.
APP_GENERATED_PICTURE_ID
:
case
EventConstant
.
APP_GENERATED_PICTURE_ID
:
exportImage
();
exportImage
();
break
;
break
;
case
EventConstant
.
APP_ABORTREADING
:
case
EventConstant
.
APP_ABORTREADING
:
if
(
mainControl
.
getReader
()
!=
null
)
if
(
mainControl
.
getReader
()
!=
null
)
{
{
mainControl
.
getReader
().
abortReader
();
mainControl
.
getReader
().
abortReader
();
}
}
break
;
break
;
case
EventConstant
.
APP_PAGE_UP_ID
:
case
EventConstant
.
APP_PAGE_UP_ID
:
if
(
spreadSheet
.
getEventManage
()
!=
null
)
if
(
spreadSheet
.
getEventManage
()
!=
null
)
{
{
spreadSheet
.
getEventManage
().
onScroll
(
null
,
null
,
0
,
-
spreadSheet
.
getHeight
()
+
10
);
spreadSheet
.
getEventManage
().
onScroll
(
null
,
null
,
0
,
-
spreadSheet
.
getHeight
()
+
10
);
exportImage
();
exportImage
();
spreadSheet
.
post
(
new
Runnable
()
spreadSheet
.
post
(
new
Runnable
()
{
{
@Override
@
Override
public
void
run
()
{
public
void
run
()
if
(!
isDispose
)
{
{
if
(!
isDispose
)
{
updateStatus
();
updateStatus
();
}
}
}
}
});
});
}
}
break
;
break
;
case
EventConstant
.
APP_PAGE_DOWN_ID
:
case
EventConstant
.
APP_PAGE_DOWN_ID
:
if
(
spreadSheet
.
getEventManage
()
!=
null
)
if
(
spreadSheet
.
getEventManage
()
!=
null
)
{
{
spreadSheet
.
getEventManage
().
onScroll
(
null
,
null
,
0
,
spreadSheet
.
getHeight
()
-
10
);
spreadSheet
.
getEventManage
().
onScroll
(
null
,
null
,
0
,
spreadSheet
.
getHeight
()
-
10
);
exportImage
();
exportImage
();
spreadSheet
.
post
(
new
Runnable
()
spreadSheet
.
post
(
new
Runnable
()
{
{
@Override
@
Override
public
void
run
()
{
public
void
run
()
if
(!
isDispose
)
{
{
if
(!
isDispose
)
{
updateStatus
();
updateStatus
();
}
}
}
}
});
});
}
}
break
;
break
;
case
EventConstant
.
SS_REMOVE_SHEET_BAR
:
case
EventConstant
.
SS_REMOVE_SHEET_BAR
:
//spreadSheet.removeSheetBar();
//spreadSheet.removeSheetBar();
excelView
.
removeSheetBar
();
excelView
.
removeSheetBar
();
break
;
break
;
case
EventConstant
.
APP_INIT_CALLOUTVIEW_ID
:
case
EventConstant
.
APP_INIT_CALLOUTVIEW_ID
:
spreadSheet
.
initCalloutView
();
spreadSheet
.
initCalloutView
();
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
/**
/**
* 得到action的状态
* 得到action的状态
*
*
* @return obj
* @return obj
*/
*/
public
@Nullable
Object
getActionValue
(
int
actionID
,
@Nullable
Object
obj
)
public
@Nullable
Object
getActionValue
(
int
actionID
,
@Nullable
Object
obj
)
{
{
switch
(
actionID
)
{
switch
(
actionID
)
{
case
EventConstant
.
APP_ZOOM_ID
:
case
EventConstant
.
APP_ZOOM_ID
:
return
spreadSheet
.
getZoom
();
return
spreadSheet
.
getZoom
();
case
EventConstant
.
APP_FIT_ZOOM_ID
:
case
EventConstant
.
APP_FIT_ZOOM_ID
:
return
spreadSheet
.
getFitZoom
();
return
spreadSheet
.
getFitZoom
();
case
EventConstant
.
APP_COUNT_PAGES_ID
:
case
EventConstant
.
APP_COUNT_PAGES_ID
:
return
spreadSheet
.
getSheetCount
();
return
spreadSheet
.
getSheetCount
();
case
EventConstant
.
APP_CURRENT_PAGE_NUMBER_ID
:
case
EventConstant
.
APP_CURRENT_PAGE_NUMBER_ID
:
return
spreadSheet
.
getCurrentSheetNumber
();
return
spreadSheet
.
getCurrentSheetNumber
();
case
EventConstant
.
SS_GET_ALL_SHEET_NAME
:
case
EventConstant
.
SS_GET_ALL_SHEET_NAME
:
Vector
<
String
>
vec
=
new
Vector
<
String
>();
Vector
<
String
>
vec
=
new
Vector
<
String
>();
Workbook
book
=
spreadSheet
.
getWorkbook
();
Workbook
book
=
spreadSheet
.
getWorkbook
();
int
cnt
=
book
.
getSheetCount
();
int
cnt
=
book
.
getSheetCount
();
for
(
int
i
=
0
;
i
<
cnt
;
i
++)
for
(
int
i
=
0
;
i
<
cnt
;
i
++)
{
{
vec
.
add
(
book
.
getSheet
(
i
).
getSheetName
());
vec
.
add
(
book
.
getSheet
(
i
).
getSheetName
());
}
}
return
vec
;
return
vec
;
case
EventConstant
.
SS_GET_SHEET_NAME
:
case
EventConstant
.
SS_GET_SHEET_NAME
:
int
number
=
(
Integer
)
obj
;
int
number
=
(
Integer
)
obj
;
if
(
number
==
-
1
)
if
(
number
==
-
1
)
{
{
return
null
;
return
null
;
}
}
Sheet
sheet
=
spreadSheet
.
getWorkbook
().
getSheet
(
number
-
1
);
Sheet
sheet
=
spreadSheet
.
getWorkbook
().
getSheet
(
number
-
1
);
if
(
sheet
!=
null
)
{
if
(
sheet
!=
null
)
return
sheet
.
getSheetName
();
{
}
return
sheet
.
getSheetName
();
return
null
;
}
return
null
;
case
EventConstant
.
APP_THUMBNAIL_ID
:
case
EventConstant
.
APP_THUMBNAIL_ID
:
if
(
obj
instanceof
int
[])
if
(
obj
instanceof
int
[])
{
{
int
[]
paraArr
=
(
int
[])
obj
;
int
[]
paraArr
=
(
int
[])
obj
;
if
(
paraArr
!=
null
&&
paraArr
.
length
==
3
)
{
if
(
paraArr
!=
null
&&
paraArr
.
length
==
3
)
return
spreadSheet
.
getThumbnail
(
paraArr
[
0
],
paraArr
[
1
],
paraArr
[
2
]
/
(
float
)
MainConstant
.
STANDARD_RATE
);
{
return
spreadSheet
.
getThumbnail
(
paraArr
[
0
],
paraArr
[
1
],
paraArr
[
2
]
/
(
float
)
MainConstant
.
STANDARD_RATE
);
}
}
}
}
case
EventConstant
.
APP_GET_SNAPSHOT_ID
:
case
EventConstant
.
APP_GET_SNAPSHOT_ID
:
if
(
spreadSheet
!=
null
)
if
(
spreadSheet
!=
null
)
{
{
return
spreadSheet
.
getSnapshot
((
Bitmap
)
obj
);
return
spreadSheet
.
getSnapshot
((
Bitmap
)
obj
);
}
}
break
;
break
;
default
:
default
:
break
;
break
;
}
}
return
null
;
return
null
;
}
}
/**
/**
*
*
*/
*/
private
void
updateStatus
()
private
void
updateStatus
()
{
{
spreadSheet
.
post
(
new
Runnable
()
{
spreadSheet
.
post
(
new
Runnable
()
public
void
run
()
{
{
if
(!
isDispose
)
{
public
void
run
()
{
if
(!
isDispose
)
{
getMainFrame
().
updateToolsbarStatus
();
getMainFrame
().
updateToolsbarStatus
();
}
}
}
}
});
});
}
}
/**
/**
*
*
*/
*/
private
void
exportImage
()
private
void
exportImage
()
{
{
spreadSheet
.
post
(
new
Runnable
()
{
spreadSheet
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
@
Override
if
(!
isDispose
)
{
public
void
run
()
{
if
(!
isDispose
)
{
spreadSheet
.
createPicture
();
spreadSheet
.
createPicture
();
}
}
}
}
});
});
}
}
/**
/**
* current view index
* current view index
*
* @return
* @return
*/
*/
public
int
getCurrentViewIndex
()
public
int
getCurrentViewIndex
()
{
{
return
excelView
.
getCurrentViewIndex
();
return
excelView
.
getCurrentViewIndex
();
}
}
/**
/**
* 获取应用组件
* 获取应用组件
*/
*/
public
View
getView
()
public
View
getView
()
{
{
return
excelView
;
return
excelView
;
}
}
/**
/**
*
*
*/
*/
public
Dialog
getDialog
(
Activity
activity
,
int
id
)
public
Dialog
getDialog
(
Activity
activity
,
int
id
)
{
{
return
null
;
return
null
;
}
}
/**
/**
*
*
*/
*/
public
IMainFrame
getMainFrame
()
public
IMainFrame
getMainFrame
()
{
{
return
mainControl
.
getMainFrame
();
return
mainControl
.
getMainFrame
();
}
}
/**
/**
*
* (non-Javadoc)
*(non-Javadoc)
* @see com.cherry.lib.doc.office.system.AbstractControl#getActivity()
*
*
* @see com.cherry.lib.doc.office.system.AbstractControl#getActivity()
*/
*/
public
Activity
getActivity
()
public
Activity
getActivity
()
{
{
return
mainControl
.
getMainFrame
().
getActivity
();
return
mainControl
.
getMainFrame
().
getActivity
();
}
}
/**
/**
*
*
*/
*/
public
IFind
getFind
()
public
IFind
getFind
()
{
{
return
spreadSheet
;
return
spreadSheet
;
}
}
/**
/**
*
*
*/
*/
public
boolean
isAutoTest
()
public
boolean
isAutoTest
()
{
{
return
mainControl
.
isAutoTest
();
return
mainControl
.
isAutoTest
();
}
}
/**
/**
*
*
*/
*/
public
IOfficeToPicture
getOfficeToPicture
()
public
IOfficeToPicture
getOfficeToPicture
()
{
{
return
mainControl
.
getOfficeToPicture
();
return
mainControl
.
getOfficeToPicture
();
}
}
/**
/**
*
*
*/
*/
public
ICustomDialog
getCustomDialog
()
public
ICustomDialog
getCustomDialog
()
{
{
return
mainControl
.
getCustomDialog
();
return
mainControl
.
getCustomDialog
();
}
}
/**
/**
*
*
*
*/
*/
public
int
getApplicationType
()
public
int
getApplicationType
()
{
{
return
MainConstant
.
APPLICATION_TYPE_SS
;
return
MainConstant
.
APPLICATION_TYPE_SS
;
}
}
/**
/**
*
*/
*/
public
SysKit
getSysKit
()
public
SysKit
getSysKit
()
{
{
return
mainControl
.
getSysKit
();
return
mainControl
.
getSysKit
();
}
}
/**
/**
* 释放内存
* 释放内存
*/
*/
public
void
dispose
()
public
void
dispose
()
{
{
isDispose
=
true
;
isDispose
=
true
;
mainControl
=
null
;
mainControl
=
null
;
spreadSheet
=
null
;
spreadSheet
=
null
;
/*if(spreadSheet != null)
/*if(spreadSheet != null)
{
{
spreadSheet.dispose();
spreadSheet.dispose();
spreadSheet = null;
spreadSheet = null;
}*/
}*/
if
(
excelView
==
null
)
if
(
excelView
==
null
)
{
{
excelView
.
dispose
();
excelView
.
dispose
();
excelView
=
null
;
excelView
=
null
;
}
}
}
}
//
//
private
IControl
mainControl
;
private
IControl
mainControl
;
//
//
private
boolean
isDispose
;
private
boolean
isDispose
;
//
//
p
rivate
Spreadsheet
spreadSheet
;
p
ublic
Spreadsheet
spreadSheet
;
//
//
p
rivate
ExcelView
excelView
;
p
ublic
ExcelView
excelView
;
}
}
library/src/main/java/com/cherry/lib/doc/office/system/beans/AEventManage.java
View file @
8217742d
...
@@ -10,6 +10,7 @@ import com.cherry.lib.doc.office.constant.EventConstant;
...
@@ -10,6 +10,7 @@ import com.cherry.lib.doc.office.constant.EventConstant;
import
com.cherry.lib.doc.office.constant.MainConstant
;
import
com.cherry.lib.doc.office.constant.MainConstant
;
import
com.cherry.lib.doc.office.system.IControl
;
import
com.cherry.lib.doc.office.system.IControl
;
import
com.cherry.lib.doc.office.system.IMainFrame
;
import
com.cherry.lib.doc.office.system.IMainFrame
;
import
android.content.Context
;
import
android.content.Context
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.GestureDetector
;
import
android.view.GestureDetector
;
...
...
library/src/main/res/drawable/bg_test_ss_sheetbar_bg.xml
0 → 100644
View file @
8217742d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#FAA9A7"
/>
<corners
android:radius=
"15dp"
/>
</shape>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment