Merge branch 'newnavigation' of git://github.com/fkloft/ingress-intel-total-conversion into fkloft-newnavigation
This commit is contained in:
commit
1705ea5c75
@ -318,7 +318,19 @@ public class IITC_Mobile extends Activity {
|
|||||||
// we want a self defined behavior for the back button
|
// we want a self defined behavior for the back button
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
// first kill all open iitc dialogs
|
// exit fullscreen mode if it is enabled and action bar is disabled or the back stack is empty
|
||||||
|
if (mFullscreenMode && (mBackStack.isEmpty() || mNavigationHelper.hideInFullscreen())) {
|
||||||
|
toggleFullscreen();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// close drawer if opened
|
||||||
|
if (mNavigationHelper.isDrawerOpened()) {
|
||||||
|
mNavigationHelper.closeDrawer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// kill all open iitc dialogs
|
||||||
if (!mDialogStack.isEmpty()) {
|
if (!mDialogStack.isEmpty()) {
|
||||||
String id = mDialogStack.pop();
|
String id = mDialogStack.pop();
|
||||||
mIitcWebView.loadUrl("javascript: " +
|
mIitcWebView.loadUrl("javascript: " +
|
||||||
@ -327,17 +339,17 @@ public class IITC_Mobile extends Activity {
|
|||||||
"selector.remove();");
|
"selector.remove();");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// exit fullscreen mode if it is enabled and action bar is disabled
|
|
||||||
// or the back stack is empty
|
|
||||||
if (mFullscreenMode && (mBackStack.isEmpty() || mNavigationHelper.hideInFullscreen())) {
|
|
||||||
this.toggleFullscreen();
|
|
||||||
} else if (!mBackStack.isEmpty()) {
|
|
||||||
// Pop last item from backstack and pretend the relevant menu item was clicked
|
// Pop last item from backstack and pretend the relevant menu item was clicked
|
||||||
|
if (!mBackStack.isEmpty()) {
|
||||||
backStackPop();
|
backStackPop();
|
||||||
} else {
|
return;
|
||||||
if (mBackButtonPressed || !mSharedPrefs.getBoolean("pref_press_twice_to_exit", false))
|
}
|
||||||
|
|
||||||
|
if (mBackButtonPressed || !mSharedPrefs.getBoolean("pref_press_twice_to_exit", false)) {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
else {
|
return;
|
||||||
|
} else {
|
||||||
mBackButtonPressed = true;
|
mBackButtonPressed = true;
|
||||||
Toast.makeText(this, "Press twice to exit", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Press twice to exit", Toast.LENGTH_SHORT).show();
|
||||||
// reset back button after 2 seconds
|
// reset back button after 2 seconds
|
||||||
@ -349,7 +361,6 @@ public class IITC_Mobile extends Activity {
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void backStackPop() {
|
public void backStackPop() {
|
||||||
// shouldn't be called when back stack is empty
|
// shouldn't be called when back stack is empty
|
||||||
|
@ -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
|
||||||
@ -178,7 +197,7 @@ 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) {
|
||||||
@ -204,6 +223,10 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
|
|||||||
updateActionBar();
|
updateActionBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void closeDrawer() {
|
||||||
|
mDrawerLayout.closeDrawers();
|
||||||
|
}
|
||||||
|
|
||||||
public String getPaneTitle(Pane pane)
|
public String getPaneTitle(Pane pane)
|
||||||
{
|
{
|
||||||
switch (pane) {
|
switch (pane) {
|
||||||
@ -224,6 +247,10 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnNa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDrawerOpened() {
|
||||||
|
return mDrawerOpened;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hideInFullscreen() {
|
public boolean hideInFullscreen() {
|
||||||
return mHideInFullscreen;
|
return mHideInFullscreen;
|
||||||
}
|
}
|
||||||
@ -240,7 +267,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,9 @@ offers many more features. It is available for
|
|||||||
|
|
||||||
<h4>22nd September 2013</h4>
|
<h4>22nd September 2013</h4>
|
||||||
<p>
|
<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:
|
IITC 0.14.1 and IITC Mobile 0.6.4 have been released. Changes in this version include:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Better performance when a very large number of portals are within view (country/continent level)</li>
|
<li>Better performance when a very large number of portals are within view (country/continent level)</li>
|
||||||
@ -44,4 +47,5 @@ And plugins:
|
|||||||
And, as always, numerous other bug fixes, tweaks and improvements.
|
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>
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
<h4>22nd September 2013</h4>
|
<h4>22nd September 2013</h4>
|
||||||
<p>
|
<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:
|
IITC 0.14.1 and IITC Mobile 0.6.4 have been released. Changes in this version include:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Better performance when a very large number of portals are within view (country/continent level)</li>
|
<li>Better performance when a very large number of portals are within view (country/continent level)</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user