Skip to content

Commit 16521c7

Browse files
committed
Replace special sign with unicode.
1 parent 500790a commit 16521c7

3 files changed

Lines changed: 6 additions & 26 deletions

File tree

activitytaskview/src/main/java/cc/rome753/activitytask/model/STree.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,16 @@
1111
*/
1212
public class STree {
1313

14-
private String tab1, tab2, tab3;
14+
private String tab1 = "" + '\u2502'; // |
15+
private String tab2 = "" + '\u2514' + '\u2500'; // |_
16+
private String tab3 = "" + '\u251c' + '\u2500'; // |-
1517

1618
private STNode root;
1719

1820
public STree() {
1921
root = new STNode("");
2022
}
2123

22-
public void setTabs(String tab1, String tab2, String tab3){
23-
this.tab1 = tab1;
24-
this.tab2 = tab2;
25-
this.tab3 = tab3;
26-
}
27-
2824
public void add(LinkedList<String> list) {
2925
STNode node = root;
3026
while (!list.isEmpty()) {

activitytaskview/src/main/java/cc/rome753/activitytask/view/FragmentTreeView.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
public class FragmentTreeView extends LinearLayout {
2323

24-
HashMap<String, STree> mAFMap;//activity-fragmentList
25-
HashMap<String, Integer> mFLMap;//fragment-life
24+
HashMap<String, STree> mAFMap; //activity-fragmentList
25+
HashMap<String, Integer> mFLMap; //fragment-life
2626
STree mTree;
2727

2828
LifecycleObservable mLifecycleObservable;
@@ -43,10 +43,6 @@ private void notifyData(){
4343
removeAllViews();
4444
mLifecycleObservable.deleteObservers();
4545
if(mTree != null){
46-
mTree.setTabs(
47-
getResources().getString(R.string.tab1),
48-
getResources().getString(R.string.tab2),
49-
getResources().getString(R.string.tab3));
5046
List<String> strings = mTree.convertToList();
5147
for(String s : strings){
5248
addTextView(s);
@@ -57,7 +53,7 @@ private void notifyData(){
5753
private void addTextView(String text){
5854
ObserverTextView textView = new ObserverTextView(getContext());
5955
textView.setTextSize(ActivityTask.getTextSize());
60-
String[] arr = text.split(getResources().getString(R.string.tab0));
56+
String[] arr = text.split(String.valueOf('\u2500')); // -
6157
String name = arr[arr.length - 1];
6258
int life = mFLMap.containsKey(name) ? mFLMap.get(name) : 0;
6359
textView.setTag(name);
@@ -72,10 +68,6 @@ public void onActivityResume(String activityName){
7268
mTree = mAFMap.get(activityName);
7369
if(mTree == null){
7470
mTree = new STree();
75-
mTree.setTabs(
76-
getResources().getString(R.string.tab1),
77-
getResources().getString(R.string.tab2),
78-
getResources().getString(R.string.tab3));
7971
mAFMap.put(activityName, mTree);
8072
}
8173
notifyData();
@@ -94,10 +86,6 @@ public void onFragmentChange(FragmentInfo fragmentInfo){
9486
STree stree = mAFMap.get(parent);
9587
if(stree == null){
9688
stree = new STree();
97-
mTree.setTabs(
98-
getResources().getString(R.string.tab1),
99-
getResources().getString(R.string.tab2),
100-
getResources().getString(R.string.tab3));
10189
mAFMap.put(parent, stree);
10290
}
10391

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
<resources>
22
<string name="app_name">activityTaskView</string>
3-
<string name="tab0">─</string>
4-
<string name="tab1">│</string>
5-
<string name="tab2">└─</string>
6-
<string name="tab3">├─</string>
73
</resources>

0 commit comments

Comments
 (0)