Commit 7b7bf476 authored by Luboš Horáček's avatar Luboš Horáček

Low-mem mod

parent 89172b6f
......@@ -47,65 +47,64 @@
android:layout_height="match_parent"
android:alpha="0"
android:background="@drawable/screen_gamemenu_startmenu_helplayer_clickablemap" />
</FrameLayout>
<cz.nic.tablexia.widget.TablexiaImageButton
android:id="@+id/screen_gamemenu_startmenu_helpbutton"
android:layout_width="@dimen/screen_gamemenu_startmenu_helpbutton_size"
android:layout_height="@dimen/screen_gamemenu_startmenu_helpbutton_size"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:scaleType="centerInside"
android:layout_margin="@dimen/screen_gamemenu_startmenu_helpbutton_margin"
android:background="@android:color/transparent"
android:scaleType="centerInside"
android:src="@drawable/screen_gamemenu_startmenu_helpbutton" />
<ImageView
<ImageView
android:id="@+id/screen_gamemenu_startmenu_halloffame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_halloffame_pressed"
android:visibility="invisible"/>
<ImageView
android:visibility="invisible" />
<ImageView
android:id="@+id/screen_gamemenu_startmenu_encyclopedia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_encyclopedia_pressed"
android:visibility="invisible"/>
<ImageView
android:visibility="invisible" />
<ImageView
android:id="@+id/screen_gamemenu_startmenu_statistics"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_statistics_pressed"
android:visibility="invisible"/>
<ImageView
android:visibility="invisible" />
<ImageView
android:id="@+id/screen_gamemenu_startmenu_streetdoor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_streetdoor_pressed"
android:visibility="invisible"/>
<ImageView
android:visibility="invisible" />
<ImageView
android:id="@+id/screen_gamemenu_startmenu_table"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_desk"/>
<ImageView
android:src="@drawable/screen_gamemenu_startmenu_desk" />
<ImageView
android:id="@+id/screen_gamemenu_startmenu_profile"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_profile_pressed"
android:visibility="invisible"/>
android:visibility="invisible" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<!--
Tablexia
Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/screen_gamemenu_startmenu_background" >
<View
android:id="@+id/screen_gamemenu_startmenu_clickablemap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="@drawable/screen_gamemenu_startmenu_clickablemap" />
<FrameLayout
android:id="@+id/screen_gamemenu_startmenu_helplayer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen_gamemenu_startmenu_helplayer_background"
android:src="@drawable/screen_gamemenu_startmenu_helplayer" />
<View
android:id="@+id/screen_gamemenu_startmenu_helplayer_clickablemap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="@drawable/screen_gamemenu_startmenu_helplayer_clickablemap" />
</FrameLayout>
<cz.nic.tablexia.widget.TablexiaImageButton
android:id="@+id/screen_gamemenu_startmenu_helpbutton"
android:layout_width="@dimen/screen_gamemenu_startmenu_helpbutton_size"
android:layout_height="@dimen/screen_gamemenu_startmenu_helpbutton_size"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="@dimen/screen_gamemenu_startmenu_helpbutton_margin"
android:background="@android:color/transparent"
android:scaleType="centerInside"
android:src="@drawable/screen_gamemenu_startmenu_helpbutton" />
<ImageView
android:id="@+id/screen_gamemenu_startmenu_table"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/screen_gamemenu_startmenu_desk" />
</RelativeLayout>
\ No newline at end of file
/*******************************************************************************
* Tablexia
*
*
* Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
......@@ -62,7 +62,7 @@ import cz.nic.tablexia.widget.TablexiaQuestionBannerDialog;
/**
* Tablexia context class
*
*
* @author Matyáš Latner
*/
public class Tablexia extends com.activeandroid.app.Application {
......@@ -163,7 +163,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Select user without confirmation dialog
*
*
* @param user
* @param menuActivity
*/
......@@ -187,7 +187,7 @@ public class Tablexia extends com.activeandroid.app.Application {
* Show switch user dialog. If dialog is confirmed
* selects user, unlock menu drawer and open start page.
* If user is already selected then only unlock menu.
*
*
* @param user
* @param menuActivity
*/
......@@ -242,7 +242,7 @@ public class Tablexia extends com.activeandroid.app.Application {
* Shows switch user dialog. If dialog is confirmed
* resets current user. Shows user menu and lock menu drawer.
* If logout menu is already selected force user reset.
*
*
* @param menuActivity
*/
public void softResetUser() {
......@@ -294,13 +294,11 @@ public class Tablexia extends com.activeandroid.app.Application {
return R.drawable.dialog_banner_pozor;
}
}
/**
* Resets current user. Shows user menu and lock menu drawer
*
*
* @param menuActivity
*/
public void hardResetUser() {
......@@ -309,7 +307,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Resets current user. Shows user menu and lock menu drawer
*
*
* @param menuActivity
* @param forceQuickTransition force quick home screen transaction
*/
......@@ -381,7 +379,6 @@ public class Tablexia extends com.activeandroid.app.Application {
});
}
public void hideUserMenuHelp() {
View userMenuHelpView = getCurrentMenuActivity().findViewById(R.id.usermenu_help);
if ((userMenuHelpView != null) && (userMenuHelpView.getVisibility() == View.VISIBLE)) {
......@@ -401,7 +398,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Returns actually selected user
*
*
* @return actually selected user
*/
public User getSelectedUser() {
......@@ -430,7 +427,14 @@ public class Tablexia extends com.activeandroid.app.Application {
public void setCurreActivity(MenuActivity curreActivity) {
if (this.curreActivity != curreActivity) {
mainMenu = null;
userMenu = null;
initGlobalEventListener();
this.curreActivity = curreActivity;
prepareMainMenu();
prepareUserMenu();
}
}
......@@ -450,7 +454,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Initialize main menu
*
*
* @param savedInstanceState
*/
public void initMenu() {
......@@ -463,7 +467,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Select and change menu in left panel
*
*
* @param menu menu fragment type
* @return <code>true</code> if menu is changed else <code>false</code>
*/
......@@ -485,7 +489,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Reset main menu selection
*
*
* @param menuItem
* @param menuActivity
*/
......@@ -495,7 +499,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Prepares new main menu if its needed
*
*
* @return
*/
public MainMenu prepareMainMenu() {
......@@ -507,7 +511,7 @@ public class Tablexia extends com.activeandroid.app.Application {
/**
* Prepares new user menu if its needed
*
*
* @param menuActivity
* @return
*/
......
/*******************************************************************************
* Tablexia
*
*
* Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
......@@ -56,7 +56,7 @@ import cz.nic.tablexia.widget.TablexiaDrawerLayout;
/**
* Tablexia main activity. Provides menu accessible from all screens and
* controls dispatching game fragments.
*
*
* @author Matyáš Latner
*/
public class MainActivity extends FragmentActivity implements MenuActivity {
......@@ -127,6 +127,7 @@ public class MainActivity extends FragmentActivity implements MenuActivity {
@Override
protected void onResume() {
getTablexiaContext().setCurreActivity(this);
super.onResume();
// show menu toggle button when there is selected user
......@@ -140,7 +141,6 @@ public class MainActivity extends FragmentActivity implements MenuActivity {
getTablexiaContext().showAllScreen(null);
}
@Override
protected void onDestroy() {
getTablexiaContext().resetCurrentActivity(this);
......
......@@ -52,7 +52,7 @@ public abstract class AbstractMenuFragment extends Fragment {
void onFragmentContentVisible();
}
private int layoutId;
protected int layoutId;
private String introSoundPath;
private boolean inflateInUIThread;
private MenuFragmentVisibilityListener fragmentVisibilityListener;
......@@ -239,7 +239,7 @@ public abstract class AbstractMenuFragment extends Fragment {
return loadingComplete;
}
private void startLoading() {
protected void startLoading() {
loaderTask = new FragmentDataPreloader();
loaderTask.execute(layoutId);
}
......
/*******************************************************************************
* Tablexia
*
*
* Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
......@@ -22,7 +22,12 @@ package cz.nic.tablexia.menu.mainmenu.screen.gamemenu;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
......@@ -40,6 +45,7 @@ import cz.nic.tablexia.game.games.GamesDefinition;
import cz.nic.tablexia.game.manager.GameManager;
import cz.nic.tablexia.menu.mainmenu.screen.GameMenu;
import cz.nic.tablexia.menu.usermenu.User;
import cz.nic.tablexia.util.DensityUtils;
/**
* @author lhoracek, Matyáš Latner
......@@ -90,22 +96,44 @@ public class BaseGameMenuFragment extends GameMenuFragment implements OnClickLis
/* //////////////////////////////////////////// FRAGMENT LIFECYCLE */
private void prepareParalax(View layout) {
RelativeLayout paralax = (RelativeLayout) layout.findViewById(R.id.screen_gamemenu_paralax_image);
backgroundLayers = new ImageView[currentGame.getGameImageResourceIds().length];
for (int i = 0; i < currentGame.getGameImageResourceIds().length; i++) {
// hack, protoze obrazky na touhle vrstvou by mohly byt ma sirku vetsi, aby fungoval paralaz i za kraj obrazovky
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(i > 1 ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
if (!DensityUtils.lowMemorySettings(getActivity())) {
RelativeLayout paralax = (RelativeLayout) layout.findViewById(R.id.screen_gamemenu_paralax_image);
backgroundLayers = new ImageView[currentGame.getGameImageResourceIds().length];
for (int i = 0; i < currentGame.getGameImageResourceIds().length; i++) {
// hack, protoze obrazky na touhle vrstvou by mohly byt ma sirku vetsi, aby fungoval paralaz i za kraj obrazovky
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(i > 1 ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
lp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
ImageView layer = new ImageView(getActivity());
layer.setAdjustViewBounds(true);
layer.setImageResource(currentGame.getGameImageResourceIds()[i]);
layer.setScaleType(ScaleType.CENTER_CROP);
paralax.addView(layer, lp);
backgroundLayers[i] = layer;
}
paralax.setTag(backgroundLayers);
} else {
Bitmap result = Bitmap.createBitmap(640, 360, Bitmap.Config.ARGB_8888);
Rect destRect = new Rect(0, 0, 640, 360);
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
for (int i = 0; i < currentGame.getGameImageResourceIds().length; i++) {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), currentGame.getGameImageResourceIds()[i]);
Rect srcRect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
canvas.drawBitmap(bitmap, srcRect, destRect, paint);
}
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
lp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
RelativeLayout paralax = (RelativeLayout) layout.findViewById(R.id.screen_gamemenu_paralax_image);
ImageView layer = new ImageView(getActivity());
layer.setAdjustViewBounds(true);
layer.setImageResource(currentGame.getGameImageResourceIds()[i]);
layer.setImageBitmap(result);
layer.setScaleType(ScaleType.CENTER_CROP);
paralax.addView(layer, lp);
backgroundLayers[i] = layer;
}
paralax.setTag(backgroundLayers);
}
/* //////////////////////////////////////////// START BUTTON CLICK LISTENER */
......@@ -165,7 +193,7 @@ public class BaseGameMenuFragment extends GameMenuFragment implements OnClickLis
/**
* Prepares start button
*
*
* @param layout
* @param imageResourceId
*/
......@@ -176,7 +204,7 @@ public class BaseGameMenuFragment extends GameMenuFragment implements OnClickLis
/**
* Prepares start button
*
*
* @param layout
* @param imageResourceId
*/
......@@ -189,7 +217,7 @@ public class BaseGameMenuFragment extends GameMenuFragment implements OnClickLis
/**
* Prepares difficulty seekbar
*
*
* @param layout
*/
private void prepareDifficultySeekBar(View layout) {
......@@ -247,8 +275,10 @@ public class BaseGameMenuFragment extends GameMenuFragment implements OnClickLis
}
public void resetParalax() {
for (ImageView imageView : backgroundLayers) {
imageView.setTranslationX(0);
if (backgroundLayers != null) {
for (ImageView imageView : backgroundLayers) {
imageView.setTranslationX(0);
}
}
}
......
......@@ -39,6 +39,7 @@ import cz.nic.tablexia.game.games.GamesDefinition;
import cz.nic.tablexia.menu.MenuActivity;
import cz.nic.tablexia.menu.mainmenu.MainMenuDefinition;
import cz.nic.tablexia.menu.usermenu.User;
import cz.nic.tablexia.util.DensityUtils;
import cz.nic.tablexia.widget.TablexiaImageButton;
import cz.nic.tablexia.widget.TablexiaImageButton.ClickSoundEventType;
......@@ -61,6 +62,7 @@ public class StartMenu extends GameMenuFragment implements OnTouchListener {
private static final int PROFILE_COLOR = Color.BLUE;
private static final int GAMES_STARTMENU_LAYOUT_ID = R.layout.screen_gamemenu_startmenu;
private static final int GAMES_STARTMENU_LAYOUT_LOWMEM_ID = R.layout.screen_gamemenu_startmenu_lowmem;
private static final int GAMES_STARTMENU_CLICKABLEMAP_ID = R.id.screen_gamemenu_startmenu_clickablemap;
private static final int GAMES_STARTMENU_HELPLAYER_ID = R.id.screen_gamemenu_startmenu_helplayer;
private static final int GAMES_STARTMENU_HELPLAYER_CLICKABLEMAP_ID = R.id.screen_gamemenu_startmenu_helplayer_clickablemap;
......@@ -84,6 +86,12 @@ public class StartMenu extends GameMenuFragment implements OnTouchListener {
private TablexiaImageButton helpButton;
private Bitmap hotspots;
@Override
protected void startLoading() {
layoutId = DensityUtils.lowMemorySettings(getActivity()) ? GAMES_STARTMENU_LAYOUT_LOWMEM_ID : GAMES_STARTMENU_LAYOUT_ID;
super.startLoading();
}
@Override
protected void asyncFragmentDataLoad(View layoutView) {
panoramaMenuLayout = layoutView;
......@@ -294,8 +302,10 @@ public class StartMenu extends GameMenuFragment implements OnTouchListener {
* nasteaveni pozadi kancelare a popredi dle predmetu, na ktery uzivatel kliknul pro vyobrazeni interakce
*/
private void showUserInteraction(View buttonView) {
buttonView.setVisibility(View.VISIBLE);
selectedButton = buttonView;
if (buttonView != null) {
buttonView.setVisibility(View.VISIBLE);
selectedButton = buttonView;
}
}
public void resetOffice() {
......
/*******************************************************************************
* Tablexia
*
*
* Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package cz.nic.tablexia.menu.usermenu;
import android.animation.Animator;
......@@ -37,19 +38,20 @@ import cz.nic.tablexia.audio.resources.PermanentSounds;
import cz.nic.tablexia.main.MainActivity;
import cz.nic.tablexia.menu.AbstractMenu;
import cz.nic.tablexia.menu.mainmenu.CommonUserAdapter;
import cz.nic.tablexia.util.DensityUtils;
import cz.nic.tablexia.widget.TablexiaDrawerLayout.DrawerListenerAdapter;
import cz.nic.tablexia.widget.TablexiaQuestionBannerDialog;
/**
* User menu control class.
*
*
* @author Matyáš Latner
*/
public class UserMenu extends AbstractMenu implements OnItemClickListener, OnItemLongClickListener {
private CommonUserAdapter userMenuAdapter;
private SoundControl soundControl;
private boolean menuClickableLock = true;
private CommonUserAdapter userMenuAdapter;
private SoundControl soundControl;
private boolean menuClickableLock = true;
public UserMenu(Tablexia tablexiaContext) {
super(tablexiaContext);
......@@ -110,11 +112,14 @@ public class UserMenu extends AbstractMenu implements OnItemClickListener, OnIte
@Override
public void run() {
if (position == userMenuAdapter.getUserCount()) {
((MainActivity) tablexiaContext.getCurrentMenuActivity()).showNewPlayerAnimation();
if (DensityUtils.lowMemorySettings((MainActivity) tablexiaContext.getCurrentMenuActivity())) {
((MainActivity) tablexiaContext.getCurrentMenuActivity()).getTablexiaContext().showNewUserScreen();
} else {
((MainActivity) tablexiaContext.getCurrentMenuActivity()).showNewPlayerAnimation();
}
} else {
tablexiaContext.doSelectUser(userMenuAdapter.getUserAtPosition(position));
tablexiaContext.changeMenu(AbstractMenu.MAIN_MENU);
// TODO remove TestFlight.log("Login user: " + userMenuAdapter.getUserAtPosition(position).getNickName());
}
}
}, 1000);
......
/*******************************************************************************
* Tablexia
*
*
* Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
......@@ -54,8 +54,13 @@ public class NewUserActivity extends RoboFragmentActivity {
}
}
public Tablexia getTablexiaContext() {
return (Tablexia) getApplicationContext();
}
@Override
protected void onResume() {
getTablexiaContext().setCurreActivity(null);
super.onResume();
showScreen();
}
......
package cz.nic.tablexia.util;
import android.app.Activity;
import android.util.DisplayMetrics;
public class DensityUtils {
/**
* Spočítá, zda je nutné aplikovat šetření s pamětí.
*
* @param activity
* @return
*/
public static boolean lowMemorySettings(Activity activity) {
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
long size = metrics.widthPixels * metrics.heightPixels;
long bytes = size * 4;
long pages = (bytes * 6 * 3 * 5) / 3;
Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();
return ((maxMemory / 3) * 2) < pages;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment