Skip to content

Commit 460b546

Browse files
committed
cleanup
1 parent 19b7a8d commit 460b546

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

app/src/main/java/com/duy/editor/CodeEditorActivity.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.content.Intent;
2121
import android.core.widget.EditAreaView;
2222
import android.os.Bundle;
23+
import android.support.v4.view.ViewPager;
2324
import android.view.Menu;
2425
import android.view.MenuItem;
2526
import android.view.SubMenu;
@@ -37,6 +38,7 @@
3738
import com.duy.ccppcompiler.ui.dialogs.CompilerOptionsDialog;
3839
import com.duy.ccppcompiler.ui.dialogs.PremiumDialog;
3940
import com.duy.ccppcompiler.ui.examples.ExampleActivity;
41+
import com.duy.common.DLog;
4042
import com.duy.common.purchase.InAppPurchaseHelper;
4143
import com.duy.common.purchase.Premium;
4244
import com.duy.editor.theme.ThemeActivity;
@@ -74,6 +76,28 @@ protected void onCreate(Bundle savedInstanceState) {
7476
mPremiumHelper = new InAppPurchaseHelper(this);
7577
// Monitor launch times and interval from installation
7678
RateThisApp.onCreate(this);
79+
80+
initCodeAnalyzer();
81+
}
82+
83+
private void initCodeAnalyzer() {
84+
mEditorPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
85+
@Override
86+
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
87+
88+
}
89+
90+
@Override
91+
public void onPageSelected(int position) {
92+
if (DLog.DEBUG)
93+
DLog.d(TAG, "onPageSelected() called with: position = [" + position + "]");
94+
}
95+
96+
@Override
97+
public void onPageScrollStateChanged(int state) {
98+
99+
}
100+
});
77101
}
78102

79103
@Override

libeditor/src/main/java/com/duy/ide/core/SimpleEditorActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,9 @@ private void createNewEditor(File file, int offset, String encoding) {
680680
}
681681

682682
public void insertText(CharSequence text) {
683-
if (text == null)
683+
if (text == null) {
684684
return;
685+
}
685686
Command c = new Command(Command.CommandEnum.INSERT_TEXT);
686687
c.object = text;
687688
doCommand(c);

libeditor/src/main/java/com/jecelyin/editor/v2/dialog/LangListDialog.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,6 @@ public void onClick(DialogInterface dialog, int which) {
9696
dialog.cancel();
9797
}
9898
});
99-
// MaterialDialog dlg = getDialogBuilder().items(langList)
100-
// .title(R.string.select_lang_to_highlight)
101-
// .itemsCallbackSingleChoice(currentLangIndex, new MaterialDialog.ListCallbackSingleChoice() {
102-
//
103-
// @Override
104-
// public boolean onSelection(MaterialDialog materialDialog, View view, int i, CharSequence charSequence) {
105-
// Command command = new Command(Command.CommandEnum.HIGHLIGHT);
106-
// command.object = scopeList[i];
107-
// getMainActivity().doCommand(command);
108-
// return true;
109-
// }
110-
// })
111-
// .negativeText(R.string.cancel)
112-
// .show();
11399
AlertDialog dlg = builder.create();
114100
dlg.show();
115101
handleDialog(dlg);

0 commit comments

Comments
 (0)