Commit 87e73080 authored by Luboš Horáček's avatar Luboš Horáček

Oprava pozice bublin

parent c35b70b5
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize" android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone" android:visibility="gone"
custom:displayRatioType="height" custom:displayRatioType="height"
custom:xPositionRatio="0.15" custom:xPositionRatio="0.17"
custom:yPositionRatio="0.1" /> custom:yPositionRatio="0.1" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
/******************************************************************************* /*******************************************************************************
* Tablexia * Tablexia
* *
* Copyright (C) 2013 CZ NIC z.s.p.o. <podpora at nic dot cz> * 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 * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/ ******************************************************************************/
package cz.nic.tablexia.menu.mainmenu; package cz.nic.tablexia.menu.mainmenu;
import android.app.Activity; import android.app.Activity;
...@@ -53,17 +54,17 @@ import cz.nic.tablexia.widget.TablexiaDrawerLayout.DrawerListenerAdapter; ...@@ -53,17 +54,17 @@ import cz.nic.tablexia.widget.TablexiaDrawerLayout.DrawerListenerAdapter;
/** /**
* Main menu control class. * Main menu control class.
* *
* @author Matyáš Latner * @author Matyáš Latner
*/ */
public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnChildClickListener, OnItemSelectedListener, OnGroupCollapseListener, OnGroupExpandListener { public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnChildClickListener, OnItemSelectedListener, OnGroupCollapseListener, OnGroupExpandListener {
private ExpandableListView mainMenuListView; private ExpandableListView mainMenuListView;
private MainMenuAdapter mainMenuAdapter; private MainMenuAdapter mainMenuAdapter;
private CommonUserAdapter userSpinnerAdapter; private CommonUserAdapter userSpinnerAdapter;
private Spinner userSpinner; private Spinner userSpinner;
private SoundControl soundControl; private SoundControl soundControl;
private boolean menuClickableLock = true; private boolean menuClickableLock = true;
private final Tablexia tablexiaContext; private final Tablexia tablexiaContext;
public MainMenu(Tablexia tablexiaContext) { public MainMenu(Tablexia tablexiaContext) {
...@@ -121,7 +122,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -121,7 +122,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
Integer parameter = null; Integer parameter = null;
Intent intent = tablexiaContext.getCurrentMenuActivity().getIntent(); Intent intent = tablexiaContext.getCurrentMenuActivity().getIntent();
if (intent != null) { if (intent != null) {
Bundle extras = intent.getExtras(); Bundle extras = intent.getExtras();
if (extras != null) { if (extras != null) {
parameter = extras.getInt(MainMenuDefinition.MAIN_MENU_SCREEN_PARAMETER_KEY); parameter = extras.getInt(MainMenuDefinition.MAIN_MENU_SCREEN_PARAMETER_KEY);
...@@ -149,10 +150,9 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -149,10 +150,9 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
collapseAllMenu(tablexiaContext); collapseAllMenu(tablexiaContext);
} }
/** /**
* Change selected menu and main screen if its needed * Change selected menu and main screen if its needed
* *
* @param menuItem menu item to change * @param menuItem menu item to change
* @param forceReplace <code>true</code> for force of replace menu item * @param forceReplace <code>true</code> for force of replace menu item
* @param forceChange force menu change * @param forceChange force menu change
...@@ -164,7 +164,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -164,7 +164,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/** /**
* Change selected menu and main screen if its needed * Change selected menu and main screen if its needed
* *
* @param menuItem menu item to change * @param menuItem menu item to change
* @param forceReplace <code>true</code> for force of replace menu item * @param forceReplace <code>true</code> for force of replace menu item
* @param forceChange force menu change * @param forceChange force menu change
...@@ -188,7 +188,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -188,7 +188,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/** /**
* Returns <code>true</code> if menu item in parameter is same as active menu item * Returns <code>true</code> if menu item in parameter is same as active menu item
* *
* @param mainMenuItem menu item to check if is active * @param mainMenuItem menu item to check if is active
* @return <code>true</code> if menu item in parameter is same as active menu item * @return <code>true</code> if menu item in parameter is same as active menu item
*/ */
...@@ -198,7 +198,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -198,7 +198,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/** /**
* Returns selected menu item enum * Returns selected menu item enum
* *
* @return selected menu item enum * @return selected menu item enum
*/ */
public MenuEnum getSelectedMenuItem() { public MenuEnum getSelectedMenuItem() {
...@@ -207,7 +207,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -207,7 +207,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/** /**
* Sets active menu item. * Sets active menu item.
* *
* @param mainMenuItem menu item to set as active * @param mainMenuItem menu item to set as active
*/ */
public void changeActiveMenuItem(MenuEnum mainMenuItem) { public void changeActiveMenuItem(MenuEnum mainMenuItem) {
...@@ -335,13 +335,13 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -335,13 +335,13 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
@Override @Override
public void positiveAction() { public void positiveAction() {
// tablexiaContext.showNewUserScreen(); // tablexiaContext.showNewUserScreen();
//TODO add code for starting animation on new user click from game menu while user logged in // TODO add code for starting animation on new user click from game menu while user logged in
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("NEWUSER_GAMEMENU", "NEWUSER_GAMEMENU"); args.putString("NEWUSER_GAMEMENU", "NEWUSER_GAMEMENU");
((MainActivity) tablexiaContext.getCurrentMenuActivity()).showLoadingScreen(true, args); ((MainActivity) tablexiaContext.getCurrentMenuActivity()).showLoadingScreen(true, args);
tablexiaContext.changeMenu(AbstractMenu.USER_MENU);
((MainActivity) tablexiaContext.getCurrentMenuActivity()).lockCloseMenuDrawer(); ((MainActivity) tablexiaContext.getCurrentMenuActivity()).lockCloseMenuDrawer();
tablexiaContext.changeMenu(AbstractMenu.USER_MENU);
userSpinner.setSelection(userSpinnerAdapter.getUserPositionInList(tablexiaContext.getCurrentMenuActivity().getTablexiaContext().getSelectedUser().getNickName())); userSpinner.setSelection(userSpinnerAdapter.getUserPositionInList(tablexiaContext.getCurrentMenuActivity().getTablexiaContext().getSelectedUser().getNickName()));
tablexiaContext.getTablexiaState().setAndSaveActiveUser(null); tablexiaContext.getTablexiaState().setAndSaveActiveUser(null);
super.positiveAction(); super.positiveAction();
...@@ -351,7 +351,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -351,7 +351,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
} else { } else {
tablexiaContext.doSelectUser(userSpinnerAdapter.getUserAtPosition(position)); tablexiaContext.doSelectUser(userSpinnerAdapter.getUserAtPosition(position));
((TextView)view.findViewById(R.id.usermenu_text)).setTypeface(Typeface.DEFAULT); ((TextView) view.findViewById(R.id.usermenu_text)).setTypeface(Typeface.DEFAULT);
view.findViewById(R.id.usermenu_selector).setVisibility(View.GONE); view.findViewById(R.id.usermenu_selector).setVisibility(View.GONE);
} }
} }
...@@ -365,7 +365,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -365,7 +365,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/** /**
* Main menu adapter. * Main menu adapter.
* *
* @author Matyáš Latner * @author Matyáš Latner
*/ */
public class MainMenuAdapter extends BaseExpandableListAdapter { public class MainMenuAdapter extends BaseExpandableListAdapter {
...@@ -413,9 +413,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh ...@@ -413,9 +413,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
// show menu selected/unselected icon // show menu selected/unselected icon
int menuIconResourceId = -1; int menuIconResourceId = -1;
final ImageView itemImage = (ImageView) convertView.findViewById(MAINMENU_GROUPITEM_IMAGE_ID); final ImageView itemImage = (ImageView) convertView.findViewById(MAINMENU_GROUPITEM_IMAGE_ID);
if (isActiveMenuItem(MainMenuDefinition.getMenuItemAtPosition(position)) || if (isActiveMenuItem(MainMenuDefinition.getMenuItemAtPosition(position)) || (isActiveMenuItem(MainMenuDefinition.START) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES)) || ((getSelectedMenuItem() instanceof GamesDefinition) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES))) {
(isActiveMenuItem(MainMenuDefinition.START) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES)) ||
((getSelectedMenuItem() instanceof GamesDefinition) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES))) {
menuIconResourceId = MainMenuDefinition.getMenuItemAtPosition(position).getMenuIconSelectedResourceId(); menuIconResourceId = MainMenuDefinition.getMenuItemAtPosition(position).getMenuIconSelectedResourceId();
} else { } else {
......
...@@ -57,6 +57,7 @@ public class NewspaperDialog extends TablexiaDialog { ...@@ -57,6 +57,7 @@ public class NewspaperDialog extends TablexiaDialog {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(new Intent("cz.nic.tablexia.action.SLIDE_NEWSPAPER")); LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(new Intent("cz.nic.tablexia.action.SLIDE_NEWSPAPER"));
dismiss();
} }
}); });
} }
......
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