···
package com.uniplugn.uniplugin_tisp;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.facebook.common.activitylistener.ActivityListener;
import com.taobao.weex.dom.binding.JSONUtils;
import java.lang.reflect.Method;
import io.dcloud.feature.uniapp.annotation.UniJSMethod;
import io.dcloud.feature.uniapp.bridge.UniJSCallback;
import io.dcloud.feature.uniapp.common.UniModule;
public class PluginModule extends UniModule{
/**
- 测试使用
- @param a
- @param b
-
@param callback
*/
@UniJSMethod(uiThread = false)
public void add(int a, int b, UniJSCallback callback){
callback.invoke(a + b);
}/**
- 应用程序初始化
- 1、隐藏底部导航栏
- 2、禁止状态栏下拉
*/
@UniJSMethod(uiThread = false)
public void appInit(UniJSCallback callback){
try {
Activity activity = (Activity )mWXSDKInstance.getContext();
Intent intent = new Intent();
String HIDE_BAR = "android.intent.action.HIDE_BAR";
intent.setAction(HIDE_BAR);
activity.sendBroadcast(intent);
callback.invoke("第二步OK");
}catch (Exception e){
callback.invoke(e);
e.printStackTrace();
}
}
}
···