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?


Yes but ui is very basic atm
On 29 Dec 2014 14:48, "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-22312033>
> :
>
> > +        FrameLayout frameLayout = (FrameLayout) getView().findViewById(R.id.action_interface);
> > +        frameLayout.removeAllViews();
> > +
> > +        getActivity().getLayoutInflater().inflate(R.layout.fragment_battle_action_moves, frameLayout);
> > +        TextView[] textViews = new TextView[4];
> > +        textViews[0] = (TextView) getView().findViewById(R.id.active_move1_name);
> > +        textViews[1] = (TextView) getView().findViewById(R.id.active_move2_name);
> > +        textViews[2] = (TextView) getView().findViewById(R.id.active_move3_name);
> > +        textViews[3] = (TextView) getView().findViewById(R.id.active_move4_name);
> > +
> > +        try {
> > +            JSONArray active = json.getJSONArray("active");
> > +            JSONArray moves = active.getJSONObject(mCurrentActivePokemon).getJSONArray("moves");
> > +            for (int i = 0; i < moves.length(); i++) {
> > +                final String moveName = moves.getJSONObject(i).getString("move");
> > +                textViews[i].setText(moveName);
>
> You could add a method that change background color of move according to
> type
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NamTThai/PokemonShowdownAndroidClient/pull/60/files#r22312033>
> .
>