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) {
if(playerName === sessionStorage[key]) {
guid = key;
window._playerNameToGuidCache[playerName] = guid;
return false; //break from $.each
}
});
window._playerNameToGuidCache[playerName] = guid;
return guid;
}

View File

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

View File

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

View File

@ -16,6 +16,8 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Comparator;
public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNavigationListener, OnItemClickListener {
// Show/hide the up arrow on the very left
// getActionBar().setDisplayHomeAsUpEnabled(enabled);
@ -30,6 +32,22 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
// getActionBar().setHomeButtonEnabled(enabled);
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() {
super(mIitc, android.R.layout.simple_list_item_1);
clear();
@ -39,6 +57,7 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
public void add(String object) {
super.remove(object); // to avoid duplicates
super.add(object);
super.sort(mComparator);
}
@Override
@ -178,7 +197,7 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
if (mHighlighters.getCount() < 2) // there should always be "No Highlights"
showHighlighter = false;
if(mDrawerOpened)
if (mDrawerOpened)
showHighlighter = false;
if (showHighlighter) {
@ -240,7 +259,7 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
public void onDrawerOpened(View drawerView) {
// TODO change menu? (via invalidateOptionsMenu)
super.onDrawerOpened(drawerView);
mDrawerOpened=true;
mDrawerOpened = true;
updateActionBar();
}

View File

@ -15,6 +15,8 @@ import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.TextView;
import com.cradle.iitc_mobile.fragments.PluginsFragment;
import java.io.File;
import java.io.FileNotFoundException;
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
private static TreeMap<String, ArrayList<IITC_PluginPreference>> sPlugins = null;
public static final String USER_PLUGIN = "00000";
private static int mDeletedPlugins = 0;
@Override
public void setListAdapter(ListAdapter adapter) {
@ -57,6 +60,36 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
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
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
@ -106,7 +139,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
for (Map.Entry<String, ArrayList<IITC_PluginPreference>> entry : sPlugins.entrySet()) {
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");
sPlugins.clear();
setUpPluginPreferenceScreen();
@ -188,6 +221,7 @@ public class IITC_PluginPreferenceActivity extends PreferenceActivity {
// do not add deleted plugins
if (plugin_cat.equals("Deleted")) {
mDeletedPlugins++;
return;
}

View File

@ -22,6 +22,7 @@ public class PluginsFragment extends PreferenceFragment {
// alphabetical order
getPreferenceScreen().setOrderingAsAdded(false);
if (getArguments() != null) {
// get plugins category for this fragments and plugins list
String category = getArguments().getString("category");
ArrayList<IITC_PluginPreference> prefs =
@ -38,5 +39,6 @@ public class PluginsFragment extends PreferenceFragment {
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>
<h4>2nd September 2013</h4>
<h4>22nd September 2013</h4>
<p>
IITC 0.14.0, and IITC Mobile 0.5.6, have just been released. This is (yet another) change required to work with
the latest changes to the standard intel website.
<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>
Also, as part of some long-term improvements, the data loading and portal rendering code has been completely rewritten.
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:
IITC 0.14.1 and IITC Mobile 0.6.4 have been released. Changes in this version include:
<ul>
<li>Resonators are not displayed when zoomed in.</li>
<li>Some smaller links/fields are not displayed. Often this is due to changes in the stock map (it doesn't show these
links/fields either), but I think there are cases where IITC is getting it wrong.</li>
<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>
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>
<a class="btn btn-small" href="?page=news">Older news</a>

View File

@ -1,5 +1,39 @@
<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>
<p>
IITC 0.14.0, and IITC Mobile 0.5.6, have just been released. This is (yet another) change required to work with