This commit is contained in:
dgis 2018-12-08 22:58:50 +00:00
parent 05e9e448b5
commit b226e32111
9 changed files with 296 additions and 36 deletions

View file

@ -2,6 +2,7 @@ package com.regis.cosnier.emu48;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.ViewGroup;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.navigation.NavigationView;
@ -27,7 +28,7 @@ public class MainActivity extends AppCompatActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
@ -50,8 +51,23 @@ public class MainActivity extends AppCompatActivity
mainScreenView = new MainScreenView(this); //, currentProject);
ViewGroup mainScreenContainer = (ViewGroup)findViewById(R.id.main_screen_container);
mainScreenView = new MainScreenView(this); //, currentProject);
mainScreenView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN){
if(motionEvent.getY() < 0.3f * mainScreenView.getHeight()) {
if(toolbar.getVisibility() == View.GONE)
toolbar.setVisibility(View.VISIBLE);
else
toolbar.setVisibility(View.GONE);
return true;
}
}
return false;
}
});
mainScreenContainer.addView(mainScreenView, 0);
}
@ -94,18 +110,40 @@ public class MainActivity extends AppCompatActivity
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_camera) {
// Handle the camera action
} else if (id == R.id.nav_gallery) {
} else if (id == R.id.nav_slideshow) {
} else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
if (id == R.id.nav_new) {
OnFileNew();
} else if (id == R.id.nav_open) {
OnFileOpen();
} else if (id == R.id.nav_save) {
OnFileSave();
} else if (id == R.id.nav_save_as) {
OnFileSaveAs();
} else if (id == R.id.nav_close) {
OnFileClose();
} else if (id == R.id.nav_load_object) {
OnObjectLoad();
} else if (id == R.id.nav_save_object) {
OnObjectSave();
} else if (id == R.id.nav_copy_screen) {
OnViewCopy();
} else if (id == R.id.nav_copy_stack) {
OnStackCopy();
} else if (id == R.id.nav_paste_stack) {
OnStackPaste();
} else if (id == R.id.nav_reset_calculator) {
OnViewReset();
} else if (id == R.id.nav_backup_save) {
OnBackupSave();
} else if (id == R.id.nav_backup_restore) {
OnBackupRestore();
} else if (id == R.id.nav_backup_delete) {
OnBackupDelete();
} else if (id == R.id.nav_change_kml_script) {
OnViewScript();
} else if (id == R.id.nav_help) {
OnTopics();
} else if (id == R.id.nav_about) {
OnAbout();
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
@ -113,6 +151,59 @@ public class MainActivity extends AppCompatActivity
return true;
}
private void OnFileNew() {
}
private void OnFileOpen() {
}
private void OnFileSave() {
}
private void OnFileSaveAs() {
}
private void OnFileClose() {
}
private void OnObjectLoad() {
}
private void OnObjectSave() {
}
private void OnViewCopy() {
}
private void OnStackCopy() {
}
private void OnStackPaste() {
}
private void OnViewReset() {
}
private void OnBackupSave() {
}
private void OnBackupRestore() {
}
private void OnBackupDelete() {
}
private void OnViewScript() {
}
private void OnTopics() {
}
private void OnAbout() {
}
@Override
protected void onDestroy() {

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>

View file

@ -1,9 +1,14 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--<gradient-->
<!--android:angle="135"-->
<!--android:centerColor="#009688"-->
<!--android:endColor="#00695C"-->
<!--android:startColor="#4DB6AC"-->
<!--android:type="linear" />-->
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:endColor="#32312B"
android:startColor="#444341"
android:type="linear" />
</shape>

View file

@ -5,34 +5,85 @@
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_camera"
android:id="@+id/nav_new"
android:icon="@drawable/ic_menu_camera"
android:title="Import" />
android:title="@string/nav_new" />
<item
android:id="@+id/nav_gallery"
android:id="@+id/nav_open"
android:icon="@drawable/ic_menu_gallery"
android:title="Gallery" />
android:title="@string/nav_open" />
<item
android:id="@+id/nav_slideshow"
android:id="@+id/nav_save"
android:icon="@drawable/ic_menu_slideshow"
android:title="Slideshow" />
android:title="@string/nav_save" />
<item
android:id="@+id/nav_manage"
android:id="@+id/nav_save_as"
android:icon="@drawable/ic_menu_manage"
android:title="Tools" />
android:title="@string/nav_save_as" />
<item
android:id="@+id/nav_close"
android:icon="@drawable/ic_menu_manage"
android:title="@string/nav_close" />
</group>
<item android:title="Communicate">
<item android:title="Edit">
<menu>
<item
android:id="@+id/nav_share"
android:id="@+id/nav_load_object"
android:icon="@drawable/ic_menu_share"
android:title="Share" />
android:title="Load Object..." />
<item
android:id="@+id/nav_send"
android:icon="@drawable/ic_menu_send"
android:title="Send" />
android:id="@+id/nav_save_object"
android:icon="@drawable/ic_menu_share"
android:title="Save Object..." />
<item
android:id="@+id/nav_copy_screen"
android:icon="@drawable/ic_menu_share"
android:title="Copy Screen" />
<item
android:id="@+id/nav_copy_stack"
android:icon="@drawable/ic_menu_share"
android:title="Copy Stack" />
<item
android:id="@+id/nav_paste_stack"
android:icon="@drawable/ic_menu_share"
android:title="Paste Stack" />
<item
android:id="@+id/nav_reset_calculator"
android:icon="@drawable/ic_menu_share"
android:title="Reset Calculator" />
<item
android:id="@+id/nav_backup_save"
android:icon="@drawable/ic_menu_share"
android:title="Save Backup" />
<item
android:id="@+id/nav_backup_restore"
android:icon="@drawable/ic_menu_share"
android:title="Restore Backup" />
<item
android:id="@+id/nav_backup_delete"
android:icon="@drawable/ic_menu_share"
android:title="Delete Backup" />
</menu>
</item>
<item android:title="View">
<menu>
<item
android:id="@+id/nav_change_kml_script"
android:icon="@drawable/ic_menu_share"
android:title="Change KML Script..." />
</menu>
</item>
<item android:title="Help">
<menu>
<item
android:id="@+id/nav_help"
android:icon="@drawable/ic_menu_share"
android:title="Help" />
<item
android:id="@+id/nav_about"
android:icon="@drawable/ic_menu_share"
android:title="About Emu48..." />
</menu>
</item>
</menu>

View file

@ -4,7 +4,8 @@
tools:context="com.regis.cosnier.emu48.MainActivity">
<item
android:id="@+id/action_settings"
android:icon="@drawable/ic_settings_white_24dp"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
app:showAsAction="never|ifRoom" />
</menu>

View file

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<!--<color name="colorPrimary">#008577</color>-->
<!--<color name="colorPrimaryDark">#00574B</color>-->
<!--<color name="colorAccent">#D81B60</color>-->
<color name="colorPrimary">#444341</color>
<color name="colorPrimaryDark">#32312B</color>
<color name="colorAccent">#8DB4D3</color>
</resources>

View file

@ -7,4 +7,9 @@
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<string name="title_activity_settings">Settings</string>
<string name="nav_new">New...</string>
<string name="nav_open">Open...</string>
<string name="nav_save">Save</string>
<string name="nav_save_as">SaveAs...</string>
<string name="nav_close">Close</string>
</resources>

View file

@ -2,6 +2,90 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:asp="http://schemas.android.com/apk/res-auto">
<!--
IDD_SET_GENERAL DIALOG DISCARDABLE 0, 0, 251, 134
STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION
CAPTION "General"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Authentic Calculator Speed",IDC_REALSPEED,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,17,133,10
CONTROL "Enable Virtual LCD Delay",IDC_GRAYSCALE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,28,133,10
CONTROL "Always On Top",IDC_ALWAYSONTOP,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,14,40,133,10
CONTROL "Activation Follows Mouse",IDC_ACTFOLLOWSMOUSE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,52,133,10
CONTROL "Single Instance",IDC_SINGLEINSTANCE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,64,133,10
CONTROL "Automatically Save Files",IDC_AUTOSAVE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,76,133,10
CONTROL "Automatically Save Files On Exit",IDC_AUTOSAVEONEXIT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,88,133,10
CONTROL "Show Load Object Warning",IDC_OBJECTLOADWARNING,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,100,133,10
CONTROL "Always Show KML Compilation Result",IDC_ALWAYSDISPLOG,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,112,133,10
GROUPBOX "General",IDC_STATIC,7,7,148,120
CONTROL "Show Title",IDC_SHOWTITLE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,168,17,69,10
CONTROL "Show Menu",IDC_SHOWMENU,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,168,28,69,10
GROUPBOX "Style",IDC_STATIC,161,7,83,70
CONTROL "HP Mnemonics",IDC_DISASM_HP,"Button",BS_AUTORADIOBUTTON |
WS_GROUP | WS_TABSTOP,168,94,69,11
CONTROL "Class Mnemonics",IDC_DISASM_CLASS,"Button",
BS_AUTORADIOBUTTON,168,108,69,11
GROUPBOX "Disassembler",IDC_STATIC,161,80,83,47
END
IDD_SET_MEMORY DIALOG DISCARDABLE 0, 0, 251, 134
STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION
CAPTION "Memory"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Port 1 is Plugged",IDC_PORT1EN,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,14,20,67,10
CONTROL "Port 1 is Writeable",IDC_PORT1WR,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,124,20,69,10
CONTROL "Port 2 is Shared",IDC_PORT2ISSHARED,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,14,32,65,10
CONTROL "Port 2 is Writeable",IDC_PORT2WR,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,124,32,69,10
LTEXT "Port 2 File :",IDC_STATIC,14,47,37,8
EDITTEXT IDC_PORT2,52,45,175,12,ES_AUTOHSCROLL
PUSHBUTTON "...",IDC_PORT2LOAD,227,45,10,12
GROUPBOX "Memory Cards",IDC_STATIC,7,7,237,58
END
IDD_SET_PERIPHERAL DIALOG DISCARDABLE 0, 0, 251, 134
STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION
CAPTION "Peripheral"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Volume",IDC_STATIC,14,21,24,8
CONTROL "Slider1",IDC_SOUND_SLIDER,"msctls_trackbar32",
TBS_AUTOTICKS | WS_TABSTOP,44,16,193,18
LTEXT "Device",IDC_STATIC,13,42,24,8
COMBOBOX IDC_SOUND_DEVICE,44,40,193,87,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
GROUPBOX "Sound",IDC_STATIC,7,7,237,54
LTEXT "IP Address:",IDC_STATIC,14,81,37,8
LTEXT "Port:",IDC_STATIC,119,81,16,8
EDITTEXT IDC_IR_ADDR,14,91,101,12,ES_AUTOHSCROLL
EDITTEXT IDC_IR_PORT,119,91,28,12,ES_NUMBER
GROUPBOX "Infrared Printer",IDC_STATIC,7,64,147,50
LTEXT "Wire:",IDC_STATIC,168,79,17,8
COMBOBOX IDC_WIRE,189,77,48,42,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
LTEXT "IR:",IDC_STATIC,168,95,9,8
COMBOBOX IDC_IR,189,93,48,43,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
GROUPBOX "Serial Ports",IDC_STATIC,161,64,83,50
END
-->
<!--<ListPreference-->
<!--android:key="settings_input"-->
<!--android:defaultValue="0"-->