Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

EditText.getText() isn't bound

オープン 初心者向け
#9,192 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
android, csharp
領域
mobile-dev

調査の方向性

src/Mono.Android/metadata から始め、binding metadata で EditText と TextView のメンバーがどのように表現されているかを確認します。EditText.getText() が編集可能な TextEditable プロパティとして公開され、要求された動作を維持したまま Clear() と Append() を使用できることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Area: Mono.Android
Android framework version

net8.0-android, net9.0-android

Affected platform version

.NET 8.0

Description

Context: https://discord.com/channels/732297728826277939/732297837953679412/1272467705534091348
Context: https://stackoverflow.com/questions/26365808/edittext-settext-changes-the-keyboard-type-to-default-from-123-to-abc

Background

A customer came onto Discord asking:

When calling EditText.setText() on android, it resets the keyboard. This is super annoying if you are processing inputs and the user changes from ABC view to symbols view, the keyboard jumps 'back' to ABC view.
…
The 'workaround' natively is to not call SetText and instead call getText().Clear() and then getText().Append(blah)

The problem is, that's not currently possible, because there is no Text or TextFormatted property that has a .Clear() method. The TextView.TextFormatted property returns ICharSequence, which has no Clear() method.

What's Going On?

What's going on is our favorite, covariant return types: TextView.getText() returns CharSequence, while EditText.getText() returns the Editable interface. However, C# covariant return types only works for classes, not interfaces, and regardless we don't re-bind the Text property on EditText.

Proposal

Use src/Mono.Android/metadata to bind the EditText.getText() method as the EditText.TextEditable property. That would allow the original customer to call myEditText.TextEditable.Clear(), which is not currently possible.

主要言語
C#
スター
2.1k
フォーク
580
平均マージ
2日 1時間
マージ済み PR(30日)
220

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/android のほかの issue

dotnet/android の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。