Project

General

Profile

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

magiccube / src / main / java / org / distorted / playui / ScreenScrambling.java @ a5972f92

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2023 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.playui;
11

    
12
import android.content.SharedPreferences;
13
import android.view.View;
14
import android.widget.LinearLayout;
15

    
16
import org.distorted.helpers.TransparentImageButton;
17
import org.distorted.main.R;
18

    
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

    
21
public class ScreenScrambling extends ScreenAbstract
22
  {
23
  private TransparentImageButton mBackButton;
24

    
25
///////////////////////////////////////////////////////////////////////////////////////////////////
26

    
27
  void leaveScreen(PlayActivity act)
28
    {
29

    
30
    }
31

    
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33

    
34
  void enterScreen(final PlayActivity act)
35
    {
36
    // TOP ////////////////////////////
37
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
38
    layoutTop.removeAllViews();
39

    
40
    // BOT ////////////////////////////
41
    LinearLayout layoutBot = act.findViewById(R.id.lowerBar);
42
    layoutBot.removeAllViews();
43

    
44
    LinearLayout.LayoutParams paramsL = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1);
45
    LinearLayout.LayoutParams paramsR = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,2);
46

    
47
    LinearLayout layoutLeft = new LinearLayout(act);
48
    layoutLeft.setLayoutParams(paramsL);
49
    LinearLayout layoutRight = new LinearLayout(act);
50
    layoutRight.setLayoutParams(paramsR);
51

    
52
    setupBackButton(act);
53

    
54
    layoutRight.addView(mBackButton);
55
    layoutBot.addView(layoutLeft);
56
    layoutBot.addView(layoutRight);
57
    }
58

    
59
///////////////////////////////////////////////////////////////////////////////////////////////////
60

    
61
  private void setupBackButton(final PlayActivity act)
62
    {
63
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
64
    mBackButton = new TransparentImageButton(act,R.drawable.ui_back,params);
65

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

    
76
///////////////////////////////////////////////////////////////////////////////////////////////////
77

    
78
  public void savePreferences(SharedPreferences.Editor editor)
79
    {
80

    
81
    }
82

    
83
///////////////////////////////////////////////////////////////////////////////////////////////////
84

    
85
  public void restorePreferences(SharedPreferences preferences)
86
    {
87

    
88
    }
89
  }
(11-11/12)