Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.gma.extension">
|
||||
|
||||
<application>
|
||||
<!--Remove it when you finished to implement your extension implementation-->
|
||||
<activity
|
||||
android:name="com.gma.extension.activities.TestExtensionActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:theme="@style/ExtensionTheme"/>
|
||||
|
||||
<!--Add android components here-->
|
||||
</application>
|
||||
</manifest>
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* FOURJS_START_COPYRIGHT(P,2013)
|
||||
* Property of Four Js*
|
||||
* (c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* * Trademark of Four Js Development Tools Europe Ltd
|
||||
* in the United States and elsewhere
|
||||
* FOURJS_END_COPYRIGHT
|
||||
*/
|
||||
package com.gma.extension.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.fourjs.gma.extension.v1.ApplicationState;
|
||||
import com.fourjs.gma.extension.v1.IClientHandler;
|
||||
import com.fourjs.gma.extension.v1.IFunctionCall;
|
||||
import com.fourjs.gma.extension.v1.IFunctionCallController;
|
||||
import com.fourjs.gma.extension.v1.OnApplicationStateChangedListener;
|
||||
import com.gma.extension.R;
|
||||
import com.gma.extension.core.MyCustomFunctionCall;
|
||||
|
||||
public class TestExtensionActivity extends Activity implements IFunctionCallController
|
||||
{
|
||||
private OnApplicationStateChangedListener mOnApplicationStateChangedListener;
|
||||
private IClientHandler mClientHandler = new IClientHandler() {
|
||||
@Override
|
||||
public void postDialogAction(String action) {
|
||||
log("Execute action '" + action + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDialogActionPending(String action) {
|
||||
log("Check if action '" + action + "' is pending");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancelDialogAction(String action) {
|
||||
log("Cancel action '" + action + "'");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnApplicationStateChangedListener(OnApplicationStateChangedListener onApplicationStateChanged) {
|
||||
mOnApplicationStateChangedListener = onApplicationStateChanged;
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.test_activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.test, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int i = item.getItemId();
|
||||
if (i == R.id.run_function_call) {
|
||||
// Instantiate here your custom function call
|
||||
// implementing IFunctionCall interface
|
||||
|
||||
IFunctionCall call = new MyCustomFunctionCall();
|
||||
call.setFunctionCallController(this);
|
||||
call.invoke(new Object[] { "Hello World!" });
|
||||
|
||||
return true;
|
||||
} else if (i == R.id.run_activity) {
|
||||
// Create here the intent to start your custom activity
|
||||
|
||||
/*
|
||||
Intent intent = new Intent(this, MyCustomActivity.class);
|
||||
startActivity(intent);
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log message
|
||||
* @param msg String
|
||||
*/
|
||||
public void log(String msg) {
|
||||
TextView tv = (TextView) findViewById(R.id.test_activity_text_view);
|
||||
tv.setText(tv.getText() + "\n" + msg);
|
||||
}
|
||||
|
||||
// IFunctionCallController implementation for test
|
||||
|
||||
private IFunctionCall mPendingCall = null;
|
||||
|
||||
@Override
|
||||
public void returnValues(IFunctionCall functionCall, Object ... objects) {
|
||||
String msg = "";
|
||||
for (Object o : objects) {
|
||||
if (!msg.isEmpty()) {
|
||||
msg += ", ";
|
||||
}
|
||||
|
||||
msg += o.toString();
|
||||
}
|
||||
|
||||
log(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void raiseError(IFunctionCall functionCall, String s) {
|
||||
log(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(IFunctionCall functionCall, Intent intent) {
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void startActivityForResult(IFunctionCall functionCall, Intent intent) {
|
||||
startActivityForResult(functionCall, intent, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(IFunctionCall functionCall, Intent intent, int requestCode) {
|
||||
mPendingCall = functionCall;
|
||||
startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Activity getCurrentActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClientHandler getClientHandler() {
|
||||
return mClientHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (mPendingCall != null) {
|
||||
mPendingCall.onActivityResult(resultCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
log("onResume");
|
||||
|
||||
if (mOnApplicationStateChangedListener != null) {
|
||||
mOnApplicationStateChangedListener.stateChanged(ApplicationState.RESUME);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
log("onStop");
|
||||
|
||||
if (mOnApplicationStateChangedListener != null) {
|
||||
mOnApplicationStateChangedListener.stateChanged(ApplicationState.STOP);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
log("onPause");
|
||||
|
||||
if (mOnApplicationStateChangedListener != null) {
|
||||
mOnApplicationStateChangedListener.stateChanged(ApplicationState.PAUSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* FOURJS_START_COPYRIGHT(P,2013)
|
||||
* Property of Four Js*
|
||||
* (c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* * Trademark of Four Js Development Tools Europe Ltd
|
||||
* in the United States and elsewhere
|
||||
* FOURJS_END_COPYRIGHT
|
||||
*/
|
||||
|
||||
package com.gma.extension.core;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.fourjs.gma.extension.v1.IFunctionCall;
|
||||
import com.fourjs.gma.extension.v1.IFunctionCallController;
|
||||
|
||||
public class MyCustomFunctionCall implements IFunctionCall
|
||||
{
|
||||
private IFunctionCallController mFunctionCallController;
|
||||
|
||||
@Override
|
||||
public void setFunctionCallController(IFunctionCallController iFunctionCallController) {
|
||||
mFunctionCallController = iFunctionCallController;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(Object[] objects) throws IllegalArgumentException {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mFunctionCallController.getCurrentActivity());
|
||||
builder.setTitle(getClass().getSimpleName());
|
||||
builder.setMessage(String.valueOf(objects[0]));
|
||||
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestoreInstanceState(Bundle bundle) {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, Intent intent) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:context=".activities.TestExtensionActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/test_activity_text_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activities.TestExtensionActivity" >
|
||||
|
||||
<item android:id="@+id/run_function_call"
|
||||
android:title="@string/run_function_call"
|
||||
android:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/run_activity"
|
||||
android:title="@string/run_activity"
|
||||
android:showAsAction="never" />
|
||||
</menu>
|
||||
@@ -0,0 +1,14 @@
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<resources>
|
||||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
|
||||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<string name="app_name">GMA Extension Project</string>
|
||||
<string name="run_function_call">Run Front-call</string>
|
||||
<string name="run_activity">Run Activity</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
FOURJS_START_COPYRIGHT(P,2013)
|
||||
Property of Four Js*
|
||||
(c) Copyright Four Js 2013, 2021. All Rights Reserved.
|
||||
* Trademark of Four Js Development Tools Europe Ltd
|
||||
in the United States and elsewhere
|
||||
FOURJS_END_COPYRIGHT
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="ExtensionTheme" parent="android:Theme.Holo.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user