Skip to content

Commit

Permalink
some edits
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Dec 19, 2024
1 parent c4b4840 commit c0c8620
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 11 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ aboutLibraries {
dependencies {
implementation(project(":libphonograph:libPhonograph"))
val media3Version = "1.4.1"
implementation("androidx.activity:activity-ktx:1.9.2")
implementation("androidx.activity:activity-ktx:1.9.3")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.collection:collection-ktx:1.4.4")
implementation("androidx.collection:collection-ktx:1.4.5")
implementation("androidx.concurrent:concurrent-futures-ktx:1.2.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.0-beta01")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.core:core-splashscreen:1.0.1")
//implementation("androidx.datastore:datastore-preferences:1.1.0-rc01") TODO don't abuse shared prefs
implementation("androidx.fragment:fragment-ktx:1.8.4")
implementation("androidx.fragment:fragment-ktx:1.8.5")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6")
implementation("androidx.media3:media3-exoplayer:$media3Version")
implementation("androidx.media3:media3-exoplayer-midi:$media3Version")
Expand All @@ -262,7 +262,7 @@ dependencies {
implementation("com.mikepenz:aboutlibraries:$aboutLibsVersion")
implementation("com.google.android.material:material:1.12.0")
implementation("me.zhanghai.android.fastscroll:library:1.3.0")
implementation("io.coil-kt.coil3:coil:3.0.0-alpha10")
implementation("io.coil-kt.coil3:coil:3.0.4")
//noinspection GradleDependency newer versions need java.nio which is api 26+
//implementation("com.github.albfernandez:juniversalchardet:2.0.3") TODO
implementation("androidx.profileinstaller:profileinstaller:1.4.1")
Expand Down
5 changes: 3 additions & 2 deletions app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<application tools:ignore="MissingApplicationIcon"
android:memtagMode="sync"
android:gwpAsanMode="always"
android:requestLegacyExternalStorage="true"
tools:targetApi="s">
android:icon="@mipmap/ic_launcher_xmas"
tools:targetApi="s"
tools:replace="android:icon">
<activity
android:name="com.android.development.MediaScannerActivity"
android:label="SD Exploder"
Expand Down
Binary file added app/src/main/ic_launcher_xmas-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions app/src/main/kotlin/org/akanework/gramophone/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@

package org.akanework.gramophone.ui

import android.annotation.SuppressLint
import android.app.NotificationManager
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Color
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.provider.Settings
import android.view.Choreographer
import android.view.ViewGroup
import android.widget.TextView
import android.widget.Toast
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.IntentSenderRequest
Expand All @@ -49,6 +53,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.akanework.gramophone.BuildConfig
import org.akanework.gramophone.R
import org.akanework.gramophone.logic.enableEdgeToEdgeProperly
import org.akanework.gramophone.logic.gramophoneApplication
Expand Down Expand Up @@ -126,6 +131,15 @@ class MainActivity : AppCompatActivity() {

// Set content Views.
setContentView(R.layout.activity_main)
if (BuildConfig.DEBUG) {
@SuppressLint("SetTextI18n")
findViewById<ViewGroup>(R.id.rootView).addView(TextView(this).apply {
text = "DEBUG"
setTextColor(Color.RED)
translationZ = 9999999f
translationX = 50f
})
}
playerBottomSheet = findViewById(R.id.player_layout)
val container = findViewById<FragmentContainerView>(R.id.container)
// Modifies FragmentContainerView's insets to account for bottom sheet size.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ class MediaControllerViewModel(application: Application) : AndroidViewModel(appl
if (lifecycleOne.currentState == Lifecycle.State.DESTROYED ||
lifecycleTwo.currentState == Lifecycle.State.DESTROYED
) {

// you cannot set DESTROYED before setting CREATED
if (lifecycle.currentState == Lifecycle.State.INITIALIZED)
lifecycleRegistry.currentState = Lifecycle.State.CREATED
Expand Down
31 changes: 31 additions & 0 deletions app/src/main/res/drawable/ic_launcher_xmas_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="1080"
android:viewportHeight="1080">
<group android:scaleX="0.66"
android:scaleY="0.66"
android:translateX="183.6"
android:translateY="183.6">
<path
android:pathData="M459.1,412.8a58.8,32 0,1 0,117.7 0a58.8,32 0,1 0,-117.7 0z"
android:strokeWidth="0"
android:fillColor="#3d5646"/>
<path
android:pathData="m867,410.6l-295.3,-161.1c-19.6,-10.7 -43.3,-10.7 -62.9,0l-295.3,161.1c-21.1,11.5 -34.2,33.6 -34.2,57.6l0,151.7c0,24 13.1,46.1 34.2,57.6l295.3,161.1c19.6,10.7 43.3,10.7 62.9,0l295.3,-161.1c21.1,-11.5 34.2,-33.6 34.2,-57.6l0,-151.7c0,-24 -13.1,-46.1 -34.2,-57.6zM518,505.2c-93.9,0 -170,-41.3 -170,-92.3s76.1,-92.3 170,-92.3s170,41.3 170,92.3s-76.1,92.3 -170,92.3zM794.2,465.9l-179.2,97.8c-2.4,1.3 -5.1,2 -7.8,2l-45.1,0c-9.1,0 -16.4,-7.3 -16.4,-16.4s7.3,-16.4 16.4,-16.4l40.9,0l150.5,-82.1c-4.1,-5 -4.9,-12.2 -1.6,-18.2c4.4,-7.9 14.3,-10.8 22.3,-6.5l20.1,11.1c5.3,2.9 8.5,8.4 8.5,14.4s-3.3,11.5 -8.6,14.4l0,0z"
android:strokeWidth="0"
android:fillColor="#3d5646"/>
<path
android:pathData="m794.6,349.2c72.3,2.3 121.9,5.3 135.5,10.2c16.7,6.2 66.1,45 66.8,72.2c1,41.1 -2.5,86.1 -27.2,135c-4.2,8.3 -24.7,-0.4 -25.5,-9.7c-2.2,-25.3 -3.9,-34 -12.9,-46.8c0,0 -7.7,32.1 -20.8,63.1c-9,21.3 -105.9,-13.4 -125.3,-38s-48,-71.6 -32.8,-103.7s42.1,-82.4 42.1,-82.4l0,0z"
android:strokeWidth="0"
android:fillColor="#ba4242"/>
<path
android:pathData="m786.7,338c-7.8,-0.7 -27.7,-2.9 -34.8,1.8c-18.1,12 -45.7,126.4 -14.3,180.6c25.6,44.3 98.9,91 163.6,85.2c4.1,-0.4 7.1,-6 9.9,-12c4.5,-9.5 7.4,-17.8 8.2,-19.8c4.2,-9.7 -3.4,-11.8 -13.8,-12.6c-44.8,-3.3 -107.7,-31.7 -125.1,-68.9c-19.9,-42.6 7.6,-121.7 19.1,-142.9c3.5,-6.6 -7.7,-10.9 -12.9,-11.4l0,0z"
android:strokeWidth="0"
android:fillColor="#fffefa"/>
<path
android:pathData="M958.9,576m-23.4,0a23.4,23.4 0,1 1,46.8 0a23.4,23.4 0,1 1,-46.8 0"
android:strokeWidth="0"
android:fillColor="#fffefa"/>
</group>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_xmas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_xmas_background"/>
<foreground android:drawable="@drawable/ic_launcher_xmas_foreground"/>
</adaptive-icon>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions app/src/main/res/values/ic_launcher_xmas_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_xmas_background">#C1D3D0</color>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.recyclerview.widget.RecyclerView
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.akanework.gramophone.logic.gramophoneApplication

class Reflections : AppCompatActivity() {
Expand All @@ -24,7 +25,10 @@ class Reflections : AppCompatActivity() {
val r = findViewById<RecyclerView>(R.id.recyclerview)
CoroutineScope(Dispatchers.Default).launch {
gramophoneApplication.reader.refresh()
r.adapter = ReflectionAdapter(gramophoneApplication.reader, null, { r.adapter = it }, false)
withContext(Dispatchers.Main) {
r.adapter =
ReflectionAdapter(gramophoneApplication.reader, null, { r.adapter = it }, false)
}
}
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
val agpVersion = "8.8.0-rc01"
val agpVersion = "8.8.0-rc02"
id("com.android.application") version agpVersion apply false
id("com.android.library") version agpVersion apply false
id("com.android.test") version agpVersion apply false
Expand Down
2 changes: 1 addition & 1 deletion libphonograph

0 comments on commit c0c8620

Please sign in to comment.