public class DisabledAppearanceCheckboxPreference extends CheckBoxPreference {
protected boolean mEnabledAppearance = false;
public DisabledAppearanceCheckboxPreference(Context context,
AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
boolean viewEnabled = isEnabled()&&mEnabledAppearance;
enableView(view, viewEnabled);
}
protected void enableView( View view, boolean enabled){
view.setEnabled(enabled);
if ( view instanceof ViewGroup){
ViewGroup grp = (ViewGroup)view;
for ( int index = 0; index < grp.getChildCount(); index++)
enableView(grp.getChildAt(index), enabled);
}
}
public void setEnabledAppearance( boolean enabled){
mEnabledAppearance = enabled;
notifyChanged();
}
@Override
protected void onClick() {
if ( mEnabledAppearance)
super.onClick();
else{
//展示其他东西 }
}
}
已发布新版的Crowdroid 1.1.0 apk,
http://www.anhuioss.com/cn/download.html
新增功能如下:
- 增设Bing翻译功能
- 屏蔽指定关键词或指定“话题内容”的功能
- 显示回信者功能
- 优化Follow 5用户接口
详情请点击此处,
http://www.anhuioss.com/cn/crowdroid/update.html
For example, by using a style, you can take this layout XML:
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#00FF00"
android:typeface="monospace"
android:text="@string/hello" />
And turn it into this:
<TextView
android:text="@string/hello" />
style定义
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CodeFont" parent="@android:style/TextAppearance.Medium">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#00FF00</item>
<item name="android:typeface">monospace</item>
</style>
</resources>