Project

General

Profile

« Previous | Next » 

Revision a6d3b158

Added by Leszek Koltunski about 4 years ago

Progress with Pretty Patterns.

View differences:

src/main/java/org/distorted/uistate/RubikStatePattern.java
20 20
package org.distorted.uistate;
21 21

  
22 22
import android.content.SharedPreferences;
23
import android.support.v4.app.FragmentManager;
23 24
import android.util.DisplayMetrics;
24 25
import android.view.LayoutInflater;
26
import android.view.View;
25 27
import android.widget.Button;
26 28
import android.widget.LinearLayout;
27 29
import android.widget.TextView;
28 30

  
31
import org.distorted.dialog.RubikDialogPattern;
29 32
import org.distorted.magic.R;
30 33
import org.distorted.magic.RubikActivity;
31 34

  
......
46 49

  
47 50
  void leaveState(RubikActivity act)
48 51
    {
49

  
52
    act.setCanRotate(true);
50 53
    }
51 54

  
52 55
///////////////////////////////////////////////////////////////////////////////////////////////////
53 56

  
54
  void enterState(RubikActivity act, RubikState prev)
57
  void enterState(final RubikActivity act)
55 58
    {
59
    act.setCanRotate(false);
60

  
56 61
    LayoutInflater inflater = act.getLayoutInflater();
57 62

  
58 63
    // TOP ////////////////////////////
......
78 83
    button.setId(BUTTON_ID_BACK);
79 84
    button.setPadding(padding,0,padding,0);
80 85
    button.setText(R.string.back);
81
    button.setOnClickListener(act);
86

  
87
    button.setOnClickListener( new View.OnClickListener()
88
      {
89
      @Override
90
      public void onClick(View v)
91
        {
92
        RubikState.goBack(act);
93

  
94
        FragmentManager mana = act.getSupportFragmentManager();
95
        RubikDialogPattern diag = new RubikDialogPattern();
96
        diag.show( mana, RubikDialogPattern.getDialogTag() );
97
        }
98
      });
99

  
82 100
    layoutRight.addView(button);
83 101
    }
84 102

  

Also available in: Unified diff