Merge branch 'master' into newnavigation

Conflicts:
	mobile/src/com/cradle/iitc_mobile/IITC_ActionBarHelper.java
This commit is contained in:
fkloft 2013-09-23 11:01:03 +02:00
commit 4234ee15b4
8 changed files with 137 additions and 31 deletions

View File

@ -43,11 +43,11 @@ window.playerNameToGuid = function(playerName) {
$.each(Object.keys(sessionStorage), function(ind,key) { $.each(Object.keys(sessionStorage), function(ind,key) {
if(playerName === sessionStorage[key]) { if(playerName === sessionStorage[key]) {
guid = key; guid = key;
window._playerNameToGuidCache[playerName] = guid;
return false; //break from $.each return false; //break from $.each
} }
}); });
window._playerNameToGuidCache[playerName] = guid;
return guid; return guid;
} }

View File

@ -66,7 +66,6 @@ window.changePortalHighlights = function(name) {
window.highlightPortal = function(p) { window.highlightPortal = function(p) {
if(_highlighters !== null && _highlighters[_current_highlighter] !== undefined) { if(_highlighters !== null && _highlighters[_current_highlighter] !== undefined) {
p.options.highligher = _current_highlighter;
_highlighters[_current_highlighter]({portal: p}); _highlighters[_current_highlighter]({portal: p});
} }
} }

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cradle.iitc_mobile" package="com.cradle.iitc_mobile"
android:versionCode="48" android:versionCode="49"
android:versionName="0.6.4"> android:versionName="0.6.5">
<uses-sdk <uses-sdk
android:minSdkVersion="14" android:minSdkVersion="14"

View File

@ -16,6 +16,8 @@ import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import java.util.Comparator;
public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNavigationListener, OnItemClickListener { public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNavigationListener, OnItemClickListener {
// Show/hide the up arrow on the very left // Show/hide the up arrow on the very left
// getActionBar().setDisplayHomeAsUpEnabled(enabled); // getActionBar().setDisplayHomeAsUpEnabled(enabled);
@ -30,6 +32,22 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
// getActionBar().setHomeButtonEnabled(enabled); // getActionBar().setHomeButtonEnabled(enabled);
private class HighlighterAdapter extends ArrayAdapter<String> { private class HighlighterAdapter extends ArrayAdapter<String> {
// Move "No Highlights" on top. Sort the rest alphabetically
private class HighlighterComparator implements Comparator<String> {
@Override
public int compare(String lhs, String rhs) {
if (lhs.equals("No Highlights"))
return -1000;
else if (rhs.equals("No Highlights"))
return 1000;
else
return lhs.compareTo(rhs);
}
}
private HighlighterComparator mComparator = new HighlighterComparator();
public HighlighterAdapter() { public HighlighterAdapter() {
super(mIitc, android.R.layout.simple_list_item_1); super(mIitc, android.R.layout.simple_list_item_1);
clear(); clear();
@ -39,6 +57,7 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
public void add(String object) { public void add(String object) {
super.remove(object); // to avoid duplicates super.remove(object); // to avoid duplicates
super.add(object); super.add(object);
super.sort(mComparator);
} }
@Override @Override
@ -177,8 +196,8 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
if (mHighlighters.getCount() < 2) // there should always be "No Highlights" if (mHighlighters.getCount() < 2) // there should always be "No Highlights"
showHighlighter = false; showHighlighter = false;
if(mDrawerOpened) if (mDrawerOpened)
showHighlighter = false; showHighlighter = false;
if (showHighlighter) { if (showHighlighter) {
@ -240,7 +259,7 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
public void onDrawerOpened(View drawerView) { public void onDrawerOpened(View drawerView) {
// TODO change menu? (via invalidateOptionsMenu) // TODO change menu? (via invalidateOptionsMenu)
super.onDrawerOpened(drawerView); super.onDrawerOpened(drawerView);
mDrawerOpened=true; mDrawerOpened = true;
updateActionBar(); updateActionBar();
} }

View File

@ -15,6 +15,8 @@ import android.widget.ArrayAdapter;
import android.widget.ListAdapter; import android.widget.ListAdapter;
import android.widget.TextView; import android.widget.TextView;
import com.cradle.iitc_mobile.fragments.PluginsFragment;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@ -30,6 +32,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
// we use a tree map to have a map with alphabetical order // we use a tree map to have a map with alphabetical order
private static TreeMap<String, ArrayList<IITC_PluginPreference>> sPlugins = null; private static TreeMap<String, ArrayList<IITC_PluginPreference>> sPlugins = null;
public static final String USER_PLUGIN = "00000"; public static final String USER_PLUGIN = "00000";
private static int mDeletedPlugins = 0;
@Override @Override
public void setListAdapter(ListAdapter adapter) { public void setListAdapter(ListAdapter adapter) {
@ -57,6 +60,36 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
addHeaders(); addHeaders();
} }
@Override
protected void onCreate(Bundle savedInstanceState) {
if(onIsMultiPane()) getIntent()
.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, PluginsFragment.class.getName());
super.onCreate(savedInstanceState);
}
@Override
protected void onResume() {
// Call super :
super.onResume();
// Select the displayed fragment in the headers (when using a tablet) :
// This should be done by Android, it is a bug fix
// thx to http://stackoverflow.com/a/16793839
if(mHeaders != null) {
final String displayedFragment = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
if (displayedFragment != null) {
for (final Header header : mHeaders) {
if (displayedFragment.equals(header.fragment)) {
switchToHeader(header);
break;
}
}
}
}
}
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
@ -106,7 +139,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
for (Map.Entry<String, ArrayList<IITC_PluginPreference>> entry : sPlugins.entrySet()) { for (Map.Entry<String, ArrayList<IITC_PluginPreference>> entry : sPlugins.entrySet()) {
numPlugins += entry.getValue().size(); numPlugins += entry.getValue().size();
} }
if ((user.length + official.length) != numPlugins) { if ((user.length + official.length) != (numPlugins + mDeletedPlugins)) {
Log.d("iitcm", "new or less plugins found since last start, rebuild preferences"); Log.d("iitcm", "new or less plugins found since last start, rebuild preferences");
sPlugins.clear(); sPlugins.clear();
setUpPluginPreferenceScreen(); setUpPluginPreferenceScreen();
@ -188,6 +221,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
// do not add deleted plugins // do not add deleted plugins
if (plugin_cat.equals("Deleted")) { if (plugin_cat.equals("Deleted")) {
mDeletedPlugins++;
return; return;
} }

View File

@ -22,21 +22,23 @@ public class PluginsFragment extends PreferenceFragment {
// alphabetical order // alphabetical order
getPreferenceScreen().setOrderingAsAdded(false); getPreferenceScreen().setOrderingAsAdded(false);
// get plugins category for this fragments and plugins list if (getArguments() != null) {
String category = getArguments().getString("category"); // get plugins category for this fragments and plugins list
ArrayList<IITC_PluginPreference> prefs = String category = getArguments().getString("category");
IITC_PluginPreferenceActivity.getPluginPreference(category); ArrayList<IITC_PluginPreference> prefs =
IITC_PluginPreferenceActivity.getPluginPreference(category);
// add plugin checkbox preferences // add plugin checkbox preferences
for (IITC_PluginPreference pref : prefs) { for (IITC_PluginPreference pref : prefs) {
getPreferenceScreen().addPreference(pref); getPreferenceScreen().addPreference(pref);
}
// set action bar stuff
ActionBar bar = getActivity().getActionBar();
category = category.replace(IITC_PluginPreferenceActivity.USER_PLUGIN, "User ");
bar.setTitle("IITC Plugins: " + category);
bar.setDisplayHomeAsUpEnabled(true);
} }
// set action bar stuff
ActionBar bar = getActivity().getActionBar();
category = category.replace(IITC_PluginPreferenceActivity.USER_PLUGIN, "User ");
bar.setTitle("IITC Plugins: " + category);
bar.setDisplayHomeAsUpEnabled(true);
} }
} }

View File

@ -13,21 +13,39 @@ offers many more features. It is available for
<h3>Latest news</h3> <h3>Latest news</h3>
<h4>2nd September 2013</h4> <h4>22nd September 2013</h4>
<p> <p>
IITC 0.14.0, and IITC Mobile 0.5.6, have just been released. This is (yet another) change required to work with <b>Update</b>: IITC Mobile 0.6.5 replaces 0.6.4. This fixes a crash on entering plugin preferences on some tablets.
the latest changes to the standard intel website.
</p> </p>
<p> <p>
Also, as part of some long-term improvements, the data loading and portal rendering code has been completely rewritten. IITC 0.14.1 and IITC Mobile 0.6.4 have been released. Changes in this version include:
This should ensure much more reliable loading of portal data, and faster rendering when lots of portals are shown.
However, this code is new, and may have bugs. Some known issues are:
<ul> <ul>
<li>Resonators are not displayed when zoomed in.</li> <li>Better performance when a very large number of portals are within view (country/continent level)</li>
<li>Some smaller links/fields are not displayed. Often this is due to changes in the stock map (it doesn't show these <li>Add layer chooser options to hide resistance/enlightened portals/links/fields</li>
links/fields either), but I think there are cases where IITC is getting it wrong.</li> <li>Chat tab now remembers which was active when reloading IITC</li>
<li>Fix some shorter links not showing on the map</li>
<li>Add details of hack information (number/cooldown time, taking account of mods) and mitigation (from shields and links)
to the portal information panel</li>
<li>Mobile
<ul>
<li>increase the size of various links on the info page to make them easier to tap</li>
<li>move the highlight selection dropdown to the native android app bar at the top</li>
</ul></li>
</ul> </ul>
However, as the current IITC release was broken I think it's better to release this build now rather than wait longer. And plugins:
<ul>
<li>Major update to bookmarks-by-zaso, including sync support</li>
<li>New features added to the resonators plugin</li>
<li>max-links plugin - start of rename to 'tidy links' - as this is a better description of what it does</li>
<li>show-linked-portals - indicate which are incoming/outgoing links in the tooltip</li>
<li>New Plugins
<ul>
<li>show-link-direction, to indicate visually which portal a link was created from</li>
<li>highlighter for portal mitigation - to show strength of defence from shields and links at a glance</li>
</ul></li>
</ul>
And, as always, numerous other bug fixes, tweaks and improvements.
</p> </p>
<a class="btn btn-small" href="?page=news">Older news</a> <a class="btn btn-small" href="?page=news">Older news</a>

View File

@ -1,5 +1,39 @@
<h2>News</h2> <h2>News</h2>
<h4>22nd September 2013</h4>
<p>
<b>Update</b>: IITC Mobile 0.6.5 replaces 0.6.4. This fixes a crash on entering plugin preferences on some tablets.
</p>
<p>
IITC 0.14.1 and IITC Mobile 0.6.4 have been released. Changes in this version include:
<ul>
<li>Better performance when a very large number of portals are within view (country/continent level)</li>
<li>Add layer chooser options to hide resistance/enlightened portals/links/fields</li>
<li>Chat tab now remembers which was active when reloading IITC</li>
<li>Fix some shorter links not showing on the map</li>
<li>Add details of hack information (number/cooldown time, taking account of mods) and mitigation (from shields and links)
to the portal information panel</li>
<li>Mobile
<ul>
<li>increase the size of various links on the info page to make them easier to tap</li>
<li>move the highlight selection dropdown to the native android app bar at the top</li>
</ul></li>
</ul>
And plugins:
<ul>
<li>Major update to bookmarks-by-zaso, including sync support</li>
<li>New features added to the resonators plugin</li>
<li>max-links plugin - start of rename to 'tidy links' - as this is a better description of what it does</li>
<li>show-linked-portals - indicate which are incoming/outgoing links in the tooltip</li>
<li>New Plugins
<ul>
<li>show-link-direction, to indicate visually which portal a link was created from</li>
<li>highlighter for portal mitigation - to show strength of defence from shields and links at a glance</li>
</ul></li>
</ul>
And, as always, numerous other bug fixes, tweaks and improvements.
</p>
<h4>2nd September 2013</h4> <h4>2nd September 2013</h4>
<p> <p>
IITC 0.14.0, and IITC Mobile 0.5.6, have just been released. This is (yet another) change required to work with IITC 0.14.0, and IITC Mobile 0.5.6, have just been released. This is (yet another) change required to work with