Skip to content

Commit f8f2ebd

Browse files
committed
support change page diagnostic
1 parent ae9edfb commit f8f2ebd

File tree

4 files changed

+62
-25
lines changed

4 files changed

+62
-25
lines changed

lib-n-ide/src/main/java/com/duy/ide/diagnostic/DiagnosticContract.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
*/
3535
@SuppressWarnings("unused")
3636
public class DiagnosticContract {
37+
public static final int DIAGNOSTIC = 0;
38+
public static final int COMPILER_LOG = 1;
39+
3740
public interface View {
3841
@WorkerThread
3942
void showDiagnostic(List<Message> messages);
@@ -58,6 +61,8 @@ public interface View {
5861

5962
void setPresenter(Presenter presenter);
6063

64+
@MainThread
65+
void setCurrentItem(int index);
6166
}
6267

6368
public interface Presenter extends ILogger {
@@ -79,6 +84,9 @@ public interface Presenter extends ILogger {
7984
@MainThread
8085
void clear();
8186

87+
@MainThread
88+
void setCurrentItem(int index);
89+
8290
void setOutputParser(@NonNull PatternAwareOutputParser... parsers);
8391

8492
@NonNull

lib-n-ide/src/main/java/com/duy/ide/diagnostic/DiagnosticPresenter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ public void clear() {
221221
mView.clearAll();
222222
}
223223

224+
@Override
225+
public void setCurrentItem(int index) {
226+
if (mView != null){
227+
mView.setCurrentItem(index);
228+
}
229+
}
230+
224231
@Override
225232
public void setOutputParser(@NonNull PatternAwareOutputParser... parsers) {
226233
mToolOutputParser = new ToolOutputParser(parsers, this);

lib-n-ide/src/main/java/com/duy/ide/diagnostic/view/DiagnosticFragment.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ public void setPresenter(DiagnosticContract.Presenter presenter) {
199199
mPresenter = presenter;
200200
}
201201

202+
@Override
203+
public void setCurrentItem(int index) {
204+
if (mViewPager != null) {
205+
mViewPager.setCurrentItem(index);
206+
}
207+
}
208+
202209
@Override
203210
public void onDiagnosisClick(Message message, View view) {
204211
if (mPresenter != null) {

lib-n-ide/src/main/res/layout/activity_default_ide.xml

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,34 +84,49 @@
8484
android:layout_height="wrap_content"
8585
android:orientation="vertical">
8686

87-
<LinearLayout
88-
android:id="@+id/drag_view"
87+
<FrameLayout
8988
android:layout_width="match_parent"
90-
android:layout_height="@dimen/symbol_bar_height"
91-
android:fillViewport="true"
92-
android:orientation="horizontal">
93-
94-
<com.duy.common.view.TintImageView
95-
android:id="@+id/btn_toggle_panel"
96-
android:layout_width="@dimen/symbol_bar_height"
97-
android:layout_height="@dimen/symbol_bar_height"
98-
android:scaleType="centerInside"
99-
android:textColor="?android:textColorPrimary"
100-
app:srcCompat="@drawable/ic_keyboard_arrow_up_white_24dp" />
101-
102-
<HorizontalScrollView
103-
android:layout_width="match_parent"
104-
android:layout_height="match_parent">
89+
android:layout_height="@dimen/symbol_bar_height">
10590

106-
<com.jecelyin.editor.v2.widget.SymbolBarLayout
107-
android:id="@+id/symbolBarLayout"
108-
android:layout_width="wrap_content"
109-
android:layout_height="match_parent"
110-
android:background="?android:attr/windowBackground"
111-
android:visibility="visible" />
112-
</HorizontalScrollView>
91+
<LinearLayout
92+
android:id="@+id/drag_view"
93+
android:layout_width="match_parent"
94+
android:layout_height="match_parent"
95+
android:fillViewport="true"
96+
android:orientation="horizontal">
97+
98+
99+
<com.duy.common.view.TintImageView
100+
android:id="@+id/btn_toggle_panel"
101+
android:layout_width="@dimen/symbol_bar_height"
102+
android:layout_height="@dimen/symbol_bar_height"
103+
android:scaleType="centerInside"
104+
android:textColor="?android:textColorPrimary"
105+
app:srcCompat="@drawable/ic_keyboard_arrow_up_white_24dp" />
106+
107+
<HorizontalScrollView
108+
android:layout_width="match_parent"
109+
android:layout_height="match_parent">
110+
111+
<com.jecelyin.editor.v2.widget.SymbolBarLayout
112+
android:id="@+id/symbolBarLayout"
113+
android:layout_width="wrap_content"
114+
android:layout_height="match_parent"
115+
android:background="?android:attr/windowBackground"
116+
android:visibility="visible" />
117+
</HorizontalScrollView>
118+
119+
</LinearLayout>
120+
121+
<ProgressBar
122+
android:id="@+id/compile_progress"
123+
style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"
124+
android:layout_width="match_parent"
125+
android:layout_height="wrap_content"
126+
android:indeterminate="true"
127+
android:visibility="gone" />
113128

114-
</LinearLayout>
129+
</FrameLayout>
115130

116131
<FrameLayout
117132
android:id="@+id/container_diagnostic_list_view"

0 commit comments

Comments
 (0)