Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lichess-org/mobile into filter-games
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauritz8 committed Aug 5, 2024
2 parents 09e1251 + 36d251b commit 680b223
Show file tree
Hide file tree
Showing 172 changed files with 16,458 additions and 11,732 deletions.
21 changes: 5 additions & 16 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ body:
id: desc
attributes:
label: What is the problem?
description: Describe the problem. What did you expect to happen? What happened instead?
validations:
required: true
- type: textarea
Expand All @@ -23,28 +24,16 @@ body:
3. ...
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true
- type: textarea
id: outcome
attributes:
label: What happened instead?
validations:
required: true
- type: input
attributes:
label: Device Info
description: Specify the device you are using the app on (e.g. Pixel 7)
label: App version
description: Specify the application version (e.g. 0.7.8).
validations:
required: true
- type: input
attributes:
label: Operating System Version
description: Example. Android 14 or iOS 16
label: Device Info
description: Specify the device and Operating System you are using the app on (e.g. Pixel 7 / Android 14)
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ GEM
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.2)
rexml (3.3.3)
strscan
rouge (2.0.7)
ruby2_keywords (0.0.5)
Expand Down
41 changes: 30 additions & 11 deletions android/app/src/main/kotlin/org/lichess/mobileV2/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ import android.app.ActivityManager
import android.content.Context
import android.graphics.Rect
import androidx.core.view.ViewCompat
import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel

class MainActivity: FlutterActivity() {
private val exclusionChannel = "mobile.lichess.org/gestures_exclusion"
private val storageChannel = "mobile.lichess.org/storage"
private val GESTURES_CHANNEL = "mobile.lichess.org/gestures_exclusion"
private val SYSTEM_CHANNEL = "mobile.lichess.org/system"

override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, exclusionChannel).setMethodCallHandler {
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, GESTURES_CHANNEL).setMethodCallHandler {
call, result ->
if (call.method == "setSystemGestureExclusionRects") {
val arguments = call.arguments as List<Map<String, Int>>
Expand All @@ -27,13 +26,26 @@ class MainActivity: FlutterActivity() {
}
}

MethodChannel(flutterEngine.dartExecutor.binaryMessenger, storageChannel).setMethodCallHandler {
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, SYSTEM_CHANNEL).setMethodCallHandler {
call, result ->
if (call.method == "clearApplicationUserData") {
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
result.success(activityManager.clearApplicationUserData())
} else {
result.notImplemented()
when (call.method) {
"clearApplicationUserData" -> {
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
result.success(activityManager.clearApplicationUserData())
}
"getTotalRam" -> {
val memoryInfo = getAvailableMemory()
val totalMemInMb = memoryInfo.totalMem / 1048576L
result.success(totalMemInMb.toInt())
}
// "getAvailableRam" -> {
// val memoryInfo = getAvailableMemory()
// val availMemInMb = memoryInfo.availMem / 1048576L
// result.success(availMemInMb.toInt())
// }
else -> {
result.notImplemented()
}
}
}
}
Expand All @@ -47,4 +59,11 @@ class MainActivity: FlutterActivity() {
item["bottom"] ?: error("rect at index $index doesn't contain 'bottom' property")
)
}

private fun getAvailableMemory(): ActivityManager.MemoryInfo {
val activityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
return ActivityManager.MemoryInfo().also { memoryInfo ->
activityManager.getMemoryInfo(memoryInfo)
}
}
}
2 changes: 1 addition & 1 deletion android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ platform :android do
end

def deploy_to_play_store(track)
sh "flutter build appbundle -v --obfuscate --split-debug-info=./build/app/outputs/bundle/release/symbols --dart-define=cronetHttpNoPlay=true --dart-define=no_default_http_client=true --dart-define=LICHESS_HOST=lichess.org --dart-define=LICHESS_WS_HOST=socket.lichess.org --dart-define=LICHESS_WS_SECRET=#{ENV['WS_SECRET']}"
sh "flutter build appbundle -v --obfuscate --split-debug-info=./build/app/outputs/bundle/release/symbols --dart-define=cronetHttpNoPlay=true --dart-define=LICHESS_HOST=lichess.org --dart-define=LICHESS_WS_HOST=socket.lichess.org --dart-define=LICHESS_WS_SECRET=#{ENV['WS_SECRET']}"
upload_to_play_store(
track: track,
aab: '../build/app/outputs/bundle/release/app-release.aab',
Expand Down
Binary file added assets/sounds/standard/puzzleStormEnd.aifc
Binary file not shown.
43 changes: 21 additions & 22 deletions ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ GEM
base64
nkf
rexml
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.930.0)
aws-sdk-core (3.196.1)
aws-partitions (1.959.0)
aws-sdk-core (3.201.3)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.81.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.151.0)
aws-sdk-core (~> 3, >= 3.194.0)
aws-sdk-kms (1.88.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.156.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.9.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
Expand All @@ -38,7 +38,7 @@ GEM
domain_name (0.6.20240107)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.110.0)
excon (0.111.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand All @@ -60,15 +60,15 @@ GEM
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.220.0)
fastlane (2.222.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -147,14 +147,14 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.5)
http-cookie (1.0.6)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.2)
jwt (2.8.1)
jwt (2.8.2)
base64
mini_magick (4.12.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.4.1)
Expand All @@ -164,15 +164,15 @@ GEM
optparse (0.5.0)
os (1.1.4)
plist (3.7.1)
public_suffix (5.0.5)
public_suffix (6.0.1)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.3.3)
strscan
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand All @@ -197,13 +197,12 @@ GEM
uber (0.1.0)
unicode-display_width (2.5.0)
word_wrap (1.0.0)
xcodeproj (1.24.0)
xcodeproj (1.19.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
Expand Down
Loading

0 comments on commit 680b223

Please sign in to comment.