Skip to content

Commit

Permalink
listView 不自动换行
Browse files Browse the repository at this point in the history
  • Loading branch information
zogodo committed Jan 11, 2017
1 parent 5ee9ac2 commit 48ed66a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
13 changes: 2 additions & 11 deletions app/src/main/java/com/zogodo/myempty/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,13 @@ protected void onCreate(Bundle savedInstanceState)
e.printStackTrace();
}

// try
// {
// ec_dic.AddDic(ec_dic);
// }
// catch (IOException e)
// {
// e.printStackTrace();
// }

Log.e("22222", ((Long)(System.currentTimeMillis() - time0)).toString());
}

protected void onRestart() {
super.onRestart();
SearchView search_view = (SearchView)findViewById(R.id.search);
search_view.setQuery(word_now, false);
//search_view.setQuery(word_now, false);
}

public static StarDict ec_dic;
Expand Down Expand Up @@ -118,7 +109,7 @@ public void updateListView(String tran) throws IOException
while(i < 100 && word.toLowerCase().indexOf(tran) == 0)
{
String meaning = ec_dic.GetMeaningOfWord(start + i*56);
meaning = meaning.replaceAll(" *\n *", " ");
meaning = meaning.replaceAll("\\s+", " ");
//meaning = meaning.replaceAll("^t(.+?)m", "[ $1 ] ");
//meaning = meaning.replaceAll("^m", "");
//meaning = meaning.replaceAll(" ([a-z]{1,7}\\.)", "\n$1 ");
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zogodo/myempty/MyDict.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void updateListView() throws IOException
ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>();
String[] my_dic_list = MainActivity.ec_dic.bookname.split("\\|");
String[] my_dic_list_info = MainActivity.ec_dic.description.split("\\|");
for (int i = 0; i < my_dic_list.length; i += 3)
for (int i = 0; i < my_dic_list.length; i++)
{
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("dic_name", my_dic_list[i]);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/simple_list_item_2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<TextView android:id="@+id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_below="@id/text1"
android:layout_marginBottom="6dp"
android:layout_alignStart="@id/text1" />
Expand Down

0 comments on commit 48ed66a

Please sign in to comment.