Skip to content
This repository was archived by the owner on Jun 14, 2025. It is now read-only.

Commit 5c6002e

Browse files
committed
Refactor: Update colors and remove unused resources
This commit updates the colors used in the app and removes some unused resources. Specific changes include: - Updating the fill color of several icons to use `?colorOnSurfaceVariant`. - Removing the `splash_background` color from `colors.xml`. - Updating the status bar and navigation bar colors to use `?colorSurfaceContainerLow`. - Adding an icon to the Git settings screen. - Updating the background color of several layouts to use `?colorSurfaceContainerLow`. - Updating the text appearance of several text views. - Adding a drag handle to the new plugin item layout. These changes improve the overall look and feel of the app and make it more consistent with Material Design 3. Signed-off-by: Pranav Purwar <[email protected]>
1 parent 70af75b commit 5c6002e

File tree

204 files changed

+216
-14993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+216
-14993
lines changed

.idea/gradle.xml

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

app/build.gradle.kts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ plugins {
1414

1515
android {
1616
namespace = "org.cosmicide"
17-
compileSdk = 34
17+
compileSdk = 35
1818

1919
defaultConfig {
2020
val commit = getGitCommit()
2121
val GEMINI_API_KEY = "AIzaSyDR-8pmVxLaZHsQM0M5aw4gmyjxnU7ljNo"
2222

2323
applicationId = "org.cosmicide"
2424
minSdk = 26
25-
targetSdk = 34
25+
targetSdk = 35
2626
versionCode = 24
2727
versionName = "2.0.4"
2828
buildConfigField("String", "GIT_COMMIT", "\"$commit\"")
@@ -170,6 +170,7 @@ materialThemeBuilder {
170170
}
171171

172172
generatePaletteAttributes = true
173+
packageName = "org.cosmicide"
173174
}
174175

175176
configurations.all {
@@ -178,7 +179,7 @@ configurations.all {
178179
}
179180

180181
dependencies {
181-
implementation("com.android.tools:r8:8.3.37")
182+
implementation("com.android.tools:r8:8.5.35")
182183
implementation("com.android.tools.smali:smali-dexlib2:3.0.7")
183184

184185
//noinspection GradleDependency
@@ -189,25 +190,24 @@ dependencies {
189190
implementation("com.github.haroldadmin:WhatTheStack:1.0.0-alpha04")
190191

191192
implementation("androidx.appcompat:appcompat:1.7.0")
192-
implementation("androidx.constraintlayout:constraintlayout:2.2.0-alpha13")
193+
implementation("androidx.constraintlayout:constraintlayout:2.2.0-alpha14")
193194
implementation("androidx.core:core-ktx:1.13.1")
194195
implementation("androidx.core:core-splashscreen:1.1.0-rc01")
195196
implementation("androidx.documentfile:documentfile:1.1.0-alpha01")
196-
implementation("androidx.fragment:fragment-ktx:1.8.0")
197-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.2")
198-
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2")
197+
implementation("androidx.fragment:fragment-ktx:1.8.2")
198+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4")
199+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4")
199200
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01")
200201
implementation("androidx.viewpager2:viewpager2:1.1.0")
201-
implementation("androidx.activity:activity-ktx:1.9.0")
202+
implementation("androidx.activity:activity-ktx:1.9.1")
202203
implementation("androidx.startup:startup-runtime:1.2.0-alpha02")
203204

204-
val editorVersion = "0.23.4-cac2770-SNAPSHOT"
205+
val editorVersion = "0.23.4-96c0abc-SNAPSHOT"
205206
//noinspection GradleDependency
206207
implementation("io.github.Rosemoe.sora-editor:editor:$editorVersion")
207208
//noinspection GradleDependency
208-
implementation("io.github.Rosemoe.sora-editor:language-treesitter:$editorVersion") {
209-
isTransitive = false
210-
}
209+
implementation("io.github.Rosemoe.sora-editor:language-treesitter:$editorVersion")
210+
implementation("io.github.Rosemoe.sora-editor:language-textmate:$editorVersion")
211211
implementation("com.itsaky.androidide.treesitter:android-tree-sitter:4.3.1")
212212
implementation("com.itsaky.androidide.treesitter:tree-sitter-java:4.3.1")
213213
implementation("com.itsaky.androidide.treesitter:tree-sitter-kotlin:4.3.1")
@@ -231,7 +231,7 @@ dependencies {
231231
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3")
232232
implementation("org.slf4j:slf4j-simple:2.1.0-alpha1")
233233

234-
implementation("com.google.ai.client.generativeai:generativeai:0.8.0")
234+
implementation("com.google.ai.client.generativeai:generativeai:0.9.0")
235235

236236
val shizukuVersion = "13.1.5"
237237
implementation("dev.rikka.shizuku:api:$shizukuVersion")
@@ -253,7 +253,6 @@ dependencies {
253253
implementation(projects.util)
254254
implementation(projects.jgit)
255255
implementation(projects.feature.treeView)
256-
implementation(projects.feature.editorTextmate)
257256

258257
// jgit uses some methods like `transferTo` are only available from Android 13 onwards
259258
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
android:label="@string/app_name"
3838
android:roundIcon="@mipmap/ic_launcher_round"
3939
android:supportsRtl="true"
40-
android:theme="@style/Theme.CosmicIde.Start"
40+
android:theme="@style/Theme.CosmicIde.Flamingo.Light"
4141
tools:targetApi="34">
4242

4343
<provider

app/src/main/kotlin/org/cosmicide/App.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ class App : Application() {
137137
override fun onActivityDestroyed(p0: Activity) {}
138138
})
139139

140-
//TermuxApplication.init(this)
141-
142140
Analytics.setAnalyticsCollectionEnabled(Prefs.analyticsEnabled)
143141
}
144142

app/src/main/kotlin/org/cosmicide/MainActivity.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ import android.content.pm.PackageManager
1212
import android.os.Bundle
1313
import android.util.AttributeSet
1414
import android.view.View
15-
import android.view.ViewGroup
15+
import androidx.activity.enableEdgeToEdge
1616
import androidx.appcompat.app.AppCompatActivity
1717
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
1818
import androidx.core.view.ViewCompat
1919
import androidx.core.view.WindowInsetsCompat
20-
import androidx.core.view.updateLayoutParams
2120
import androidx.fragment.app.commit
2221
import androidx.lifecycle.lifecycleScope
2322
import com.google.android.material.color.DynamicColors
@@ -64,19 +63,20 @@ class MainActivity : AppCompatActivity() {
6463

6564
binding = ActivityMainBinding.inflate(layoutInflater)
6665

66+
enableEdgeToEdge()
67+
6768
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, windowInsets ->
6869
val imeInset =
6970
ViewCompat.getRootWindowInsets(view)!!.getInsets(WindowInsetsCompat.Type.ime())
7071

7172
val systemBarInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
7273

73-
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
74-
leftMargin = systemBarInsets.left
75-
rightMargin = systemBarInsets.right
76-
topMargin = systemBarInsets.top
77-
bottomMargin = if (imeInset.bottom > 0) 0 else systemBarInsets.bottom
78-
}
79-
74+
view.setPadding(
75+
systemBarInsets.left,
76+
systemBarInsets.top,
77+
systemBarInsets.right,
78+
if (imeInset.bottom > 0) 0 else systemBarInsets.bottom
79+
)
8080

8181
WindowInsetsCompat.CONSUMED
8282
}

app/src/main/kotlin/org/cosmicide/fragment/ProjectFragment.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import android.content.Intent
1212
import android.os.Bundle
1313
import android.view.View
1414
import android.widget.EditText
15+
import android.widget.LinearLayout
1516
import android.widget.TextView
1617
import android.widget.Toast
1718
import androidx.activity.result.ActivityResult
@@ -133,6 +134,7 @@ class ProjectFragment : BaseBindingFragment<FragmentProjectBinding>(),
133134
}
134135
true
135136
}
137+
136138
else -> false
137139
}
138140
}
@@ -343,8 +345,14 @@ class ProjectFragment : BaseBindingFragment<FragmentProjectBinding>(),
343345
hint = "Enter your name"
344346
}
345347

