fix display of wordlist note when there is none

This commit is contained in:
Eric House 2022-06-05 17:04:28 -07:00
parent 8c4a1d2be6
commit 3dea7bd205

View file

@ -142,7 +142,6 @@ public class DictBrowseDelegate extends DelegateBase
private Spinner m_spinnerMin; private Spinner m_spinnerMin;
private Spinner m_spinnerMax; private Spinner m_spinnerMax;
private boolean m_filterAlertShown; private boolean m_filterAlertShown;
private String m_desc;
private Runnable mResetChecker; private Runnable mResetChecker;
private class DictListAdapter extends BaseAdapter private class DictListAdapter extends BaseAdapter
@ -727,16 +726,23 @@ public class DictBrowseDelegate extends DelegateBase
makeSpinnerAdapter( m_spinnerMax, m_browseState.m_chosenMax ); makeSpinnerAdapter( m_spinnerMax, m_browseState.m_chosenMax );
} }
private String[] mDescWrap = null;
private String getDesc() private String getDesc()
{ {
if ( null == m_desc ) { if ( null == mDescWrap ) {
m_desc = XwJNI.dict_getDesc( m_dict ); String desc = XwJNI.dict_getDesc( m_dict );
if ( BuildConfig.NON_RELEASE ) { if ( BuildConfig.NON_RELEASE ) {
String[] sums = DictLangCache.getDictMD5Sums( m_activity, m_name ); String[] sums = DictLangCache.getDictMD5Sums( m_activity, m_name );
m_desc += "\n\nmd5s: " + sums[0] + "\n" + sums[1]; if ( null != desc ) {
desc += "\n\n";
} else {
desc = "";
}
desc += "md5s: " + sums[0] + "\n" + sums[1];
} }
mDescWrap = new String[] { desc };
} }
return m_desc; return mDescWrap[0];
} }
private FrameLayout removeList() private FrameLayout removeList()