MCPcopy Create free account
hub / github.com/buggins/coolreader / findInDictionary

Method findInDictionary

android/src/org/coolreader/CoolReader.java:1932–1959  ·  view source on GitHub ↗
( String s )

Source from the content-addressed store, hash-verified

1930 }
1931
1932 public void findInDictionary( String s ) {
1933 if ( s!=null && s.length()!=0 ) {
1934 s = s.trim();
1935 for ( ;s.length()>0; ) {
1936 char ch = s.charAt(s.length()-1);
1937 if ( ch>=128 )
1938 break;
1939 if ( ch>='0' && ch<='9' || ch>='A' && ch<='Z' || ch>='a' && ch<='z' )
1940 break;
1941 s = s.substring(0, s.length()-1);
1942 }
1943 if ( s.length()>0 ) {
1944 //
1945 final String pattern = s;
1946 BackgroundThread.instance().executeBackground(new Runnable() {
1947 @Override
1948 public void run() {
1949 BackgroundThread.instance().postGUI(new Runnable() {
1950 @Override
1951 public void run() {
1952 findInDictionaryInternal(pattern);
1953 }
1954 }, 100);
1955 }
1956 });
1957 }
1958 }
1959 }
1960
1961 public Properties loadSettings(int profile) {
1962 File f = getSettingsFile(profile);

Callers 2

onSelectionCompleteMethod · 0.45
onClickMethod · 0.45

Calls 4

instanceMethod · 0.95
executeBackgroundMethod · 0.80
lengthMethod · 0.45
trimMethod · 0.45

Tested by

no test coverage detected