From 3fc7bbc76945b2e3103df4c8db26592c1aaa5c50 Mon Sep 17 00:00:00 2001 From: muqing <1966944300@qq.com> Date: Sat, 27 Jul 2024 09:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=A2=9C=E8=89=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rust/pro/edit/autoComplete/AutoCompleteJob.kt | 1 - .../github/rosemoe/sora/widget/SymbolInputView.java | 3 +++ .../rosemoe/sora/widget/base/EditorPopupWindow.java | 2 ++ .../component/DefaultCompletionItemAdapter.java | 12 ++++++++++-- .../component/EditorDiagnosticTooltipWindow.kt | 1 + .../res/layout/default_completion_result_item.xml | 5 ++--- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/coldmint/rust/pro/edit/autoComplete/AutoCompleteJob.kt b/app/src/main/java/com/coldmint/rust/pro/edit/autoComplete/AutoCompleteJob.kt index 17126ab..00895f5 100644 --- a/app/src/main/java/com/coldmint/rust/pro/edit/autoComplete/AutoCompleteJob.kt +++ b/app/src/main/java/com/coldmint/rust/pro/edit/autoComplete/AutoCompleteJob.kt @@ -1,7 +1,6 @@ package com.coldmint.rust.pro.edit.autoComplete import android.os.Bundle -import com.coldmint.rust.pro.edit.RustAutoComplete import com.coldmint.rust.pro.edit.RustCompletionItem import io.github.rosemoe.sora.lang.completion.CompletionPublisher import io.github.rosemoe.sora.text.CharPosition diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/SymbolInputView.java b/editor/src/main/java/io/github/rosemoe/sora/widget/SymbolInputView.java index e12f607..c854896 100644 --- a/editor/src/main/java/io/github/rosemoe/sora/widget/SymbolInputView.java +++ b/editor/src/main/java/io/github/rosemoe/sora/widget/SymbolInputView.java @@ -27,6 +27,7 @@ import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.util.AttributeSet; +import android.util.Log; import android.widget.Button; import android.widget.LinearLayout; @@ -95,6 +96,8 @@ public class SymbolInputView extends LinearLayout { for (int i = 0; i < getChildCount(); i++) { ((Button) getChildAt(i)).setTextColor(color); } + + Log.i("SymbolInputView", "Set text color to " + color); textColor = color; } diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/base/EditorPopupWindow.java b/editor/src/main/java/io/github/rosemoe/sora/widget/base/EditorPopupWindow.java index efafab1..dfa8667 100644 --- a/editor/src/main/java/io/github/rosemoe/sora/widget/base/EditorPopupWindow.java +++ b/editor/src/main/java/io/github/rosemoe/sora/widget/base/EditorPopupWindow.java @@ -23,6 +23,7 @@ */ package io.github.rosemoe.sora.widget.base; +import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.PopupWindow; @@ -271,6 +272,7 @@ public class EditorPopupWindow { if (isShowing()) { return; } + Log.i("EditorPopupWindow", "Created a new window for editor"); applyWindowAttributes(true); } diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/component/DefaultCompletionItemAdapter.java b/editor/src/main/java/io/github/rosemoe/sora/widget/component/DefaultCompletionItemAdapter.java index 43c5257..70919a7 100644 --- a/editor/src/main/java/io/github/rosemoe/sora/widget/component/DefaultCompletionItemAdapter.java +++ b/editor/src/main/java/io/github/rosemoe/sora/widget/component/DefaultCompletionItemAdapter.java @@ -23,6 +23,7 @@ */ package io.github.rosemoe.sora.widget.component; +import android.graphics.Color; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; @@ -30,6 +31,8 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; +import androidx.core.content.ContextCompat; + import io.github.rosemoe.sora.R; import io.github.rosemoe.sora.widget.schemes.EditorColorScheme; @@ -53,13 +56,18 @@ public final class DefaultCompletionItemAdapter extends EditorCompletionAdapter } var item = getItem(pos); + + //编辑器代码提示文本渲染 TextView tv = view.findViewById(R.id.result_item_label); tv.setText(item.label); - tv.setTextColor(getThemeColor(EditorColorScheme.COMPLETION_WND_TEXT_PRIMARY)); +// tv.setTextColor(getThemeColor(EditorColorScheme.COMPLETION_WND_TEXT_PRIMARY)); + tv.setTextColor(ContextCompat.getColor(getContext(),R.color.defaultSymbolInputTextColor)); + tv = view.findViewById(R.id.result_item_desc); tv.setText(item.desc); - tv.setTextColor(getThemeColor(EditorColorScheme.COMPLETION_WND_TEXT_SECONDARY)); +// tv.setTextColor(getThemeColor(EditorColorScheme.COMPLETION_WND_TEXT_SECONDARY)); + tv.setTextColor(ContextCompat.getColor(getContext(),R.color.defaultSymbolInputTextColor)); view.setTag(pos); if (isCurrentCursorPosition) { diff --git a/editor/src/main/java/io/github/rosemoe/sora/widget/component/EditorDiagnosticTooltipWindow.kt b/editor/src/main/java/io/github/rosemoe/sora/widget/component/EditorDiagnosticTooltipWindow.kt index 6f6225c..a1b5822 100644 --- a/editor/src/main/java/io/github/rosemoe/sora/widget/component/EditorDiagnosticTooltipWindow.kt +++ b/editor/src/main/java/io/github/rosemoe/sora/widget/component/EditorDiagnosticTooltipWindow.kt @@ -25,6 +25,7 @@ package io.github.rosemoe.sora.widget.component import android.graphics.drawable.GradientDrawable +import android.util.Log import android.view.LayoutInflater import android.view.MotionEvent import android.view.View diff --git a/editor/src/main/res/layout/default_completion_result_item.xml b/editor/src/main/res/layout/default_completion_result_item.xml index 6030872..78f93ed 100644 --- a/editor/src/main/res/layout/default_completion_result_item.xml +++ b/editor/src/main/res/layout/default_completion_result_item.xml @@ -52,9 +52,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Medium Text" - android:textColor="#FF000000" - android:id="@+id/result_item_label" - android:textSize="15sp"/> + style="@style/TextAppearance.Material3.TitleSmall" + android:id="@+id/result_item_label" />