Skip to content

Commit 3378ead

Browse files
Merge pull request #2 from AnachronisticTech/UI-update
UI update
2 parents 70d91fa + 8ce7360 commit 3378ead

15 files changed

Lines changed: 648 additions & 359 deletions

File tree

.idea/codeStyles/Project.xml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
targetSdkVersion 28
1313
versionCode 1
1414
versionName "1.0"
15-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
}
1717
buildTypes {
1818
release {
@@ -24,9 +24,12 @@ android {
2424

2525
dependencies {
2626
implementation fileTree(dir: 'libs', include: ['*.jar'])
27-
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
28-
implementation 'com.android.support:appcompat-v7:28.0.0'
27+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
28+
implementation 'androidx.core:core-ktx:1.1.0'
29+
implementation 'androidx.appcompat:appcompat:1.1.0'
30+
implementation 'org.jetbrains.anko:anko-commons:0.10.4'
31+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
2932
testImplementation 'junit:junit:4.12'
30-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
31-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
33+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
34+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3235
}

app/src/androidTest/java/com/anachronistic/daniel/psakse/ExampleInstrumentedTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.anachronistic.daniel.psakse
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
55

66
import org.junit.Test
77
import org.junit.runner.RunWith

app/src/main/AndroidManifest.xml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.anachronistic.daniel.psakse">
3+
package="com.anachronistic.daniel.psakse">
34

4-
<application android:allowBackup="true"
5-
android:label="@string/app_name"
6-
android:icon="@mipmap/ic_launcher"
7-
android:roundIcon="@mipmap/ic_launcher_round"
8-
android:supportsRtl="true"
9-
android:theme="@style/AppTheme">
10-
<activity android:name=".HomeViewController" android:screenOrientation="portrait">
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity
13+
android:name=".GameViewController"
14+
android:screenOrientation="portrait" />
15+
<activity
16+
android:name=".HomeViewController"
17+
android:screenOrientation="portrait">
1118
<intent-filter>
1219
<action android:name="android.intent.action.MAIN" />
20+
1321
<category android:name="android.intent.category.LAUNCHER" />
1422
</intent-filter>
1523
</activity>
16-
<activity android:name=".GameViewController" android:screenOrientation="portrait"></activity>
17-
<activity android:name=".SelectViewController" android:screenOrientation="portrait"></activity>
24+
<activity
25+
android:name=".SelectViewController"
26+
android:screenOrientation="portrait" />
1827
</application>
19-
</manifest>
28+
<uses-permission android:name="android.permission.INTERNET" />
29+
30+
</manifest>

app/src/main/java/com/anachronistic/daniel/psakse/Deck.kt

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -65,42 +65,23 @@ class Deck {
6565
}
6666

6767
fun stringToCard(col: String, sym: String): Card {
68-
var card: Card = Wild()
69-
when (col) {
70-
"g" -> {
71-
when (sym) {
72-
"p" -> card = Normal(Symbols.Psi, Colors.Green)
73-
"a" -> card = Normal(Symbols.A, Colors.Green)
74-
"x" -> card = Normal(Symbols.Xi, Colors.Green)
75-
"e" -> card = Normal(Symbols.E, Colors.Green)
76-
}
68+
fun symbol(sym: String): Symbols {
69+
return when (sym) {
70+
"p" -> Symbols.Psi
71+
"a" -> Symbols.A
72+
"x" -> Symbols.Xi
73+
else -> Symbols.E
7774
}
78-
"y" -> {
79-
when (sym) {
80-
"p" -> card = Normal(Symbols.Psi, Colors.Yellow)
81-
"a" -> card = Normal(Symbols.A, Colors.Yellow)
82-
"x" -> card = Normal(Symbols.Xi, Colors.Yellow)
83-
"e" -> card = Normal(Symbols.E, Colors.Yellow)
84-
}
85-
}
86-
"p" -> {
87-
when (sym) {
88-
"p" -> card = Normal(Symbols.Psi, Colors.Purple)
89-
"a" -> card = Normal(Symbols.A, Colors.Purple)
90-
"x" -> card = Normal(Symbols.Xi, Colors.Purple)
91-
"e" -> card = Normal(Symbols.E, Colors.Purple)
92-
}
93-
}
94-
"o" -> {
95-
when (sym) {
96-
"p" -> card = Normal(Symbols.Psi, Colors.Orange)
97-
"a" -> card = Normal(Symbols.A, Colors.Orange)
98-
"x" -> card = Normal(Symbols.Xi, Colors.Orange)
99-
"e" -> card = Normal(Symbols.E, Colors.Orange)
100-
}
75+
}
76+
fun color(col: String): Colors {
77+
return when (col) {
78+
"g" -> Colors.Green
79+
"y" -> Colors.Yellow
80+
"p" -> Colors.Purple
81+
else -> Colors.Orange
10182
}
10283
}
103-
return card
84+
return Normal(symbol(sym), color(col))
10485
}
10586

10687
fun finalShuffle() {

app/src/main/java/com/anachronistic/daniel/psakse/Extensions.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package com.anachronistic.daniel.psakse
22

33
import android.graphics.drawable.GradientDrawable
4-
import android.support.v4.content.ContextCompat
4+
import androidx.core.content.ContextCompat
55
import android.widget.ImageButton
66

77
fun ImageButton.reset() {
88
this.setAttrs("clear", R.color.gameWhite, 0, R.color.gameSBorder)
9+
this.isEnabled = true
910
}
1011

1112
fun ImageButton.setAttrs(image: String, bgColor: Int, sWidth: Int, sColor: Int) {

0 commit comments

Comments
 (0)