moeidy cmake/options ..,add edit_text assets

This commit is contained in:
侯歌 2022-02-21 16:30:34 +08:00
parent 3430daf582
commit 86c1c7478b
12 changed files with 79 additions and 25 deletions

View File

@ -31,3 +31,6 @@ function(Translate pofile transtopath)
COMMENT "Translate strings resource...${PROJECT_BINARY_DIR}"
)
endfunction()
option(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" OFF)
option(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" OFF)

View File

@ -1,8 +1,8 @@
option(MINIMAL_SIZE_OPTIMIZED "For IOT/Embedded size optimize" ON)
option(MINIMAL_SIZE_OPTIMIZED "For IOT/Embedded size optimize" OFF)
option(BUILD_DOCS "Build documents" OFF)
option(BUILD_EXAMPLES "Build examples" OFF)
option(BUILD_TESTS "Build unit tests" OFF)
option(BUILD_CDROID_TESTS "Build unit tests" ON)
option(ENABLE_GIF "enable gif encode and decoder" OFF)
option(ENABLE_CAIROSVG "enable svg decoder" OFF)

View File

@ -655,3 +655,6 @@ install(TARGETS cairo_static RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIB
install(FILES ${enabled_cairo_headers} DESTINATION include/cairo)
install(FILES ../cairo-version.h DESTINATION include/cairo)
install(FILES ${PROJECT_BINARY_DIR}/cairo-features.h DESTINATION include/cairo)
file(COPY ../cairo-version.h ${enabled_cairo_headers} ${PROJECT_BINARY_DIR}/cairo-features.h
DESTINATION ${CMAKE_BINARY_DIR}/include/cairo)

View File

@ -294,8 +294,7 @@ Drawable* Assets::getDrawable(const std::string&fullresid){
if(TextUtils::startWith(resname,"attr")){//for reference resource
resname = mTheme.getString(resname.substr(5));
d=getDrawable(resname);
LOG(DEBUG)<<fullresid<<"="<<resname<<" d="<<d;
d=getDrawable(resname);
}else if(TextUtils::endWith(resname,".9.png")){
d=new NinePatchDrawable(this,fullresid);
}else if (TextUtils::endWith(resname,".png")||TextUtils::endWith(resname,".jpg")){

View File

@ -202,7 +202,7 @@ InputMethodManager&InputMethodManager::getInstance(){
mInst->setKeyCharacterMap("qwerty.kcm");
}
if(imemethods.size()==0){
InputMethod*m=new InputMethod("cdroid:xml/qwerty.xml");
InputMethod*m=new InputMethod("cdroid:values/qwerty.xml");
m->load_dicts("dict_pinyin.dat","userdict.dat");
registeMethod("ChinesePinyin26",m);
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:cdroid="http://schemas.android.com/apk/res/android">
<item cdroid:state_multiline="true" cdroid:state_window_focused="false" cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_default_holo_dark" />
<item cdroid:state_multiline="true" cdroid:state_window_focused="false" cdroid:state_enabled="false" cdroid:drawable="@cdroid:mipmap/textfield_multiline_disabled_holo_dark" />
<item cdroid:state_multiline="true" cdroid:state_enabled="true" cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_activated_holo_dark" />
<item cdroid:state_multiline="true" cdroid:state_enabled="true" cdroid:state_activated="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_focused_holo_dark" />
<item cdroid:state_multiline="true" cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_default_holo_dark" />
<item cdroid:state_multiline="true" cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_disabled_focused_holo_dark" />
<item cdroid:state_multiline="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_disabled_holo_dark" />
<item cdroid:state_window_focused="false" cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_default_holo_dark" />
<item cdroid:state_window_focused="false" cdroid:state_enabled="false" cdroid:drawable="@cdroid:mipmap/textfield_disabled_holo_dark" />
<item cdroid:state_enabled="true" cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_activated_holo_dark" />
<item cdroid:state_enabled="true" cdroid:state_activated="true" cdroid:drawable="@cdroid:mipmap/textfield_focused_holo_dark" />
<item cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_default_holo_dark" />
<item cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_disabled_focused_holo_dark" />
<item cdroid:drawable="@cdroid:mipmap/textfield_disabled_holo_dark" />
</selector>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:cdroid="http://schemas.android.com/apk/res/android">
<item cdroid:state_multiline="true" cdroid:state_window_focused="false" cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_default_holo_light" />
<item cdroid:state_multiline="true" cdroid:state_window_focused="false" cdroid:state_enabled="false" cdroid:drawable="@cdroid:mipmap/textfield_multiline_disabled_holo_light" />
<item cdroid:state_multiline="true" cdroid:state_enabled="true" cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_activated_holo_light" />
<item cdroid:state_multiline="true" cdroid:state_enabled="true" cdroid:state_activated="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_focused_holo_light" />
<item cdroid:state_multiline="true" cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_default_holo_light" />
<item cdroid:state_multiline="true" cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_disabled_focused_holo_light" />
<item cdroid:state_multiline="true" cdroid:drawable="@cdroid:mipmap/textfield_multiline_disabled_holo_light" />
<item cdroid:state_window_focused="false" cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_default_holo_light" />
<item cdroid:state_window_focused="false" cdroid:state_enabled="false" cdroid:drawable="@cdroid:mipmap/textfield_disabled_holo_light" />
<item cdroid:state_enabled="true" cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_activated_holo_light" />
<item cdroid:state_enabled="true" cdroid:state_activated="true" cdroid:drawable="@cdroid:mipmap/textfield_focused_holo_light" />
<item cdroid:state_enabled="true" cdroid:drawable="@cdroid:mipmap/textfield_default_holo_light" />
<item cdroid:state_focused="true" cdroid:drawable="@cdroid:mipmap/textfield_disabled_focused_holo_light" />
<item cdroid:drawable="@cdroid:mipmap/textfield_disabled_holo_light" />
</selector>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
<Keyboard xmlns:cdroid="http://schemas.android.com/apk/res/android"
keyWidth="10%p"
horizontalGap="2%p"
verticalGap="5%p"
horizontalGap="0.5%"
verticalGap="1%"
keyHeight="20%p"
>
<Row>

View File

@ -255,9 +255,9 @@
<item name="focusable">true</item>
<item name="focusableInTouchMode">true</item>
<item name="clickable">true</item>
<item name="background">?attr/editTextBackground</item>
<item name="textAppearance">?attr/textAppearanceMediumInverse</item>
<item name="textColor">?attr/editTextColor</item>
<item name="background">?cdroid:attr/editTextBackground</item>
<item name="textAppearance">?cdroid:attr/textAppearanceMediumInverse</item>
<item name="textColor">?cdroid:attr/editTextColor</item>
<item name="gravity">center_vertical</item>
<item name="breakStrategy">simple</item>
<item name="hyphenationFrequency">normal</item>
@ -266,9 +266,9 @@
<style name="Widget.ExpandableListView" parent="Widget.ListView">
<item name="groupIndicator">@drawable/expander_group</item>
<item name="indicatorLeft">?attr/expandableListPreferredItemIndicatorLeft</item>
<item name="indicatorRight">?attr/expandableListPreferredItemIndicatorRight</item>
<item name="childDivider">@drawable/divider_horizontal_dark_opaque</item>
<item name="indicatorLeft">?cdroid:attr/expandableListPreferredItemIndicatorLeft</item>
<item name="indicatorRight">?cdroid:attr/expandableListPreferredItemIndicatorRight</item>
<item name="childDivider">@cdroid:drawable/divider_horizontal_dark_opaque</item>
</style>
<style name="Widget.ExpandableListView.White">

View File

@ -122,8 +122,8 @@ please see themes_device_defaults.xml.
<item name="textAppearanceButton">@style/TextAppearance.Holo.Widget.Button</item>
<item name="editTextColor">?attr/textColorPrimary</item>
<item name="editTextBackground">@drawable/edit_text_holo_dark</item>
<item name="editTextColor">?cdroid:attr/textColorPrimary</item>
<item name="editTextBackground">@cdroid:drawable/edit_text_holo_dark</item>
<item name="candidatesTextStyleSpans">@string/candidates_style</item>
@ -465,7 +465,7 @@ please see themes_device_defaults.xml.
<item name="textAppearanceButton">@style/TextAppearance.Holo.Light.Widget.Button</item>
<item name="editTextColor">?attr/textColorPrimary</item>
<item name="editTextBackground">@drawable/edit_text_holo_light</item>
<item name="editTextBackground">@cdroid:drawable/edit_text_holo_light</item>
<item name="textEditSuggestionItemLayout">@layout/text_edit_suggestion_item</item>
<item name="textEditSuggestionContainerLayout">@layout/text_edit_suggestion_container</item>
<item name="textEditSuggestionHighlightStyle">@style/TextAppearance.Holo.SuggestionHighlight</item>

View File

@ -98,6 +98,7 @@ void ViewGroup::initGroup(){
mGroupFlags|= FLAG_CLIP_TO_PADDING;
mGroupFlags|= FLAG_ANIMATION_DONE;
mGroupFlags|= FLAG_ANIMATION_CACHE;
mGroupFlags|= FOCUS_BEFORE_DESCENDANTS;
mGroupFlags!= FLAG_ALWAYS_DRAWN_WITH_CACHE;
mLayoutMode = LAYOUT_MODE_UNDEFINED;
mFocused = nullptr;
@ -132,7 +133,14 @@ void ViewGroup::initFromAttributes(Context*ctx,const AttributeSet&atts){
//setAnimationCacheEnabled
std::string resid=atts.getString("layoutAnimation");
setLayoutAnimation(AnimationUtils::loadLayoutAnimation(ctx,resid));
setDescendantFocusability(0);
const int flags=atts.getInt("descendantFocusability",std::map<const std::string,int>{
{"beforeDescendants",FOCUS_BEFORE_DESCENDANTS},
{"afterDescendants",FOCUS_AFTER_DESCENDANTS},
{"blocksDescendants",FOCUS_BLOCK_DESCENDANTS}
},FOCUS_BEFORE_DESCENDANTS);
setDescendantFocusability(flags);
setMotionEventSplittingEnabled(atts.getBoolean("splitMotionEvents"));
if(atts.getBoolean("animateLayoutChanges",false))
setLayoutTransition(new LayoutTransition());
@ -2451,7 +2459,7 @@ bool ViewGroup::requestLayoutDuringLayout(View* view){
}
bool ViewGroup::requestFocus(int direction,Rect*previouslyFocusedRect){
int descendantFocusability = getDescendantFocusability();
const int descendantFocusability = getDescendantFocusability();
bool result,took;
switch (descendantFocusability) {

11
tests/CMakeLists.txt Normal file → Executable file
View File

@ -1,6 +1,5 @@
add_subdirectory(gui)
add_subdirectory(porting)
if (ENABLE_DTV)
add_subdirectory(epg)
add_subdirectory(tv)
endif(ENABLE_DTV)
if (BUILD_CDROID_TESTS)
add_subdirectory(gui)
add_subdirectory(porting)
endif(BUILD_CDROID_TESTS)