Made the GameActivity Rotatable. (Sounds easy.... wasn't though)
This commit is contained in:
parent
1b31b5cfe2
commit
91530e3efa
12 changed files with 418 additions and 86 deletions
|
@ -3,11 +3,15 @@ package org.secuso.privacyfriendlysudoku.controller;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import org.secuso.privacyfriendlysudoku.controller.helper.GameInfoContainer;
|
import org.secuso.privacyfriendlysudoku.controller.helper.GameInfoContainer;
|
||||||
import org.secuso.privacyfriendlysudoku.game.CellConflict;
|
import org.secuso.privacyfriendlysudoku.game.CellConflict;
|
||||||
|
@ -26,7 +30,7 @@ import org.secuso.privacyfriendlysudoku.game.listener.ITimerListener;
|
||||||
/**
|
/**
|
||||||
* Created by Chris on 06.11.2015.
|
* Created by Chris on 06.11.2015.
|
||||||
*/
|
*/
|
||||||
public class GameController implements IModelChangedListener {
|
public class GameController implements IModelChangedListener, Parcelable {
|
||||||
|
|
||||||
// General
|
// General
|
||||||
private SharedPreferences settings;
|
private SharedPreferences settings;
|
||||||
|
@ -63,11 +67,12 @@ public class GameController implements IModelChangedListener {
|
||||||
|
|
||||||
// Timer
|
// Timer
|
||||||
private int time = 0;
|
private int time = 0;
|
||||||
private boolean timerRunning = false;
|
private AtomicBoolean timerRunning = new AtomicBoolean(false);
|
||||||
private LinkedList<ITimerListener> timerListeners = new LinkedList<>();
|
private LinkedList<ITimerListener> timerListeners = new LinkedList<>();
|
||||||
private Handler timerHandler = new Handler();
|
private Handler timerHandler = new Handler();
|
||||||
private Timer timer = new Timer();
|
private Timer timer = new Timer();
|
||||||
private TimerTask timerTask;
|
private TimerTask timerTask;
|
||||||
|
|
||||||
private boolean noteStatus = false;
|
private boolean noteStatus = false;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -584,31 +589,40 @@ public class GameController implements IModelChangedListener {
|
||||||
return usedHints;
|
return usedHints;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTimer() {
|
public void initTimer() {
|
||||||
|
deleteTimer();
|
||||||
|
|
||||||
timerTask = new TimerTask() {
|
timerTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
timerHandler.post(new Runnable() {
|
timerHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if(timerRunning) {
|
if(timerRunning.get()) {
|
||||||
notifyTimerListener(time++);
|
notifyTimerListener(time++);
|
||||||
|
//Log.d("Timer", "calling notifyTimerListener(" + time + ");");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
timer = new Timer();
|
timer = new Timer();
|
||||||
timer.scheduleAtFixedRate(timerTask,0,1000);
|
timer.scheduleAtFixedRate(timerTask, 0, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteTimer() {
|
||||||
|
pauseTimer();
|
||||||
|
timer.cancel();
|
||||||
|
timer.purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startTimer() {
|
public void startTimer() {
|
||||||
timerRunning = true;
|
timerRunning.set(true);
|
||||||
notifyHighlightChangedListeners();
|
notifyHighlightChangedListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pauseTimer(){
|
public void pauseTimer(){
|
||||||
timerRunning = false;
|
timerRunning.set(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReDo() {
|
public void ReDo() {
|
||||||
|
@ -665,4 +679,83 @@ public class GameController implements IModelChangedListener {
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
|
|
||||||
|
// get the gamecontroller a new context
|
||||||
|
out.writeInt(selectedRow);
|
||||||
|
out.writeInt(selectedCol);
|
||||||
|
out.writeInt(selectedValue);
|
||||||
|
out.writeInt(highlightValue);
|
||||||
|
out.writeInt(gameID);
|
||||||
|
out.writeInt(size);
|
||||||
|
out.writeInt(sectionHeight);
|
||||||
|
out.writeInt(sectionWidth);
|
||||||
|
out.writeInt(usedHints);
|
||||||
|
out.writeInt(time);
|
||||||
|
|
||||||
|
out.writeIntArray(solution);
|
||||||
|
|
||||||
|
out.writeInt(noteStatus ? 1 : 0);
|
||||||
|
out.writeInt(notifiedOnSolvedListeners ? 1 : 0);
|
||||||
|
|
||||||
|
out.writeParcelable(gameType, 0);
|
||||||
|
out.writeParcelable(difficulty, 0);
|
||||||
|
out.writeParcelable(gameBoard, 0);
|
||||||
|
out.writeParcelable(undoRedoManager, 0);
|
||||||
|
|
||||||
|
// delete lists, in case we get the same object back from Parcel
|
||||||
|
removeAllListeners();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<GameController> CREATOR = new Parcelable.Creator<GameController>() {
|
||||||
|
public GameController createFromParcel(Parcel in) {
|
||||||
|
return new GameController(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameController[] newArray(int size) {
|
||||||
|
return new GameController[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** recreate object from parcel */
|
||||||
|
private GameController(Parcel in) {
|
||||||
|
|
||||||
|
selectedRow = in.readInt();
|
||||||
|
selectedCol = in.readInt();
|
||||||
|
selectedValue = in.readInt();
|
||||||
|
highlightValue = in.readInt();
|
||||||
|
gameID = in.readInt();
|
||||||
|
size = in.readInt();
|
||||||
|
sectionHeight = in.readInt();
|
||||||
|
sectionWidth = in.readInt();
|
||||||
|
usedHints = in.readInt();
|
||||||
|
time = in.readInt();
|
||||||
|
|
||||||
|
in.readIntArray(solution);
|
||||||
|
|
||||||
|
noteStatus = in.readInt() == 1;
|
||||||
|
notifiedOnSolvedListeners = in.readInt() == 1;
|
||||||
|
|
||||||
|
gameType = in.readParcelable(null);
|
||||||
|
difficulty = in.readParcelable(null);
|
||||||
|
gameBoard = in.readParcelable(null);
|
||||||
|
undoRedoManager = in.readParcelable(null);
|
||||||
|
|
||||||
|
removeAllListeners();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeAllListeners() {
|
||||||
|
highlightListeners = new LinkedList<>();
|
||||||
|
solvedListeners = new LinkedList<>();
|
||||||
|
hintListener = new LinkedList<>();
|
||||||
|
timerListeners = new LinkedList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.secuso.privacyfriendlysudoku.controller;
|
package org.secuso.privacyfriendlysudoku.controller;
|
||||||
|
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package org.secuso.privacyfriendlysudoku.controller;
|
package org.secuso.privacyfriendlysudoku.controller;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import org.secuso.privacyfriendlysudoku.game.GameBoard;
|
import org.secuso.privacyfriendlysudoku.game.GameBoard;
|
||||||
|
@ -7,7 +10,7 @@ import org.secuso.privacyfriendlysudoku.game.GameBoard;
|
||||||
/**
|
/**
|
||||||
* Created by Chris on 24.11.2015.
|
* Created by Chris on 24.11.2015.
|
||||||
*/
|
*/
|
||||||
public class UndoRedoManager {
|
public class UndoRedoManager implements Parcelable {
|
||||||
|
|
||||||
private int activeState;
|
private int activeState;
|
||||||
private LinkedList<GameBoard> states = new LinkedList<>();
|
private LinkedList<GameBoard> states = new LinkedList<>();
|
||||||
|
@ -78,4 +81,33 @@ public class UndoRedoManager {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
|
out.writeInt(activeState);
|
||||||
|
out.writeTypedList(states);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<UndoRedoManager> CREATOR
|
||||||
|
= new Parcelable.Creator<UndoRedoManager>() {
|
||||||
|
public UndoRedoManager createFromParcel(Parcel in) {
|
||||||
|
return new UndoRedoManager(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UndoRedoManager[] newArray(int size) {
|
||||||
|
return new UndoRedoManager[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** recreate object from parcel */
|
||||||
|
private UndoRedoManager(Parcel in) {
|
||||||
|
activeState = in.readInt();
|
||||||
|
in.readTypedList(states, GameBoard.CREATOR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package org.secuso.privacyfriendlysudoku.game;
|
package org.secuso.privacyfriendlysudoku.game;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -8,7 +11,7 @@ import org.secuso.privacyfriendlysudoku.game.listener.IModelChangedListener;
|
||||||
/**
|
/**
|
||||||
* Created by Christopher Beckmann on 06.11.2015.
|
* Created by Christopher Beckmann on 06.11.2015.
|
||||||
*/
|
*/
|
||||||
public class GameBoard implements Cloneable {
|
public class GameBoard implements Cloneable, Parcelable {
|
||||||
|
|
||||||
//private int id;
|
//private int id;
|
||||||
private GameType gameType;
|
private GameType gameType;
|
||||||
|
@ -272,4 +275,51 @@ public class GameBoard implements Cloneable {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
|
||||||
|
dest.writeParcelable(gameType, 0);
|
||||||
|
dest.writeInt(sectionHeight);
|
||||||
|
dest.writeInt(sectionWidth);
|
||||||
|
dest.writeInt(size);
|
||||||
|
|
||||||
|
for(int i = 0; i < field.length; i++) {
|
||||||
|
dest.writeParcelableArray(field[i], 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public static final Parcelable.Creator<GameBoard> CREATOR
|
||||||
|
= new Parcelable.Creator<GameBoard>() {
|
||||||
|
public GameBoard createFromParcel(Parcel in) {
|
||||||
|
return new GameBoard(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameBoard[] newArray(int size) {
|
||||||
|
return new GameBoard[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** recreate object from parcel */
|
||||||
|
private GameBoard(Parcel in) {
|
||||||
|
//private int id;
|
||||||
|
gameType = in.readParcelable(null);
|
||||||
|
sectionHeight = in.readInt();
|
||||||
|
sectionWidth = in.readInt();
|
||||||
|
size = in.readInt();
|
||||||
|
|
||||||
|
field = new GameCell[size][size];
|
||||||
|
|
||||||
|
for(int i = 0; i < field.length; i++) {
|
||||||
|
// TODO: does this work?!
|
||||||
|
field[i] = (GameCell[]) in.readParcelableArray(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
modelChangedListeners = new LinkedList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package org.secuso.privacyfriendlysudoku.game;
|
package org.secuso.privacyfriendlysudoku.game;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -9,7 +12,7 @@ import org.secuso.privacyfriendlysudoku.game.listener.IModelChangedListener;
|
||||||
/**
|
/**
|
||||||
* Created by Chris on 06.11.2015.
|
* Created by Chris on 06.11.2015.
|
||||||
*/
|
*/
|
||||||
public class GameCell implements Cloneable {
|
public class GameCell implements Cloneable, Parcelable {
|
||||||
|
|
||||||
private int row = 0;
|
private int row = 0;
|
||||||
private int col = 0;
|
private int col = 0;
|
||||||
|
@ -199,4 +202,42 @@ public class GameCell implements Cloneable {
|
||||||
m.onModelChange(this);
|
m.onModelChange(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(row);
|
||||||
|
dest.writeInt(col);
|
||||||
|
dest.writeInt(value);
|
||||||
|
dest.writeInt(fixed ? 1 : 0);
|
||||||
|
dest.writeInt(noteCount);
|
||||||
|
dest.writeBooleanArray(notes);
|
||||||
|
dest.writeInt(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<GameCell> CREATOR
|
||||||
|
= new Parcelable.Creator<GameCell>() {
|
||||||
|
public GameCell createFromParcel(Parcel in) {
|
||||||
|
return new GameCell(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameCell[] newArray(int size) {
|
||||||
|
return new GameCell[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** recreate object from parcel */
|
||||||
|
private GameCell(Parcel in) {
|
||||||
|
row = in.readInt();
|
||||||
|
col = in.readInt();
|
||||||
|
value = in.readInt();
|
||||||
|
fixed = in.readInt() == 1;
|
||||||
|
noteCount = in.readInt();
|
||||||
|
in.readBooleanArray(notes);
|
||||||
|
size = in.readInt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.secuso.privacyfriendlysudoku.game;
|
package org.secuso.privacyfriendlysudoku.game;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -9,7 +11,7 @@ import org.secuso.privacyfriendlysudoku.ui.view.R;
|
||||||
/**
|
/**
|
||||||
* Created by Chris on 18.11.2015.
|
* Created by Chris on 18.11.2015.
|
||||||
*/
|
*/
|
||||||
public enum GameDifficulty {
|
public enum GameDifficulty implements Parcelable {
|
||||||
|
|
||||||
Unspecified(R.string.gametype_unspecified),
|
Unspecified(R.string.gametype_unspecified),
|
||||||
Easy(R.string.difficulty_easy),
|
Easy(R.string.difficulty_easy),
|
||||||
|
@ -35,4 +37,28 @@ public enum GameDifficulty {
|
||||||
return validList;
|
return validList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(ordinal());
|
||||||
|
dest.writeInt(resID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<GameDifficulty> CREATOR
|
||||||
|
= new Parcelable.Creator<GameDifficulty>() {
|
||||||
|
public GameDifficulty createFromParcel(Parcel in) {
|
||||||
|
GameDifficulty g = GameDifficulty.values()[in.readInt()];
|
||||||
|
g.resID = in.readInt();
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameDifficulty[] newArray(int size) {
|
||||||
|
return new GameDifficulty[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package org.secuso.privacyfriendlysudoku.game;
|
package org.secuso.privacyfriendlysudoku.game;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import org.secuso.privacyfriendlysudoku.ui.view.R;
|
import org.secuso.privacyfriendlysudoku.ui.view.R;
|
||||||
|
@ -7,14 +10,15 @@ import org.secuso.privacyfriendlysudoku.ui.view.R;
|
||||||
/**
|
/**
|
||||||
* Created by Chris on 09.11.2015.
|
* Created by Chris on 09.11.2015.
|
||||||
*/
|
*/
|
||||||
public enum GameType {
|
public enum GameType implements Parcelable{
|
||||||
Unspecified(1,1,1,R.string.gametype_unspecified,R.drawable.icon_default_6x6),
|
Unspecified(1,1,1,R.string.gametype_unspecified,R.drawable.icon_default_6x6),
|
||||||
Default_9x9(9,3,3,R.string.gametype_default_9x9,R.drawable.icon_default_9x9),
|
Default_9x9(9,3,3,R.string.gametype_default_9x9,R.drawable.icon_default_9x9),
|
||||||
Default_12x12(12,3,4,R.string.gametype_default_12x12,R.drawable.icon_default_12x12),
|
Default_12x12(12,3,4,R.string.gametype_default_12x12,R.drawable.icon_default_12x12),
|
||||||
Default_6x6(6,2,3,R.string.gametype_default_6x6,R.drawable.icon_default_6x6),
|
Default_6x6(6,2,3,R.string.gametype_default_6x6,R.drawable.icon_default_6x6),
|
||||||
X_9x9(9,3,3,R.string.gametype_x_9x9,R.drawable.icon_default_9x9),
|
X_9x9(9,3,3,R.string.gametype_x_9x9,R.drawable.icon_default_9x9),
|
||||||
Hyper_9x9(9,3,3,R.string.gametype_hyper_9x9,R.drawable.icon_default_9x9);
|
Hyper_9x9(9,3,3,R.string.gametype_hyper_9x9,R.drawable.icon_default_9x9);
|
||||||
//TODO: change pictures for unsepc x9x9 and hyper 9x9 as soon as available
|
|
||||||
|
// change pictures for unsepc x9x9 and hyper 9x9 as soon as available
|
||||||
int resIDString;
|
int resIDString;
|
||||||
int sectionWidth;
|
int sectionWidth;
|
||||||
int sectionHeight;
|
int sectionHeight;
|
||||||
|
@ -53,4 +57,35 @@ public enum GameType {
|
||||||
return resIDString;
|
return resIDString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(ordinal());
|
||||||
|
dest.writeInt(resIDString);
|
||||||
|
dest.writeInt(sectionWidth);
|
||||||
|
dest.writeInt(sectionHeight);
|
||||||
|
dest.writeInt(size);
|
||||||
|
dest.writeInt(resIDImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<GameType> CREATOR
|
||||||
|
= new Parcelable.Creator<GameType>() {
|
||||||
|
public GameType createFromParcel(Parcel in) {
|
||||||
|
GameType g = GameType.values()[in.readInt()];
|
||||||
|
g.resIDString = in.readInt();
|
||||||
|
g.sectionWidth = in.readInt();
|
||||||
|
g.sectionHeight = in.readInt();
|
||||||
|
g.size = in.readInt();
|
||||||
|
g.resIDImage = in.readInt();
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameType[] newArray(int size) {
|
||||||
|
return new GameType[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,10 @@ import android.app.DialogFragment;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
|
@ -22,6 +24,7 @@ import android.support.v7.widget.Toolbar;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RatingBar;
|
import android.widget.RatingBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -62,25 +65,45 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
|
||||||
|
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
GameType gameType = GameType.Unspecified;
|
GameType gameType = GameType.Unspecified;
|
||||||
GameDifficulty gameDifficulty = GameDifficulty.Unspecified;
|
GameDifficulty gameDifficulty = GameDifficulty.Unspecified;
|
||||||
int loadLevelID = 0;
|
int loadLevelID = 0;
|
||||||
boolean loadLevel = false;
|
boolean loadLevel = false;
|
||||||
|
|
||||||
Bundle extras = getIntent().getExtras();
|
if(savedInstanceState == null) {
|
||||||
if (extras != null) {
|
|
||||||
Object o = extras.get("gameType");
|
Bundle extras = getIntent().getExtras();
|
||||||
if(o instanceof GameType) {
|
if (extras != null) {
|
||||||
gameType = (GameType)extras.get("gameType");
|
Object o = extras.get("gameType");
|
||||||
|
if (o instanceof GameType) {
|
||||||
|
gameType = (GameType) extras.get("gameType");
|
||||||
|
}
|
||||||
|
gameDifficulty = (GameDifficulty) (extras.get("gameDifficulty"));
|
||||||
|
loadLevel = extras.getBoolean("loadLevel", false);
|
||||||
|
if (loadLevel) {
|
||||||
|
loadLevelID = extras.getInt("loadLevelID");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gameDifficulty = (GameDifficulty)(extras.get("gameDifficulty"));
|
|
||||||
loadLevel = extras.getBoolean("loadLevel", false);
|
gameController = new GameController(sharedPref, getApplicationContext());
|
||||||
if(loadLevel) {
|
|
||||||
loadLevelID = extras.getInt("loadLevelID");
|
List<GameInfoContainer> loadableGames = GameStateManager.getLoadableGameList();
|
||||||
|
|
||||||
|
if (loadLevel && loadableGames.size() > loadLevelID) {
|
||||||
|
// load level from GameStateManager
|
||||||
|
gameController.loadLevel(loadableGames.get(loadLevelID));
|
||||||
|
} else {
|
||||||
|
// load a new level
|
||||||
|
gameController.loadNewLevel(gameType, gameDifficulty);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
gameController = savedInstanceState.getParcelable("gameController");
|
||||||
|
gameController.removeAllListeners();
|
||||||
|
gameSolved = savedInstanceState.getInt("gameSolved") == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_game_view);
|
setContentView(R.layout.activity_game_view);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
@ -89,19 +112,9 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
|
|
||||||
//Create new GameField
|
//Create new GameField
|
||||||
layout = (SudokuFieldLayout)findViewById(R.id.sudokuLayout);
|
layout = (SudokuFieldLayout)findViewById(R.id.sudokuLayout);
|
||||||
gameController = new GameController(sharedPref, getApplicationContext());
|
|
||||||
gameController.registerGameSolvedListener(this);
|
gameController.registerGameSolvedListener(this);
|
||||||
gameController.registerTimerListener(this);
|
gameController.registerTimerListener(this);
|
||||||
statistics.setGameController(gameController);
|
statistics.setGameController(gameController);
|
||||||
List<GameInfoContainer> loadableGames = GameStateManager.getLoadableGameList();
|
|
||||||
|
|
||||||
if(loadLevel && loadableGames.size() > loadLevelID) {
|
|
||||||
// load level from GameStateManager
|
|
||||||
gameController.loadLevel(loadableGames.get(loadLevelID));
|
|
||||||
} else {
|
|
||||||
// load a new level
|
|
||||||
gameController.loadNewLevel(gameType, gameDifficulty);
|
|
||||||
}
|
|
||||||
|
|
||||||
layout.setSettingsAndGame(sharedPref, gameController);
|
layout.setSettingsAndGame(sharedPref, gameController);
|
||||||
|
|
||||||
|
@ -114,8 +127,11 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
Point p = new Point();
|
Point p = new Point();
|
||||||
getWindowManager().getDefaultDisplay().getSize(p);
|
getWindowManager().getDefaultDisplay().getSize(p);
|
||||||
|
|
||||||
//int width = p.x;
|
// set keyboard orientation
|
||||||
keyboard.setKeyBoard(gameController.getSize(), p.x,layout.getHeight()-p.y);
|
int orientation = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT ?
|
||||||
|
LinearLayout.HORIZONTAL : LinearLayout.VERTICAL;
|
||||||
|
|
||||||
|
keyboard.setKeyBoard(gameController.getSize(), p.x,layout.getHeight()-p.y, orientation);
|
||||||
|
|
||||||
|
|
||||||
//set Special keys
|
//set Special keys
|
||||||
|
@ -130,7 +146,6 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
viewName = (TextView) findViewById(R.id.gameModeText);
|
viewName = (TextView) findViewById(R.id.gameModeText);
|
||||||
viewName.setText(getString(gameController.getGameType().getStringResID()));
|
viewName.setText(getString(gameController.getGameType().getStringResID()));
|
||||||
|
|
||||||
|
|
||||||
//set Rating bar
|
//set Rating bar
|
||||||
List<GameDifficulty> difficutyList = GameDifficulty.getValidDifficultyList();
|
List<GameDifficulty> difficutyList = GameDifficulty.getValidDifficultyList();
|
||||||
int numberOfStarts = difficutyList.size();
|
int numberOfStarts = difficutyList.size();
|
||||||
|
@ -150,8 +165,16 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
navigationView.setNavigationItemSelectedListener(this);
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
|
|
||||||
// start the game
|
if(gameSolved) {
|
||||||
gameController.startTimer();
|
layout.setEnabled(false);
|
||||||
|
keyboard.setButtonsEnabled(false);
|
||||||
|
specialButtonLayout.setButtonsEnabled(false);
|
||||||
|
gameController.pauseTimer();
|
||||||
|
} else {
|
||||||
|
// start the game
|
||||||
|
gameController.startTimer();
|
||||||
|
}
|
||||||
|
onTick(gameController.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -159,12 +182,14 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if(!gameSolved) {
|
if(!gameSolved) {
|
||||||
gameController.saveGame(this);
|
gameController.saveGame(this);
|
||||||
gameController.pauseTimer();
|
|
||||||
}
|
}
|
||||||
|
gameController.deleteTimer();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onResume(){
|
public void onResume(){
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
gameController.initTimer();
|
||||||
|
|
||||||
if(!gameSolved) {
|
if(!gameSolved) {
|
||||||
gameController.startTimer();
|
gameController.startTimer();
|
||||||
}
|
}
|
||||||
|
@ -277,7 +302,6 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTick(int time) {
|
public void onTick(int time) {
|
||||||
if(gameSolved) return;
|
|
||||||
|
|
||||||
//do something not so awesome
|
//do something not so awesome
|
||||||
int seconds = time % 60;
|
int seconds = time % 60;
|
||||||
|
@ -289,6 +313,7 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
h = (hours< 10)? "0"+String.valueOf(hours):String.valueOf(hours);
|
h = (hours< 10)? "0"+String.valueOf(hours):String.valueOf(hours);
|
||||||
timerView.setText(h + ":" + m + ":" + s);
|
timerView.setText(h + ":" + m + ":" + s);
|
||||||
|
|
||||||
|
if(gameSolved) return;
|
||||||
// save time
|
// save time
|
||||||
gameController.saveGame(this);
|
gameController.saveGame(this);
|
||||||
}
|
}
|
||||||
|
@ -341,4 +366,21 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
|
||||||
return builder.create();
|
return builder.create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(Bundle savedInstanceState) {
|
||||||
|
// Save the user's current game state
|
||||||
|
|
||||||
|
savedInstanceState.putParcelable("gameController", gameController);
|
||||||
|
savedInstanceState.putInt("gameSolved", gameSolved ? 1 : 0);
|
||||||
|
|
||||||
|
// Always call the superclass so it can save the view hierarchy state
|
||||||
|
super.onSaveInstanceState(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||||
|
//super.onRestoreInstanceState(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import android.widget.RatingBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -176,8 +177,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
|
|
||||||
// send everything to game activity
|
// send everything to game activity
|
||||||
i = new Intent(this, GameActivity.class);
|
i = new Intent(this, GameActivity.class);
|
||||||
i.putExtra("gameType", gameType);
|
i.putExtra("gameType", (Serializable)gameType);
|
||||||
i.putExtra("gameDifficulty", gameDifficulty);
|
i.putExtra("gameDifficulty", (Serializable)gameDifficulty);
|
||||||
} else {
|
} else {
|
||||||
newLevelManager.checkAndRestock();
|
newLevelManager.checkAndRestock();
|
||||||
Toast t = Toast.makeText(getApplicationContext(), R.string.generating, Toast.LENGTH_SHORT);
|
Toast t = Toast.makeText(getApplicationContext(), R.string.generating, Toast.LENGTH_SHORT);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.secuso.privacyfriendlysudoku.ui.view;
|
package org.secuso.privacyfriendlysudoku.ui.view;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
@ -52,7 +53,7 @@ public class SudokuKeyboardLayout extends LinearLayout implements IHighlightChan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKeyBoard(int size,int width, int height) {
|
public void setKeyBoard(int size,int width, int height, int orientation) {
|
||||||
LayoutParams p;
|
LayoutParams p;
|
||||||
int number = 0;
|
int number = 0;
|
||||||
int numberOfButtonsPerRow = (size % 2 == 0) ? size/2 :(size+1)/2;
|
int numberOfButtonsPerRow = (size % 2 == 0) ? size/2 :(size+1)/2;
|
||||||
|
@ -60,16 +61,19 @@ public class SudokuKeyboardLayout extends LinearLayout implements IHighlightChan
|
||||||
|
|
||||||
buttons = new SudokuButton[numberOfButtons];
|
buttons = new SudokuButton[numberOfButtons];
|
||||||
|
|
||||||
|
|
||||||
//set layout parameters and init Layouts
|
//set layout parameters and init Layouts
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
p = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,0,1);
|
if(orientation == LinearLayout.HORIZONTAL) {
|
||||||
|
p = new LayoutParams(LayoutParams.MATCH_PARENT, 0, 1);
|
||||||
|
} else {
|
||||||
|
p = new LayoutParams(0, LayoutParams.MATCH_PARENT, 1);
|
||||||
|
}
|
||||||
//if (i == 0) p.bottomMargin=10; else p.topMargin=10;
|
//if (i == 0) p.bottomMargin=10; else p.topMargin=10;
|
||||||
p.setMargins(0,5,0,5);
|
p.setMargins(0,5,0,5);
|
||||||
layouts[i] = new LinearLayout(getContext(),null);
|
layouts[i] = new LinearLayout(getContext(),null);
|
||||||
layouts[i].setLayoutParams(p);
|
layouts[i].setLayoutParams(p);
|
||||||
layouts[i].setWeightSum(numberOfButtonsPerRow);
|
layouts[i].setWeightSum(numberOfButtonsPerRow);
|
||||||
layouts[i].setOrientation(LinearLayout.HORIZONTAL);
|
layouts[i].setOrientation(orientation);
|
||||||
addView(layouts[i]);
|
addView(layouts[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +85,11 @@ public class SudokuKeyboardLayout extends LinearLayout implements IHighlightChan
|
||||||
for (int i = 0; i < numberOfButtonsPerRow; i++){
|
for (int i = 0; i < numberOfButtonsPerRow; i++){
|
||||||
int buttonIndex = i + layoutNumber * numberOfButtonsPerRow;
|
int buttonIndex = i + layoutNumber * numberOfButtonsPerRow;
|
||||||
buttons[buttonIndex] = new SudokuButton(getContext(),null);
|
buttons[buttonIndex] = new SudokuButton(getContext(),null);
|
||||||
p = new LayoutParams(0, LayoutParams.MATCH_PARENT,1);
|
if(orientation == LinearLayout.HORIZONTAL) {
|
||||||
|
p = new LayoutParams(0, LayoutParams.MATCH_PARENT, 1);
|
||||||
|
} else {
|
||||||
|
p = new LayoutParams(LayoutParams.MATCH_PARENT, 0, 1);
|
||||||
|
}
|
||||||
p.setMargins(5,5,5,5);
|
p.setMargins(5,5,5,5);
|
||||||
buttons[buttonIndex].setLayoutParams(p);
|
buttons[buttonIndex].setLayoutParams(p);
|
||||||
/* removed GridLayout because of bad scaling will use now a Linearlayout
|
/* removed GridLayout because of bad scaling will use now a Linearlayout
|
||||||
|
|
|
@ -58,17 +58,7 @@ public class SudokuSpecialButtonLayout extends LinearLayout implements IHighligh
|
||||||
// rotates the Drawable
|
// rotates the Drawable
|
||||||
gameController.setNoteStatus(!gameController.getNoteStatus());
|
gameController.setNoteStatus(!gameController.getNoteStatus());
|
||||||
keyboard.updateNotesEnabled();
|
keyboard.updateNotesEnabled();
|
||||||
|
onHighlightChanged();
|
||||||
bitMap = BitmapFactory.decodeResource(getResources(), btn.getType().getResID());
|
|
||||||
bitResult = Bitmap.createBitmap(bitMap.getWidth(), bitMap.getHeight(), Bitmap.Config.ARGB_8888);
|
|
||||||
|
|
||||||
canvas = new Canvas(bitResult);
|
|
||||||
canvas.rotate(gameController.getNoteStatus() ? 45.0f : 0.0f, bitMap.getWidth()/2, bitMap.getHeight()/2);
|
|
||||||
canvas.drawBitmap(bitMap, 0, 0, null);
|
|
||||||
|
|
||||||
btn.setImageBitmap(bitResult);
|
|
||||||
btn.setBackgroundResource(gameController.getNoteStatus() ? R.drawable.numpad_highlighted_three : R.drawable.numpad_highlighted_four);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Do:
|
case Do:
|
||||||
gameController.ReDo();
|
gameController.ReDo();
|
||||||
|
@ -117,8 +107,8 @@ public class SudokuSpecialButtonLayout extends LinearLayout implements IHighligh
|
||||||
fragmentManager = fm;
|
fragmentManager = fm;
|
||||||
keyboard=key;
|
keyboard=key;
|
||||||
gameController = gc;
|
gameController = gc;
|
||||||
if(gc != null) {
|
if(gameController != null) {
|
||||||
gc.registerHighlightChangedListener(this);
|
gameController.registerHighlightChangedListener(this);
|
||||||
}
|
}
|
||||||
fixedButtons = new SudokuSpecialButton[fixedButtonsCount];
|
fixedButtons = new SudokuSpecialButton[fixedButtonsCount];
|
||||||
LayoutParams p;
|
LayoutParams p;
|
||||||
|
@ -166,6 +156,17 @@ public class SudokuSpecialButtonLayout extends LinearLayout implements IHighligh
|
||||||
fixedButtons[i].setBackgroundResource(gameController.isRedoAvailable() ?
|
fixedButtons[i].setBackgroundResource(gameController.isRedoAvailable() ?
|
||||||
R.drawable.numpad_highlighted_four : R.drawable.inactive_button);
|
R.drawable.numpad_highlighted_four : R.drawable.inactive_button);
|
||||||
break;
|
break;
|
||||||
|
case NoteToggle:
|
||||||
|
bitMap = BitmapFactory.decodeResource(getResources(), fixedButtons[i].getType().getResID());
|
||||||
|
bitResult = Bitmap.createBitmap(bitMap.getWidth(), bitMap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
|
||||||
|
canvas = new Canvas(bitResult);
|
||||||
|
canvas.rotate(gameController.getNoteStatus() ? 45.0f : 0.0f, bitMap.getWidth()/2, bitMap.getHeight()/2);
|
||||||
|
canvas.drawBitmap(bitMap, 0, 0, null);
|
||||||
|
|
||||||
|
fixedButtons[i].setImageBitmap(bitResult);
|
||||||
|
fixedButtons[i].setBackgroundResource(gameController.getNoteStatus() ? R.drawable.numpad_highlighted_three : R.drawable.numpad_highlighted_four);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,40 +11,42 @@
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
tools:context="tu_darmstadt.sudoku.activity.GameActivity">
|
tools:context="tu_darmstadt.sudoku.activity.GameActivity">
|
||||||
|
|
||||||
|
<org.secuso.privacyfriendlysudoku.ui.view.SudokuSpecialButtonLayout
|
||||||
|
android:id="@+id/sudokuSpecialLayout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:minWidth="70dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
</org.secuso.privacyfriendlysudoku.ui.view.SudokuSpecialButtonLayout>
|
||||||
|
|
||||||
|
|
||||||
<org.secuso.privacyfriendlysudoku.ui.view.SudokuFieldLayout
|
<org.secuso.privacyfriendlysudoku.ui.view.SudokuFieldLayout
|
||||||
android:id="@+id/sudokuLayout"
|
android:id="@+id/sudokuLayout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toRightOf="@+id/sudokuSpecialLayout"
|
||||||
|
android:layout_toEndOf="@+id/sudokuSpecialLayout"
|
||||||
|
android:minWidth="100dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:gravity="center" />
|
android:gravity="center" />
|
||||||
|
|
||||||
<LinearLayout
|
<org.secuso.privacyfriendlysudoku.ui.view.SudokuKeyboardLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentRight="@+id/sudokuLayout"
|
android:layout_marginLeft="40dp"
|
||||||
android:layout_alignParentEnd="@+id/sudokuLayout"
|
android:layout_marginStart="40dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_toRightOf="@+id/sudokuLayout"
|
||||||
|
android:layout_toEndOf="@+id/sudokuLayout"
|
||||||
|
android:id="@+id/sudokuKeyboardLayout"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:weightSum="3">
|
android:weightSum="2">
|
||||||
|
|
||||||
<org.secuso.privacyfriendlysudoku.ui.view.SudokuKeyboardLayout
|
</org.secuso.privacyfriendlysudoku.ui.view.SudokuKeyboardLayout>
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/sudokuKeyboardLayout"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_weight="2"
|
|
||||||
android:weightSum="2">
|
|
||||||
|
|
||||||
</org.secuso.privacyfriendlysudoku.ui.view.SudokuKeyboardLayout>
|
|
||||||
|
|
||||||
<org.secuso.privacyfriendlysudoku.ui.view.SudokuSpecialButtonLayout
|
|
||||||
android:id="@+id/sudokuSpecialLayout"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
</org.secuso.privacyfriendlysudoku.ui.view.SudokuSpecialButtonLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
Loading…
Reference in a new issue