Project

General

Profile

« Previous | Next » 

Revision e0e84674

Added by Leszek Koltunski over 4 years ago

Improve the upper_text.

View differences:

build.gradle
5 5

  
6 6
    defaultConfig {
7 7
        applicationId "org.distorted.magic"
8
        minSdkVersion 24
8
        minSdkVersion 26
9 9
        targetSdkVersion 27
10 10
        versionCode 1
11 11
        versionName "1.0"
src/main/java/org/distorted/dialog/RubikDialogPatternView.java
120 120

  
121 121
///////////////////////////////////////////////////////////////////////////////////////////////////
122 122

  
123
  private void fillPatterns(int category)
123
  private void fillPatterns(final int category)
124 124
    {
125 125
    final RubikActivity act = (RubikActivity)getContext();
126 126

  
......
148 148
        public void onClick(View view)
149 149
          {
150 150
          RubikStatePattern state = (RubikStatePattern) RubikState.PATT.getStateClass();
151
          state.setPatternName(patterns[ii]);
151
          state.setPattern(mPosition, category, ii);
152 152
          mDialog.dismiss();
153 153
          }
154 154
        });
src/main/java/org/distorted/uistate/RubikStatePattern.java
39 39

  
40 40
public class RubikStatePattern extends RubikStateAbstract
41 41
  {
42
  // TODO: read this from upper_text.xml;  this is the height of the TextView there.
43
  private static final int DEFAULT_TEXT_SIZE = 30;
44

  
42 45
  private TextView mText;
43 46
  private Button mBackButton;
44 47
  private int mSize;
......
144 147

  
145 148
        if( diag==null )
146 149
          {
150
          mText.setTextSize(DEFAULT_TEXT_SIZE);
151
          mText.setText(R.string.patterns);
147 152
          showDialog(mana);
148 153
          }
149 154
        else
......
157 162

  
158 163
///////////////////////////////////////////////////////////////////////////////////////////////////
159 164

  
160
  public void setPatternName(String name)
165
  public void setPattern(int sizeIndex, int category, int pattern)
161 166
    {
162
    mText.setText(name);
167
    RubikPattern patt = RubikPattern.getInstance();
168
    String patternName = patt.getPatternName(sizeIndex,category,pattern);
169
    mText.setText(patternName);
163 170
    }
164 171

  
165 172
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/res/layout/upper_text.xml
3 3
        android:layout_width="fill_parent"
4 4
        android:layout_height="50dp"
5 5
        android:textAlignment="center"
6
        android:paddingLeft="10dp"
7
        android:paddingRight="10dp"
8
        android:autoSizeTextType="uniform"
6 9
        android:textSize="30sp"/>

Also available in: Unified diff