mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
remove unnecessary types from generics constructors
This commit is contained in:
parent
387d88bdde
commit
0f6b1897b7
49 changed files with 167 additions and 201 deletions
|
@ -125,7 +125,7 @@ public class BiDiSockWrap {
|
||||||
private void init( Socket socket )
|
private void init( Socket socket )
|
||||||
{
|
{
|
||||||
mSocket = socket;
|
mSocket = socket;
|
||||||
mQueue = new LinkedBlockingQueue<byte[]>();
|
mQueue = new LinkedBlockingQueue<>();
|
||||||
startThreads();
|
startThreads();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -335,30 +335,6 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
// public void drawTimer( Rect rect, int player, int secondsLeft,
|
|
||||||
// boolean turnDone )
|
|
||||||
// {
|
|
||||||
// if ( m_lastSecsLeft != secondsLeft
|
|
||||||
// || m_lastTimerPlayer != player
|
|
||||||
// || m_lastTimerTurnDone != turnDone ) {
|
|
||||||
// if ( null != m_activity && null != m_jniThread ) {
|
|
||||||
// Rect rectCopy = new Rect(rect);
|
|
||||||
// m_lastSecsLeft = secondsLeft;
|
|
||||||
// m_lastTimerPlayer = player;
|
|
||||||
// m_lastTimerTurnDone = turnDone;
|
|
||||||
|
|
||||||
// String negSign = secondsLeft < 0? "-" : "";
|
|
||||||
// secondsLeft = Math.abs( secondsLeft );
|
|
||||||
// String time = String.format( "%s%d:%02d", negSign,
|
|
||||||
// secondsLeft/60, secondsLeft%60 );
|
|
||||||
|
|
||||||
// fillRectOther( rectCopy, CommonPrefs.COLOR_BACKGRND );
|
|
||||||
|
|
||||||
// int color = m_playerColors[player];
|
|
||||||
// if ( turnDone ) {
|
|
||||||
// color &= NOT_TURN_ALPHA;
|
|
||||||
// }
|
|
||||||
// m_fillPaint.setColor( color );
|
|
||||||
public void drawTimer( Rect rect, final int player,
|
public void drawTimer( Rect rect, final int player,
|
||||||
int secondsLeft, final boolean turnDone )
|
int secondsLeft, final boolean turnDone )
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class BoardContainer extends ViewGroup {
|
||||||
|
|
||||||
public static void registerSizeChangeListener(SizeChangeListener scl)
|
public static void registerSizeChangeListener(SizeChangeListener scl)
|
||||||
{
|
{
|
||||||
s_scl = new WeakReference<SizeChangeListener>(scl);
|
s_scl = new WeakReference<>(scl);
|
||||||
callSCL();
|
callSCL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class CommsTransport implements TransportProcs,
|
||||||
m_context = context;
|
m_context = context;
|
||||||
m_tpHandler = handler;
|
m_tpHandler = handler;
|
||||||
m_rowid = rowid;
|
m_rowid = rowid;
|
||||||
m_buffersOut = new Vector<ByteBuffer>();
|
m_buffersOut = new Vector<>();
|
||||||
m_bytesIn = ByteBuffer.allocate( 2048 );
|
m_bytesIn = ByteBuffer.allocate( 2048 );
|
||||||
|
|
||||||
NetStateCache.register( context, this );
|
NetStateCache.register( context, this );
|
||||||
|
|
|
@ -497,7 +497,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
if ( null != columnNames ) {
|
if ( null != columnNames ) {
|
||||||
ArrayList<String> oldCols =
|
ArrayList<String> oldCols =
|
||||||
new ArrayList<String>( Arrays.asList( columnNames ) );
|
new ArrayList<>( Arrays.asList( columnNames ) );
|
||||||
|
|
||||||
// Make a list of columns in the new DB, using it to
|
// Make a list of columns in the new DB, using it to
|
||||||
// remove from the old list any that aren't in the
|
// remove from the old list any that aren't in the
|
||||||
|
@ -507,7 +507,7 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
// the newly-created table doesn't work, perhaps
|
// the newly-created table doesn't work, perhaps
|
||||||
// because we're in a transaction and nothing's been
|
// because we're in a transaction and nothing's been
|
||||||
// committed.
|
// committed.
|
||||||
ArrayList<String> newCols = new ArrayList<String>();
|
ArrayList<String> newCols = new ArrayList<>();
|
||||||
for ( int ii = 0; ii < data.length; ++ii ) {
|
for ( int ii = 0; ii < data.length; ++ii ) {
|
||||||
newCols.add( data[ii][0] );
|
newCols.add( data[ii][0] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,13 +89,13 @@ public class DBUtils {
|
||||||
GameChangeType change );
|
GameChangeType change );
|
||||||
}
|
}
|
||||||
private static HashSet<DBChangeListener> s_listeners =
|
private static HashSet<DBChangeListener> s_listeners =
|
||||||
new HashSet<DBChangeListener>();
|
new HashSet<>();
|
||||||
|
|
||||||
public static interface StudyListListener {
|
public static interface StudyListListener {
|
||||||
void onWordAdded( String word, int langCode );
|
void onWordAdded( String word, int langCode );
|
||||||
}
|
}
|
||||||
private static Set<StudyListListener> s_slListeners
|
private static Set<StudyListListener> s_slListeners
|
||||||
= new HashSet<StudyListListener>();
|
= new HashSet<>();
|
||||||
|
|
||||||
private static SQLiteOpenHelper s_dbHelper = null;
|
private static SQLiteOpenHelper s_dbHelper = null;
|
||||||
private static SQLiteDatabase s_db = null;
|
private static SQLiteDatabase s_db = null;
|
||||||
|
@ -500,9 +500,9 @@ public class DBUtils {
|
||||||
|
|
||||||
private SentInvitesInfo( long rowID ) {
|
private SentInvitesInfo( long rowID ) {
|
||||||
m_rowid = rowID;
|
m_rowid = rowID;
|
||||||
m_means = new ArrayList<InviteMeans>();
|
m_means = new ArrayList<>();
|
||||||
m_targets = new ArrayList<String>();
|
m_targets = new ArrayList<>();
|
||||||
m_timestamps = new ArrayList<Date>();
|
m_timestamps = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addEntry( InviteMeans means, String target, Date ts )
|
private void addEntry( InviteMeans means, String target, Date ts )
|
||||||
|
@ -543,7 +543,7 @@ public class DBUtils {
|
||||||
InviteMeans means = m_means.get(ii);
|
InviteMeans means = m_means.get(ii);
|
||||||
Set<String> devs;
|
Set<String> devs;
|
||||||
if ( ! hashes.containsKey( means ) ) {
|
if ( ! hashes.containsKey( means ) ) {
|
||||||
devs = new HashSet<String>();
|
devs = new HashSet<>();
|
||||||
hashes.put( means, devs );
|
hashes.put( means, devs );
|
||||||
}
|
}
|
||||||
devs = hashes.get( means );
|
devs = hashes.get( means );
|
||||||
|
@ -770,7 +770,7 @@ public class DBUtils {
|
||||||
public static HashMap<Long,CommsConnTypeSet>
|
public static HashMap<Long,CommsConnTypeSet>
|
||||||
getGamesWithSendsPending( Context context )
|
getGamesWithSendsPending( Context context )
|
||||||
{
|
{
|
||||||
HashMap<Long, CommsConnTypeSet> result = new HashMap<Long,CommsConnTypeSet>();
|
HashMap<Long, CommsConnTypeSet> result = new HashMap<>();
|
||||||
String[] columns = { ROW_ID, DBHelper.CONTYPE };
|
String[] columns = { ROW_ID, DBHelper.CONTYPE };
|
||||||
String selection = String.format( "%s > 0 AND %s != %d", DBHelper.NPACKETSPENDING,
|
String selection = String.format( "%s > 0 AND %s != %d", DBHelper.NPACKETSPENDING,
|
||||||
DBHelper.GROUPID, getArchiveGroup( context ) );
|
DBHelper.GROUPID, getArchiveGroup( context ) );
|
||||||
|
@ -892,7 +892,7 @@ public class DBUtils {
|
||||||
for ( String dev : TextUtils.split( devs, "\n" ) ) {
|
for ( String dev : TextUtils.split( devs, "\n" ) ) {
|
||||||
set = map.get( dev );
|
set = map.get( dev );
|
||||||
if ( null == set ) {
|
if ( null == set ) {
|
||||||
set = new HashSet<Integer>();
|
set = new HashSet<>();
|
||||||
map.put( dev, set );
|
map.put( dev, set );
|
||||||
}
|
}
|
||||||
set.add( new Integer(gameID) );
|
set.add( new Integer(gameID) );
|
||||||
|
@ -943,7 +943,7 @@ public class DBUtils {
|
||||||
String[] result = null;
|
String[] result = null;
|
||||||
String[] columns = { ROW_ID, DBHelper.RELAYID };
|
String[] columns = { ROW_ID, DBHelper.RELAYID };
|
||||||
String selection = DBHelper.RELAYID + " NOT null";
|
String selection = DBHelper.RELAYID + " NOT null";
|
||||||
ArrayList<String> ids = new ArrayList<String>();
|
ArrayList<String> ids = new ArrayList<>();
|
||||||
|
|
||||||
initDB( context );
|
initDB( context );
|
||||||
synchronized( s_dbHelper ) {
|
synchronized( s_dbHelper ) {
|
||||||
|
@ -1000,7 +1000,7 @@ public class DBUtils {
|
||||||
public static Obit[] listObits( Context context )
|
public static Obit[] listObits( Context context )
|
||||||
{
|
{
|
||||||
Obit[] result = null;
|
Obit[] result = null;
|
||||||
ArrayList<Obit> al = new ArrayList<Obit>();
|
ArrayList<Obit> al = new ArrayList<>();
|
||||||
String[] columns = { DBHelper.RELAYID, DBHelper.SEED };
|
String[] columns = { DBHelper.RELAYID, DBHelper.SEED };
|
||||||
|
|
||||||
initDB( context );
|
initDB( context );
|
||||||
|
@ -1214,8 +1214,8 @@ public class DBUtils {
|
||||||
if ( null != oldHistory ) {
|
if ( null != oldHistory ) {
|
||||||
Log.d( TAG, "convertChatString(): got string: %s", oldHistory );
|
Log.d( TAG, "convertChatString(): got string: %s", oldHistory );
|
||||||
|
|
||||||
ArrayList<ContentValues> valuess = new ArrayList<ContentValues>();
|
ArrayList<ContentValues> valuess = new ArrayList<>();
|
||||||
ArrayList<HistoryPair> pairs = new ArrayList<HistoryPair>();
|
ArrayList<HistoryPair> pairs = new ArrayList<>();
|
||||||
String localPrefix = LocUtils.getString( context, R.string.chat_local_id );
|
String localPrefix = LocUtils.getString( context, R.string.chat_local_id );
|
||||||
String rmtPrefix = LocUtils.getString( context, R.string.chat_other_id );
|
String rmtPrefix = LocUtils.getString( context, R.string.chat_other_id );
|
||||||
Log.d( TAG, "convertChatString(): prefixes: \"%s\" and \"%s\"", localPrefix, rmtPrefix );
|
Log.d( TAG, "convertChatString(): prefixes: \"%s\" and \"%s\"", localPrefix, rmtPrefix );
|
||||||
|
@ -1477,7 +1477,7 @@ public class DBUtils {
|
||||||
|
|
||||||
private static HashMap<Long, Integer> getGameCounts( SQLiteDatabase db )
|
private static HashMap<Long, Integer> getGameCounts( SQLiteDatabase db )
|
||||||
{
|
{
|
||||||
HashMap<Long, Integer> result = new HashMap<Long, Integer>();
|
HashMap<Long, Integer> result = new HashMap<>();
|
||||||
String query = "SELECT %s, count(%s) as cnt FROM %s GROUP BY %s";
|
String query = "SELECT %s, count(%s) as cnt FROM %s GROUP BY %s";
|
||||||
query = String.format( query, DBHelper.GROUPID, DBHelper.GROUPID,
|
query = String.format( query, DBHelper.GROUPID, DBHelper.GROUPID,
|
||||||
DBHelper.TABLE_NAMES.SUM, DBHelper.GROUPID );
|
DBHelper.TABLE_NAMES.SUM, DBHelper.GROUPID );
|
||||||
|
@ -2298,8 +2298,8 @@ public class DBUtils {
|
||||||
// caller cast.
|
// caller cast.
|
||||||
public static Object[] getXlations( Context context, String locale )
|
public static Object[] getXlations( Context context, String locale )
|
||||||
{
|
{
|
||||||
HashMap<String, String> local = new HashMap<String, String>();
|
HashMap<String, String> local = new HashMap<>();
|
||||||
HashMap<String, String> blessed = new HashMap<String, String>();
|
HashMap<String, String> blessed = new HashMap<>();
|
||||||
|
|
||||||
String selection = String.format( "%s = '%s'", DBHelper.LOCALE,
|
String selection = String.format( "%s = '%s'", DBHelper.LOCALE,
|
||||||
locale );
|
locale );
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class DbgUtils {
|
||||||
|
|
||||||
static String extrasToString( Bundle extras )
|
static String extrasToString( Bundle extras )
|
||||||
{
|
{
|
||||||
ArrayList<String> al = new ArrayList<String>();
|
ArrayList<String> al = new ArrayList<>();
|
||||||
if ( null != extras ) {
|
if ( null != extras ) {
|
||||||
for ( String key : extras.keySet() ) {
|
for ( String key : extras.keySet() ) {
|
||||||
al.add( key + ":" + extras.get(key) );
|
al.add( key + ":" + extras.get(key) );
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class DelegateBase implements DlgClickNotify,
|
||||||
private boolean m_finishCalled;
|
private boolean m_finishCalled;
|
||||||
private View m_rootView;
|
private View m_rootView;
|
||||||
private boolean m_isVisible;
|
private boolean m_isVisible;
|
||||||
private ArrayList<Runnable> m_visibleProcs = new ArrayList<Runnable>();
|
private ArrayList<Runnable> m_visibleProcs = new ArrayList<>();
|
||||||
private static Map<Class, WeakReference<DelegateBase>> s_instances
|
private static Map<Class, WeakReference<DelegateBase>> s_instances
|
||||||
= new HashMap<Class, WeakReference<DelegateBase>>();
|
= new HashMap<Class, WeakReference<DelegateBase>>();
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ public class DelegateBase implements DlgClickNotify,
|
||||||
if ( s_instances.containsKey( clazz ) ) {
|
if ( s_instances.containsKey( clazz ) ) {
|
||||||
Log.d( TAG, "onStart(): replacing curThis" );
|
Log.d( TAG, "onStart(): replacing curThis" );
|
||||||
}
|
}
|
||||||
s_instances.put( clazz, new WeakReference<DelegateBase>(this) );
|
s_instances.put( clazz, new WeakReference<>(this) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class DictLangCache {
|
||||||
|
|
||||||
public void rebuild()
|
public void rebuild()
|
||||||
{
|
{
|
||||||
m_map = new HashMap<String, String>();
|
m_map = new HashMap<>();
|
||||||
DictAndLoc[] dals = DictUtils.dictList( m_context );
|
DictAndLoc[] dals = DictUtils.dictList( m_context );
|
||||||
for ( DictAndLoc dal : dals ) {
|
for ( DictAndLoc dal : dals ) {
|
||||||
String lang = getLangName( m_context, dal.name );
|
String lang = getLangName( m_context, dal.name );
|
||||||
|
@ -175,7 +175,7 @@ public class DictLangCache {
|
||||||
|
|
||||||
private static DictInfo[] getInfosHaveLang( Context context, int code )
|
private static DictInfo[] getInfosHaveLang( Context context, int code )
|
||||||
{
|
{
|
||||||
ArrayList<DictInfo> al = new ArrayList<DictInfo>();
|
ArrayList<DictInfo> al = new ArrayList<>();
|
||||||
DictAndLoc[] dals = DictUtils.dictList( context );
|
DictAndLoc[] dals = DictUtils.dictList( context );
|
||||||
for ( DictAndLoc dal : dals ) {
|
for ( DictAndLoc dal : dals ) {
|
||||||
DictInfo info = getInfo( context, dal );
|
DictInfo info = getInfo( context, dal );
|
||||||
|
@ -221,7 +221,7 @@ public class DictLangCache {
|
||||||
Arrays.sort( infos, comp );
|
Arrays.sort( infos, comp );
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> al = new ArrayList<String>();
|
ArrayList<String> al = new ArrayList<>();
|
||||||
String fmt = "%s (%d)"; // must match stripCount below
|
String fmt = "%s (%d)"; // must match stripCount below
|
||||||
for ( DictInfo info : infos ) {
|
for ( DictInfo info : infos ) {
|
||||||
String name = info.name;
|
String name = info.name;
|
||||||
|
@ -244,7 +244,7 @@ public class DictLangCache {
|
||||||
|
|
||||||
public static DictAndLoc[] getDALsHaveLang( Context context, int code )
|
public static DictAndLoc[] getDALsHaveLang( Context context, int code )
|
||||||
{
|
{
|
||||||
ArrayList<DictAndLoc> al = new ArrayList<DictAndLoc>();
|
ArrayList<DictAndLoc> al = new ArrayList<>();
|
||||||
DictAndLoc[] dals = DictUtils.dictList( context );
|
DictAndLoc[] dals = DictUtils.dictList( context );
|
||||||
for ( DictAndLoc dal : dals ) {
|
for ( DictAndLoc dal : dals ) {
|
||||||
DictInfo info = getInfo( context, dal );
|
DictInfo info = getInfo( context, dal );
|
||||||
|
@ -356,7 +356,7 @@ public class DictLangCache {
|
||||||
|
|
||||||
public static String[] listLangs( Context context, DictAndLoc[] dals )
|
public static String[] listLangs( Context context, DictAndLoc[] dals )
|
||||||
{
|
{
|
||||||
Set<String> langs = new HashSet<String>();
|
Set<String> langs = new HashSet<>();
|
||||||
for ( DictAndLoc dal : dals ) {
|
for ( DictAndLoc dal : dals ) {
|
||||||
String name = getLangName( context, dal.name );
|
String name = getLangName( context, dal.name );
|
||||||
if ( null == name || 0 == name.length() ) {
|
if ( null == name || 0 == name.length() ) {
|
||||||
|
@ -422,8 +422,7 @@ public class DictLangCache {
|
||||||
{
|
{
|
||||||
if ( lang != s_adaptedLang ) {
|
if ( lang != s_adaptedLang ) {
|
||||||
s_dictsAdapter =
|
s_dictsAdapter =
|
||||||
new ArrayAdapter<String>( context,
|
new ArrayAdapter<>(context, android.R.layout.simple_spinner_item);
|
||||||
android.R.layout.simple_spinner_item );
|
|
||||||
rebuildAdapter( s_dictsAdapter, getHaveLang( context, lang ) );
|
rebuildAdapter( s_dictsAdapter, getHaveLang( context, lang ) );
|
||||||
s_adaptedLang = lang;
|
s_adaptedLang = lang;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,8 @@ public class DictListPreference extends XWListPreference {
|
||||||
int langCode = DictLangCache.getLangLangCode( context, curLang );
|
int langCode = DictLangCache.getLangLangCode( context, curLang );
|
||||||
|
|
||||||
DictUtils.DictAndLoc[] dals = DictUtils.dictList( context );
|
DictUtils.DictAndLoc[] dals = DictUtils.dictList( context );
|
||||||
ArrayList<String> dictEntries = new ArrayList<String>();
|
ArrayList<String> dictEntries = new ArrayList<>();
|
||||||
ArrayList<String> values = new ArrayList<String>();
|
ArrayList<String> values = new ArrayList<>();
|
||||||
for ( int ii = 0; ii < dals.length; ++ii ) {
|
for ( int ii = 0; ii < dals.length; ++ii ) {
|
||||||
String name = dals[ii].name;
|
String name = dals[ii].name;
|
||||||
if ( langCode == DictLangCache.getDictLangCode( context, name ) ) {
|
if ( langCode == DictLangCache.getDictLangCode( context, name ) ) {
|
||||||
|
|
|
@ -452,7 +452,7 @@ public class DictUtils {
|
||||||
byte[][] dictBytes = new byte[names.length][];
|
byte[][] dictBytes = new byte[names.length][];
|
||||||
String[] dictPaths = new String[names.length];
|
String[] dictPaths = new String[names.length];
|
||||||
|
|
||||||
HashMap<String,byte[]> seen = new HashMap<String,byte[]>();
|
HashMap<String,byte[]> seen = new HashMap<>();
|
||||||
for ( int ii = 0; ii < names.length; ++ii ) {
|
for ( int ii = 0; ii < names.length; ++ii ) {
|
||||||
byte[] bytes = null;
|
byte[] bytes = null;
|
||||||
String path = null;
|
String path = null;
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
private String[] m_locNames;
|
private String[] m_locNames;
|
||||||
private String m_finishOnName;
|
private String m_finishOnName;
|
||||||
private Map<String, XWListItem> m_selViews;
|
private Map<String, XWListItem> m_selViews;
|
||||||
private Map<String, Object> m_selDicts = new HashMap<String, Object>();
|
private Map<String, Object> m_selDicts = new HashMap<>();
|
||||||
private String m_origTitle;
|
private String m_origTitle;
|
||||||
private boolean m_showRemote = false;
|
private boolean m_showRemote = false;
|
||||||
private String m_filterLang;
|
private String m_filterLang;
|
||||||
|
@ -123,7 +123,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
String curDict, int lang ) {
|
String curDict, int lang ) {
|
||||||
|
|
||||||
final HashMap<MenuItem, DictAndLoc> itemData
|
final HashMap<MenuItem, DictAndLoc> itemData
|
||||||
= new HashMap<MenuItem, DictAndLoc>();
|
= new HashMap<>();
|
||||||
|
|
||||||
MenuItem.OnMenuItemClickListener listener =
|
MenuItem.OnMenuItemClickListener listener =
|
||||||
new MenuItem.OnMenuItemClickListener() {
|
new MenuItem.OnMenuItemClickListener() {
|
||||||
|
@ -207,7 +207,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
@Override
|
@Override
|
||||||
public Object[] makeListData()
|
public Object[] makeListData()
|
||||||
{
|
{
|
||||||
ArrayList<Object> alist = new ArrayList<Object>();
|
ArrayList<Object> alist = new ArrayList<>();
|
||||||
int nLangs = m_langs.length;
|
int nLangs = m_langs.length;
|
||||||
for ( int ii = 0; ii < nLangs; ++ii ) {
|
for ( int ii = 0; ii < nLangs; ++ii ) {
|
||||||
String langName = m_langs[ii];
|
String langName = m_langs[ii];
|
||||||
|
@ -317,9 +317,9 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
|
|
||||||
private ArrayList<Object> makeLangItems( String langName )
|
private ArrayList<Object> makeLangItems( String langName )
|
||||||
{
|
{
|
||||||
ArrayList<Object> result = new ArrayList<Object>();
|
ArrayList<Object> result = new ArrayList<>();
|
||||||
|
|
||||||
HashSet<String> locals = new HashSet<String>();
|
HashSet<String> locals = new HashSet<>();
|
||||||
int lang = DictLangCache.getLangLangCode( m_context, langName );
|
int lang = DictLangCache.getLangLangCode( m_context, langName );
|
||||||
DictAndLoc[] dals = DictLangCache.getDALsHaveLang( m_context, lang );
|
DictAndLoc[] dals = DictLangCache.getDALsHaveLang( m_context, lang );
|
||||||
if ( null != dals ) {
|
if ( null != dals ) {
|
||||||
|
@ -470,13 +470,13 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
protected void init( Bundle savedInstanceState )
|
protected void init( Bundle savedInstanceState )
|
||||||
{
|
{
|
||||||
m_onServerStr = getString( R.string.dict_on_server );
|
m_onServerStr = getString( R.string.dict_on_server );
|
||||||
m_closedLangs = new HashSet<String>();
|
m_closedLangs = new HashSet<>();
|
||||||
String[] closed = XWPrefs.getClosedLangs( m_activity );
|
String[] closed = XWPrefs.getClosedLangs( m_activity );
|
||||||
if ( null != closed ) {
|
if ( null != closed ) {
|
||||||
m_closedLangs.addAll( Arrays.asList( closed ) );
|
m_closedLangs.addAll( Arrays.asList( closed ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_expandedItems = new HashSet<DictInfo>();
|
m_expandedItems = new HashSet<>();
|
||||||
|
|
||||||
m_locNames = getStringArray( R.array.loc_names );
|
m_locNames = getStringArray( R.array.loc_names );
|
||||||
m_noteNone = getString( R.string.note_none );
|
m_noteNone = getString( R.string.note_none );
|
||||||
|
@ -829,7 +829,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
|
|
||||||
class LangDelData {
|
class LangDelData {
|
||||||
public LangDelData( int langCode ) {
|
public LangDelData( int langCode ) {
|
||||||
delDicts = new HashSet<String>();
|
delDicts = new HashSet<>();
|
||||||
langName = DictLangCache.getLangName( m_activity, langCode );
|
langName = DictLangCache.getLangName( m_activity, langCode );
|
||||||
nDicts = DictLangCache.getDALsHaveLang( m_activity, langCode ).length;
|
nDicts = DictLangCache.getDALsHaveLang( m_activity, langCode ).length;
|
||||||
}
|
}
|
||||||
|
@ -847,8 +847,8 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
int nDicts;
|
int nDicts;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<Integer, LangDelData> dels = new HashMap<Integer, LangDelData>();
|
Map<Integer, LangDelData> dels = new HashMap<>();
|
||||||
Set<Integer> skipLangs = new HashSet<Integer>();
|
Set<Integer> skipLangs = new HashSet<>();
|
||||||
for ( String dict : m_selDicts.keySet() ) {
|
for ( String dict : m_selDicts.keySet() ) {
|
||||||
int langCode = DictLangCache.getDictLangCode( m_activity, dict );
|
int langCode = DictLangCache.getDictLangCode( m_activity, dict );
|
||||||
if ( skipLangs.contains( langCode ) ) {
|
if ( skipLangs.contains( langCode ) ) {
|
||||||
|
@ -963,7 +963,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
|
|
||||||
private void resetLangs()
|
private void resetLangs()
|
||||||
{
|
{
|
||||||
Set<String> langs = new HashSet<String>();
|
Set<String> langs = new HashSet<>();
|
||||||
langs.addAll( Arrays.asList(DictLangCache.listLangs( m_activity )) );
|
langs.addAll( Arrays.asList(DictLangCache.listLangs( m_activity )) );
|
||||||
if ( m_showRemote && null != m_remoteInfo ) {
|
if ( m_showRemote && null != m_remoteInfo ) {
|
||||||
langs.addAll( m_remoteInfo.keySet() );
|
langs.addAll( m_remoteInfo.keySet() );
|
||||||
|
@ -978,7 +978,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
m_adapter = new DictListAdapter( m_activity );
|
m_adapter = new DictListAdapter( m_activity );
|
||||||
setListAdapterKeepScroll( m_adapter );
|
setListAdapterKeepScroll( m_adapter );
|
||||||
|
|
||||||
m_selViews = new HashMap<String, XWListItem>();
|
m_selViews = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveClosed()
|
private void saveClosed()
|
||||||
|
@ -1370,11 +1370,11 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
JSONArray langs = null;
|
JSONArray langs = null;
|
||||||
|
|
||||||
m_needUpdates = new HashMap<String, Uri>();
|
m_needUpdates = new HashMap<>();
|
||||||
if ( null != jsonData ) {
|
if ( null != jsonData ) {
|
||||||
Set<String> closedLangs = new HashSet<String>();
|
Set<String> closedLangs = new HashSet<>();
|
||||||
final Set<String> curLangs =
|
final Set<String> curLangs =
|
||||||
new HashSet<String>( Arrays.asList( m_langs ) );
|
new HashSet<>( Arrays.asList( m_langs ) );
|
||||||
|
|
||||||
// DictLangCache hits the DB hundreds of times below. Fix!
|
// DictLangCache hits the DB hundreds of times below. Fix!
|
||||||
Log.w( TAG, "Fix me I'm stupid" );
|
Log.w( TAG, "Fix me I'm stupid" );
|
||||||
|
@ -1384,7 +1384,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
langs = obj.optJSONArray( "langs" );
|
langs = obj.optJSONArray( "langs" );
|
||||||
|
|
||||||
int nLangs = langs.length();
|
int nLangs = langs.length();
|
||||||
m_remoteInfo = new HashMap<String, DictInfo[]>();
|
m_remoteInfo = new HashMap<>();
|
||||||
for ( int ii = 0; !isCancelled() && ii < nLangs; ++ii ) {
|
for ( int ii = 0; !isCancelled() && ii < nLangs; ++ii ) {
|
||||||
JSONObject langObj = langs.getJSONObject( ii );
|
JSONObject langObj = langs.getJSONObject( ii );
|
||||||
String langName = langObj.getString( "lang" );
|
String langName = langObj.getString( "lang" );
|
||||||
|
@ -1400,8 +1400,7 @@ public class DictsDelegate extends ListDelegateBase
|
||||||
|
|
||||||
JSONArray dicts = langObj.getJSONArray( "dicts" );
|
JSONArray dicts = langObj.getJSONArray( "dicts" );
|
||||||
int nDicts = dicts.length();
|
int nDicts = dicts.length();
|
||||||
ArrayList<DictInfo> dictNames =
|
ArrayList<DictInfo> dictNames = new ArrayList<>();
|
||||||
new ArrayList<DictInfo>();
|
|
||||||
for ( int jj = 0; !isCancelled() && jj < nDicts;
|
for ( int jj = 0; !isCancelled() && jj < nDicts;
|
||||||
++jj ) {
|
++jj ) {
|
||||||
JSONObject dict = dicts.getJSONObject( jj );
|
JSONObject dict = dicts.getJSONObject( jj );
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class DwnldDelegate extends ListDelegateBase {
|
||||||
public DownloadFinishedListener m_lstnr;
|
public DownloadFinishedListener m_lstnr;
|
||||||
}
|
}
|
||||||
private static Map<Uri,ListenerData> s_listeners =
|
private static Map<Uri,ListenerData> s_listeners =
|
||||||
new HashMap<Uri,ListenerData>();
|
new HashMap<>();
|
||||||
|
|
||||||
private class DownloadFilesTask extends AsyncTask<Void, Void, Void>
|
private class DownloadFilesTask extends AsyncTask<Void, Void, Void>
|
||||||
implements DictUtils.DownProgListener {
|
implements DictUtils.DownProgListener {
|
||||||
|
@ -249,7 +249,7 @@ public class DwnldDelegate extends ListDelegateBase {
|
||||||
@Override
|
@Override
|
||||||
protected void init( Bundle savedInstanceState )
|
protected void init( Bundle savedInstanceState )
|
||||||
{
|
{
|
||||||
m_dfts = new ArrayList<DownloadFilesTask>();
|
m_dfts = new ArrayList<>();
|
||||||
DownloadFilesTask dft = null;
|
DownloadFilesTask dft = null;
|
||||||
Uri[] uris = null;
|
Uri[] uris = null;
|
||||||
LinearLayout item = null;
|
LinearLayout item = null;
|
||||||
|
@ -269,7 +269,7 @@ public class DwnldDelegate extends ListDelegateBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( null != uris ) {
|
if ( null != uris ) {
|
||||||
m_views = new ArrayList<LinearLayout>();
|
m_views = new ArrayList<>();
|
||||||
for ( int ii = 0; ii < uris.length; ++ii ) {
|
for ( int ii = 0; ii < uris.length; ++ii ) {
|
||||||
item = (LinearLayout)inflate( R.layout.import_dict_item );
|
item = (LinearLayout)inflate( R.layout.import_dict_item );
|
||||||
m_dfts.add( new DownloadFilesTask( uris[ii], item, isApp ));
|
m_dfts.add( new DownloadFilesTask( uris[ii], item, isApp ));
|
||||||
|
@ -287,7 +287,7 @@ public class DwnldDelegate extends ListDelegateBase {
|
||||||
if ( null != dft ) {
|
if ( null != dft ) {
|
||||||
Assert.assertTrue( 0 == m_dfts.size() );
|
Assert.assertTrue( 0 == m_dfts.size() );
|
||||||
m_dfts.add( dft );
|
m_dfts.add( dft );
|
||||||
m_views = new ArrayList<LinearLayout>( 1 );
|
m_views = new ArrayList<>( 1 );
|
||||||
m_views.add( item );
|
m_views.add( item );
|
||||||
dft = null;
|
dft = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,11 @@ public class ExpiringDelegate {
|
||||||
private Handler m_handler;
|
private Handler m_handler;
|
||||||
private ArrayList<WeakReference<ExpiringDelegate>> m_refs
|
private ArrayList<WeakReference<ExpiringDelegate>> m_refs
|
||||||
= new ArrayList<WeakReference<ExpiringDelegate>>();
|
= new ArrayList<WeakReference<ExpiringDelegate>>();
|
||||||
private Set<Integer> m_hashes = new HashSet<Integer>();
|
private Set<Integer> m_hashes = new HashSet<>();
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
int sizeBefore;
|
int sizeBefore;
|
||||||
ArrayList<ExpiringDelegate> dlgts = new ArrayList<ExpiringDelegate>();
|
ArrayList<ExpiringDelegate> dlgts = new ArrayList<>();
|
||||||
synchronized( this ) {
|
synchronized( this ) {
|
||||||
sizeBefore = m_refs.size();
|
sizeBefore = m_refs.size();
|
||||||
m_hashes.clear();
|
m_hashes.clear();
|
||||||
|
@ -111,7 +111,7 @@ public class ExpiringDelegate {
|
||||||
synchronized( this ) {
|
synchronized( this ) {
|
||||||
if ( ! m_hashes.contains( hash ) ) {
|
if ( ! m_hashes.contains( hash ) ) {
|
||||||
m_hashes.add( hash );
|
m_hashes.add( hash );
|
||||||
m_refs.add( new WeakReference<ExpiringDelegate>(self) );
|
m_refs.add( new WeakReference<>(self) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class GameListItem extends LinearLayout
|
||||||
|
|
||||||
private static final int SUMMARY_WAIT_MSECS = 1000;
|
private static final int SUMMARY_WAIT_MSECS = 1000;
|
||||||
|
|
||||||
private static HashSet<Long> s_invalRows = new HashSet<Long>();
|
private static HashSet<Long> s_invalRows = new HashSet<>();
|
||||||
|
|
||||||
private Activity m_activity;
|
private Activity m_activity;
|
||||||
private Context m_context;
|
private Context m_context;
|
||||||
|
@ -455,7 +455,7 @@ public class GameListItem extends LinearLayout
|
||||||
GameListItem m_item;
|
GameListItem m_item;
|
||||||
}
|
}
|
||||||
private static LinkedBlockingQueue<ThumbQueueElem> s_queue
|
private static LinkedBlockingQueue<ThumbQueueElem> s_queue
|
||||||
= new LinkedBlockingQueue<ThumbQueueElem>();
|
= new LinkedBlockingQueue<>();
|
||||||
private static Thread s_thumbThread;
|
private static Thread s_thumbThread;
|
||||||
|
|
||||||
private static void enqueueGetThumbnail( GameListItem item, long rowid )
|
private static void enqueueGetThumbnail( GameListItem item, long rowid )
|
||||||
|
|
|
@ -883,7 +883,7 @@ public class GameUtils {
|
||||||
HashSet<String> missingSet;
|
HashSet<String> missingSet;
|
||||||
DictUtils.DictAndLoc[] installed = DictUtils.dictList( context );
|
DictUtils.DictAndLoc[] installed = DictUtils.dictList( context );
|
||||||
|
|
||||||
missingSet = new HashSet<String>( Arrays.asList( gameDicts ) );
|
missingSet = new HashSet<>( Arrays.asList( gameDicts ) );
|
||||||
missingSet.remove( null );
|
missingSet.remove( null );
|
||||||
boolean allHere = 0 != missingSet.size(); // need some non-null!
|
boolean allHere = 0 != missingSet.size(); // need some non-null!
|
||||||
if ( allHere ) {
|
if ( allHere ) {
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
protected Object[] makeListData()
|
protected Object[] makeListData()
|
||||||
{
|
{
|
||||||
final Map<Long,GameGroupInfo> gameInfo = DBUtils.getGroups( m_activity );
|
final Map<Long,GameGroupInfo> gameInfo = DBUtils.getGroups( m_activity );
|
||||||
ArrayList<Object> alist = new ArrayList<Object>();
|
ArrayList<Object> alist = new ArrayList<>();
|
||||||
long[] positions = getGroupPositions();
|
long[] positions = getGroupPositions();
|
||||||
for ( int ii = 0; ii < positions.length; ++ii ) {
|
for ( int ii = 0; ii < positions.length; ++ii ) {
|
||||||
long groupID = positions[ii];
|
long groupID = positions[ii];
|
||||||
|
@ -425,7 +425,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
private List<Object> makeChildren( long groupID )
|
private List<Object> makeChildren( long groupID )
|
||||||
{
|
{
|
||||||
long[] rows = DBUtils.getGroupGames( m_activity, groupID );
|
long[] rows = DBUtils.getGroupGames( m_activity, groupID );
|
||||||
List<Object> alist = new ArrayList<Object>( rows.length );
|
List<Object> alist = new ArrayList<>( rows.length );
|
||||||
for ( long row : rows ) {
|
for ( long row : rows ) {
|
||||||
alist.add( new GameRec( row ) );
|
alist.add( new GameRec( row ) );
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
int start, int len )
|
int start, int len )
|
||||||
{
|
{
|
||||||
Log.d( TAG, "removeRange(start=%d, len=%d)", start, len );
|
Log.d( TAG, "removeRange(start=%d, len=%d)", start, len );
|
||||||
ArrayList<Object> result = new ArrayList<Object>(len);
|
ArrayList<Object> result = new ArrayList<>(len);
|
||||||
for ( int ii = 0; ii < len; ++ii ) {
|
for ( int ii = 0; ii < len; ++ii ) {
|
||||||
result.add( list.remove( start ) );
|
result.add( list.remove( start ) );
|
||||||
}
|
}
|
||||||
|
@ -466,7 +466,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
|
|
||||||
private Set<GameListGroup> getGroupWithID( long groupID )
|
private Set<GameListGroup> getGroupWithID( long groupID )
|
||||||
{
|
{
|
||||||
Set<Long> groupIDs = new HashSet<Long>();
|
Set<Long> groupIDs = new HashSet<>();
|
||||||
groupIDs.add( groupID );
|
groupIDs.add( groupID );
|
||||||
Set<GameListGroup> result = getGroupsWithIDs( groupIDs );
|
Set<GameListGroup> result = getGroupsWithIDs( groupIDs );
|
||||||
return result;
|
return result;
|
||||||
|
@ -477,7 +477,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
// get to page out when they scroll offscreen.
|
// get to page out when they scroll offscreen.
|
||||||
private Set<GameListGroup> getGroupsWithIDs( Set<Long> groupIDs )
|
private Set<GameListGroup> getGroupsWithIDs( Set<Long> groupIDs )
|
||||||
{
|
{
|
||||||
Set<GameListGroup> result = new HashSet<GameListGroup>();
|
Set<GameListGroup> result = new HashSet<>();
|
||||||
ListView listView = getListView();
|
ListView listView = getListView();
|
||||||
int count = listView.getChildCount();
|
int count = listView.getChildCount();
|
||||||
for ( int ii = 0; ii < count; ++ii ) {
|
for ( int ii = 0; ii < count; ++ii ) {
|
||||||
|
@ -494,14 +494,14 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
|
|
||||||
private Set<GameListItem> getGamesFromElems( long rowID )
|
private Set<GameListItem> getGamesFromElems( long rowID )
|
||||||
{
|
{
|
||||||
HashSet<Long> rowSet = new HashSet<Long>();
|
HashSet<Long> rowSet = new HashSet<>();
|
||||||
rowSet.add( rowID );
|
rowSet.add( rowID );
|
||||||
return getGamesFromElems( rowSet );
|
return getGamesFromElems( rowSet );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<GameListItem> getGamesFromElems( Set<Long> rowIDs )
|
private Set<GameListItem> getGamesFromElems( Set<Long> rowIDs )
|
||||||
{
|
{
|
||||||
Set<GameListItem> result = new HashSet<GameListItem>();
|
Set<GameListItem> result = new HashSet<>();
|
||||||
ListView listView = getListView();
|
ListView listView = getListView();
|
||||||
int count = listView.getChildCount();
|
int count = listView.getChildCount();
|
||||||
for ( int ii = 0; ii < count; ++ii ) {
|
for ( int ii = 0; ii < count; ++ii ) {
|
||||||
|
@ -619,7 +619,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
{
|
{
|
||||||
super( delegator, sis, R.layout.game_list, R.menu.games_list_menu );
|
super( delegator, sis, R.layout.game_list, R.menu.games_list_menu );
|
||||||
m_activity = delegator.getActivity();
|
m_activity = delegator.getActivity();
|
||||||
m_launchedGames = new HashSet<Long>();
|
m_launchedGames = new HashSet<>();
|
||||||
s_self = this;
|
s_self = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,6 +1013,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
warnSMSBannedIf();
|
warnSMSBannedIf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( false ) {
|
||||||
Set<Long> dupModeGames = DBUtils.getDupModeGames( m_activity ).keySet();
|
Set<Long> dupModeGames = DBUtils.getDupModeGames( m_activity ).keySet();
|
||||||
long[] asArray = new long[dupModeGames.size()];
|
long[] asArray = new long[dupModeGames.size()];
|
||||||
int ii = 0;
|
int ii = 0;
|
||||||
|
@ -1020,7 +1021,6 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
Log.d( TAG, "row %d is dup-mode", rowid );
|
Log.d( TAG, "row %d is dup-mode", rowid );
|
||||||
asArray[ii++] = rowid;
|
asArray[ii++] = rowid;
|
||||||
}
|
}
|
||||||
if ( false ) {
|
|
||||||
deleteGames( asArray, true );
|
deleteGames( asArray, true );
|
||||||
}
|
}
|
||||||
} // init
|
} // init
|
||||||
|
@ -2522,7 +2522,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
boolean needsClear = 0 < m_mySIS.selGames.size();
|
boolean needsClear = 0 < m_mySIS.selGames.size();
|
||||||
if ( needsClear ) {
|
if ( needsClear ) {
|
||||||
// long[] rowIDs = getSelRowIDs();
|
// long[] rowIDs = getSelRowIDs();
|
||||||
Set<Long> selGames = new HashSet<Long>( m_mySIS.selGames );
|
Set<Long> selGames = new HashSet<>( m_mySIS.selGames );
|
||||||
m_mySIS.selGames.clear();
|
m_mySIS.selGames.clear();
|
||||||
m_adapter.clearSelectedGames( selGames );
|
m_adapter.clearSelectedGames( selGames );
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,8 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
public void populateBuilder( final Context context, final DlgState state,
|
public void populateBuilder( final Context context, final DlgState state,
|
||||||
AlertDialog.Builder builder )
|
AlertDialog.Builder builder )
|
||||||
{
|
{
|
||||||
final ArrayList<InviteMeans> means =
|
final ArrayList<InviteMeans> means = new ArrayList<>();
|
||||||
new ArrayList<InviteMeans>();
|
ArrayList<String> items = new ArrayList<>();
|
||||||
ArrayList<String> items = new ArrayList<String>();
|
|
||||||
InviteMeans lastMeans = null;
|
InviteMeans lastMeans = null;
|
||||||
if ( null != state.m_params
|
if ( null != state.m_params
|
||||||
&& state.m_params[0] instanceof SentInvitesInfo ) {
|
&& state.m_params[0] instanceof SentInvitesInfo ) {
|
||||||
|
|
|
@ -103,8 +103,7 @@ public class LookupAlertView extends LinearLayout
|
||||||
m_wordIndex = bundle.getInt( WORDINDEX, 0 );
|
m_wordIndex = bundle.getInt( WORDINDEX, 0 );
|
||||||
m_urlIndex = bundle.getInt( URLINDEX, 0 );
|
m_urlIndex = bundle.getInt( URLINDEX, 0 );
|
||||||
|
|
||||||
m_wordsAdapter = new ArrayAdapter<String>( m_context, LIST_LAYOUT,
|
m_wordsAdapter = new ArrayAdapter<>( m_context, LIST_LAYOUT, m_words );
|
||||||
m_words );
|
|
||||||
m_listView = (ListView)findViewById( android.R.id.list );
|
m_listView = (ListView)findViewById( android.R.id.list );
|
||||||
m_listView.setOnItemClickListener( this );
|
m_listView.setOnItemClickListener( this );
|
||||||
|
|
||||||
|
@ -248,8 +247,8 @@ public class LookupAlertView extends LinearLayout
|
||||||
|
|
||||||
if ( s_lang != lang ) {
|
if ( s_lang != lang ) {
|
||||||
String[] urls = context.getResources().getStringArray( R.array.lookup_urls );
|
String[] urls = context.getResources().getStringArray( R.array.lookup_urls );
|
||||||
ArrayList<String> tmpUrls = new ArrayList<String>();
|
ArrayList<String> tmpUrls = new ArrayList<>();
|
||||||
ArrayList<String> tmpNames = new ArrayList<String>();
|
ArrayList<String> tmpNames = new ArrayList<>();
|
||||||
String langCode = String.format( ":%s:", s_langCodes[lang] );
|
String langCode = String.format( ":%s:", s_langCodes[lang] );
|
||||||
for ( int ii = 0; ii < urls.length; ii += 3 ) {
|
for ( int ii = 0; ii < urls.length; ii += 3 ) {
|
||||||
String codes = urls[ii+1];
|
String codes = urls[ii+1];
|
||||||
|
@ -263,7 +262,7 @@ public class LookupAlertView extends LinearLayout
|
||||||
}
|
}
|
||||||
s_lookupNames = tmpNames.toArray( new String[tmpNames.size()] );
|
s_lookupNames = tmpNames.toArray( new String[tmpNames.size()] );
|
||||||
s_lookupUrls = tmpUrls.toArray( new String[tmpUrls.size()] );
|
s_lookupUrls = tmpUrls.toArray( new String[tmpUrls.size()] );
|
||||||
s_urlsAdapter = new ArrayAdapter<String>( context, LIST_LAYOUT,
|
s_urlsAdapter = new ArrayAdapter<>( context, LIST_LAYOUT,
|
||||||
s_lookupNames );
|
s_lookupNames );
|
||||||
s_lang = lang;
|
s_lang = lang;
|
||||||
String langName = DictLangCache.getLangName( context, lang );
|
String langName = DictLangCache.getLangName( context, lang );
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class MainActivity extends XWActivity
|
||||||
// Used only if m_dpEnabled is true
|
// Used only if m_dpEnabled is true
|
||||||
private LinearLayout m_root;
|
private LinearLayout m_root;
|
||||||
private boolean m_safeToCommit;
|
private boolean m_safeToCommit;
|
||||||
private ArrayList<Runnable> m_runWhenSafe = new ArrayList<Runnable>();
|
private ArrayList<Runnable> m_runWhenSafe = new ArrayList<>();
|
||||||
private Intent m_newIntent; // work in progress...
|
private Intent m_newIntent; // work in progress...
|
||||||
|
|
||||||
// for tracking launchForResult callback recipients
|
// for tracking launchForResult callback recipients
|
||||||
|
@ -270,7 +270,7 @@ public class MainActivity extends XWActivity
|
||||||
public Intent m_data;
|
public Intent m_data;
|
||||||
public PendingResultCache( Fragment target, int request,
|
public PendingResultCache( Fragment target, int request,
|
||||||
int result, Intent data ) {
|
int result, Intent data ) {
|
||||||
m_frag = new WeakReference<Fragment>(target);
|
m_frag = new WeakReference<>(target);
|
||||||
m_request = request;
|
m_request = request;
|
||||||
m_result = result;
|
m_result = result;
|
||||||
m_data = data;
|
m_data = data;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class MountEventReceiver extends BroadcastReceiver {
|
||||||
void cardMounted( boolean nowMounted );
|
void cardMounted( boolean nowMounted );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HashSet<SDCardNotifiee> s_procs = new HashSet<SDCardNotifiee>();
|
private static HashSet<SDCardNotifiee> s_procs = new HashSet<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive( Context context, Intent intent )
|
public void onReceive( Context context, Intent intent )
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class MultiMsgSink implements TransportProcs {
|
||||||
private Context m_context;
|
private Context m_context;
|
||||||
// Use set to count so message sent over both BT and Relay is counted only
|
// Use set to count so message sent over both BT and Relay is counted only
|
||||||
// once.
|
// once.
|
||||||
private Set<String> m_sentSet = new HashSet<String>();
|
private Set<String> m_sentSet = new HashSet<>();
|
||||||
|
|
||||||
public MultiMsgSink( Context context, long rowid )
|
public MultiMsgSink( Context context, long rowid )
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class NBSProto {
|
||||||
private static int s_nReceived = 0;
|
private static int s_nReceived = 0;
|
||||||
private static int s_nSent = 0;
|
private static int s_nSent = 0;
|
||||||
|
|
||||||
private static Set<Integer> s_sentDied = new HashSet<Integer>();
|
private static Set<Integer> s_sentDied = new HashSet<>();
|
||||||
|
|
||||||
public static void handleFrom( Context context, byte[] buffer,
|
public static void handleFrom( Context context, byte[] buffer,
|
||||||
String phone, short port )
|
String phone, short port )
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class NagTurnReceiver extends BroadcastReceiver {
|
||||||
result = s_lastIntervals;
|
result = s_lastIntervals;
|
||||||
} else {
|
} else {
|
||||||
String[] strs = TextUtils.split( pref, "," );
|
String[] strs = TextUtils.split( pref, "," );
|
||||||
ArrayList<Long> al = new ArrayList<Long>();
|
ArrayList<Long> al = new ArrayList<>();
|
||||||
for ( String str : strs ) {
|
for ( String str : strs ) {
|
||||||
try {
|
try {
|
||||||
long value = Long.parseLong(str);
|
long value = Long.parseLong(str);
|
||||||
|
@ -203,7 +203,7 @@ public class NagTurnReceiver extends BroadcastReceiver {
|
||||||
private static String formatMillis( Context context, long millis )
|
private static String formatMillis( Context context, long millis )
|
||||||
{
|
{
|
||||||
long seconds = millis / 1000;
|
long seconds = millis / 1000;
|
||||||
ArrayList<String> results = new ArrayList<String>();
|
ArrayList<String> results = new ArrayList<>();
|
||||||
for ( int[] datum : s_fmtData ) {
|
for ( int[] datum : s_fmtData ) {
|
||||||
long val = seconds / datum[0];
|
long val = seconds / datum[0];
|
||||||
if ( 1 <= val ) {
|
if ( 1 <= val ) {
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class NetStateCache {
|
||||||
context.getApplicationContext()
|
context.getApplicationContext()
|
||||||
.registerReceiver( s_receiver, filter );
|
.registerReceiver( s_receiver, filter );
|
||||||
|
|
||||||
s_ifs = new HashSet<StateChangedIf>();
|
s_ifs = new HashSet<>();
|
||||||
s_haveReceiver.set( true );
|
s_haveReceiver.set( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@ public class NetUtils {
|
||||||
private static String runConn( HttpsURLConnection conn, String param )
|
private static String runConn( HttpsURLConnection conn, String param )
|
||||||
{
|
{
|
||||||
String result = null;
|
String result = null;
|
||||||
Map<String, String> params = new HashMap<String, String>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put( k_PARAMS, param );
|
params.put( k_PARAMS, param );
|
||||||
String paramsString = getPostDataString( params );
|
String paramsString = getPostDataString( params );
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ public class NetUtils {
|
||||||
{
|
{
|
||||||
String result = null;
|
String result = null;
|
||||||
try {
|
try {
|
||||||
ArrayList<String> pairs = new ArrayList<String>();
|
ArrayList<String> pairs = new ArrayList<>();
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
// String[] pair = { null, null };
|
// String[] pair = { null, null };
|
||||||
for ( Map.Entry<String, String> entry : params.entrySet() ){
|
for ( Map.Entry<String, String> entry : params.entrySet() ){
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class PrefsDelegate extends DelegateBase
|
||||||
protected void init( Bundle savedInstanceState )
|
protected void init( Bundle savedInstanceState )
|
||||||
{
|
{
|
||||||
if ( null == s_keysHash ) {
|
if ( null == s_keysHash ) {
|
||||||
s_keysHash = new HashMap<String, Integer>();
|
s_keysHash = new HashMap<>();
|
||||||
for ( int key : s_keys ) {
|
for ( int key : s_keys ) {
|
||||||
String str = getString( key );
|
String str = getString( key );
|
||||||
s_keysHash.put( str, key );
|
s_keysHash.put( str, key );
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
|
||||||
@Override
|
@Override
|
||||||
protected String[] doInBackground( Void...unused )
|
protected String[] doInBackground( Void...unused )
|
||||||
{
|
{
|
||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<>();
|
||||||
Log.i( TAG, "doInBackground()" );
|
Log.i( TAG, "doInBackground()" );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -125,7 +125,7 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
|
||||||
{
|
{
|
||||||
Log.i( TAG, "onPostExecute()" );
|
Log.i( TAG, "onPostExecute()" );
|
||||||
ArrayAdapter<String> adapter =
|
ArrayAdapter<String> adapter =
|
||||||
new ArrayAdapter<String>( m_context,
|
new ArrayAdapter<>( m_context,
|
||||||
android.R.layout.simple_spinner_item,
|
android.R.layout.simple_spinner_item,
|
||||||
result );
|
result );
|
||||||
int resID = android.R.layout.simple_spinner_dropdown_item;
|
int resID = android.R.layout.simple_spinner_dropdown_item;
|
||||||
|
|
|
@ -577,7 +577,7 @@ public class RelayInviteDelegate extends InviteDelegate {
|
||||||
// Spinner spinner = (Spinner)
|
// Spinner spinner = (Spinner)
|
||||||
// item.findViewById(R.id.nperdev_spinner);
|
// item.findViewById(R.id.nperdev_spinner);
|
||||||
// ArrayAdapter<String> adapter =
|
// ArrayAdapter<String> adapter =
|
||||||
// new ArrayAdapter<String>( m_activity, android.R.layout
|
// new ArrayAdapter<>( m_activity, android.R.layout
|
||||||
// .simple_spinner_item );
|
// .simple_spinner_item );
|
||||||
// for ( int ii = 1; ii <= m_nMissing; ++ii ) {
|
// for ( int ii = 1; ii <= m_nMissing; ++ii ) {
|
||||||
// String str = getQuantityString( R.plurals.nplayers_fmt, ii, ii );
|
// String str = getQuantityString( R.plurals.nplayers_fmt, ii, ii );
|
||||||
|
@ -642,7 +642,7 @@ public class RelayInviteDelegate extends InviteDelegate {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if ( null != reply ) {
|
// if ( null != reply ) {
|
||||||
// result = new HashSet<String>();
|
// result = new HashSet<>();
|
||||||
|
|
||||||
// setProgressMsg( R.string.processing_games );
|
// setProgressMsg( R.string.processing_games );
|
||||||
|
|
||||||
|
@ -673,7 +673,7 @@ public class RelayInviteDelegate extends InviteDelegate {
|
||||||
// if ( null == devIDs ) {
|
// if ( null == devIDs ) {
|
||||||
// Log.w( TAG, "onPostExecute: no results from server?" );
|
// Log.w( TAG, "onPostExecute: no results from server?" );
|
||||||
// } else {
|
// } else {
|
||||||
// m_devIDRecs = new ArrayList<DevIDRec>(devIDs.size());
|
// m_devIDRecs = new ArrayList<>(devIDs.size());
|
||||||
// Iterator<String> iter = devIDs.iterator();
|
// Iterator<String> iter = devIDs.iterator();
|
||||||
// while ( iter.hasNext() ) {
|
// while ( iter.hasNext() ) {
|
||||||
// String devID = iter.next();
|
// String devID = iter.next();
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class RelayService extends XWJIService
|
||||||
private static final String MSGNUM = "MSGNUM";
|
private static final String MSGNUM = "MSGNUM";
|
||||||
|
|
||||||
private static LinkedBlockingQueue<PacketData> s_queue =
|
private static LinkedBlockingQueue<PacketData> s_queue =
|
||||||
new LinkedBlockingQueue<PacketData>();
|
new LinkedBlockingQueue<>();
|
||||||
private static List<PacketData> s_packetsSentUDP = new ArrayList<>();
|
private static List<PacketData> s_packetsSentUDP = new ArrayList<>();
|
||||||
private static List<PacketData> s_packetsSentWeb = new ArrayList<>();
|
private static List<PacketData> s_packetsSentWeb = new ArrayList<>();
|
||||||
private static final PacketData sEOQPacket = new PacketData();
|
private static final PacketData sEOQPacket = new PacketData();
|
||||||
|
@ -1254,10 +1254,9 @@ public class RelayService extends XWJIService
|
||||||
if ( null != msgs ) {
|
if ( null != msgs ) {
|
||||||
RelayMsgSink sink = new RelayMsgSink();
|
RelayMsgSink sink = new RelayMsgSink();
|
||||||
int nameCount = relayIDs.length;
|
int nameCount = relayIDs.length;
|
||||||
ArrayList<String> idsWMsgs = new ArrayList<String>( nameCount );
|
ArrayList<String> idsWMsgs = new ArrayList<>( nameCount );
|
||||||
ArrayList<Boolean> isLocals = new ArrayList<Boolean>( nameCount );
|
ArrayList<Boolean> isLocals = new ArrayList<>( nameCount );
|
||||||
ArrayList<BackMoveResult> bmrs =
|
ArrayList<BackMoveResult> bmrs = new ArrayList<>( nameCount );
|
||||||
new ArrayList<BackMoveResult>( nameCount );
|
|
||||||
|
|
||||||
boolean[] isLocalP = new boolean[1];
|
boolean[] isLocalP = new boolean[1];
|
||||||
for ( int ii = 0; ii < nameCount; ++ii ) {
|
for ( int ii = 0; ii < nameCount; ++ii ) {
|
||||||
|
@ -1512,7 +1511,7 @@ public class RelayService extends XWJIService
|
||||||
|
|
||||||
ArrayList<byte[]> list = m_msgLists.get( relayID );
|
ArrayList<byte[]> list = m_msgLists.get( relayID );
|
||||||
if ( list == null ) {
|
if ( list == null ) {
|
||||||
list = new ArrayList<byte[]>();
|
list = new ArrayList<>();
|
||||||
m_msgLists.put( relayID, list );
|
m_msgLists.put( relayID, list );
|
||||||
}
|
}
|
||||||
list.add( buf );
|
list.add( buf );
|
||||||
|
|
|
@ -312,7 +312,7 @@ public class SMSInviteDelegate extends InviteDelegate {
|
||||||
{
|
{
|
||||||
JSONObject phones = XWPrefs.getSMSPhones( m_activity );
|
JSONObject phones = XWPrefs.getSMSPhones( m_activity );
|
||||||
|
|
||||||
m_phoneRecs = new ArrayList<PhoneRec>();
|
m_phoneRecs = new ArrayList<>();
|
||||||
for ( Iterator<String> iter = phones.keys(); iter.hasNext(); ) {
|
for ( Iterator<String> iter = phones.keys(); iter.hasNext(); ) {
|
||||||
String phone = iter.next();
|
String phone = iter.next();
|
||||||
String name = phones.optString( phone, null );
|
String name = phones.optString( phone, null );
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class StudyListDelegate extends ListDelegateBase
|
||||||
|
|
||||||
m_spinner = (Spinner)findViewById( R.id.pick_lang_spinner );
|
m_spinner = (Spinner)findViewById( R.id.pick_lang_spinner );
|
||||||
m_pickView = findViewById( R.id.pick_lang );
|
m_pickView = findViewById( R.id.pick_lang );
|
||||||
m_checkeds = new HashSet<String>();
|
m_checkeds = new HashSet<>();
|
||||||
m_words = new String[0];
|
m_words = new String[0];
|
||||||
|
|
||||||
getBundledData( sis );
|
getBundledData( sis );
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class TilePickView extends LinearLayout {
|
||||||
private ArrayList<Integer> m_pendingTiles;
|
private ArrayList<Integer> m_pendingTiles;
|
||||||
private TilePickListener m_listner;
|
private TilePickListener m_listner;
|
||||||
private TilePickState m_state;
|
private TilePickState m_state;
|
||||||
private Map<Integer, Button> m_buttons = new HashMap<Integer, Button>();
|
private Map<Integer, Button> m_buttons = new HashMap<>();
|
||||||
|
|
||||||
public TilePickView( Context context, AttributeSet as ) {
|
public TilePickView( Context context, AttributeSet as ) {
|
||||||
super( context, as );
|
super( context, as );
|
||||||
|
@ -65,7 +65,7 @@ public class TilePickView extends LinearLayout {
|
||||||
m_pendingTiles = (ArrayList<Integer>)bundle.getSerializable( NEW_TILES );
|
m_pendingTiles = (ArrayList<Integer>)bundle.getSerializable( NEW_TILES );
|
||||||
if ( null == m_pendingTiles ) {
|
if ( null == m_pendingTiles ) {
|
||||||
Log.d( TAG, "creating new m_pendingTiles" );
|
Log.d( TAG, "creating new m_pendingTiles" );
|
||||||
m_pendingTiles = new ArrayList<Integer>();
|
m_pendingTiles = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
showPending();
|
showPending();
|
||||||
|
@ -156,7 +156,7 @@ public class TilePickView extends LinearLayout {
|
||||||
if ( m_state.forBlank() ) {
|
if ( m_state.forBlank() ) {
|
||||||
desc.setVisibility( View.GONE );
|
desc.setVisibility( View.GONE );
|
||||||
} else {
|
} else {
|
||||||
List<String> faces = new ArrayList<String>();
|
List<String> faces = new ArrayList<>();
|
||||||
for ( int indx : m_pendingTiles ) {
|
for ( int indx : m_pendingTiles ) {
|
||||||
faces.add( m_state.faces[indx] );
|
faces.add( m_state.faces[indx] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class Toolbar implements BoardContainer.SizeChangeListener {
|
||||||
private boolean m_visible;
|
private boolean m_visible;
|
||||||
private Map<Buttons, Object> m_onClickListeners = new HashMap<>();
|
private Map<Buttons, Object> m_onClickListeners = new HashMap<>();
|
||||||
private Map<Buttons, Object> m_onLongClickListeners = new HashMap<>();
|
private Map<Buttons, Object> m_onLongClickListeners = new HashMap<>();
|
||||||
private Set<Buttons> m_enabled = new HashSet<Buttons>();
|
private Set<Buttons> m_enabled = new HashSet<>();
|
||||||
|
|
||||||
public Toolbar( Activity activity, HasDlgDelegate dlgDlgt )
|
public Toolbar( Activity activity, HasDlgDelegate dlgDlgt )
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,8 +94,7 @@ public class Utils {
|
||||||
private static Boolean s_firstVersion = null;
|
private static Boolean s_firstVersion = null;
|
||||||
private static Boolean s_isFirstBootEver = null;
|
private static Boolean s_isFirstBootEver = null;
|
||||||
private static Integer s_appVersion = null;
|
private static Integer s_appVersion = null;
|
||||||
private static HashMap<String,String> s_phonesHash =
|
private static HashMap<String,String> s_phonesHash = new HashMap<>();
|
||||||
new HashMap<String,String>();
|
|
||||||
private static Boolean s_hasSmallScreen = null;
|
private static Boolean s_hasSmallScreen = null;
|
||||||
private static Random s_random = new Random();
|
private static Random s_random = new Random();
|
||||||
|
|
||||||
|
|
|
@ -113,14 +113,12 @@ public class WiDirService extends XWService {
|
||||||
private static Thread sAcceptThread;
|
private static Thread sAcceptThread;
|
||||||
private static ServerSocket sServerSock;
|
private static ServerSocket sServerSock;
|
||||||
private static BiDiSockWrap.Iface sIface;
|
private static BiDiSockWrap.Iface sIface;
|
||||||
private static Map<String, BiDiSockWrap> sSocketWrapMap
|
private static Map<String, BiDiSockWrap> sSocketWrapMap = new HashMap<>();
|
||||||
= new HashMap<String, BiDiSockWrap>();
|
private static Map<String, String> sUserMap = new HashMap<>();
|
||||||
private static Map<String, String> sUserMap = new HashMap<String, String>();
|
private static Map<String, Long> sPendingDevs = new HashMap<>();
|
||||||
private static Map<String, Long> sPendingDevs = new HashMap<String, Long>();
|
|
||||||
private static String sMacAddress;
|
private static String sMacAddress;
|
||||||
private static String sDeviceName;
|
private static String sDeviceName;
|
||||||
private static Set<DevSetListener> s_devListeners
|
private static Set<DevSetListener> s_devListeners = new HashSet<>();
|
||||||
= new HashSet<DevSetListener>();
|
|
||||||
private static Set<String> s_peersSet;
|
private static Set<String> s_peersSet;
|
||||||
|
|
||||||
private P2pMsgSink m_sink;
|
private P2pMsgSink m_sink;
|
||||||
|
@ -190,7 +188,7 @@ public class WiDirService extends XWService {
|
||||||
false );
|
false );
|
||||||
|
|
||||||
Assert.assertNull( s_peersSet );
|
Assert.assertNull( s_peersSet );
|
||||||
s_peersSet = new HashSet<String>();
|
s_peersSet = new HashSet<>();
|
||||||
String peers = DBUtils.getStringFor( context, PEERS_LIST_KEY, null );
|
String peers = DBUtils.getStringFor( context, PEERS_LIST_KEY, null );
|
||||||
if ( null != peers ) {
|
if ( null != peers ) {
|
||||||
String[] macs = TextUtils.split( peers, "," );
|
String[] macs = TextUtils.split( peers, "," );
|
||||||
|
@ -583,7 +581,7 @@ public class WiDirService extends XWService {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ADD_LOCAL_SERVICES:
|
case ADD_LOCAL_SERVICES:
|
||||||
Map<String, String> record = new HashMap<String, String>();
|
Map<String, String> record = new HashMap<>();
|
||||||
record.put( "AVAILABLE", "visible");
|
record.put( "AVAILABLE", "visible");
|
||||||
record.put( "PORT", "" + OWNER_PORT );
|
record.put( "PORT", "" + OWNER_PORT );
|
||||||
record.put( "NAME", sDeviceName );
|
record.put( "NAME", sDeviceName );
|
||||||
|
@ -937,7 +935,7 @@ public class WiDirService extends XWService {
|
||||||
{
|
{
|
||||||
Map<String, String> macToName;
|
Map<String, String> macToName;
|
||||||
synchronized ( sUserMap ) {
|
synchronized ( sUserMap ) {
|
||||||
macToName = new HashMap<String, String>(sUserMap);
|
macToName = new HashMap<>(sUserMap);
|
||||||
}
|
}
|
||||||
return macToName;
|
return macToName;
|
||||||
}
|
}
|
||||||
|
@ -1053,7 +1051,7 @@ public class WiDirService extends XWService {
|
||||||
|
|
||||||
private static void updatePeersList( WifiP2pDeviceList peerList )
|
private static void updatePeersList( WifiP2pDeviceList peerList )
|
||||||
{
|
{
|
||||||
Set<String> newSet = new HashSet<String>();
|
Set<String> newSet = new HashSet<>();
|
||||||
for ( WifiP2pDevice device : peerList.getDeviceList() ) {
|
for ( WifiP2pDevice device : peerList.getDeviceList() ) {
|
||||||
String macAddress = device.deviceAddress;
|
String macAddress = device.deviceAddress;
|
||||||
newSet.add( macAddress );
|
newSet.add( macAddress );
|
||||||
|
|
|
@ -128,7 +128,7 @@ abstract class XWDialogFragment extends DialogFragment {
|
||||||
private Map<Integer, DialogInterface.OnClickListener> getButtonMap()
|
private Map<Integer, DialogInterface.OnClickListener> getButtonMap()
|
||||||
{
|
{
|
||||||
if ( null == m_buttonMap ) {
|
if ( null == m_buttonMap ) {
|
||||||
m_buttonMap = new HashMap<Integer, DialogInterface.OnClickListener>();
|
m_buttonMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
return m_buttonMap;
|
return m_buttonMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ abstract class XWExpListAdapter extends XWListAdapter {
|
||||||
public XWExpListAdapter( Class[] childClasses )
|
public XWExpListAdapter( Class[] childClasses )
|
||||||
{
|
{
|
||||||
m_groupClass = childClasses[0];
|
m_groupClass = childClasses[0];
|
||||||
m_types = new HashMap<Class, Integer>();
|
m_types = new HashMap<>();
|
||||||
for ( int ii = 0; ii < childClasses.length; ++ii ) {
|
for ( int ii = 0; ii < childClasses.length; ++ii ) {
|
||||||
m_types.put( childClasses[ii], ii );
|
m_types.put( childClasses[ii], ii );
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ abstract class XWFragment extends Fragment implements Delegator {
|
||||||
private boolean m_hasOptionsMenu = false;
|
private boolean m_hasOptionsMenu = false;
|
||||||
private int m_commitID;
|
private int m_commitID;
|
||||||
|
|
||||||
private static Set<XWFragment> sActiveFrags = new HashSet<XWFragment>();
|
private static Set<XWFragment> sActiveFrags = new HashSet<>();
|
||||||
public static XWFragment findOwnsView( View view )
|
public static XWFragment findOwnsView( View view )
|
||||||
{
|
{
|
||||||
XWFragment result = null;
|
XWFragment result = null;
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class CommsAddrRec {
|
||||||
if ( 0 == types.length ) {
|
if ( 0 == types.length ) {
|
||||||
result = LocUtils.getString( context, R.string.note_none );
|
result = LocUtils.getString( context, R.string.note_none );
|
||||||
} else {
|
} else {
|
||||||
List<String> strs = new ArrayList<String>();
|
List<String> strs = new ArrayList<>();
|
||||||
for ( CommsConnType typ : types ) {
|
for ( CommsConnType typ : types ) {
|
||||||
if ( typ.isSelectable() ) {
|
if ( typ.isSelectable() ) {
|
||||||
String str = longVersion?
|
String str = longVersion?
|
||||||
|
|
|
@ -425,7 +425,7 @@ public class CurGameInfo implements Serializable {
|
||||||
{
|
{
|
||||||
String[] dicts =
|
String[] dicts =
|
||||||
DictLangCache.getHaveLang( context, dictLang );
|
DictLangCache.getHaveLang( context, dictLang );
|
||||||
HashSet<String> installed = new HashSet<String>( Arrays.asList(dicts) );
|
HashSet<String> installed = new HashSet<>( Arrays.asList(dicts) );
|
||||||
|
|
||||||
if ( !installed.contains( dictName ) ) {
|
if ( !installed.contains( dictName ) ) {
|
||||||
dictName = newDict;
|
dictName = newDict;
|
||||||
|
|
|
@ -824,7 +824,7 @@ public class JNIThread extends Thread implements AutoCloseable {
|
||||||
return XwJNI.server_do( gamePtr );
|
return XwJNI.server_do( gamePtr );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Map<Long, JNIThread> s_instances = new HashMap<Long, JNIThread>();
|
private static Map<Long, JNIThread> s_instances = new HashMap<>();
|
||||||
private void retain_sync()
|
private void retain_sync()
|
||||||
{
|
{
|
||||||
++m_refCount;
|
++m_refCount;
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class JNIUtilsImpl implements JNIUtils {
|
||||||
@Override
|
@Override
|
||||||
public String[][] splitFaces( byte[] chars, boolean isUTF8 )
|
public String[][] splitFaces( byte[] chars, boolean isUTF8 )
|
||||||
{
|
{
|
||||||
ArrayList<String[]> faces = new ArrayList<String[]>();
|
ArrayList<String[]> faces = new ArrayList<>();
|
||||||
ByteArrayInputStream bais = new ByteArrayInputStream( chars );
|
ByteArrayInputStream bais = new ByteArrayInputStream( chars );
|
||||||
InputStreamReader isr;
|
InputStreamReader isr;
|
||||||
try {
|
try {
|
||||||
|
@ -115,7 +115,7 @@ public class JNIUtilsImpl implements JNIUtils {
|
||||||
}
|
}
|
||||||
lastWasDelim = false;
|
lastWasDelim = false;
|
||||||
if ( null == face ) {
|
if ( null == face ) {
|
||||||
face = new ArrayList<String>();
|
face = new ArrayList<>();
|
||||||
}
|
}
|
||||||
face.add( letter );
|
face.add( letter );
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class LocIDs extends LocIDsData {
|
||||||
protected static HashMap<String, Integer> getS_MAP( Context context )
|
protected static HashMap<String, Integer> getS_MAP( Context context )
|
||||||
{
|
{
|
||||||
if ( null == S_MAP ) {
|
if ( null == S_MAP ) {
|
||||||
S_MAP = new HashMap<String, Integer>(S_IDS.length);
|
S_MAP = new HashMap<>(S_IDS.length);
|
||||||
for ( int id : S_IDS ) {
|
for ( int id : S_IDS ) {
|
||||||
String str = context.getString( id );
|
String str = context.getString( id );
|
||||||
S_MAP.put( str, id );
|
S_MAP.put( str, id );
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class LocItemEditDelegate extends DelegateBase implements TextWatcher {
|
||||||
// searching for them anyway.
|
// searching for them anyway.
|
||||||
private HashSet<String> getFmtSet( String txt, TextView owner )
|
private HashSet<String> getFmtSet( String txt, TextView owner )
|
||||||
{
|
{
|
||||||
HashSet<String> fmts = new HashSet<String>();
|
HashSet<String> fmts = new HashSet<>();
|
||||||
Spannable spanText = null; // null unless used
|
Spannable spanText = null; // null unless used
|
||||||
|
|
||||||
Matcher matcher = s_patFormat.matcher( txt );
|
Matcher matcher = s_patFormat.matcher( txt );
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class LocSearcher {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Pair> matches = new ArrayList<Pair>();
|
ArrayList<Pair> matches = new ArrayList<>();
|
||||||
for ( Pair pair : m_pairs ) {
|
for ( Pair pair : m_pairs ) {
|
||||||
if ( proc.passes( m_context, pair ) ) {
|
if ( proc.passes( m_context, pair ) ) {
|
||||||
matches.add( pair );
|
matches.add( pair );
|
||||||
|
@ -135,7 +135,7 @@ public class LocSearcher {
|
||||||
Pair[] usePairs = null != m_lastTerm && term.contains(m_lastTerm)
|
Pair[] usePairs = null != m_lastTerm && term.contains(m_lastTerm)
|
||||||
? m_matchingPairs : m_filteredPairs;
|
? m_matchingPairs : m_filteredPairs;
|
||||||
Log.i( TAG, "start: searching %d pairs", usePairs.length );
|
Log.i( TAG, "start: searching %d pairs", usePairs.length );
|
||||||
ArrayList<Pair> matches = new ArrayList<Pair>();
|
ArrayList<Pair> matches = new ArrayList<>();
|
||||||
for ( Pair pair : usePairs ) {
|
for ( Pair pair : usePairs ) {
|
||||||
if ( pair.matches( term ) ) {
|
if ( pair.matches( term ) ) {
|
||||||
matches.add( pair );
|
matches.add( pair );
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class LocUtils {
|
||||||
public static String xlateLang( Context context, String lang, boolean caps )
|
public static String xlateLang( Context context, String lang, boolean caps )
|
||||||
{
|
{
|
||||||
if ( null == s_langMap ) {
|
if ( null == s_langMap ) {
|
||||||
s_langMap = new HashMap<String, String>();
|
s_langMap = new HashMap<>();
|
||||||
s_langMap.put( "English", context.getString( R.string.lang_name_english ) );
|
s_langMap.put( "English", context.getString( R.string.lang_name_english ) );
|
||||||
s_langMap.put( "French", context.getString( R.string.lang_name_french ) );
|
s_langMap.put( "French", context.getString( R.string.lang_name_french ) );
|
||||||
s_langMap.put( "German", context.getString( R.string.lang_name_german ) );
|
s_langMap.put( "German", context.getString( R.string.lang_name_german ) );
|
||||||
|
@ -156,7 +156,7 @@ public class LocUtils {
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if ( null == s_langCodeMap ) {
|
if ( null == s_langCodeMap ) {
|
||||||
s_langCodeMap = new HashMap<String, Integer>();
|
s_langCodeMap = new HashMap<>();
|
||||||
String[] langCodes =
|
String[] langCodes =
|
||||||
context.getResources().getStringArray( R.array.language_codes );
|
context.getResources().getStringArray( R.array.language_codes );
|
||||||
for ( int ii = 0; ii < langCodes.length; ++ii ) {
|
for ( int ii = 0; ii < langCodes.length; ++ii ) {
|
||||||
|
@ -199,7 +199,7 @@ public class LocUtils {
|
||||||
if ( XWApp.LOCUTILS_ENABLED ) {
|
if ( XWApp.LOCUTILS_ENABLED ) {
|
||||||
pareMenus();
|
pareMenus();
|
||||||
|
|
||||||
xlateMenu( activity, new WeakReference<Menu>( menu ), menu, 0 );
|
xlateMenu( activity, new WeakReference<>( menu ), menu, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,8 +456,7 @@ public class LocUtils {
|
||||||
pairs.length(), newVersion );
|
pairs.length(), newVersion );
|
||||||
|
|
||||||
int len = pairs.length();
|
int len = pairs.length();
|
||||||
Map<String,String> newXlations =
|
Map<String,String> newXlations = new HashMap<>( len );
|
||||||
new HashMap<String,String>( len );
|
|
||||||
for ( int jj = 0; jj < len; ++jj ) {
|
for ( int jj = 0; jj < len; ++jj ) {
|
||||||
JSONObject pair = pairs.getJSONObject( jj );
|
JSONObject pair = pairs.getJSONObject( jj );
|
||||||
int id = pair.getInt( "id" );
|
int id = pair.getInt( "id" );
|
||||||
|
@ -619,8 +618,7 @@ public class LocUtils {
|
||||||
{
|
{
|
||||||
if ( null == s_idsToKeys ) {
|
if ( null == s_idsToKeys ) {
|
||||||
Map<String,Integer> map = LocIDs.getS_MAP( context );
|
Map<String,Integer> map = LocIDs.getS_MAP( context );
|
||||||
HashMap<Integer, String> idsToKeys =
|
HashMap<Integer, String> idsToKeys = new HashMap<>( map.size() );
|
||||||
new HashMap<Integer, String>( map.size() );
|
|
||||||
|
|
||||||
Iterator<String> iter = map.keySet().iterator();
|
Iterator<String> iter = map.keySet().iterator();
|
||||||
while ( iter.hasNext() ) {
|
while ( iter.hasNext() ) {
|
||||||
|
@ -783,7 +781,7 @@ public class LocUtils {
|
||||||
{
|
{
|
||||||
HashSet<String> keys = s_menuSets.get( ref );
|
HashSet<String> keys = s_menuSets.get( ref );
|
||||||
if ( null == keys ) {
|
if ( null == keys ) {
|
||||||
keys = new HashSet<String>();
|
keys = new HashSet<>();
|
||||||
s_menuSets.put( ref, keys );
|
s_menuSets.put( ref, keys );
|
||||||
}
|
}
|
||||||
keys.add( key );
|
keys.add( key );
|
||||||
|
@ -798,7 +796,7 @@ public class LocUtils {
|
||||||
{
|
{
|
||||||
HashSet<String> keys = s_contextSets.get( contextName );
|
HashSet<String> keys = s_contextSets.get( contextName );
|
||||||
if ( null == keys ) {
|
if ( null == keys ) {
|
||||||
keys = new HashSet<String>();
|
keys = new HashSet<>();
|
||||||
s_contextSets.put( contextName, keys );
|
s_contextSets.put( contextName, keys );
|
||||||
// DbgUtils.logf( "adding keys hash to %s", contextName );
|
// DbgUtils.logf( "adding keys hash to %s", contextName );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue