Skip to content

Commit

Permalink
移除高亮api,移除通用adapter[继续用可参考demo]
Browse files Browse the repository at this point in the history
  • Loading branch information
crazysunj committed Jul 30, 2018
1 parent d64ce0a commit 32422c3
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 315 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
</activity>
<activity android:name=".LinearActivity" />
<activity android:name=".GridActivity" />
<activity android:name=".HighLightActivity" />
<activity android:name=".RxLinearActivity" />
<activity android:name=".RxErrorAndEmptyLinearActivity" />
<activity android:name=".RxContinuityActivity" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ public void click3(View view) {
startActivity(new Intent(this, GridActivity.class));
}

public void click5(View view) {
startActivity(new Intent(this, HighLightActivity.class));
}

public void click6(View view) {
startActivity(new Intent(this, RxLinearActivity.class));
}
Expand Down
44 changes: 0 additions & 44 deletions app/src/main/res/layout/activity_high_light.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
android:onClick="click3"
android:text="方格排布" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="click5"
android:text="高亮" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
package com.crazysunj.multitypeadapter.helper;

import android.support.annotation.CallSuper;
import android.support.annotation.ColorInt;
import android.support.annotation.IntDef;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.v7.util.DiffUtil;
import android.support.v7.util.ListUpdateCallback;
import android.support.v7.widget.RecyclerView;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.util.LruCache;
import android.util.SparseArray;

Expand All @@ -44,8 +40,6 @@
import java.util.List;
import java.util.Locale;
import java.util.Queue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* 如果您发现哪里性能比较差或者说设计不合理,希望您能反馈给我
Expand Down Expand Up @@ -2117,25 +2111,4 @@ public void release() {
mResourcesManager.release();
mResourcesManager = null;
}

/**
* 处理关键字高亮
* 该api即将移除,因为它的功能貌似和主题不搭
*
* @param originStr 被处理字符串
* @param keyWord 关键字
* @param hightLightColor 高亮颜色
* @return CharSequence
*/
@Deprecated
public static CharSequence handleKeyWordHighLight
(String originStr, String keyWord, @ColorInt int hightLightColor) {
SpannableString ss = new SpannableString(originStr);
Pattern p = Pattern.compile(keyWord);
Matcher m = p.matcher(ss);
while (m.find()) {
ss.setSpan(new ForegroundColorSpan(hightLightColor), m.start(), m.end(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return ss;
}
}

This file was deleted.

0 comments on commit 32422c3

Please sign in to comment.