348+
val linear = LinearLayout(requireContext()).apply {
349+
orientation = LinearLayout.VERTICAL
350+
setPadding(32, 16, 32, 8)
351+
addView(editText)
352+
}
353+
346354
MaterialAlertDialogBuilder(requireContext()).apply {
347-
setView(editText)
355+
setView(linear)
348356
setTitle("Enter your name")
349357
setPositiveButton("Okay") { _, _ ->
350358
val name = editText.text.toString()

app/src/main/kotlin/org/cosmicide/fragment/SettingsFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import de.Maxr1998.modernpreferences.helpers.screen
1919
import de.Maxr1998.modernpreferences.helpers.subScreen
2020
import org.cosmicide.MainActivity
2121
import org.cosmicide.chat.ChatProvider
22+
import org.cosmicide.common.BaseBindingFragment
2223
import org.cosmicide.databinding.FragmentSettingsBinding
2324
import org.cosmicide.fragment.settings.AboutSettings
2425
import org.cosmicide.fragment.settings.AppearanceSettings
@@ -28,7 +29,6 @@ import org.cosmicide.fragment.settings.FormatterSettings
2829
import org.cosmicide.fragment.settings.GeminiSettings
2930
import org.cosmicide.fragment.settings.GitSettings
3031
import org.cosmicide.fragment.settings.PluginSettingsProvider
31-
import org.cosmicide.common.BaseBindingFragment
3232

3333
/**
3434
* Fragment for displaying settings screen.
@@ -52,7 +52,7 @@ class SettingsFragment : BaseBindingFragment<FragmentSettingsBinding>() {
5252
val formatterSettings = FormatterSettings(requireActivity())
5353
val compilerSettings = CompilerSettings(requireActivity())
5454
val pluginsSettings = PluginSettingsProvider(requireActivity())
55-
val gitSettings = GitSettings()
55+
val gitSettings = GitSettings(requireActivity())
5656
val aboutSettings = AboutSettings(requireActivity())
5757
val geminiSettings = GeminiSettings(requireActivity())
5858

app/src/main/kotlin/org/cosmicide/fragment/settings/GitSettings.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@
77

88
package org.cosmicide.fragment.settings
99

10+
import androidx.core.content.res.ResourcesCompat
11+
import androidx.fragment.app.FragmentActivity
1012
import de.Maxr1998.modernpreferences.PreferenceScreen
1113
import de.Maxr1998.modernpreferences.helpers.editText
14+
import org.cosmicide.R
1215
import org.cosmicide.util.PreferenceKeys
1316

14-
class GitSettings : SettingsProvider {
17+
class GitSettings(private val activity: FragmentActivity) : SettingsProvider {
1518

1619
override fun provideSettings(builder: PreferenceScreen.Builder) {
1720
builder.apply {
21+
icon = ResourcesCompat.getDrawable(
22+
activity.resources,
23+
R.drawable.github,
24+
activity.theme
25+
)
26+
1827
editText(PreferenceKeys.GIT_USERNAME) {
1928
title = "Username"
2029
defaultValue = ""
@@ -32,4 +41,4 @@ class GitSettings : SettingsProvider {
3241
}
3342
}
3443
}
35-
}
44+
}

app/src/main/res/drawable/baseline_arrow_back_24.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
android:width="24dp"
1010
android:height="24dp"
1111
android:viewportWidth="960"
12-
android:viewportHeight="960"
13-
android:tint="?attr/colorControlNormal">
12+
android:viewportHeight="960">
1413
<path
15-
android:fillColor="@android:color/white"
14+
android:fillColor="?colorOnSurfaceVariant"
1615
android:pathData="M313,520L509,716Q521,728 521,744Q520,760 508,772Q496,783 480,784Q464,784 452,772L188,508Q182,502 180,495Q177,488 177,480Q177,472 180,465Q182,458 188,452L452,188Q463,177 480,177Q496,177 508,188Q520,200 520,217Q520,233 508,245L313,440L760,440Q777,440 789,452Q800,463 800,480Q800,497 789,509Q777,520 760,520L313,520Z" />
17-
</vector>
16+
</vector>

0 commit comments

Comments
 (0)