Project

General

Profile

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

magiccube / src / main / java / org / distorted / screens / RubikScreenReady.java @ 1ba56d95

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.screens;
11

    
12
import android.content.SharedPreferences;
13
import android.util.TypedValue;
14
import android.view.LayoutInflater;
15
import android.view.View;
16
import android.widget.LinearLayout;
17
import android.widget.TextView;
18

    
19
import org.distorted.helpers.TransparentImageButton;
20
import org.distorted.main.R;
21
import org.distorted.main.RubikActivity;
22

    
23
///////////////////////////////////////////////////////////////////////////////////////////////////
24

    
25
public class RubikScreenReady extends RubikScreenBase
26
  {
27
  private TransparentImageButton mBackButton;
28

    
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30

    
31
  void leaveScreen(RubikActivity act)
32
    {
33

    
34
    }
35

    
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37

    
38
  void enterScreen(final RubikActivity act)
39
    {
40
    float width = act.getScreenWidthInPixels();
41
    float titleSize = width*RubikActivity.TITLE_TEXT_SIZE;
42
    LayoutInflater inflater = act.getLayoutInflater();
43

    
44
    // TOP ////////////////////////////
45
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
46
    layoutTop.removeAllViews();
47
    TextView label = (TextView)inflater.inflate(R.layout.upper_text, null);
48
    label.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleSize);
49
    label.setText(R.string.ready);
50
    layoutTop.addView(label);
51

    
52
    setupBackButton(act);
53
    createBottomPane(act,mBackButton,null);
54
    }
55

    
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57

    
58
  private void setupBackButton(final RubikActivity act)
59
    {
60
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back);
61
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
62
    mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
63

    
64
    mBackButton.setOnClickListener( new View.OnClickListener()
65
      {
66
      @Override
67
      public void onClick(View v)
68
        {
69
        ScreenList.goBack(act);
70
        }
71
      });
72
    }
73

    
74
///////////////////////////////////////////////////////////////////////////////////////////////////
75

    
76
  public void savePreferences(SharedPreferences.Editor editor)
77
    {
78

    
79
    }
80

    
81
///////////////////////////////////////////////////////////////////////////////////////////////////
82

    
83
  public void restorePreferences(SharedPreferences preferences)
84
    {
85

    
86
    }
87
  }
(6-6/10)