Skip to content

Commit 0a262ed

Browse files
committed
Fix not set icon
1 parent 7e6f5a9 commit 0a262ed

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

libeditor/src/main/java/com/duy/ide/diagnostic/DiagnosticPresenter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ private void highlightError() {
205205
command.args.putInt("line", lineNumber);
206206
command.args.putInt("col", columnNumber);
207207
editorDelegate.doCommand(command);
208-
209-
if (!firstIndex) {
210-
Command gotoIndexCmd = new Command(Command.CommandEnum.GOTO_INDEX);
211-
gotoIndexCmd.args.putAll(command.args);
212-
editorDelegate.doCommand(gotoIndexCmd);
213-
firstIndex = true;
214-
}
208+
//
209+
// if (!firstIndex) {
210+
// Command gotoIndexCmd = new Command(Command.CommandEnum.GOTO_INDEX);
211+
// gotoIndexCmd.args.putAll(command.args);
212+
// editorDelegate.doCommand(gotoIndexCmd);
213+
// firstIndex = true;
214+
// }
215215
}
216216
}
217217

libeditor/src/main/java/com/duy/ide/diagnostic/view/DiagnosticsAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
7878
holder.txtFile.setText("");
7979
}
8080

81-
81+
setIcon(holder, diagnostic);
8282
if (diagnostic.getMessage(mContext).isEmpty()) {
8383
holder.txtMessage.setVisibility(View.GONE);
8484
} else {
@@ -106,7 +106,7 @@ private void setIcon(ViewHolder holder, Diagnostic diagnostic) {
106106
}
107107
case WARNING: {
108108
Drawable drawable = ContextCompat.getDrawable(mContext, R.drawable.baseline_warning_24);
109-
drawable = DrawableUtils.tintDrawable(drawable, Color.YELLOW);
109+
drawable = DrawableUtils.tintDrawable(drawable, ContextCompat.getColor(mContext, R.color.color_diagnostic_warn));
110110
holder.icon.setImageDrawable(drawable);
111111
break;
112112
}

libeditor/src/main/res/layout/list_item_diagnostic.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,35 @@
1414
~ limitations under the License.
1515
-->
1616
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
17+
xmlns:app="http://schemas.android.com/apk/res-auto"
1718
xmlns:tools="http://schemas.android.com/tools"
1819
android:layout_width="match_parent"
1920
android:layout_height="wrap_content"
20-
xmlns:app="http://schemas.android.com/apk/res-auto"
2121
android:background="?selectableItemBackground"
2222
android:orientation="vertical">
2323

2424
<LinearLayout
2525
android:layout_width="match_parent"
2626
android:layout_height="wrap_content"
27+
android:gravity="center_vertical"
2728
android:orientation="horizontal">
2829

2930
<android.support.v7.widget.AppCompatImageView
3031
android:id="@+id/imageview"
3132
android:layout_width="wrap_content"
3233
android:layout_height="wrap_content"
3334
android:layout_gravity="center"
35+
android:padding="4dp"
3436
app:srcCompat="@drawable/baseline_warning_black_18"
3537
tools:tint="#d50000" />
3638

3739
<android.support.v7.widget.AppCompatTextView
3840
android:id="@+id/txt_line_col"
3941
android:layout_width="wrap_content"
4042
android:layout_height="wrap_content"
43+
android:minEms="4"
4144
android:padding="4dp"
4245
android:textColor="?android:textColorPrimary"
43-
android:minEms="4"
4446
android:textSize="@dimen/smallest_text_size"
4547
tools:text="1222:222" />
4648

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2018 Duy Tran Le
4+
~
5+
~ This program is free software: you can redistribute it and/or modify
6+
~ it under the terms of the GNU General Public License as published by
7+
~ the Free Software Foundation, either version 3 of the License, or
8+
~ (at your option) any later version.
9+
~
10+
~ This program is distributed in the hope that it will be useful,
11+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
~ GNU General Public License for more details.
14+
~
15+
~ You should have received a copy of the GNU General Public License
16+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
-->
18+
19+
<resources>
20+
<color name="color_diagnostic_warn">#ff8f00</color>
21+
</resources>

0 commit comments

Comments
 (0)