Adding settings - 4
This commit is contained in:
@@ -3,14 +3,6 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
// signingConfigs {
|
||||
// release {
|
||||
// storeFile file('/home/hajdam/cert/exbin/keystore.jks')
|
||||
// storePassword 'g5RV7uXp'
|
||||
// keyAlias 'android'
|
||||
// keyPassword 'H4$PuXmt'
|
||||
// }
|
||||
// }
|
||||
compileSdkVersion 34
|
||||
defaultConfig {
|
||||
applicationId "org.exbin.bined.editor.android"
|
||||
@@ -19,7 +11,6 @@ android {
|
||||
versionCode 4
|
||||
versionName "0.2.1-SNAPSHOT"
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
// signingConfig signingConfigs.release
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
||||
@@ -32,17 +32,18 @@ import android.widget.Toast;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.preference.ListPreference;
|
||||
|
||||
import org.exbin.auxiliary.binary_data.BinaryData;
|
||||
import org.exbin.auxiliary.binary_data.ByteArrayEditableData;
|
||||
import org.exbin.bined.CodeAreaCaretPosition;
|
||||
import org.exbin.bined.CodeCharactersCase;
|
||||
import org.exbin.bined.CodeType;
|
||||
import org.exbin.bined.EditMode;
|
||||
import org.exbin.bined.EditOperation;
|
||||
import org.exbin.bined.SelectionRange;
|
||||
import org.exbin.bined.android.basic.CodeArea;
|
||||
import org.exbin.bined.basic.BasicCodeAreaSection;
|
||||
import org.exbin.bined.basic.CodeAreaViewMode;
|
||||
import org.exbin.bined.capability.EditModeCapable;
|
||||
import org.exbin.bined.highlight.android.HighlightNonAsciiCodeAreaPainter;
|
||||
import org.exbin.bined.operation.android.CodeAreaOperationCommandHandler;
|
||||
@@ -367,10 +368,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
codeArea.setCodeType(CodeType.values()[which]);
|
||||
dialog.dismiss();
|
||||
});
|
||||
builder.setPositiveButton(R.string.button_set, (dialog, which) -> {
|
||||
// dialog.
|
||||
// codeArea.setCodeType(CodeType.values()[which]);
|
||||
});
|
||||
builder.setNegativeButton(R.string.button_cancel, null);
|
||||
AlertDialog alertDialog = builder.create();
|
||||
alertDialog.show();
|
||||
@@ -413,12 +410,35 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
case R.id.view_mode: {
|
||||
// TODO
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.view_mode);
|
||||
builder.setSingleChoiceItems(getResources().getTextArray(R.array.view_mode_entries), codeArea.getViewMode().ordinal(), (dialog, which) -> {
|
||||
codeArea.setViewMode(CodeAreaViewMode.values()[which]);
|
||||
dialog.dismiss();
|
||||
});
|
||||
builder.setNegativeButton(R.string.button_cancel, null);
|
||||
AlertDialog alertDialog = builder.create();
|
||||
alertDialog.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
case R.id.hex_chars_case: {
|
||||
// TODO
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.hex_characters_case);
|
||||
builder.setSingleChoiceItems(getResources().getTextArray(R.array.hex_chars_case_entries), codeArea.getCodeCharactersCase().ordinal(), (dialog, which) -> {
|
||||
codeArea.setCodeCharactersCase(CodeCharactersCase.values()[which]);
|
||||
dialog.dismiss();
|
||||
});
|
||||
builder.setNegativeButton(R.string.button_cancel, null);
|
||||
AlertDialog alertDialog = builder.create();
|
||||
alertDialog.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
case R.id.non_printing_characters: {
|
||||
boolean checked = item.isChecked();
|
||||
item.setChecked(!checked);
|
||||
((HighlightNonAsciiCodeAreaPainter) codeArea.getPainter()).setNonAsciiHighlightingEnabled(!checked);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,14 +37,12 @@
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/view_mode"
|
||||
android:enabled="false"
|
||||
android:title="@string/view_mode" />
|
||||
<item
|
||||
android:id="@+id/code_type"
|
||||
android:title="@string/code_type" />
|
||||
<item
|
||||
android:id="@+id/hex_chars_case"
|
||||
android:enabled="false"
|
||||
android:title="@string/hex_characters_case" />
|
||||
<item
|
||||
android:id="@+id/encoding"
|
||||
@@ -52,7 +50,8 @@
|
||||
android:title="@string/encoding" />
|
||||
<item
|
||||
android:id="@+id/non_printing_characters"
|
||||
android:enabled="false"
|
||||
android:checkable="true"
|
||||
android:checked="true"
|
||||
android:title="@string/non_printing_characters" />
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user