Skip to content

Commit

Permalink
Remove hint from the Textbox UI element
Browse files Browse the repository at this point in the history
Makes it so we can make it smaller because there is a lot of wasted space and we can use the help balloon instead
  • Loading branch information
deadman96385 committed Jan 16, 2024
1 parent cadd728 commit 0c414d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public class TextboxDialog extends DialogFragment {

Preference preference = PowerPreference.getDefaultFile();

AtomicReference<TextInputLayout> popup_hint_example = new AtomicReference<>();


public interface TextboxDialogListener {
void onTextboxDialogPositiveClick(Cell newCell, boolean location, int viewId, int realId);
}
Expand Down Expand Up @@ -84,16 +81,6 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
TextView picker_help = v.findViewById(R.id.popup_help_text);

ImageButton helpIcon = v.findViewById(R.id.help_button);
TextView picker_hint;

// Sets the saved title and hint text
popup_hint_example.set(v.findViewById(R.id.textbox_text_layout));
picker_hint = v.findViewById(R.id.popup_title_hint_text);
if (location) {
popup_hint_example.get().setHint(preference.getString("top_" + viewId + "_hint_value"));
} else {
popup_hint_example.get().setHint(preference.getString("bot_" + viewId + "_hint_value"));
}

// Set default title to both TextViews
picker_title.setText(title);
Expand Down Expand Up @@ -153,16 +140,10 @@ public void afterTextChanged(Editable s) {
String cellTitle = picker_title.getText().toString();

String newTitle = picker_title.getText().toString();
String hint = picker_hint.getText().toString();
String newHelp = picker_help.getText().toString();
if (!newTitle.isEmpty()) {
preference.putString(viewId + "_title_value", title);
}
if (!hint.isEmpty()) {
preference.putString(viewId + "_hint_value", hint);

cellParam.setTextHint(hint);
}
if (!newHelp.isEmpty()) {
preference.putString(viewId + "_help_value", newHelp);
cellParam.setHelpText(newHelp);
Expand Down
42 changes: 0 additions & 42 deletions app/src/main/res/layout/popup_textbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,48 +74,6 @@
/>
</com.google.android.material.textfield.TextInputLayout>

<!--This layout sets the size/dimensions of the box-->
<TextView
android:id="@+id/hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/HintTextTitle"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/popup_help_layout"
/>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/popup_edittext_layout_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hint"
app:boxStrokeColor="@color/accent_color"
app:counterTextColor="@color/accent_color"
app:hintTextColor="@color/accent_color"
>

<!--This is the actual edit text which takes the input-->
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/popup_title_hint_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:selectAllOnFocus="true"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@+id/yes_no_example"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/filledTextField"
/>
</com.google.android.material.textfield.TextInputLayout>

<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 0c414d9

Please sign in to comment.