Project

General

Profile

Download (4.16 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / screens / RubikScreenReady.java @ 3f287c05

1 807d82b7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 fcd5b990 Leszek Koltunski
package org.distorted.screens;
21 807d82b7 Leszek Koltunski
22
import android.content.SharedPreferences;
23 e3c74c0f Leszek Koltunski
import android.util.TypedValue;
24 807d82b7 Leszek Koltunski
import android.view.LayoutInflater;
25
import android.view.View;
26 15846fe4 Leszek Koltunski
import android.widget.ImageButton;
27 807d82b7 Leszek Koltunski
import android.widget.LinearLayout;
28
import android.widget.TextView;
29
30 55e6be1d Leszek Koltunski
import org.distorted.helpers.TransparentImageButton;
31 807d82b7 Leszek Koltunski
import org.distorted.main.R;
32
import org.distorted.main.RubikActivity;
33
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35
36 fcd5b990 Leszek Koltunski
public class RubikScreenReady extends RubikScreenBase
37 807d82b7 Leszek Koltunski
  {
38 a8576d91 Leszek Koltunski
  private ImageButton mBackButton;
39 15846fe4 Leszek Koltunski
40
///////////////////////////////////////////////////////////////////////////////////////////////////
41
42 f5da732a Leszek Koltunski
  void leaveScreen(RubikActivity act)
43 807d82b7 Leszek Koltunski
    {
44
45
    }
46
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48
49 f5da732a Leszek Koltunski
  void enterScreen(final RubikActivity act)
50 807d82b7 Leszek Koltunski
    {
51 e3c74c0f Leszek Koltunski
    float width = act.getScreenWidthInPixels();
52 a8576d91 Leszek Koltunski
    float titleSize = width*RubikActivity.TITLE_TEXT_SIZE;
53 807d82b7 Leszek Koltunski
    LayoutInflater inflater = act.getLayoutInflater();
54
55
    // TOP ////////////////////////////
56
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
57
    layoutTop.removeAllViews();
58
    TextView label = (TextView)inflater.inflate(R.layout.upper_text, null);
59 e3c74c0f Leszek Koltunski
    label.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
60 807d82b7 Leszek Koltunski
    label.setText(R.string.ready);
61
    layoutTop.addView(label);
62
63 46405bb4 Leszek Koltunski
    setupBackButton(act,width);
64 a8576d91 Leszek Koltunski
    createBottomPane(act,width,mBackButton);
65 46405bb4 Leszek Koltunski
    }
66
67
///////////////////////////////////////////////////////////////////////////////////////////////////
68
69 a8576d91 Leszek Koltunski
  private void setupBackButton(final RubikActivity act, final float width)
70 46405bb4 Leszek Koltunski
    {
71 a8576d91 Leszek Koltunski
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back);
72 da768c35 Leszek Koltunski
    mBackButton = new TransparentImageButton(act, icon, width, LinearLayout.LayoutParams.MATCH_PARENT);
73 807d82b7 Leszek Koltunski
74 46405bb4 Leszek Koltunski
    mBackButton.setOnClickListener( new View.OnClickListener()
75 807d82b7 Leszek Koltunski
      {
76
      @Override
77
      public void onClick(View v)
78
        {
79 fcd5b990 Leszek Koltunski
        ScreenList.goBack(act);
80 807d82b7 Leszek Koltunski
        }
81
      });
82 46405bb4 Leszek Koltunski
    }
83 807d82b7 Leszek Koltunski
84
///////////////////////////////////////////////////////////////////////////////////////////////////
85
86
  public void savePreferences(SharedPreferences.Editor editor)
87
    {
88
89
    }
90
91
///////////////////////////////////////////////////////////////////////////////////////////////////
92
93
  public void restorePreferences(SharedPreferences preferences)
94
    {
95
96
    }
97
  }