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

Oprava pozice bublin

parent c35b70b5
......@@ -103,7 +103,7 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone"
custom:displayRatioType="height"
custom:xPositionRatio="0.15"
custom:xPositionRatio="0.17"
custom:yPositionRatio="0.1" />
</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/>.
******************************************************************************/
package cz.nic.tablexia.menu.mainmenu;
import android.app.Activity;
......@@ -53,17 +54,17 @@ import cz.nic.tablexia.widget.TablexiaDrawerLayout.DrawerListenerAdapter;
/**
* Main menu control class.
*
*
* @author Matyáš Latner
*/
public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnChildClickListener, OnItemSelectedListener, OnGroupCollapseListener, OnGroupExpandListener {
private ExpandableListView mainMenuListView;
private MainMenuAdapter mainMenuAdapter;
private CommonUserAdapter userSpinnerAdapter;
private Spinner userSpinner;
private SoundControl soundControl;
private boolean menuClickableLock = true;
private ExpandableListView mainMenuListView;
private MainMenuAdapter mainMenuAdapter;
private CommonUserAdapter userSpinnerAdapter;
private Spinner userSpinner;
private SoundControl soundControl;
private boolean menuClickableLock = true;
private final Tablexia tablexiaContext;
public MainMenu(Tablexia tablexiaContext) {
......@@ -121,7 +122,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
Integer parameter = null;
Intent intent = tablexiaContext.getCurrentMenuActivity().getIntent();
if (intent != null) {
if (intent != null) {
Bundle extras = intent.getExtras();
if (extras != null) {
parameter = extras.getInt(MainMenuDefinition.MAIN_MENU_SCREEN_PARAMETER_KEY);
......@@ -149,10 +150,9 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
collapseAllMenu(tablexiaContext);
}
/**
* Change selected menu and main screen if its needed
*
*
* @param menuItem menu item to change
* @param forceReplace <code>true</code> for force of replace menu item
* @param forceChange force menu change
......@@ -164,7 +164,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/**
* Change selected menu and main screen if its needed
*
*
* @param menuItem menu item to change
* @param forceReplace <code>true</code> for force of replace menu item
* @param forceChange force menu change
......@@ -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
*
*
* @param mainMenuItem menu item to check if is active
* @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
/**
* Returns selected menu item enum
*
*
* @return selected menu item enum
*/
public MenuEnum getSelectedMenuItem() {
......@@ -207,7 +207,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/**
* Sets active menu item.
*
*
* @param mainMenuItem menu item to set as active
*/
public void changeActiveMenuItem(MenuEnum mainMenuItem) {
......@@ -335,13 +335,13 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
@Override
public void positiveAction() {
// tablexiaContext.showNewUserScreen();
//TODO add code for starting animation on new user click from game menu while user logged in
// tablexiaContext.showNewUserScreen();
// TODO add code for starting animation on new user click from game menu while user logged in
Bundle args = new Bundle();
args.putString("NEWUSER_GAMEMENU", "NEWUSER_GAMEMENU");
((MainActivity) tablexiaContext.getCurrentMenuActivity()).showLoadingScreen(true, args);
tablexiaContext.changeMenu(AbstractMenu.USER_MENU);
((MainActivity) tablexiaContext.getCurrentMenuActivity()).lockCloseMenuDrawer();
tablexiaContext.changeMenu(AbstractMenu.USER_MENU);
userSpinner.setSelection(userSpinnerAdapter.getUserPositionInList(tablexiaContext.getCurrentMenuActivity().getTablexiaContext().getSelectedUser().getNickName()));
tablexiaContext.getTablexiaState().setAndSaveActiveUser(null);
super.positiveAction();
......@@ -351,7 +351,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
} else {
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);
}
}
......@@ -365,7 +365,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
/**
* Main menu adapter.
*
*
* @author Matyáš Latner
*/
public class MainMenuAdapter extends BaseExpandableListAdapter {
......@@ -413,9 +413,7 @@ public class MainMenu extends AbstractMenu implements OnGroupClickListener, OnCh
// show menu selected/unselected icon
int menuIconResourceId = -1;
final ImageView itemImage = (ImageView) convertView.findViewById(MAINMENU_GROUPITEM_IMAGE_ID);
if (isActiveMenuItem(MainMenuDefinition.getMenuItemAtPosition(position)) ||
(isActiveMenuItem(MainMenuDefinition.START) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES)) ||
((getSelectedMenuItem() instanceof GamesDefinition) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES))) {
if (isActiveMenuItem(MainMenuDefinition.getMenuItemAtPosition(position)) || (isActiveMenuItem(MainMenuDefinition.START) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES)) || ((getSelectedMenuItem() instanceof GamesDefinition) && (MainMenuDefinition.getMenuItemAtPosition(position) == MainMenuDefinition.GAMES))) {
menuIconResourceId = MainMenuDefinition.getMenuItemAtPosition(position).getMenuIconSelectedResourceId();
} else {
......
......@@ -57,6 +57,7 @@ public class NewspaperDialog extends TablexiaDialog {
@Override
public void onClick(View v) {
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