«
Previous
|
Next
»
Revision 40d02f47
Added by Leszek Koltunski about 1 month ago
- ID 40d02f47b58d01bbf64af7445aeb7e5460fb7357
- Child a96b9267
.gitignore | ||
---|---|---|
1 |
/build |
build.gradle | ||
---|---|---|
1 |
plugins { |
|
2 |
id 'com.android.application' |
|
3 |
} |
|
4 |
|
|
5 |
android { |
|
6 |
namespace 'org.distorted.phasedsolver' |
|
7 |
compileSdk 34 |
|
8 |
|
|
9 |
defaultConfig { |
|
10 |
applicationId "org.distorted.phasedsolver" |
|
11 |
minSdk 21 |
|
12 |
targetSdk 34 |
|
13 |
versionCode 1 |
|
14 |
versionName "1.0" |
|
15 |
|
|
16 |
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
|
17 |
} |
|
18 |
|
|
19 |
buildTypes { |
|
20 |
release { |
|
21 |
minifyEnabled false |
|
22 |
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
|
23 |
} |
|
24 |
} |
|
25 |
compileOptions { |
|
26 |
sourceCompatibility JavaVersion.VERSION_1_8 |
|
27 |
targetCompatibility JavaVersion.VERSION_1_8 |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
dependencies { |
|
32 |
api project(':distorted-objectlib') |
|
33 |
implementation project(':distorted-os-android') |
|
34 |
implementation ('androidx.preference:preference:1.2.1') |
|
35 |
} |
|
36 |
|
proguard-rules.pro | ||
---|---|---|
1 |
# Add project specific ProGuard rules here. |
|
2 |
# You can control the set of applied configuration files using the |
|
3 |
# proguardFiles setting in build.gradle. |
|
4 |
# |
|
5 |
# For more details, see |
|
6 |
# http://developer.android.com/guide/developing/tools/proguard.html |
|
7 |
|
|
8 |
# If your project uses WebView with JS, uncomment the following |
|
9 |
# and specify the fully qualified class name to the JavaScript interface |
|
10 |
# class: |
|
11 |
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { |
|
12 |
# public *; |
|
13 |
#} |
|
14 |
|
|
15 |
# Uncomment this to preserve the line number information for |
|
16 |
# debugging stack traces. |
|
17 |
#-keepattributes SourceFile,LineNumberTable |
|
18 |
|
|
19 |
# If you keep the line number information, uncomment this to |
|
20 |
# hide the original source file name. |
|
21 |
#-renamesourcefileattribute SourceFile |
src/main/AndroidManifest.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
|
|
4 |
<uses-feature android:glEsVersion="0x00030000" android:required="true" /> |
|
5 |
<uses-feature android:name="android.hardware.faketouch" android:required="true" /> |
|
6 |
|
|
7 |
<supports-screens android:largeScreens="true" android:xlargeScreens="true" /> |
|
8 |
|
|
9 |
<application |
|
10 |
android:allowBackup="true" |
|
11 |
android:icon="@mipmap/ic_launcher" |
|
12 |
android:label="@string/app_name" |
|
13 |
android:supportsRtl="true" |
|
14 |
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> |
|
15 |
|
|
16 |
<activity android:name="org.distorted.phasedsolver.SolverActivity" android:exported="true" android:screenOrientation="portrait"> |
|
17 |
<intent-filter> |
|
18 |
<action android:name="android.intent.action.MAIN" /> |
|
19 |
<category android:name="android.intent.category.LAUNCHER" /> |
|
20 |
</intent-filter> |
|
21 |
</activity> |
|
22 |
</application> |
|
23 |
</manifest> |
src/main/java/org/distorted/phasedsolver/SolverActivity.java | ||
---|---|---|
1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
2 |
// Copyright 2024 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.phasedsolver; |
|
11 |
|
|
12 |
import static org.distorted.objectlib.main.TwistyObject.MODE_NORM; |
|
13 |
|
|
14 |
import android.app.Activity; |
|
15 |
import android.content.SharedPreferences; |
|
16 |
import android.os.Bundle; |
|
17 |
import android.view.View; |
|
18 |
import androidx.preference.PreferenceManager; |
|
19 |
|
|
20 |
import org.distorted.library.main.DistortedLibrary; |
|
21 |
import org.distorted.objectlib.main.InitAssets; |
|
22 |
import org.distorted.objectlib.main.ObjectControl; |
|
23 |
import org.distorted.objectlib.metadata.ListObjects; |
|
24 |
import org.distorted.os.OSInterface; |
|
25 |
|
|
26 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
27 |
|
|
28 |
public class SolverActivity extends Activity |
|
29 |
{ |
|
30 |
private InitAssets mAsset; |
|
31 |
private SharedPreferences mPreferences; |
|
32 |
|
|
33 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
34 |
|
|
35 |
@Override |
|
36 |
protected void onCreate(Bundle icicle) |
|
37 |
{ |
|
38 |
super.onCreate(icicle); |
|
39 |
mPreferences = PreferenceManager.getDefaultSharedPreferences(this); |
|
40 |
DistortedLibrary.onCreate(); |
|
41 |
setContentView(R.layout.mainlayout); |
|
42 |
SolverSurfaceView view = findViewById(R.id.solverView); |
|
43 |
OSInterface os = view.getInterface(); |
|
44 |
mAsset = new InitAssets(null,null,os); |
|
45 |
} |
|
46 |
|
|
47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
48 |
|
|
49 |
@Override |
|
50 |
protected void onPause() |
|
51 |
{ |
|
52 |
super.onPause(); |
|
53 |
SolverSurfaceView view = findViewById(R.id.solverView); |
|
54 |
view.onPause(); |
|
55 |
DistortedLibrary.onPause(); |
|
56 |
|
|
57 |
savePreferences(); |
|
58 |
} |
|
59 |
|
|
60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
61 |
|
|
62 |
@Override |
|
63 |
protected void onResume() |
|
64 |
{ |
|
65 |
super.onResume(); |
|
66 |
SolverSurfaceView view = findViewById(R.id.solverView); |
|
67 |
view.onResume(); |
|
68 |
DistortedLibrary.onResume(); |
|
69 |
|
|
70 |
restorePreferences(); |
|
71 |
|
|
72 |
ObjectControl control = getControl(); |
|
73 |
control.changeObject( ListObjects.CUBE_3.ordinal(), MODE_NORM, mAsset); |
|
74 |
} |
|
75 |
|
|
76 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
77 |
|
|
78 |
@Override |
|
79 |
protected void onDestroy() |
|
80 |
{ |
|
81 |
DistortedLibrary.onDestroy(); |
|
82 |
super.onDestroy(); |
|
83 |
} |
|
84 |
|
|
85 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
86 |
|
|
87 |
private ObjectControl getControl() |
|
88 |
{ |
|
89 |
SolverSurfaceView view = findViewById(R.id.solverView); |
|
90 |
return view.getObjectControl(); |
|
91 |
} |
|
92 |
|
|
93 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
94 |
|
|
95 |
private void savePreferences() |
|
96 |
{ |
|
97 |
SharedPreferences.Editor editor = mPreferences.edit(); |
|
98 |
SolverSurfaceView view = findViewById(R.id.solverView); |
|
99 |
OSInterface os = view.getInterface(); |
|
100 |
os.setEditor(editor); |
|
101 |
view.getObjectControl().savePreferences(); |
|
102 |
|
|
103 |
editor.apply(); |
|
104 |
} |
|
105 |
|
|
106 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
107 |
|
|
108 |
private void restorePreferences() |
|
109 |
{ |
|
110 |
SolverSurfaceView view = findViewById(R.id.solverView); |
|
111 |
OSInterface os = view.getInterface(); |
|
112 |
os.setPreferences(mPreferences); |
|
113 |
view.getObjectControl().restorePreferences(); |
|
114 |
} |
|
115 |
|
|
116 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
117 |
|
|
118 |
public void Reset(View v) |
|
119 |
{ |
|
120 |
|
|
121 |
} |
|
122 |
|
|
123 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
124 |
|
|
125 |
public void Solve(View v) |
|
126 |
{ |
|
127 |
|
|
128 |
} |
|
129 |
|
|
130 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
131 |
|
|
132 |
public void Left(View v) |
|
133 |
{ |
|
134 |
|
|
135 |
} |
|
136 |
|
|
137 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
138 |
|
|
139 |
public void Right(View v) |
|
140 |
{ |
|
141 |
|
|
142 |
} |
|
143 |
} |
src/main/java/org/distorted/phasedsolver/SolverObjectLibInterface.java | ||
---|---|---|
1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
2 |
// Copyright 2024 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.phasedsolver; |
|
11 |
|
|
12 |
import org.distorted.objectlib.helpers.ObjectLibInterface; |
|
13 |
|
|
14 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
15 |
|
|
16 |
public class SolverObjectLibInterface implements ObjectLibInterface |
|
17 |
{ |
|
18 |
public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { } |
|
19 |
public void onScrambleEffectFinished() { } |
|
20 |
public void onBeginRotation() { } |
|
21 |
public void onSolved() { } |
|
22 |
public void onObjectCreated(long time) { } |
|
23 |
public void onRemoveRotation(int axis, int row, int angle) { } |
|
24 |
public void failedToDrag() { } |
|
25 |
public void reportBlockProblem(int type, int place, long pause, long resume, long time) { } |
|
26 |
public void reportProblem(String problem, boolean reportException) {} |
|
27 |
|
|
28 |
public void onReplaceModeDown(int cubit, int face) { } |
|
29 |
public void onReplaceModeUp() { } |
|
30 |
public void reportJSONError(String error, int ordinal) { } |
|
31 |
} |
src/main/java/org/distorted/phasedsolver/SolverRenderer.java | ||
---|---|---|
1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
2 |
// Copyright 2024 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.phasedsolver; |
|
11 |
|
|
12 |
import android.content.res.Resources; |
|
13 |
import android.opengl.GLSurfaceView; |
|
14 |
|
|
15 |
import org.distorted.library.effect.EffectType; |
|
16 |
import org.distorted.library.effect.PostprocessEffectBorder; |
|
17 |
import org.distorted.library.effect.VertexEffectQuaternion; |
|
18 |
import org.distorted.library.effect.VertexEffectRotate; |
|
19 |
import org.distorted.library.main.DistortedLibrary; |
|
20 |
import org.distorted.library.main.DistortedScreen; |
|
21 |
import org.distorted.library.mesh.MeshBase; |
|
22 |
import org.distorted.objectlib.effects.BaseEffect; |
|
23 |
import org.distorted.objectlib.main.ObjectControl; |
|
24 |
|
|
25 |
import java.io.InputStream; |
|
26 |
|
|
27 |
import javax.microedition.khronos.egl.EGLConfig; |
|
28 |
import javax.microedition.khronos.opengles.GL10; |
|
29 |
|
|
30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
31 |
|
|
32 |
class SolverRenderer implements GLSurfaceView.Renderer, DistortedLibrary.LibraryUser |
|
33 |
{ |
|
34 |
static final float BRIGHTNESS = 0.30f; |
|
35 |
|
|
36 |
private final SolverSurfaceView mView; |
|
37 |
private final DistortedScreen mScreen; |
|
38 |
private final Resources mResources; |
|
39 |
|
|
40 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
41 |
|
|
42 |
SolverRenderer(SolverSurfaceView v) |
|
43 |
{ |
|
44 |
mView = v; |
|
45 |
mResources = v.getResources(); |
|
46 |
mScreen = new DistortedScreen(); |
|
47 |
mScreen.glClearColor(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 1.0f); |
|
48 |
} |
|
49 |
|
|
50 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
51 |
|
|
52 |
DistortedScreen getScreen() |
|
53 |
{ |
|
54 |
return mScreen; |
|
55 |
} |
|
56 |
|
|
57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
58 |
|
|
59 |
public void onDrawFrame(GL10 glUnused) |
|
60 |
{ |
|
61 |
long time = System.currentTimeMillis(); |
|
62 |
mView.getObjectControl().preRender(); |
|
63 |
mScreen.render(time); |
|
64 |
} |
|
65 |
|
|
66 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
67 |
|
|
68 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
|
69 |
{ |
|
70 |
mScreen.resize(width,height); |
|
71 |
mView.setScreenSize(width,height); |
|
72 |
} |
|
73 |
|
|
74 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
75 |
|
|
76 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
|
77 |
{ |
|
78 |
DistortedLibrary.setMax(EffectType.VERTEX,ObjectControl.MAX_QUATS+1); |
|
79 |
MeshBase.setMaxEffComponents(ObjectControl.MAX_MOVING_PARTS); |
|
80 |
|
|
81 |
VertexEffectRotate.enable(); |
|
82 |
VertexEffectQuaternion.enable(); |
|
83 |
PostprocessEffectBorder.enable(); |
|
84 |
BaseEffect.Type.enableEffects(); |
|
85 |
|
|
86 |
DistortedLibrary.onSurfaceCreated(this); |
|
87 |
} |
|
88 |
|
|
89 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
90 |
|
|
91 |
public void distortedException(Exception ex) |
|
92 |
{ |
|
93 |
android.util.Log.e("Solver", ex.getMessage() ); |
|
94 |
} |
|
95 |
|
|
96 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
97 |
|
|
98 |
public InputStream localFile(int fileID) |
|
99 |
{ |
|
100 |
return mResources.openRawResource(fileID); |
|
101 |
} |
|
102 |
|
|
103 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
104 |
|
|
105 |
public void logMessage(String message) |
|
106 |
{ |
|
107 |
android.util.Log.e("Solver", message ); |
|
108 |
} |
|
109 |
} |
src/main/java/org/distorted/phasedsolver/SolverSurfaceView.java | ||
---|---|---|
1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
2 |
// Copyright 2024 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.phasedsolver; |
|
11 |
|
|
12 |
import static org.distorted.objectlib.main.ObjectControl.MODE_ROTATE; |
|
13 |
|
|
14 |
import android.app.ActivityManager; |
|
15 |
import android.content.Context; |
|
16 |
import android.content.pm.ConfigurationInfo; |
|
17 |
import android.opengl.GLSurfaceView; |
|
18 |
import android.util.AttributeSet; |
|
19 |
import android.view.MotionEvent; |
|
20 |
|
|
21 |
import org.distorted.objectlib.main.ObjectControl; |
|
22 |
import org.distorted.objectlib.main.TwistyObjectNode; |
|
23 |
import org.distorted.os.OSInterface; |
|
24 |
|
|
25 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
26 |
|
|
27 |
class SolverSurfaceView extends GLSurfaceView |
|
28 |
{ |
|
29 |
private ObjectControl mObjectController; |
|
30 |
private OSInterface mInterface; |
|
31 |
private SolverRenderer mRenderer; |
|
32 |
private int mScreenWidth; |
|
33 |
private boolean mCreated; |
|
34 |
|
|
35 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
36 |
|
|
37 |
void setScreenSize(int width, int height) |
|
38 |
{ |
|
39 |
mScreenWidth = width; |
|
40 |
mObjectController.setScreenSizeAndScaling(width,height, Math.min(width,height) ); |
|
41 |
|
|
42 |
if( !mCreated ) |
|
43 |
{ |
|
44 |
mCreated = true; |
|
45 |
mObjectController.createNode(width,height); |
|
46 |
TwistyObjectNode objectNode = mObjectController.getNode(); |
|
47 |
mRenderer.getScreen().attach(objectNode); |
|
48 |
} |
|
49 |
} |
|
50 |
|
|
51 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
52 |
|
|
53 |
int getScreenWidth() |
|
54 |
{ |
|
55 |
return mScreenWidth; |
|
56 |
} |
|
57 |
|
|
58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
59 |
|
|
60 |
ObjectControl getObjectControl() |
|
61 |
{ |
|
62 |
return mObjectController; |
|
63 |
} |
|
64 |
|
|
65 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
66 |
|
|
67 |
OSInterface getInterface() |
|
68 |
{ |
|
69 |
return mInterface; |
|
70 |
} |
|
71 |
|
|
72 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
73 |
|
|
74 |
SolverRenderer getRenderer() |
|
75 |
{ |
|
76 |
return mRenderer; |
|
77 |
} |
|
78 |
|
|
79 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
80 |
|
|
81 |
public SolverSurfaceView(Context context, AttributeSet attrs) |
|
82 |
{ |
|
83 |
super(context,attrs); |
|
84 |
|
|
85 |
mCreated = false; |
|
86 |
|
|
87 |
if(!isInEditMode()) |
|
88 |
{ |
|
89 |
SolverActivity act = (SolverActivity)context; |
|
90 |
SolverObjectLibInterface ref = new SolverObjectLibInterface(); |
|
91 |
mInterface = new OSInterface(act,ref); |
|
92 |
mObjectController = new ObjectControl(mInterface); |
|
93 |
|
|
94 |
mRenderer = new SolverRenderer(this); |
|
95 |
final ActivityManager activityManager= (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
|
96 |
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); |
|
97 |
int esVersion = configurationInfo.reqGlEsVersion>>16; |
|
98 |
setEGLContextClientVersion(esVersion); |
|
99 |
setRenderer(mRenderer); |
|
100 |
} |
|
101 |
} |
|
102 |
|
|
103 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
104 |
|
|
105 |
@Override |
|
106 |
public void onPause() |
|
107 |
{ |
|
108 |
super.onPause(); |
|
109 |
mObjectController.onPause(); |
|
110 |
} |
|
111 |
|
|
112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
113 |
|
|
114 |
@Override |
|
115 |
public void onResume() |
|
116 |
{ |
|
117 |
super.onResume(); |
|
118 |
mObjectController.onResume(); |
|
119 |
} |
|
120 |
|
|
121 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
122 |
|
|
123 |
@Override |
|
124 |
public boolean onTouchEvent(MotionEvent event) |
|
125 |
{ |
|
126 |
mInterface.setMotionEvent(event); |
|
127 |
return mObjectController.onTouchEvent(MODE_ROTATE); |
|
128 |
} |
|
129 |
} |
|
130 |
|
src/main/res/drawable-v24/ic_launcher_foreground.xml | ||
---|---|---|
1 |
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|
2 |
xmlns:aapt="http://schemas.android.com/aapt" |
|
3 |
android:width="108dp" |
|
4 |
android:height="108dp" |
|
5 |
android:viewportWidth="108" |
|
6 |
android:viewportHeight="108"> |
|
7 |
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> |
|
8 |
<aapt:attr name="android:fillColor"> |
|
9 |
<gradient |
|
10 |
android:endX="85.84757" |
|
11 |
android:endY="92.4963" |
|
12 |
android:startX="42.9492" |
|
13 |
android:startY="49.59793" |
|
14 |
android:type="linear"> |
|
15 |
<item |
|
16 |
android:color="#44000000" |
|
17 |
android:offset="0.0" /> |
|
18 |
<item |
|
19 |
android:color="#00000000" |
|
20 |
android:offset="1.0" /> |
|
21 |
</gradient> |
|
22 |
</aapt:attr> |
|
23 |
</path> |
|
24 |
<path |
|
25 |
android:fillColor="#FFFFFF" |
|
26 |
android:fillType="nonZero" |
|
27 |
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" |
|
28 |
android:strokeWidth="1" |
|
29 |
android:strokeColor="#00000000" /> |
|
30 |
</vector> |
src/main/res/drawable/ic_launcher_background.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 |
android:width="108dp" |
|
4 |
android:height="108dp" |
|
5 |
android:viewportWidth="108" |
|
6 |
android:viewportHeight="108"> |
|
7 |
<path |
|
8 |
android:fillColor="#3DDC84" |
|
9 |
android:pathData="M0,0h108v108h-108z" /> |
|
10 |
<path |
|
11 |
android:fillColor="#00000000" |
|
12 |
android:pathData="M9,0L9,108" |
|
13 |
android:strokeWidth="0.8" |
|
14 |
android:strokeColor="#33FFFFFF" /> |
|
15 |
<path |
|
16 |
android:fillColor="#00000000" |
|
17 |
android:pathData="M19,0L19,108" |
|
18 |
android:strokeWidth="0.8" |
|
19 |
android:strokeColor="#33FFFFFF" /> |
|
20 |
<path |
|
21 |
android:fillColor="#00000000" |
|
22 |
android:pathData="M29,0L29,108" |
|
23 |
android:strokeWidth="0.8" |
|
24 |
android:strokeColor="#33FFFFFF" /> |
|
25 |
<path |
|
26 |
android:fillColor="#00000000" |
|
27 |
android:pathData="M39,0L39,108" |
|
28 |
android:strokeWidth="0.8" |
|
29 |
android:strokeColor="#33FFFFFF" /> |
|
30 |
<path |
|
31 |
android:fillColor="#00000000" |
|
32 |
android:pathData="M49,0L49,108" |
|
33 |
android:strokeWidth="0.8" |
|
34 |
android:strokeColor="#33FFFFFF" /> |
|
35 |
<path |
|
36 |
android:fillColor="#00000000" |
|
37 |
android:pathData="M59,0L59,108" |
|
38 |
android:strokeWidth="0.8" |
|
39 |
android:strokeColor="#33FFFFFF" /> |
|
40 |
<path |
|
41 |
android:fillColor="#00000000" |
|
42 |
android:pathData="M69,0L69,108" |
|
43 |
android:strokeWidth="0.8" |
|
44 |
android:strokeColor="#33FFFFFF" /> |
|
45 |
<path |
|
46 |
android:fillColor="#00000000" |
|
47 |
android:pathData="M79,0L79,108" |
|
48 |
android:strokeWidth="0.8" |
|
49 |
android:strokeColor="#33FFFFFF" /> |
|
50 |
<path |
|
51 |
android:fillColor="#00000000" |
|
52 |
android:pathData="M89,0L89,108" |
|
53 |
android:strokeWidth="0.8" |
|
54 |
android:strokeColor="#33FFFFFF" /> |
|
55 |
<path |
|
56 |
android:fillColor="#00000000" |
|
57 |
android:pathData="M99,0L99,108" |
|
58 |
android:strokeWidth="0.8" |
|
59 |
android:strokeColor="#33FFFFFF" /> |
|
60 |
<path |
|
61 |
android:fillColor="#00000000" |
|
62 |
android:pathData="M0,9L108,9" |
|
63 |
android:strokeWidth="0.8" |
|
64 |
android:strokeColor="#33FFFFFF" /> |
|
65 |
<path |
|
66 |
android:fillColor="#00000000" |
|
67 |
android:pathData="M0,19L108,19" |
|
68 |
android:strokeWidth="0.8" |
|
69 |
android:strokeColor="#33FFFFFF" /> |
|
70 |
<path |
|
71 |
android:fillColor="#00000000" |
|
72 |
android:pathData="M0,29L108,29" |
|
73 |
android:strokeWidth="0.8" |
|
74 |
android:strokeColor="#33FFFFFF" /> |
|
75 |
<path |
|
76 |
android:fillColor="#00000000" |
|
77 |
android:pathData="M0,39L108,39" |
|
78 |
android:strokeWidth="0.8" |
|
79 |
android:strokeColor="#33FFFFFF" /> |
|
80 |
<path |
|
81 |
android:fillColor="#00000000" |
|
82 |
android:pathData="M0,49L108,49" |
|
83 |
android:strokeWidth="0.8" |
|
84 |
android:strokeColor="#33FFFFFF" /> |
|
85 |
<path |
|
86 |
android:fillColor="#00000000" |
|
87 |
android:pathData="M0,59L108,59" |
|
88 |
android:strokeWidth="0.8" |
|
89 |
android:strokeColor="#33FFFFFF" /> |
|
90 |
<path |
|
91 |
android:fillColor="#00000000" |
|
92 |
android:pathData="M0,69L108,69" |
|
93 |
android:strokeWidth="0.8" |
|
94 |
android:strokeColor="#33FFFFFF" /> |
|
95 |
<path |
|
96 |
android:fillColor="#00000000" |
|
97 |
android:pathData="M0,79L108,79" |
|
98 |
android:strokeWidth="0.8" |
|
99 |
android:strokeColor="#33FFFFFF" /> |
|
100 |
<path |
|
101 |
android:fillColor="#00000000" |
|
102 |
android:pathData="M0,89L108,89" |
|
103 |
android:strokeWidth="0.8" |
|
104 |
android:strokeColor="#33FFFFFF" /> |
|
105 |
<path |
|
106 |
android:fillColor="#00000000" |
|
107 |
android:pathData="M0,99L108,99" |
|
108 |
android:strokeWidth="0.8" |
|
109 |
android:strokeColor="#33FFFFFF" /> |
|
110 |
<path |
|
111 |
android:fillColor="#00000000" |
|
112 |
android:pathData="M19,29L89,29" |
|
113 |
android:strokeWidth="0.8" |
|
114 |
android:strokeColor="#33FFFFFF" /> |
|
115 |
<path |
|
116 |
android:fillColor="#00000000" |
|
117 |
android:pathData="M19,39L89,39" |
|
118 |
android:strokeWidth="0.8" |
|
119 |
android:strokeColor="#33FFFFFF" /> |
|
120 |
<path |
|
121 |
android:fillColor="#00000000" |
|
122 |
android:pathData="M19,49L89,49" |
|
123 |
android:strokeWidth="0.8" |
|
124 |
android:strokeColor="#33FFFFFF" /> |
|
125 |
<path |
|
126 |
android:fillColor="#00000000" |
|
127 |
android:pathData="M19,59L89,59" |
|
128 |
android:strokeWidth="0.8" |
|
129 |
android:strokeColor="#33FFFFFF" /> |
|
130 |
<path |
|
131 |
android:fillColor="#00000000" |
|
132 |
android:pathData="M19,69L89,69" |
|
133 |
android:strokeWidth="0.8" |
|
134 |
android:strokeColor="#33FFFFFF" /> |
|
135 |
<path |
|
136 |
android:fillColor="#00000000" |
|
137 |
android:pathData="M19,79L89,79" |
|
138 |
android:strokeWidth="0.8" |
|
139 |
android:strokeColor="#33FFFFFF" /> |
|
140 |
<path |
|
141 |
android:fillColor="#00000000" |
|
142 |
android:pathData="M29,19L29,89" |
|
143 |
android:strokeWidth="0.8" |
|
144 |
android:strokeColor="#33FFFFFF" /> |
|
145 |
<path |
|
146 |
android:fillColor="#00000000" |
|
147 |
android:pathData="M39,19L39,89" |
|
148 |
android:strokeWidth="0.8" |
|
149 |
android:strokeColor="#33FFFFFF" /> |
|
150 |
<path |
|
151 |
android:fillColor="#00000000" |
|
152 |
android:pathData="M49,19L49,89" |
|
153 |
android:strokeWidth="0.8" |
|
154 |
android:strokeColor="#33FFFFFF" /> |
|
155 |
<path |
|
156 |
android:fillColor="#00000000" |
|
157 |
android:pathData="M59,19L59,89" |
|
158 |
android:strokeWidth="0.8" |
|
159 |
android:strokeColor="#33FFFFFF" /> |
|
160 |
<path |
|
161 |
android:fillColor="#00000000" |
|
162 |
android:pathData="M69,19L69,89" |
|
163 |
android:strokeWidth="0.8" |
|
164 |
android:strokeColor="#33FFFFFF" /> |
|
165 |
<path |
|
166 |
android:fillColor="#00000000" |
|
167 |
android:pathData="M79,19L79,89" |
|
168 |
android:strokeWidth="0.8" |
|
169 |
android:strokeColor="#33FFFFFF" /> |
|
170 |
</vector> |
src/main/res/layout/mainlayout.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
3 |
android:id="@+id/relativeLayout" |
|
4 |
android:layout_width="match_parent" |
|
5 |
android:layout_height="match_parent" > |
|
6 |
|
|
7 |
<org.distorted.phasedsolver.SolverSurfaceView |
|
8 |
android:id="@+id/solverView" |
|
9 |
android:layout_width="match_parent" |
|
10 |
android:layout_height="match_parent" |
|
11 |
android:layout_alignParentStart="true" |
|
12 |
android:layout_alignParentTop="true"/> |
|
13 |
|
|
14 |
<LinearLayout |
|
15 |
android:id="@+id/upperBar" |
|
16 |
android:layout_alignParentTop="true" |
|
17 |
android:layout_width="match_parent" |
|
18 |
android:layout_height="80dp" |
|
19 |
android:gravity="center" |
|
20 |
android:orientation="horizontal" |
|
21 |
android:background="@android:color/transparent"> |
|
22 |
|
|
23 |
<Button |
|
24 |
android:id="@+id/solverReset" |
|
25 |
android:layout_width="0dp" |
|
26 |
android:layout_height="match_parent" |
|
27 |
android:layout_weight="1.0" |
|
28 |
android:gravity="center_vertical|center" |
|
29 |
android:text="@string/reset" |
|
30 |
android:onClick="Reset" |
|
31 |
android:textAppearance="?android:attr/textAppearanceMedium" |
|
32 |
android:layout_gravity="center_vertical"/> |
|
33 |
|
|
34 |
<Button |
|
35 |
android:id="@+id/solverSolve" |
|
36 |
android:layout_width="0dp" |
|
37 |
android:layout_height="match_parent" |
|
38 |
android:layout_weight="1.0" |
|
39 |
android:gravity="center_vertical|center" |
|
40 |
android:text="@string/solve" |
|
41 |
android:onClick="Solve" |
|
42 |
android:textAppearance="?android:attr/textAppearanceMedium" |
|
43 |
android:layout_gravity="center_vertical"/> |
|
44 |
|
|
45 |
</LinearLayout> |
|
46 |
|
|
47 |
<LinearLayout |
|
48 |
android:id="@+id/lowerBar" |
|
49 |
android:layout_alignParentBottom="true" |
|
50 |
android:layout_width="match_parent" |
|
51 |
android:layout_height="80dp" |
|
52 |
android:orientation="horizontal" |
|
53 |
android:background="@android:color/transparent"> |
|
54 |
|
|
55 |
<ImageButton |
|
56 |
android:id="@+id/solverLeft" |
|
57 |
android:background="@drawable/ui_left" |
|
58 |
android:layout_width="0dp" |
|
59 |
android:layout_height="match_parent" |
|
60 |
android:layout_weight="1.0" |
|
61 |
android:gravity="center_vertical|center" |
|
62 |
android:onClick="Left" |
|
63 |
android:layout_gravity="center_vertical"/> |
|
64 |
|
|
65 |
<TextView |
|
66 |
android:id="@+id/solverText" |
|
67 |
android:layout_width="0dp" |
|
68 |
android:layout_height="match_parent" |
|
69 |
android:layout_weight="4.0"/> |
|
70 |
|
|
71 |
<ImageButton |
|
72 |
android:id="@+id/solverRight" |
|
73 |
android:background="@drawable/ui_right" |
|
74 |
android:layout_width="0dp" |
|
75 |
android:layout_height="match_parent" |
|
76 |
android:layout_weight="1.0" |
|
77 |
android:gravity="center_vertical|center" |
|
78 |
android:onClick="Right" |
|
79 |
android:layout_gravity="center_vertical"/> |
|
80 |
</LinearLayout> |
|
81 |
|
|
82 |
</RelativeLayout> |
src/main/res/mipmap-anydpi-v26/ic_launcher.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
<background android:drawable="@drawable/ic_launcher_background" /> |
|
4 |
<foreground android:drawable="@drawable/ic_launcher_foreground" /> |
|
5 |
<monochrome android:drawable="@drawable/ic_launcher_foreground" /> |
|
6 |
</adaptive-icon> |
src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> |
|
3 |
<background android:drawable="@drawable/ic_launcher_background" /> |
|
4 |
<foreground android:drawable="@drawable/ic_launcher_foreground" /> |
|
5 |
<monochrome android:drawable="@drawable/ic_launcher_foreground" /> |
|
6 |
</adaptive-icon> |
src/main/res/values/colors.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<resources> |
|
3 |
<color name="colorPrimary">#008577</color> |
|
4 |
<color name="colorPrimaryDark">#00574B</color> |
|
5 |
<color name="colorAccent">#D81B60</color> |
|
6 |
<color name="red">#ffff0000</color> |
|
7 |
<color name="dark_grey">#ff222222</color> |
|
8 |
<color name="grey">#ff333333</color> |
|
9 |
<color name="light_grey">#ff555555</color> |
|
10 |
<color name="black">#ff010101</color> |
|
11 |
<color name="white">#ffffffff</color> |
|
12 |
</resources> |
src/main/res/values/strings.xml | ||
---|---|---|
1 |
<resources> |
|
2 |
<string name="app_name">Phased Solver</string> |
|
3 |
<string name="solve">Solve</string> |
|
4 |
<string name="reset">Reset</string> |
|
5 |
</resources> |
Also available in: Unified diff
Initial commit