日常备份,接入广点通开屏、Banner
数据改成掉落日志和战斗日志(战斗日志咕了)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.yutou.jianrmg_v2.plugs.test.app1;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.yutou.jianrmg_v2.plugs.test.app1.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package Interfaces;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
|
||||
/**
|
||||
* Created by 58381 on 2018/2/27.
|
||||
*/
|
||||
|
||||
public interface BaseActivityInterface {
|
||||
void onCreate(Bundle savedInstanceState, LinearLayout layout, Context context, Intent intent);
|
||||
void onRestart();
|
||||
void onResume();
|
||||
void onPause();
|
||||
void onDestroy();
|
||||
void getIntent(Intent intent);
|
||||
boolean onKeyDown(int keyCode, KeyEvent event);
|
||||
boolean onKeyUp(int keyCode, KeyEvent event);
|
||||
boolean onTouchEvent(MotionEvent event);
|
||||
Data getData();
|
||||
class Data{
|
||||
private String type;
|
||||
private String url;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.yutou.jianrmg_v2.plugins;
|
||||
|
||||
public class Data {
|
||||
public static String name="test";
|
||||
public static String title="测试插件";
|
||||
public static String appId="abcdefg";
|
||||
public static String url="#";
|
||||
public static String image="#";
|
||||
public static String mainFunction="com.yutou.jianrmg_v2.plugs.test.app1.MainActivity#localActivity";
|
||||
public static Integer permission=0;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.yutou.jianrmg_v2.plugs.test.app1;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.kaopiz.kprogresshud.KProgressHUD;
|
||||
|
||||
import Interfaces.BaseActivityInterface;
|
||||
|
||||
public class MainActivity implements BaseActivityInterface {
|
||||
public MainActivity() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState, LinearLayout layout, Context context, Intent intent) {
|
||||
Toast.makeText(context,"已装载插件",Toast.LENGTH_LONG).show();
|
||||
TextView textView=new TextView(context);
|
||||
textView.setText("测试");
|
||||
layout.addView(textView);
|
||||
final KProgressHUD hud=showLoading(context,null,null);
|
||||
hud.show();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
hud.dismiss();
|
||||
}
|
||||
},3000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIntent(Intent intent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Data getData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static KProgressHUD showLoading(Context context, String title, String text) {
|
||||
if (text == null) {
|
||||
text = "载入中";
|
||||
}
|
||||
if (title == null) {
|
||||
title = "请稍后";
|
||||
}
|
||||
KProgressHUD hud = KProgressHUD.create(context)
|
||||
.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
|
||||
.setLabel(title)
|
||||
.setDetailsLabel(text)
|
||||
.setCancellable(false)
|
||||
.setAnimationSpeed(2)
|
||||
.setDimAmount(0.5f);
|
||||
return hud;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.yutou.jianrmg_v2.plugs.test.app1;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
public interface SDKActivity {
|
||||
void onCreate(Activity activity, Bundle savedInstanceState);
|
||||
void onResume();
|
||||
void onPause();
|
||||
void onRestart();
|
||||
void finish();
|
||||
void onStop();
|
||||
Activity getActivity();
|
||||
View createView(Activity sdkActivity);
|
||||
}
|
||||
3
mylibrary/src/main/res/values/strings.xml
Normal file
3
mylibrary/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">My Library</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yutou.jianrmg_v2.plugs.test.app1;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user