mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
Implement Tabs and Spaces identation
This commit is contained in:
parent
f93fdf9a1a
commit
1e16505414
|
@ -73,8 +73,25 @@ public class CodeEditorActivity extends BaseActivity {
|
||||||
binding.codeView.setLineNumberTextSize(32f);
|
binding.codeView.setLineNumberTextSize(32f);
|
||||||
|
|
||||||
// Setup Auto indenting feature
|
// Setup Auto indenting feature
|
||||||
binding.codeView.setTabLength(4);
|
if (tinyDB.getInt("ceIndentationId") == 0) {
|
||||||
binding.codeView.setEnableAutoIndentation(true);
|
binding.codeView.setEnableAutoIndentation(true);
|
||||||
|
switch (tinyDB.getInt("ceIndentationTabsId")) {
|
||||||
|
case 0:
|
||||||
|
binding.codeView.setTabLength(2);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
binding.codeView.setTabLength(4);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
binding.codeView.setTabLength(6);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
binding.codeView.setTabLength(8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
binding.codeView.setEnableAutoIndentation(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Set up the language and theme with SyntaxManager helper class
|
// Set up the language and theme with SyntaxManager helper class
|
||||||
currentLanguage.applyTheme(this, binding.codeView, currentTheme);
|
currentLanguage.applyTheme(this, binding.codeView, currentTheme);
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class SettingsCodeEditorActivity extends BaseActivity {
|
||||||
|
|
||||||
// color selector dialog
|
// color selector dialog
|
||||||
colorList = getResources().getStringArray(R.array.ceColors);
|
colorList = getResources().getStringArray(R.array.ceColors);
|
||||||
|
colorSelectedChoice = tinyDB.getInt("ceColorId");
|
||||||
activitySettingsCodeEditorBinding.ceColorSelected.setText(colorList[colorSelectedChoice]);
|
activitySettingsCodeEditorBinding.ceColorSelected.setText(colorList[colorSelectedChoice]);
|
||||||
|
|
||||||
activitySettingsCodeEditorBinding.ceColorSelectionFrame.setOnClickListener(
|
activitySettingsCodeEditorBinding.ceColorSelectionFrame.setOnClickListener(
|
||||||
|
@ -66,6 +67,7 @@ public class SettingsCodeEditorActivity extends BaseActivity {
|
||||||
|
|
||||||
// indentation selector dialog
|
// indentation selector dialog
|
||||||
indentationList = getResources().getStringArray(R.array.ceIndentation);
|
indentationList = getResources().getStringArray(R.array.ceIndentation);
|
||||||
|
indentationSelectedChoice = tinyDB.getInt("ceIndentationId");
|
||||||
activitySettingsCodeEditorBinding.indentationSelected.setText(
|
activitySettingsCodeEditorBinding.indentationSelected.setText(
|
||||||
indentationList[indentationSelectedChoice]);
|
indentationList[indentationSelectedChoice]);
|
||||||
|
|
||||||
|
@ -107,6 +109,7 @@ public class SettingsCodeEditorActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
indentationTabsList = getResources().getStringArray(R.array.ceIndentationTabsWidth);
|
indentationTabsList = getResources().getStringArray(R.array.ceIndentationTabsWidth);
|
||||||
|
indentationTabsSelectedChoice = tinyDB.getInt("ceIndentationTabsId");
|
||||||
activitySettingsCodeEditorBinding.indentationTabsSelected.setText(
|
activitySettingsCodeEditorBinding.indentationTabsSelected.setText(
|
||||||
indentationTabsList[indentationTabsSelectedChoice]);
|
indentationTabsList[indentationTabsSelectedChoice]);
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
android:icon="@drawable/ic_branch"
|
android:icon="@drawable/ic_branch"
|
||||||
android:orderInCategory="1"
|
android:orderInCategory="1"
|
||||||
android:title="@string/strSwitchBranches"
|
android:title="@string/strSwitchBranches"
|
||||||
app:showAsAction="ifRoom|withText" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/branchCommits"
|
android:id="@+id/branchCommits"
|
||||||
android:icon="@drawable/ic_commit"
|
android:icon="@drawable/ic_commit"
|
||||||
android:orderInCategory="2"
|
android:orderInCategory="2"
|
||||||
android:title="@string/commitTitle"
|
android:title="@string/commitTitle"
|
||||||
app:showAsAction="ifRoom|withText" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<string name="versionLow" translatable="false">1.17</string>
|
<string name="versionLow" translatable="false">1.18</string>
|
||||||
<string name="versionHigh" translatable="false">1.19</string>
|
<string name="versionHigh" translatable="false">1.20</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue