Battling

- singles works (teampreview , attackign and switching and mega evolving)
- doubles works but no targetting yet (TODO, not sure about team preview?)
- Fixed a problem in the request case when we switch

TODO :

- a better UI
- targetting system for doubles
- teampreview for doubles
- canceling support?


UI is very basic atm
On 29 Dec 2014 14:50, "Nam Thai" <notifications@github.com> wrote:

> In app/src/main/java/com/pokemonshowdown/app/BattleFragment.java
> <https://github.com/NamTThai/PokemonShowdownAndroidClient/pull/60#discussion-diff-22312074>
> :
>
> > +    private void showSwitchFrame(final JSONObject json) {
> > +        FrameLayout frameLayout = (FrameLayout) getView().findViewById(R.id.action_interface);
> > +        frameLayout.removeAllViews();
> > +
> > +        getActivity().getLayoutInflater().inflate(R.layout.fragment_battle_action_switch, frameLayout);
> > +
> > +        TextView[] textViews = new TextView[6];
> > +        textViews[0] = (TextView) getView().findViewById(R.id.switch_pokemon1_name);
> > +        textViews[1] = (TextView) getView().findViewById(R.id.switch_pokemon2_name);
> > +        textViews[2] = (TextView) getView().findViewById(R.id.switch_pokemon3_name);
> > +        textViews[3] = (TextView) getView().findViewById(R.id.switch_pokemon4_name);
> > +        textViews[4] = (TextView) getView().findViewById(R.id.switch_pokemon5_name);
> > +        textViews[5] = (TextView) getView().findViewById(R.id.switch_pokemon6_name);
> > +        for (int i = 0; i < getPlayer1Team().size(); i++) {
> > +            final int idx = i + 1;
> > +            textViews[i].setText(getPlayer1Team().get(i).getName());
>
> Icon ?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NamTThai/PokemonShowdownAndroidClient/pull/60/files#r22312074>
> .
>