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_old.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);
|
54
|
}
|
55
|
|
56
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
57
|
|
58
|
private void setupBackButton(final RubikActivity act)
|
59
|
{
|
60
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
61
|
mBackButton = new TransparentImageButton(act,R.drawable.ui_back,params);
|
62
|
|
63
|
mBackButton.setOnClickListener( new View.OnClickListener()
|
64
|
{
|
65
|
@Override
|
66
|
public void onClick(View v)
|
67
|
{
|
68
|
ScreenList.goBack(act);
|
69
|
}
|
70
|
});
|
71
|
}
|
72
|
|
73
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
74
|
|
75
|
public void savePreferences(SharedPreferences.Editor editor)
|
76
|
{
|
77
|
|
78
|
}
|
79
|
|
80
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
81
|
|
82
|
public void restorePreferences(SharedPreferences preferences)
|
83
|
{
|
84
|
|
85
|
}
|
86
|
}
|