diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..1f5251d
Binary files /dev/null and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..30aa626
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..e28dbd3
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..99202cc
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..766765a
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AppHome/.gitignore b/AppHome/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/AppHome/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/AppHome/build.gradle b/AppHome/build.gradle
new file mode 100644
index 0000000..c11b3dd
--- /dev/null
+++ b/AppHome/build.gradle
@@ -0,0 +1,46 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 26
+
+
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+ //图片流缓存
+ implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
+ //轮播图
+ implementation 'com.bigkoo:convenientbanner:2.0.5'
+ //FastJson
+ implementation 'com.alibaba:fastjson:1.2.41'
+ //载入界面
+ implementation 'com.kaopiz:kprogresshud:1.1.0'
+
+ compile project(path: ':BaseModel')
+ compile project(path: ':ResModl')
+ compile project(path: ':RefreshRecyclerView')
+}
diff --git a/AppHome/proguard-rules.pro b/AppHome/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/AppHome/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/AppHome/src/main/AndroidManifest.xml b/AppHome/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..278ada6
--- /dev/null
+++ b/AppHome/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
diff --git a/AppHome/src/main/java/Interfaces/BaseActivityInterface.java b/AppHome/src/main/java/Interfaces/BaseActivityInterface.java
new file mode 100644
index 0000000..bbfc063
--- /dev/null
+++ b/AppHome/src/main/java/Interfaces/BaseActivityInterface.java
@@ -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;
+
+ }
+}
diff --git a/AppHome/src/main/java/Interfaces/BaseFragmeneInerface.java b/AppHome/src/main/java/Interfaces/BaseFragmeneInerface.java
new file mode 100644
index 0000000..65e2eee
--- /dev/null
+++ b/AppHome/src/main/java/Interfaces/BaseFragmeneInerface.java
@@ -0,0 +1,15 @@
+package Interfaces;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public interface BaseFragmeneInerface {
+ void init(Context context);
+ View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);
+ void setIntent();
+
+}
diff --git a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Adapters/HomeRecyclerAdapter.java b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Adapters/HomeRecyclerAdapter.java
new file mode 100644
index 0000000..b643aab
--- /dev/null
+++ b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Adapters/HomeRecyclerAdapter.java
@@ -0,0 +1,85 @@
+package com.yutou.jianrmg_v2.apphome.Adapters;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+
+import com.alibaba.fastjson.JSON;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.apphome.Datas.MAppHome;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.views.WebActivity;
+
+import cn.lemon.view.adapter.BaseViewHolder;
+import cn.lemon.view.adapter.RecyclerAdapter;
+
+;import static android.view.Gravity.BOTTOM;
+import static android.view.Gravity.CENTER;
+
+/**
+ * Created by 58381 on 2018/1/23.
+ */
+
+public class HomeRecyclerAdapter extends RecyclerAdapter {
+ private ImageLoader imageLoader;
+ private Activity activity;
+
+ public HomeRecyclerAdapter(Context context) {
+ super(context);
+ this.activity= (Activity) context;
+ imageLoader = Utils.initImageLoader(context);
+ }
+
+ @Override
+ public BaseViewHolder onCreateBaseViewHolder(ViewGroup parent, int viewType) {
+ return new CardRecordHolder(parent, R.layout.item_home);
+ }
+
+ private class CardRecordHolder extends BaseViewHolder {
+ private ImageView icon;
+ private TextView name;
+
+
+ public CardRecordHolder(ViewGroup parent, int layoutId) {
+ super(parent, layoutId);
+ icon = findViewById(R.id.image);
+ name = findViewById(R.id.title);
+
+
+ }
+
+ @Override
+ public void setData(MAppHome data) {
+ super.setData(data);
+ Log.i("首页收据", JSON.toJSONString(data));
+ if (data.getIcon() != null && "null".equals(data.getIcon()))
+ imageLoader.displayImage(data.getIcon(), icon);
+ name.setText(data.getName() + "");
+ }
+
+ @Override
+ public void onItemViewClick(MAppHome data) {
+ super.onItemViewClick(data);
+ if (data.getUrl() != null && data.getUrl().contains("webhttp")) {
+ Intent intent = new Intent(getContext(), WebActivity.class);
+ // intent.setAction(Intent.ACTION_VIEW);
+ // intent.setData(Uri.parse(data.getUrl()));
+ intent.putExtra("url", data.getUrl().replace("webhttp", "http"));
+ getContext().startActivity(intent);
+ }
+ }
+ }
+}
diff --git a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Datas/MAppHome.java b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Datas/MAppHome.java
new file mode 100644
index 0000000..089ed22
--- /dev/null
+++ b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Datas/MAppHome.java
@@ -0,0 +1,120 @@
+package com.yutou.jianrmg_v2.apphome.Datas;
+
+public class MAppHome {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.id
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.name
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private String name;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.icon
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private String icon;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.url
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private String url;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.isshow
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private Integer isshow;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.id
+ * @return the value of m_app_home.id
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.id
+ * @param id the value for m_app_home.id
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.name
+ * @return the value of m_app_home.name
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.name
+ * @param name the value for m_app_home.name
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.icon
+ * @return the value of m_app_home.icon
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public String getIcon() {
+ return icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.icon
+ * @param icon the value for m_app_home.icon
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.url
+ * @return the value of m_app_home.url
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.url
+ * @param url the value for m_app_home.url
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.isshow
+ * @return the value of m_app_home.isshow
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public Integer getIsshow() {
+ return isshow;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.isshow
+ * @param isshow the value for m_app_home.isshow
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setIsshow(Integer isshow) {
+ this.isshow = isshow;
+ }
+}
\ No newline at end of file
diff --git a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/MainFragmene.java b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/MainFragmene.java
new file mode 100644
index 0000000..33dd04f
--- /dev/null
+++ b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/MainFragmene.java
@@ -0,0 +1,249 @@
+package com.yutou.jianrmg_v2.apphome;
+
+import android.app.Activity;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.annotation.Nullable;
+import android.support.v4.app.NotificationCompat;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutCompat;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RemoteViews;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSON;
+import com.bigkoo.convenientbanner.ConvenientBanner;
+import com.bigkoo.convenientbanner.holder.CBViewHolderCreator;
+import com.bigkoo.convenientbanner.holder.Holder;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.apphome.Adapters.HomeRecyclerAdapter;
+import com.yutou.jianrmg_v2.apphome.Datas.MAppHome;
+import com.yutou.jianrmg_v2.basemodel.Data.MBanner;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpApi;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.basemodel.views.WebActivity;
+import com.yutou.jianrmg_v2.basemodel.R;
+
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import Interfaces.BaseFragmeneInerface;
+import cn.lemon.view.RefreshRecyclerView;
+import cn.lemon.view.adapter.Action;
+
+public class MainFragmene implements BaseFragmeneInerface {
+ private ConvenientBanner banner;
+ private RefreshRecyclerView recyclerView;
+ private HomeRecyclerAdapter adapter;
+ private View view;
+ private List datas;
+ private int min=0, max=10;
+ private boolean isInit=true;
+ private Handler handler;
+ private ImageLoader imageLoader;
+ private Context context;
+ @Override
+ public void init(Context context) {
+ this.context=context;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ if(view!=null)
+ return view;
+ view=new RefreshRecyclerView(context);
+ imageLoader= Utils.initImageLoader(context);
+ handler=new Handler();
+ initBanner();
+ init(-1);
+ //Toast.makeText(context,"这是插件",Toast.LENGTH_LONG).show();
+ TextView textView=new TextView(context);
+ textView.setText("插件");
+
+
+ return view;
+ }
+
+ @Override
+ public void setIntent() {
+
+ }
+ public void init(int index) {
+ initView(view);
+ }
+ private void initBanner(){
+ HttpUtils.get(HttpApi.HOME_URL + HttpApi.BANNER, new HttpInterface() {
+ @Override
+ public void httpError(Exception e) {
+ e.printStackTrace();
+ }
+
+ @Override
+ public void httpGetData(String string, int code) {
+ final List array;
+ try {
+ Log.i("banner",string);
+ JSONObject json=new JSONObject(string);
+
+ if(json.getInt("code")==100){
+ array= JSON.parseArray(json.getString("data"),MBanner.class);
+ }else{
+ array=new ArrayList<>();
+ }
+ Log.i(""+(handler==null));
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ setBanner(array);
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+ private void setBanner( List list){
+ banner.setCanLoop(true);
+ banner.startTurning(2000);
+ banner.setPages(new CBViewHolderCreator(){
+
+ @Override
+ public Object createHolder() {
+ return new Banner();
+ }
+ },list).setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.ALIGN_PARENT_RIGHT);
+ }
+ private void initView(View view){
+ Log.i("初始化主页");
+ banner=new ConvenientBanner(context);
+ ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,400);
+ banner.setLayoutParams(params);
+ recyclerView= (RefreshRecyclerView) view;
+ recyclerView.setSwipeRefreshColors(0xFF437845,0xFFE44F98,0xFF2FAC21);
+ recyclerView.setLayoutManager(new GridLayoutManager(context,3));
+ adapter=new com.yutou.jianrmg_v2.apphome.Adapters.HomeRecyclerAdapter(context);
+ adapter.setHeader(banner);
+ TextView endText=new TextView(context);
+ endText.setLayoutParams(new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Utils.getPixelsFromDp(((Activity) context),48)));
+ endText.setTextSize(16);
+ endText.setGravity(Gravity.CENTER);
+ endText.setText(" --已经没有了--");
+ adapter.setFooter(endText);
+ recyclerView.setAdapter(adapter);
+ recyclerView.setRefreshAction(new Action() {
+ @Override
+ public void onAction() {
+ min=0;
+ max=10;
+ isInit=true;
+ initData();
+ }
+ });
+ recyclerView.setLoadMoreAction(new Action() {
+ @Override
+ public void onAction() {
+ if(isInit){
+ recyclerView.showNoMore();
+ }else {
+ min = max;
+ max += 10;
+ initData();
+ }
+ }
+ });
+ recyclerView.showSwipeRefresh();
+ initData();
+ }
+ private void initData(){
+ try {
+ datas=new ArrayList<>();
+ Log.i("载入数据");
+ JSONObject json=new JSONObject();
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.MG_HOME_LIST, json, new HttpInterface() {
+ @Override
+ public void httpError(Exception e) {
+
+ }
+
+ @Override
+ public void httpGetData(String string, int code) {
+ Log.i(HttpApi.MG_HOME_LIST,string);
+ try{
+ JSONObject json=new JSONObject(string);
+ if(json.getInt("code")==100){
+ datas= JSON.parseArray(json.getString("data"), MAppHome.class);
+ }
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ setData();
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+
+ }
+ private void setData(){
+ if(datas.size()>0){
+ adapter.clear();
+ adapter.addAll(datas);
+ recyclerView.dismissSwipeRefresh();
+ recyclerView.getRecyclerView().scrollToPosition(0);
+ }else{
+ adapter.addAll(datas);
+ }
+ }
+ private class Banner implements Holder {
+ private ImageView imageView;
+ @Override
+ public View createView(Context context) {
+ imageView = new ImageView(context);
+ imageView.setScaleType(ImageView.ScaleType.FIT_XY);
+ return imageView;
+ }
+
+ @Override
+ public void UpdateUI(final Context context, int position, final MBanner data) {
+ imageLoader.displayImage(data.getUrl(),imageView);
+ imageView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(data.getClick()!=null&&data.getClick().contains("webhttp")){
+ Intent intent=new Intent(context, WebActivity.class);
+ intent.putExtra("url",data.getClick().replace("webhttp","http"));
+ context.startActivity(intent);
+ }else {
+ Intent intent = new Intent();
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setData(Uri.parse(data.getClick()));
+ MainFragmene.this.context.startActivity(intent);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/AppHome/src/main/res/values/strings.xml b/AppHome/src/main/res/values/strings.xml
new file mode 100644
index 0000000..bf86693
--- /dev/null
+++ b/AppHome/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ AppHome
+
diff --git a/BaseModel/.gitignore b/BaseModel/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/BaseModel/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/BaseModel/build.gradle b/BaseModel/build.gradle
new file mode 100644
index 0000000..5364eee
--- /dev/null
+++ b/BaseModel/build.gradle
@@ -0,0 +1,70 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 26
+
+
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+ //okhttp
+ implementation 'com.squareup.okhttp3:okhttp:3.9.1'
+ //FastJson
+ implementation 'com.alibaba:fastjson:1.2.41'
+ //轮播图
+ implementation 'com.bigkoo:convenientbanner:2.0.5'
+ //图片流缓存
+ implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
+ //圆形图片
+ implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
+ //滑动Tabs
+ implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
+ implementation 'com.ogaclejapan.smarttablayout:utils-v13:1.6.1@aar'
+ //MD 对话框
+ implementation 'me.drakeet.materialdialog:library:1.3.1'
+ //载入界面
+ implementation 'com.kaopiz:kprogresshud:1.1.0'
+
+ //文件选择器
+ implementation 'com.leon:lfilepickerlibrary:1.4.0'
+ //富文本
+ implementation 'com.github.limedroid:XRichText:v1.0.0'
+ //底端对话框
+ implementation 'com.orhanobut:dialogplus:1.11@aar'
+ //二维码扫描
+ implementation 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.3'
+ //底端菜单
+ implementation 'me.majiajie:pager-bottom-tab-strip:2.2.5'
+ //刷新载入
+ implementation project(path: ':RefreshRecyclerView')
+ //图片形状
+ implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
+ //毛玻璃
+ implementation 'jp.wasabeef:glide-transformations:3.0.0'
+ // compile project(path: ':app')
+ compile project(path: ':ResModl')
+}
diff --git a/BaseModel/proguard-rules.pro b/BaseModel/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/BaseModel/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/BaseModel/src/main/AndroidManifest.xml b/BaseModel/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..3038acb
--- /dev/null
+++ b/BaseModel/src/main/AndroidManifest.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
diff --git a/BaseModel/src/main/java/Interfaces/BaseActivityInterface.java b/BaseModel/src/main/java/Interfaces/BaseActivityInterface.java
new file mode 100644
index 0000000..bbfc063
--- /dev/null
+++ b/BaseModel/src/main/java/Interfaces/BaseActivityInterface.java
@@ -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;
+
+ }
+}
diff --git a/BaseModel/src/main/java/Interfaces/BaseFragmeneInerface.java b/BaseModel/src/main/java/Interfaces/BaseFragmeneInerface.java
new file mode 100644
index 0000000..65e2eee
--- /dev/null
+++ b/BaseModel/src/main/java/Interfaces/BaseFragmeneInerface.java
@@ -0,0 +1,15 @@
+package Interfaces;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public interface BaseFragmeneInerface {
+ void init(Context context);
+ View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);
+ void setIntent();
+
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/MyItemGridViewAdapter.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/MyItemGridViewAdapter.java
new file mode 100644
index 0000000..e1d4571
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/MyItemGridViewAdapter.java
@@ -0,0 +1,90 @@
+package com.yutou.jianrmg_v2.basemodel.Adapters;
+
+import android.content.Context;
+import android.database.DataSetObserver;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.ListAdapter;
+import android.widget.TextView;
+
+import com.yutou.jianrmg_v2.basemodel.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+
+import java.util.List;
+
+
+public class MyItemGridViewAdapter extends BaseAdapter {
+ public static class ItemData{
+ private String title;
+ private int imageUrl=-1;
+
+ public ItemData(int imageUrl, String title) {
+ this.imageUrl = imageUrl;
+ this.title = title;
+ }
+
+ public int getImageUrl() {
+ return imageUrl;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+ }
+ private List list;
+ private Context context;
+
+ public MyItemGridViewAdapter(List list, Context context) {
+ this.list = list;
+ this.context = context;
+ Log.i("List Size",""+list.size());
+ }
+
+ @Override
+ public int getCount() {
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int i) {
+ return list.get(i);
+ }
+
+ @Override
+ public long getItemId(int i) {
+ return i;
+ }
+
+ @Override
+ public View getView(final int i, View view, ViewGroup viewGroup) {
+ Item item=null;
+ if(view==null){
+ item=new Item();
+ view= LayoutInflater.from(context).inflate(R.layout.item_my_gridview,null);
+ item.imageView=view.findViewById(R.id.image);
+ item.title=view.findViewById(R.id.title);
+ view.setTag(item);
+ }else{
+ item= (Item) view.getTag();
+ }
+ if(list.get(i).imageUrl!=-1){
+ item.imageView.setImageResource(list.get(i).getImageUrl());
+ }
+ item.title.setText(list.get(i).title);
+ view.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Log.i("点击"+list.get(i).getTitle());
+ }
+ });
+ return view;
+ }
+
+ private class Item{
+ private ImageView imageView;
+ private TextView title;
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/ViewPagerAdapter.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/ViewPagerAdapter.java
new file mode 100644
index 0000000..7554b59
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/ViewPagerAdapter.java
@@ -0,0 +1,31 @@
+package com.yutou.jianrmg_v2.basemodel.Adapters;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+
+
+import java.util.List;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class ViewPagerAdapter extends FragmentPagerAdapter {
+ private List mlist;
+
+ public ViewPagerAdapter(FragmentManager fm,List list) {
+ super(fm);
+ this.mlist = list;
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+ return mlist.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return mlist.size();
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Application.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Application.java
new file mode 100644
index 0000000..c38b746
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Application.java
@@ -0,0 +1,94 @@
+package com.yutou.jianrmg_v2.basemodel;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.User;
+import com.yutou.jianrmg_v2.basemodel.Tools.ActivitysManager;
+import com.yutou.jianrmg_v2.basemodel.Tools.ConfigUtils;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+
+import dalvik.system.DexClassLoader;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class Application extends android.app.Application {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ init();
+ // initPlugsin();
+ regActivity();
+ }
+ private void initPlugsin(){
+ Map plugsin=new HashMap<>();
+ File path=new File(Utils.getSDCardPath()+"/plugin/");
+ for (File file : path.listFiles()) {
+ if(file.getName().contains(".jar")){
+ DexClassLoader dexClassLoader=new DexClassLoader(file.getAbsolutePath(),"/data/data/"+getPackageName()+"/",null,getClassLoader());
+ plugsin.put(file.getName(),dexClassLoader);
+ }
+ }
+ AppData.plugsin=plugsin;
+ }
+ private void init(){
+ AppData.Token= (String) ConfigUtils.init().load("token");
+ AppData.user=new User();
+ try {
+ AppData.user.setId((Integer) ConfigUtils.init().load("uid"));
+ }catch (Exception e){
+ AppData.user.setId(-1);
+ }
+
+ }
+ private void regActivity(){
+ registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
+ @Override
+ public void onActivityCreated(Activity activity, Bundle bundle) {
+ Log.i("Appliction","创建:"+activity.getClass().getName());
+ ActivitysManager.addActivity(activity);
+ }
+
+ @Override
+ public void onActivityStarted(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivityResumed(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivityPaused(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivityStopped(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
+
+ }
+
+ @Override
+ public void onActivityDestroyed(Activity activity) {
+ Log.i("Appliction","销毁:"+activity.getClass().getName());
+ ActivitysManager.finishActivity(activity);
+ }
+ });
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/AppData.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/AppData.java
new file mode 100644
index 0000000..6b55c87
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/AppData.java
@@ -0,0 +1,21 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+import java.util.List;
+import java.util.Map;
+
+import dalvik.system.DexClassLoader;
+
+/**
+ * Created by 58381 on 2018/2/2.
+ */
+
+public class AppData {
+ public static List packnames;
+ public static Map plugsin;
+ public static SConfig appConfig;
+ public static User user;
+ public static UUserdata userdata;
+ public static String Token="";
+
+ public static boolean RxDeBug=true;
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppHome.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppHome.java
new file mode 100644
index 0000000..dd071b1
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppHome.java
@@ -0,0 +1,120 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class MAppHome {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.id
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.name
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private String name;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.icon
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private String icon;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.url
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private String url;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_home.isshow
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ private Integer isshow;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.id
+ * @return the value of m_app_home.id
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.id
+ * @param id the value for m_app_home.id
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.name
+ * @return the value of m_app_home.name
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.name
+ * @param name the value for m_app_home.name
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.icon
+ * @return the value of m_app_home.icon
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public String getIcon() {
+ return icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.icon
+ * @param icon the value for m_app_home.icon
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.url
+ * @return the value of m_app_home.url
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.url
+ * @param url the value for m_app_home.url
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_home.isshow
+ * @return the value of m_app_home.isshow
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public Integer getIsshow() {
+ return isshow;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_home.isshow
+ * @param isshow the value for m_app_home.isshow
+ * @mbg.generated Tue Jan 23 12:06:19 CST 2018
+ */
+ public void setIsshow(Integer isshow) {
+ this.isshow = isshow;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppMg.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppMg.java
new file mode 100644
index 0000000..805b2a4
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppMg.java
@@ -0,0 +1,213 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+
+public class MAppMg{
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.id
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.indexs
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private Integer indexs;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.name
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private String name;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.icon
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private String icon;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.mg_type
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private String mgType;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.isshow
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private Integer isshow;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.url
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private String url;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.version
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private Integer version;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_app_mg.main_function
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ private String mainFunction;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.id
+ * @return the value of m_app_mg.id
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.id
+ * @param id the value for m_app_mg.id
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.indexs
+ * @return the value of m_app_mg.indexs
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public Integer getIndexs() {
+ return indexs;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.indexs
+ * @param indexs the value for m_app_mg.indexs
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setIndexs(Integer indexs) {
+ this.indexs = indexs;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.name
+ * @return the value of m_app_mg.name
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.name
+ * @param name the value for m_app_mg.name
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.icon
+ * @return the value of m_app_mg.icon
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public String getIcon() {
+ return icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.icon
+ * @param icon the value for m_app_mg.icon
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.mg_type
+ * @return the value of m_app_mg.mg_type
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public String getMgType() {
+ return mgType;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.mg_type
+ * @param mgType the value for m_app_mg.mg_type
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setMgType(String mgType) {
+ this.mgType = mgType;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.isshow
+ * @return the value of m_app_mg.isshow
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public Integer getIsshow() {
+ return isshow;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.isshow
+ * @param isshow the value for m_app_mg.isshow
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setIsshow(Integer isshow) {
+ this.isshow = isshow;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.url
+ * @return the value of m_app_mg.url
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.url
+ * @param url the value for m_app_mg.url
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.version
+ * @return the value of m_app_mg.version
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public Integer getVersion() {
+ return version;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.version
+ * @param version the value for m_app_mg.version
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_app_mg.main_function
+ * @return the value of m_app_mg.main_function
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public String getMainFunction() {
+ return mainFunction;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_app_mg.main_function
+ * @param mainFunction the value for m_app_mg.main_function
+ * @mbg.generated Wed Feb 28 13:25:37 CST 2018
+ */
+ public void setMainFunction(String mainFunction) {
+ this.mainFunction = mainFunction;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MBanner.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MBanner.java
new file mode 100644
index 0000000..a1cf934
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MBanner.java
@@ -0,0 +1,97 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class MBanner {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_banner.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_banner.url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String url;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_banner.click
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String click;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_banner.isshow
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer isshow;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_banner.id
+ * @return the value of m_banner.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_banner.id
+ * @param id the value for m_banner.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_banner.url
+ * @return the value of m_banner.url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_banner.url
+ * @param url the value for m_banner.url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_banner.click
+ * @return the value of m_banner.click
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getClick() {
+ return click;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_banner.click
+ * @param click the value for m_banner.click
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setClick(String click) {
+ this.click = click;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_banner.isshow
+ * @return the value of m_banner.isshow
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getIsshow() {
+ return isshow;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_banner.isshow
+ * @param isshow the value for m_banner.isshow
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setIsshow(Integer isshow) {
+ this.isshow = isshow;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MGamePackname.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MGamePackname.java
new file mode 100644
index 0000000..7e24ee6
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MGamePackname.java
@@ -0,0 +1,97 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class MGamePackname {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_game_packname.id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_game_packname.packname
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String packname;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_game_packname.zhname
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String zhname;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column m_game_packname.isshow
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer isshow;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_game_packname.id
+ * @return the value of m_game_packname.id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_game_packname.id
+ * @param id the value for m_game_packname.id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_game_packname.packname
+ * @return the value of m_game_packname.packname
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getPackname() {
+ return packname;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_game_packname.packname
+ * @param packname the value for m_game_packname.packname
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setPackname(String packname) {
+ this.packname = packname;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_game_packname.zhname
+ * @return the value of m_game_packname.zhname
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getZhname() {
+ return zhname;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_game_packname.zhname
+ * @param zhname the value for m_game_packname.zhname
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setZhname(String zhname) {
+ this.zhname = zhname;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column m_game_packname.isshow
+ * @return the value of m_game_packname.isshow
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getIsshow() {
+ return isshow;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column m_game_packname.isshow
+ * @param isshow the value for m_game_packname.isshow
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setIsshow(Integer isshow) {
+ this.isshow = isshow;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/SConfig.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/SConfig.java
new file mode 100644
index 0000000..14da4d7
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/SConfig.java
@@ -0,0 +1,168 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class SConfig {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.apk_version
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String apkVersion;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.msg_version
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String msgVersion;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.apk_url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String apkUrl;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.msg_url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String msgUrl;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.message
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String message;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column s_config.downloadHome
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String downloadhome;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.id
+ * @return the value of s_config.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.id
+ * @param id the value for s_config.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.apk_version
+ * @return the value of s_config.apk_version
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getApkVersion() {
+ return apkVersion;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.apk_version
+ * @param apkVersion the value for s_config.apk_version
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setApkVersion(String apkVersion) {
+ this.apkVersion = apkVersion;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.msg_version
+ * @return the value of s_config.msg_version
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getMsgVersion() {
+ return msgVersion;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.msg_version
+ * @param msgVersion the value for s_config.msg_version
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setMsgVersion(String msgVersion) {
+ this.msgVersion = msgVersion;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.apk_url
+ * @return the value of s_config.apk_url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getApkUrl() {
+ return apkUrl;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.apk_url
+ * @param apkUrl the value for s_config.apk_url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setApkUrl(String apkUrl) {
+ this.apkUrl = apkUrl;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.msg_url
+ * @return the value of s_config.msg_url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getMsgUrl() {
+ return msgUrl;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.msg_url
+ * @param msgUrl the value for s_config.msg_url
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setMsgUrl(String msgUrl) {
+ this.msgUrl = msgUrl;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.message
+ * @return the value of s_config.message
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.message
+ * @param message the value for s_config.message
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column s_config.downloadHome
+ * @return the value of s_config.downloadHome
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getDownloadhome() {
+ if(downloadhome!=null)
+ return downloadhome;
+ return "";
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column s_config.downloadHome
+ * @param downloadhome the value for s_config.downloadHome
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setDownloadhome(String downloadhome) {
+ this.downloadhome = downloadhome;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TMod.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TMod.java
new file mode 100644
index 0000000..bb2f946
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TMod.java
@@ -0,0 +1,428 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class TMod {
+
+ @Override
+ public String toString() {
+ return "TMod [id=" + id + ", modname=" + modname + ", title=" + title + ", modtype=" + modtype + ", jianrtype="
+ + jianrtype + ", jianrId=" + jianrId + ", info=" + info + ", byid=" + byid + ", byuser=" + byuser
+ + ", overview=" + overview + ", image=" + image + ", icon=" + icon + ", createtime=" + createtime
+ + ", updatetime=" + updatetime + ", modversion=" + modversion + ", gameverid=" + gameverid + ", city="
+ + city + "]";
+ }
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.modName
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String modname;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.title
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String title;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.modType
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String modtype;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.jianrType
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String jianrtype;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.jianr_id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer jianrId;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.info
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String info;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.byId
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer byid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.byUser
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String byuser;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.overview
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String overview;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.image
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String image;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.icon
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private String icon;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.createTime
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Long createtime;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.updateTime
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Long updatetime;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.modVersion
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer modversion;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.gameVerId
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer gameverid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.city
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer city;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_mod.reMod
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ private Integer remod;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.id
+ * @return the value of t_mod.id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.id
+ * @param id the value for t_mod.id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.modName
+ * @return the value of t_mod.modName
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getModname() {
+ return modname;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.modName
+ * @param modname the value for t_mod.modName
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setModname(String modname) {
+ this.modname = modname;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.title
+ * @return the value of t_mod.title
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.title
+ * @param title the value for t_mod.title
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.modType
+ * @return the value of t_mod.modType
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getModtype() {
+ return modtype;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.modType
+ * @param modtype the value for t_mod.modType
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setModtype(String modtype) {
+ this.modtype = modtype;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.jianrType
+ * @return the value of t_mod.jianrType
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getJianrtype() {
+ return jianrtype;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.jianrType
+ * @param jianrtype the value for t_mod.jianrType
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setJianrtype(String jianrtype) {
+ this.jianrtype = jianrtype;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.jianr_id
+ * @return the value of t_mod.jianr_id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getJianrId() {
+ return jianrId;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.jianr_id
+ * @param jianrId the value for t_mod.jianr_id
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setJianrId(Integer jianrId) {
+ this.jianrId = jianrId;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.info
+ * @return the value of t_mod.info
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getInfo() {
+ return info;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.info
+ * @param info the value for t_mod.info
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setInfo(String info) {
+ this.info = info;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.byId
+ * @return the value of t_mod.byId
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getByid() {
+ return byid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.byId
+ * @param byid the value for t_mod.byId
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setByid(Integer byid) {
+ this.byid = byid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.byUser
+ * @return the value of t_mod.byUser
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getByuser() {
+ return byuser;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.byUser
+ * @param byuser the value for t_mod.byUser
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setByuser(String byuser) {
+ this.byuser = byuser;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.overview
+ * @return the value of t_mod.overview
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getOverview() {
+ return overview;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.overview
+ * @param overview the value for t_mod.overview
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setOverview(String overview) {
+ this.overview = overview;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.image
+ * @return the value of t_mod.image
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getImage() {
+ return image;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.image
+ * @param image the value for t_mod.image
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.icon
+ * @return the value of t_mod.icon
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public String getIcon() {
+ return icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.icon
+ * @param icon the value for t_mod.icon
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.createTime
+ * @return the value of t_mod.createTime
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Long getCreatetime() {
+ return createtime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.createTime
+ * @param createtime the value for t_mod.createTime
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setCreatetime(Long createtime) {
+ this.createtime = createtime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.updateTime
+ * @return the value of t_mod.updateTime
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Long getUpdatetime() {
+ return updatetime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.updateTime
+ * @param updatetime the value for t_mod.updateTime
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setUpdatetime(Long updatetime) {
+ this.updatetime = updatetime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.modVersion
+ * @return the value of t_mod.modVersion
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getModversion() {
+ return modversion;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.modVersion
+ * @param modversion the value for t_mod.modVersion
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setModversion(Integer modversion) {
+ this.modversion = modversion;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.gameVerId
+ * @return the value of t_mod.gameVerId
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getGameverid() {
+ return gameverid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.gameVerId
+ * @param gameverid the value for t_mod.gameVerId
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setGameverid(Integer gameverid) {
+ this.gameverid = gameverid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.city
+ * @return the value of t_mod.city
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getCity() {
+ return city;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.city
+ * @param city the value for t_mod.city
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setCity(Integer city) {
+ this.city = city;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_mod.reMod
+ * @return the value of t_mod.reMod
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public Integer getRemod() {
+ return remod;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_mod.reMod
+ * @param remod the value for t_mod.reMod
+ * @mbg.generated Tue Feb 06 15:48:54 CST 2018
+ */
+ public void setRemod(Integer remod) {
+ this.remod = remod;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModfile.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModfile.java
new file mode 100644
index 0000000..224a876
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModfile.java
@@ -0,0 +1,166 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class TModfile {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.id
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.mid
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private Integer mid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.fileName
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private String filename;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.serviceUrl
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private String serviceurl;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.installPathId
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private String installpathid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.createTime
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private Long createtime;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modfile.updateTime
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ private Long updatetime;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.id
+ * @return the value of t_modfile.id
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.id
+ * @param id the value for t_modfile.id
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.mid
+ * @return the value of t_modfile.mid
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public Integer getMid() {
+ return mid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.mid
+ * @param mid the value for t_modfile.mid
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setMid(Integer mid) {
+ this.mid = mid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.fileName
+ * @return the value of t_modfile.fileName
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public String getFilename() {
+ return filename;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.fileName
+ * @param filename the value for t_modfile.fileName
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setFilename(String filename) {
+ this.filename = filename;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.serviceUrl
+ * @return the value of t_modfile.serviceUrl
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public String getServiceurl() {
+ return AppData.appConfig.getDownloadhome()+serviceurl;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.serviceUrl
+ * @param serviceurl the value for t_modfile.serviceUrl
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setServiceurl(String serviceurl) {
+ this.serviceurl = serviceurl;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.installPathId
+ * @return the value of t_modfile.installPathId
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public String getInstallpathid() {
+ return installpathid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.installPathId
+ * @param installpathid the value for t_modfile.installPathId
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setInstallpathid(String installpathid) {
+ this.installpathid = installpathid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.createTime
+ * @return the value of t_modfile.createTime
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public Long getCreatetime() {
+ return createtime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.createTime
+ * @param createtime the value for t_modfile.createTime
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setCreatetime(Long createtime) {
+ this.createtime = createtime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modfile.updateTime
+ * @return the value of t_modfile.updateTime
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public Long getUpdatetime() {
+ return updatetime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modfile.updateTime
+ * @param updatetime the value for t_modfile.updateTime
+ * @mbg.generated Fri Feb 02 18:11:06 CST 2018
+ */
+ public void setUpdatetime(Long updatetime) {
+ this.updatetime = updatetime;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModtag.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModtag.java
new file mode 100644
index 0000000..68d7369
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModtag.java
@@ -0,0 +1,74 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class TModtag {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modtag.id
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modtag.mid
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ private Integer mid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column t_modtag.tag
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ private String tag;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modtag.id
+ * @return the value of t_modtag.id
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modtag.id
+ * @param id the value for t_modtag.id
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modtag.mid
+ * @return the value of t_modtag.mid
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ public Integer getMid() {
+ return mid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modtag.mid
+ * @param mid the value for t_modtag.mid
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ public void setMid(Integer mid) {
+ this.mid = mid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column t_modtag.tag
+ * @return the value of t_modtag.tag
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ public String getTag() {
+ return tag;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column t_modtag.tag
+ * @param tag the value for t_modtag.tag
+ * @mbg.generated Sat Jan 27 12:36:26 CST 2018
+ */
+ public void setTag(String tag) {
+ this.tag = tag;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUsercollection.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUsercollection.java
new file mode 100644
index 0000000..d1fb2ae
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUsercollection.java
@@ -0,0 +1,83 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class UUsercollection {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_usercollection.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_usercollection.uid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer uid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_usercollection.mid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer mid;
+ private Long createtime;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_usercollection.id
+ * @return the value of u_usercollection.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_usercollection.id
+ * @param id the value for u_usercollection.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_usercollection.uid
+ * @return the value of u_usercollection.uid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getUid() {
+ return uid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_usercollection.uid
+ * @param uid the value for u_usercollection.uid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setUid(Integer uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_usercollection.mid
+ * @return the value of u_usercollection.mid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getMid() {
+ return mid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_usercollection.mid
+ * @param mid the value for u_usercollection.mid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setMid(Integer mid) {
+ this.mid = mid;
+ }
+
+ public Long getCreatetime() {
+ return createtime;
+ }
+
+ public void setCreatetime(Long createtime) {
+ this.createtime = createtime;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUserdata.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUserdata.java
new file mode 100644
index 0000000..bf52046
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUserdata.java
@@ -0,0 +1,106 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class UUserdata {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_userdata.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_userdata.uid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer uid;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_userdata.email
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String email;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column u_userdata.createTime
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Long createtime;
+ private String image;
+
+ public String getImage() {
+ return image;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_userdata.id
+ * @return the value of u_userdata.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_userdata.id
+ * @param id the value for u_userdata.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_userdata.uid
+ * @return the value of u_userdata.uid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getUid() {
+ return uid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_userdata.uid
+ * @param uid the value for u_userdata.uid
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setUid(Integer uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_userdata.email
+ * @return the value of u_userdata.email
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_userdata.email
+ * @param email the value for u_userdata.email
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column u_userdata.createTime
+ * @return the value of u_userdata.createTime
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Long getCreatetime() {
+ return createtime;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column u_userdata.createTime
+ * @param createtime the value for u_userdata.createTime
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setCreatetime(Long createtime) {
+ this.createtime = createtime;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/User.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/User.java
new file mode 100644
index 0000000..a1ae934
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/User.java
@@ -0,0 +1,120 @@
+package com.yutou.jianrmg_v2.basemodel.Data;
+
+public class User {
+
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column user.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer id;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column user.name
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String name;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column user.pass
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String pass;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column user.IMEI
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private String imei;
+ /**
+ * This field was generated by MyBatis Generator. This field corresponds to the database column user.power
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ private Integer power;
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column user.id
+ * @return the value of user.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getId() {
+ return id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column user.id
+ * @param id the value for user.id
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column user.name
+ * @return the value of user.name
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column user.name
+ * @param name the value for user.name
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column user.pass
+ * @return the value of user.pass
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getPass() {
+ return pass;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column user.pass
+ * @param pass the value for user.pass
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setPass(String pass) {
+ this.pass = pass;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column user.IMEI
+ * @return the value of user.IMEI
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public String getImei() {
+ return imei;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column user.IMEI
+ * @param imei the value for user.IMEI
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setImei(String imei) {
+ this.imei = imei;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method returns the value of the database column user.power
+ * @return the value of user.power
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public Integer getPower() {
+ return power;
+ }
+
+ /**
+ * This method was generated by MyBatis Generator. This method sets the value of the database column user.power
+ * @param power the value for user.power
+ * @mbg.generated Sun Jan 21 18:14:28 CST 2018
+ */
+ public void setPower(Integer power) {
+ this.power = power;
+ }
+}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/GameData.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/GameData.java
new file mode 100644
index 0000000..928bef3
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/GameData.java
@@ -0,0 +1,90 @@
+package com.yutou.jianrmg_v2.basemodel.Fragments;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+
+import java.util.Iterator;
+import java.util.Set;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.services.DownloadService;
+
+import Interfaces.BaseFragmeneInerface;
+
+
+/**
+ * Created by 58381 on 2018/1/21.
+ */
+
+public class GameData extends Fragment {
+ private static GameData gameData;
+ private DownloadService service;
+ private Activity activity;
+ private BaseFragmeneInerface baseFragmene;
+
+ public static GameData init(Activity activity){
+ if(gameData==null){
+ gameData=new GameData();
+ gameData.baseFragmene.init(activity);
+ }
+ return gameData;
+ }
+ public GameData(){
+ try {
+ baseFragmene= (BaseFragmeneInerface) AppData.plugsin.get("rx.jar").loadClass("com.yutou.jianrmg_v2.gamedatamodel.MainFragmene").newInstance();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Log.i("加载数据模块失败");
+ baseFragmene=new BaseFragmeneInerface() {
+ private Context context;
+ @Override
+ public void init(Context context) {
+ this.context=context;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ TextView textView=new TextView(activity);
+ textView.setLayoutParams(params);
+ textView.setGravity(Gravity.CENTER);
+ textView.setText("未加载插件,请尝试重启");
+ return textView;
+ }
+
+ @Override
+ public void setIntent() {
+
+ }
+ };
+
+ }
+ }
+
+ private void setActivity(Activity activity) {
+ this.activity = activity;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ /*ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ TextView textView=new TextView(getContext());
+ textView.setLayoutParams(params);
+ textView.setGravity(Gravity.CENTER);
+ textView.setText("Hello World");
+ return textView;*/
+ return baseFragmene.onCreateView(inflater, container, savedInstanceState);
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/Home.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/Home.java
new file mode 100644
index 0000000..64d88ba
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/Home.java
@@ -0,0 +1,77 @@
+package com.yutou.jianrmg_v2.basemodel.Fragments;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+
+import Interfaces.BaseFragmeneInerface;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class Home extends Fragment {
+ private static Home home;
+
+
+ private BaseFragmeneInerface baseFragmene;
+
+ public static Home init(Activity activity){
+ if(home==null){
+ home=new Home();
+ home.baseFragmene.init(activity);
+ }
+ return home;
+ }
+
+
+
+ public Home(){
+ try {
+ baseFragmene= (BaseFragmeneInerface) AppData.plugsin.get("home.jar").loadClass("com.yutou.jianrmg_v2.apphome.MainFragmene").newInstance();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Log.i("热插件加载失败,启用默认");
+ baseFragmene=new BaseFragmeneInerface() {
+ private Context context;
+ @Override
+ public void init(Context context) {
+ this.context=context;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ TextView textView=new TextView(context);
+ textView.setLayoutParams(params);
+ textView.setGravity(Gravity.CENTER);
+ textView.setText("未加载插件,请尝试重启");
+ return textView;
+ }
+
+ @Override
+ public void setIntent() {
+
+ }
+ };
+ }
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ return baseFragmene.onCreateView(inflater, container, savedInstanceState);
+ }
+
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/MGList.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/MGList.java
new file mode 100644
index 0000000..463eff2
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/MGList.java
@@ -0,0 +1,75 @@
+package com.yutou.jianrmg_v2.basemodel.Fragments;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+
+import Interfaces.BaseFragmeneInerface;
+
+/**
+ * Created by 58381 on 2018/1/23.
+ */
+
+public class MGList extends Fragment {
+ private static MGList modView;
+ private BaseFragmeneInerface baseFragmeneInerface;
+
+ public static MGList init(Activity activity) {
+ if (modView == null) {
+ modView = new MGList();
+ modView.baseFragmeneInerface.init(activity);
+ }
+ return modView;
+ }
+
+ public MGList() {
+ try {
+ this.baseFragmeneInerface = (BaseFragmeneInerface) AppData.plugsin.get("mglist.jar").loadClass("com.yutou.jianrmg_v2.mglistmodel.MainFragments").newInstance();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Log.i("魔改列表插件加载失败");
+ baseFragmeneInerface = new BaseFragmeneInerface() {
+ private Context context;
+
+ @Override
+ public void init(Context context) {
+ this.context = context;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ ViewGroup.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ TextView textView = new TextView(context);
+ textView.setLayoutParams(params);
+ textView.setGravity(Gravity.CENTER);
+ textView.setText("未加载插件,请尝试重启");
+ return textView;
+ }
+
+ @Override
+ public void setIntent() {
+
+ }
+ };
+ }
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+
+ return baseFragmeneInerface.onCreateView(inflater, container, savedInstanceState);
+ }
+
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/My.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/My.java
new file mode 100644
index 0000000..88f14f7
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/My.java
@@ -0,0 +1,106 @@
+package com.yutou.jianrmg_v2.basemodel.Fragments;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.GridLayout;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+
+
+import com.bumptech.glide.Glide;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.basemodel.Adapters.MyItemGridViewAdapter;
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.UUserdata;
+import com.yutou.jianrmg_v2.basemodel.Data.User;
+import com.yutou.jianrmg_v2.basemodel.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jp.wasabeef.glide.transformations.BlurTransformation;
+
+import static com.bumptech.glide.request.RequestOptions.bitmapTransform;
+
+
+/**
+ * Created by 58381 on 2018/2/22.
+ */
+
+public class My extends Fragment {
+ public static My my;
+ public static My init(){
+ if(my==null){
+ my=new My();
+ }
+ return my;
+ }
+ private View view;
+ private User user;
+ private UUserdata udata;
+ private ImageLoader imageLoader;
+
+ private TextView uname,item_title;
+ private ImageView icon,item_icon,image_top;
+ // private LinearLayout items;
+ private ListView myItems;
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ if(view==null){
+ view=LayoutInflater.from(getContext()).inflate(R.layout.fragment_my,null);
+ uname=view.findViewById(R.id.uname);
+ icon=view.findViewById(R.id.icon);
+ item_title=view.findViewById(R.id.item_title);
+ item_icon=view.findViewById(R.id.item_icon);
+ image_top=view.findViewById(R.id.image_top);
+ // items=view.findViewById(R.id.items);
+ myItems=view.findViewById(R.id._my_items);
+ }
+ imageLoader= Utils.initImageLoader(getContext());
+ initData();
+ return view;
+ }
+ private void initData(){
+ user= AppData.user;
+ udata=AppData.userdata;
+ if(udata==null)
+ udata=new UUserdata();
+ udata.setImage("https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1209476926,1108056910&fm=58");
+ if(user==null||user.getId()<1){
+ uname.setText("未登录");
+ icon.setImageResource(R.mipmap.ic_launcher);
+ return;
+ }
+ try {
+ uname.setText(user.getName());
+ imageLoader.displayImage(udata.getImage(),icon);
+ Glide.with(this).load(udata.getImage()).apply(bitmapTransform(new BlurTransformation(25))).into(image_top);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ myItems.setAdapter(new MyItemGridViewAdapter(getItemData(),getContext()));
+ }
+ private List getItemData(){
+ List list=new ArrayList<>();
+ list.add(new MyItemGridViewAdapter.ItemData(-1,"下载中心"));
+ list.add(new MyItemGridViewAdapter.ItemData(-1,"收藏夹"));
+ list.add(new MyItemGridViewAdapter.ItemData(-1,"问题/建议"));
+ list.add(new MyItemGridViewAdapter.ItemData(-1,"设置"));
+ /* list.add(new MyItemGridViewAdapter.ItemData(-1,""));
+ list.add(new MyItemGridViewAdapter.ItemData(-1,""));
+ list.add(new MyItemGridViewAdapter.ItemData(-1,""));
+ list.add(new MyItemGridViewAdapter.ItemData(-1,""));*/
+ return list;
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadFileInerface.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadFileInerface.java
new file mode 100644
index 0000000..9ff3ea9
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadFileInerface.java
@@ -0,0 +1,10 @@
+package com.yutou.jianrmg_v2.basemodel.Interfaces;
+
+/**
+ * Created by 58381 on 2018/2/5.
+ */
+
+public interface DownloadFileInerface {
+ boolean downloading(String fileName, int current, long length);
+ void over(boolean isOver);
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadInterface.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadInterface.java
new file mode 100644
index 0000000..41a1e41
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadInterface.java
@@ -0,0 +1,17 @@
+package com.yutou.jianrmg_v2.basemodel.Interfaces;
+
+import com.yutou.jianrmg_v2.basemodel.Data.TModfile;
+
+
+/**
+ * Created by 58381 on 2018/2/2.
+ */
+
+public interface DownloadInterface {
+ void getDownloadList(int size);
+ void getDownloadFile(TModfile modfile);
+ void getDownloadFileSize(int size);
+ void getCurrent(int current);
+ void over();
+ void start();
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/HttpInterface.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/HttpInterface.java
new file mode 100644
index 0000000..8ac89ee
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/HttpInterface.java
@@ -0,0 +1,12 @@
+package com.yutou.jianrmg_v2.basemodel.Interfaces;
+
+
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public interface HttpInterface {
+ void httpGetData(String string, int code);
+ void httpError(Exception e);
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpApi.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpApi.java
new file mode 100644
index 0000000..70f0b37
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpApi.java
@@ -0,0 +1,32 @@
+package com.yutou.jianrmg_v2.basemodel.Network;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class HttpApi {
+ // public static final String HOME_URL="http://192.168.31.240:8088/android/"; //zzz_gz wifi
+ public static final String HOME_URL="http://192.168.137.1:8088/android/"; //笔记本本身WIFI
+ // public static final String HOME_URL="http://game.yutou233.cn/android/"; //服务器
+
+ public static final String MOD_ALL="mod/all.do";
+ public static final String MOD_TYPE="mod/getType.do";
+ public static final String MOD_REMOD="mod/remod.do";
+ public static final String MOD_USER_LIST="mod/user.do";
+ public static final String MOD_TAG="mod/tags.do";
+ public static final String MOD_DOWNLOAD="mod/download.do";
+ public static final String MOD_GAME_PACKNAME="mod/packnames.do";
+ public static final String MOD_COLLCETION="mod/collection.do";
+
+ public static final String BANNER="banner/get.do";
+
+ public static final String MG_HOME_LIST="config/home.do";
+ public static final String MG_MG_LIST="config/mg.do";
+ public static final String MG_CONFIG="config/update.do";
+
+ public static final String USER_LOGIN="user/login.do";
+ public static final String USER_REG="user/reg.do";
+ public static final String USER_RELOAD="user/reload.do";
+ public static final String USER_LOGOUT="user/logout.do";
+ public static final String USER_TEST="user/test.do";
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpUtils.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpUtils.java
new file mode 100644
index 0000000..61527f5
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpUtils.java
@@ -0,0 +1,181 @@
+package com.yutou.jianrmg_v2.basemodel.Network;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.DownloadFileInerface;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.concurrent.TimeUnit;
+
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.FormBody;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class HttpUtils {
+ private static OkHttpClient client;
+ private static OkHttpClient getClient(){
+ return new OkHttpClient.Builder()
+ .connectTimeout(3000, TimeUnit.SECONDS)
+ .readTimeout(3000,TimeUnit.SECONDS).build();
+
+ }
+ public static void get(final String url, final HttpInterface httpInterface) {
+ if(client==null){
+ client=getClient();
+ }
+ Log.i("GET",url);
+ Request request = new Request.Builder().url(url).build();
+ Call call = client.newCall(request);
+ call.enqueue(new Callback() {
+ @Override
+ public void onFailure(Call call, IOException e) {
+ httpInterface.httpError(e);
+ }
+
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ String http=response.body().string();
+ if(httpInterface!=null)
+ httpInterface.httpGetData(http, response.code());
+ Log.i(url,"接收:"+http);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ public static void post(final String url, final JSONObject json, final HttpInterface httpInterface) {
+ if(client==null){
+ client=getClient();
+ }
+ Log.i("POST",url);
+ Request request = new Request.Builder().url(url).post(mapToBody(json)).removeHeader("User-Agent").build();
+ Call call = client.newCall(request);
+ try {
+ call.enqueue(new Callback() {
+ @Override
+ public void onFailure(Call call, IOException e) {
+ if(httpInterface!=null)
+ httpInterface.httpError(e);
+ e.printStackTrace();
+ }
+
+ @Override
+ public void onResponse(Call call, Response response) {
+ try {
+ String http=response.body().string();
+ if(httpInterface!=null)
+ httpInterface.httpGetData(http, response.code());
+ Log.i(url,"传参:"+json.toString()+" 接收:"+http);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+
+ }
+ public static void downloadFile(final String url, final String srcPath, final DownloadFileInerface downloadFileInerface){
+ if(client==null)
+ client=getClient();
+ File path=new File(srcPath);
+ if(!path.exists())
+ path.mkdirs();
+ Request request=new Request.Builder().url(url).build();
+ client.newCall(request).enqueue(new Callback() {
+ @Override
+ public void onFailure(Call call, IOException e) {
+ downloadFileInerface.over(false);
+ }
+
+ @Override
+ public void onResponse(Call call, Response response) throws IOException {
+ InputStream is = null;
+ byte[] buf = new byte[2048];
+ int len = 0;
+ FileOutputStream fos = null;
+ try {
+ is = response.body().byteStream();
+ long total = response.body().contentLength();
+ File file = new File(srcPath, getNameFromUrl(url));
+ fos = new FileOutputStream(file);
+ long sum = 0;
+ while ((len = is.read(buf)) != -1) {
+ fos.write(buf, 0, len);
+ sum += len;
+ int progress = (int) (sum * 1.0f / total * 100);
+ // 下载中
+ while (!downloadFileInerface.downloading(getNameFromUrl(url),progress,total)){
+ Thread.sleep(10);
+ }
+
+ }
+ fos.flush();
+ // 下载完成
+ downloadFileInerface.over(true);
+ }catch (Exception e){
+ e.printStackTrace();
+ downloadFileInerface.over(false);
+ }
+ }
+ });
+ }
+ private static String getNameFromUrl(String url) {
+ return url.substring(url.lastIndexOf("/") + 1);
+ }
+
+ public static String getHtml(String url){
+ Log.i("获取网页源码:"+url);
+ if(client==null)
+ client=getClient();
+ Request request=new Request.Builder().url(url).build();
+ try {
+ Response response= client.newCall(request).execute();
+ return response.body().string();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return "";
+ }
+
+ private static FormBody mapToBody(JSONObject json) {
+ FormBody.Builder builder = new FormBody.Builder();
+ if (json == null) {
+ return builder.build();
+ }
+ Iterator keys = json.keys();
+ while (keys.hasNext()) {
+ String key = keys.next();
+ try {
+ builder.add(key, json.get(key) + "");
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+ builder.add("token", AppData.Token);
+ return builder.build();
+ }
+
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Test.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Test.java
new file mode 100644
index 0000000..07cc63a
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Test.java
@@ -0,0 +1,23 @@
+package com.yutou.jianrmg_v2.basemodel;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.widget.LinearLayout;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+
+import Interfaces.BaseActivityInterface;
+import dalvik.system.DexClassLoader;
+
+public class Test extends AppCompatActivity{
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setTitle(R.string.app_name);
+
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ActivitysManager.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ActivitysManager.java
new file mode 100644
index 0000000..7c908f2
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ActivitysManager.java
@@ -0,0 +1,92 @@
+package com.yutou.jianrmg_v2.basemodel.Tools;
+
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.content.Context;
+
+import java.util.Stack;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class ActivitysManager {
+ private static Stack activityStack = new Stack();
+
+ /**
+ * 添加Activity到堆栈
+ */
+ public static void addActivity(Activity activity) {
+ activityStack.push(activity);
+ }
+
+ /**
+ * 获取当前Activity(堆栈中最后一个压入的)
+ */
+ public static Activity currentActivity() {
+ return activityStack.lastElement();
+ }
+
+ /**
+ * 结束当前Activity(堆栈中最后一个压入的)
+ */
+ public static void finishCurrentActivity() {
+ Activity activity = activityStack.pop();
+ activity.finish();
+ }
+
+ /**
+ * 结束指定的Activity
+ */
+ public static void finishActivity(Activity activity) {
+ if (activity != null) {
+ activityStack.remove(activity);
+ if(!activity.isFinishing()) {
+ activity.finish();
+ }
+ }
+ if(activityStack.empty()){
+ Log.i("Activity管理器","已清空");
+ System.exit(0);
+ }
+ }
+
+ /**
+ * 结束指定类名的Activity
+ */
+ public static void finishActivity(Class> cls) {
+ for (Activity activity : activityStack) {
+ if (activity.getClass().equals(cls)) {
+ finishActivity(activity);
+ return;
+ }
+ }
+ }
+
+ /**
+ * 结束所有Activity
+ */
+ public static void finishAllActivity() {
+ for (Activity activity : activityStack) {
+ if (activity != null) {
+ activity.finish();
+ }
+ }
+ activityStack.clear();
+ }
+
+ /**
+ * 退出应用程序
+ */
+ public static void AppExit(Context context) {
+ try {
+ finishAllActivity();
+ ActivityManager manager = (ActivityManager) context
+ .getSystemService(Context.ACTIVITY_SERVICE);
+ manager.killBackgroundProcesses(context.getPackageName());
+ System.exit(0);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ConfigUtils.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ConfigUtils.java
new file mode 100644
index 0000000..eb2dd50
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ConfigUtils.java
@@ -0,0 +1,99 @@
+package com.yutou.jianrmg_v2.basemodel.Tools;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+
+/**
+ * Created by 58381 on 2018/2/18.
+ */
+
+public class ConfigUtils {
+ public static final String collection="collection";
+ public static final String token="token";
+ public static final String uid="uid";
+ public static final String user="user";
+
+ private static ConfigUtils config;
+ private static final String configPath="/data/data/com.yutou.jianrmg_v2/files/";
+ private JSONObject json;
+ public static ConfigUtils init(){
+ if(config==null){
+ config=new ConfigUtils();
+ }
+ return config;
+ }
+
+ public ConfigUtils() {
+ json=read();
+ }
+ private JSONObject read(){
+ File file=new File(configPath+"appConfig.json");
+ if(file.exists()){
+ try {
+ BufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(file)));
+ String tmp,str="";
+ while ((tmp=reader.readLine())!=null){
+ str+=tmp;
+ }
+ reader.close();
+ return new JSONObject(str);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return initConfig();
+ }else{
+ try {
+ new File(configPath).mkdirs();
+ file.createNewFile();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return initConfig();
+ }
+ }
+ private JSONObject initConfig(){
+ JSONObject json=new JSONObject();
+ try {
+ json.put("token","");
+ json.put("uid",0);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ return json;
+ }
+ public boolean save(String key, Object value){
+ try {
+ File file=new File(configPath+"appConfig.json");
+ if(!file.exists()){
+ file.createNewFile();
+ }
+ json.put(key,value);
+ PrintWriter writer=new PrintWriter(file);
+ writer.println(json.toString());
+ writer.flush();
+ writer.close();
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+ public Object load(String key){
+ try{
+ return json.get(key);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+ public void printConfig(){
+ Log.i("读取配置文件",json.toString());
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Log.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Log.java
new file mode 100644
index 0000000..71a71e0
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Log.java
@@ -0,0 +1,61 @@
+package com.yutou.jianrmg_v2.basemodel.Tools;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class Log {
+ private static final boolean LOG=true;
+ /**
+ * 错误输出
+ * @param str 正文
+ */
+ public static void e(String str) {
+ if(LOG)
+ System.err.println(str);
+ }
+ /**
+ * 普通输出
+ * @param str 正文
+ */
+ public static void i(String str) {
+ if(LOG)
+ System.out.println(str);
+ }
+ /**
+ * 错误输出带标题
+ * @param title 标题
+ * @param str 正文
+ */
+ public static void e(String title,String str) {
+ if(LOG)
+ System.err.println("["+title+"]"+str);
+ }
+ /**
+ * 普通输出带标题
+ * @param title 标题
+ * @param str 正文
+ */
+ public static void i(String title,String str) {
+ if(LOG)
+ System.out.println("["+title+"]"+str);
+
+ }
+ /**
+ * 异常输出
+ * @param e 异常
+ * @param object 异常所在的类
+ * @return
+ */
+ public static String printf_Error(Exception e,Object object) {
+ StringWriter writer=new StringWriter();
+ PrintWriter printWriter=new PrintWriter(writer);
+ e.printStackTrace(printWriter);
+ if(LOG)
+ System.err.println("["+object.getClass().getName()+"]"+writer.toString());
+ return "["+object.getClass().getName()+"]"+writer.toString();
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ModUtils.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ModUtils.java
new file mode 100644
index 0000000..d998635
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ModUtils.java
@@ -0,0 +1,351 @@
+package com.yutou.jianrmg_v2.basemodel.Tools;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Handler;
+import android.os.IBinder;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSON;
+import com.kaopiz.kprogresshud.KProgressHUD;
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.MGamePackname;
+import com.yutou.jianrmg_v2.basemodel.Data.TMod;
+import com.yutou.jianrmg_v2.basemodel.Data.TModfile;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.DownloadInterface;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpApi;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.basemodel.services.DownloadService;
+
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+import me.drakeet.materialdialog.MaterialDialog;
+
+
+/**
+ * Created by 58381 on 2018/2/2.
+ */
+
+public class ModUtils {
+ private static ModUtils modUtils;
+ private Context context;
+ private Handler handler;
+ private List modfiles;
+ private KProgressHUD hud;
+ private TMod mod;
+ public static ModUtils init(Context context){
+ if(modUtils==null){
+ modUtils=new ModUtils();
+ }
+ modUtils.setContext(context);
+ return modUtils;
+ }
+ private void setContext(Context context){
+ this.context=context;
+ hud=Utils.showLoading(context,"安装中","请稍后");
+ }
+ private ModUtils(){
+ handler=new Handler();
+ }
+ public void setMod(TMod mod){
+ this.mod=mod;
+ getModDownloadInfo();
+ }
+ public List getModfiles(){
+ return modfiles;
+ }
+ public void installMod(TMod mod){
+ this.mod=mod;
+ install();
+ }
+ private void install(){
+ if(modfiles==null){
+ Toast.makeText(context,"正在加载数据,请稍后再试",Toast.LENGTH_LONG).show();
+ getModDownloadInfo();
+ return;
+ }
+ Log.i("安装mod",changeMod(mod,modfiles)+"");
+ if(!isInstallMod(mod)&&changeMod(mod,modfiles)){
+ install(mod);
+ }else{
+ if(getModPath(mod).listFiles().length>0&&!changeMod(mod,modfiles)){
+ final MaterialDialog dialog=new MaterialDialog(context);
+ dialog.setTitle("mod已损失");
+ dialog.setMessage("当前mod文件有缺失,是否重新下载?");
+ dialog.setPositiveButton("确定", new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ downloadMod();
+ dialog.dismiss();
+ }
+ });
+ dialog.setNegativeButton("算了", new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dialog.dismiss();
+ }
+ });
+ dialog.show();
+ }else {
+ downloadMod();
+ }
+ }
+ }
+ private void install(final TMod mod){
+ List clientList=new ArrayList<>();
+ for (MGamePackname packname : AppData.packnames) {
+ clientList.add(packname.getZhname()+"("+packname.getPackname()+")");
+ }
+ final MaterialDialog dialog=new MaterialDialog(context);
+ dialog.setTitle("选择安装客户端");
+ ListView listView=new ListView(context);
+ listView.setAdapter(new ArrayAdapter(context,android.R.layout.simple_list_item_1,clientList));
+ listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ MGamePackname packname=AppData.packnames.get(i);
+ hud.show();
+ for (TModfile modfile : modfiles) {
+ File file=getModPath(mod,modfile.getFilename());
+ if(packname.getZhname().contains("[ROOT]")){
+ backupOrRoot(file,"/data/data/"+packname.getPackname()+modfile.getInstallpathid(),packname.getPackname(),mod);
+ rootInstall(file,"/data/data/"+packname.getPackname()+modfile.getInstallpathid());
+ }else{
+
+ }
+ }
+ try {
+ new File(getModInstallPath(mod)+packname.getPackname()+".lock").createNewFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ hud.dismiss();
+ dialog.dismiss();
+ Toast.makeText(context,"安装成功,重启游戏生效",Toast.LENGTH_LONG).show();
+ }
+ });
+ dialog.setContentView(listView);
+ dialog.setPositiveButton("放弃", new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dialog.dismiss();
+ }
+ });
+ dialog.show();
+
+ }
+ private void notRootInstall(File src,String path){
+
+ }
+ private void rootInstall(File src,String path){
+ RootUtils root=RootUtils.init(context);
+ if(RootUtils.su()){
+ root.exec("\\cp -f "+src.getAbsolutePath()+" "+path);
+ root.exec("chmod 777 "+src.getAbsolutePath()+" "+path+src.getName());
+ }else {
+ final MaterialDialog dialog=new MaterialDialog(context);
+ dialog.setTitle("错误");
+ dialog.setMessage("未获取到ROOT权限\n提示:魔改专用端可免ROOT使用魔改,以及更多功能");
+ dialog.setPositiveButton("确定", new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dialog.dismiss();
+ }
+ });
+ dialog.setNegativeButton("下载魔改专用客户端", new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dialog.dismiss();
+ }
+ });
+ dialog.show();
+ }
+ }
+ public void reBackMod(TMod tMod) {
+ final MaterialDialog dialog=new MaterialDialog(context);
+ dialog.setTitle("将还原 "+tMod.getTitle());
+ final List clientList=getInstallClens();
+ ListView listView=new ListView(context);
+ listView.setAdapter(new ArrayAdapter(context,android.R.layout.simple_list_item_1,clientList));
+ listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ RootUtils root=RootUtils.init(context);
+ for (TModfile modfile : modfiles) {
+ if(getModPath(mod,"backup/"+clientList.get(i)+"/"+modfile.getFilename()).exists()){
+ root.exec("\\cp -f "+getModInstallPath(mod)+"backup/"+clientList.get(i)+"/"+modfile.getFilename()+" "+"/data/data/"+clientList.get(i)+modfile.getInstallpathid());
+ }else{
+ root.exec("rm -f "+"/data/data/"+clientList.get(i)+modfile.getInstallpathid()+modfile.getFilename());
+ }
+ }
+ dialog.dismiss();
+ }
+ });
+ dialog.dismiss();
+ dialog.setNegativeButton("放弃", new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dialog.dismiss();;
+ }
+ });
+ dialog.show();
+
+ }
+ private void backupOrRoot(File srcFile,String srcPath,String backupClient,TMod mod){
+ RootUtils root = RootUtils.init(context);
+ if(RootUtils.su()) {
+ File backup = getModPath(mod, "backup/"+backupClient);
+ File file=new File(backup.getAbsolutePath()+"/"+srcFile.getName());
+ if(file.exists()){
+ return;
+ }
+ if (!backup.exists()) {
+ Log.i("获取ROOT","2");
+ backup.mkdirs();
+ }
+ root.exec("chmod 777 "+srcPath+srcFile.getName());
+ root.exec("\\cp -f"+srcPath+srcFile.getName()+" "+backup+"/");
+ }else{
+ }
+ }
+ private void downloadMod(){
+ Toast.makeText(context,"开始下载",Toast.LENGTH_LONG).show();
+ Intent intent=new Intent(context.getApplicationContext(), DownloadService.class);
+ intent.setPackage(context.getPackageName());
+ boolean isBindService=context.getApplicationContext().bindService(intent, new ServiceConnection() {
+ @Override
+ public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
+ DownloadService.ServiceBinder binder=(DownloadService.ServiceBinder)iBinder;
+ DownloadService service=binder.getService(new DownloadInterface() {
+ @Override
+ public void getDownloadList(int size) {
+
+ }
+
+ @Override
+ public void getDownloadFile(TModfile modfile) {
+
+ }
+
+ @Override
+ public void getDownloadFileSize(int size) {
+
+ }
+
+ @Override
+ public void getCurrent(int current) {
+
+ }
+
+ @Override
+ public void over() {
+
+ }
+
+ @Override
+ public void start() {
+
+ }
+ });
+ service.start(modfiles);
+
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName componentName) {
+ Log.i("下载服务","绑定失败:"+componentName);
+ }
+ },Context.BIND_AUTO_CREATE);
+ Log.i("绑定下载:",isBindService+"");
+ }
+ private void getModDownloadInfo(){
+ modfiles=null;
+ try{
+ JSONObject json=new JSONObject();
+ json.put("mid",mod.getId());
+ json.put("uid", AppData.user.getId());
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.MOD_DOWNLOAD, json, new HttpInterface() {
+ @Override
+ public void httpGetData(String string, int code) {
+ try{
+ JSONObject json=new JSONObject(string);
+ if(json.getInt("code")==100){
+ modfiles= JSON.parseArray(json.getJSONArray("data").toString(),TModfile.class);
+ }
+ }catch (Exception e){
+
+ }
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ }catch (Exception e){
+
+ }
+ }
+
+ public static String getModInstallPath(TMod mod){
+ return Utils.getSDCardPath()+"/"+mod.getId()+"/";
+ }
+ public static boolean isInstallMod(TMod mod){
+ File modPath=new File(Utils.getSDCardPath()+"/"+mod.getId()+"/");
+ for (int i = 0; i < modPath.listFiles().length; i++) {
+ Log.i("检测mod是否安装","位置:"+modPath.listFiles()[i].getAbsolutePath()+" exists:"+modPath.listFiles()[i].exists()+" .lock="+(modPath.listFiles()[i].getName().contains(".lock")));
+ if(modPath.listFiles()[i].getName().contains(".lock")){
+ return true;
+ }
+ }
+
+ return false;
+ }
+ public static boolean changeMod(TMod mod, List modfiles){
+ File modPath=new File(Utils.getSDCardPath()+"/"+mod.getId()+"/");
+ Log.i("检测mod是否完整","位置:"+Utils.getSDCardPath()+"/"+mod.getId()+"/"+" exists:"+modPath.exists());
+ for (TModfile modfile : modfiles) {
+ if(!new File(Utils.getSDCardPath()+"/"+mod.getId()+"/"+modfile.getFilename()).exists()){
+ return false;
+ }
+ }
+ return true;
+ }
+ public static File getModPath(TMod mod){
+ return getModPath(mod,"");
+ }
+ public static File getModPath(TMod mod,String name){
+ File path=new File(Utils.getSDCardPath()+"/"+mod.getId()+"/"+name);
+ if(!path.exists()){
+ path.mkdirs();
+ }
+ return path;
+ }
+
+
+ public List getInstallClens() {
+ List installClens=new ArrayList<>();
+ File modPath=getModPath(mod);
+ if(modPath.exists()){
+ for (int i = 0; i < modPath.listFiles().length; i++) {
+ if(modPath.listFiles()[i].getName().contains(".lock")){
+ installClens.add(modPath.listFiles()[i].getName().split("\\.")[0]);
+ }
+ }
+ }
+ return installClens;
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/RootUtils.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/RootUtils.java
new file mode 100644
index 0000000..5a83ae7
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/RootUtils.java
@@ -0,0 +1,112 @@
+package com.yutou.jianrmg_v2.basemodel.Tools;
+
+import android.content.Context;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by 58381 on 2018/2/6.
+ */
+
+public class RootUtils {
+ private Context context;
+ private static RootUtils rootUtils;
+ private Runtime localProcess;
+ private Process process;
+ private DataOutputStream stream;
+ private int exitValue;
+ public static RootUtils init(Context context){
+ if(rootUtils==null){
+ rootUtils=new RootUtils(context);
+ rootUtils.init();
+ }
+ return rootUtils;
+ }
+ private void init(){
+ try {
+ localProcess = Runtime.getRuntime();
+ process= localProcess.exec("su\n");
+ stream=new DataOutputStream(process.getOutputStream());
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ private RootUtils(Context context) {
+ this.context = context;
+ }
+ private static int isRoot=0;
+ public static boolean su(){
+ if(isRoot!=0){
+ if(isRoot==1){
+ return true;
+ }else{
+ return false;
+ }
+ }
+ try {
+ Process localProcess = Runtime.getRuntime().exec("su\n");
+ Object localObject = localProcess.getOutputStream();
+ DataOutputStream localDataOutputStream = new DataOutputStream(
+ (OutputStream) localObject);
+ localDataOutputStream.writeBytes("echo test\n");
+ localDataOutputStream.flush();
+ localDataOutputStream.writeBytes("exit\n");
+ localDataOutputStream.flush();
+ int result =localProcess.waitFor();
+ localDataOutputStream.close();
+ localProcess.exitValue();
+ if (result == 0) {
+ isRoot=1;
+ return true;
+ }
+ else {
+ isRoot=-1;
+ return false;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ isRoot=-1;
+ return false;
+ }
+ public boolean exec(String exec){
+ try {
+ exec="./data/data/"+context.getPackageName()+"/files/busybox-armv6l "+exec;
+ Log.i("ROOT",exec);
+ stream.writeBytes(exec+"\n");
+ stream.flush();
+ }catch (Exception e) {
+ e.printStackTrace();;
+ return false;
+ }
+ return true;
+ }
+ public boolean println(String exec) {
+ try {
+ // exec="./data/data/"+context.getPackageName()+"/files/busybox-armv6l "+exec;
+ exec="su\n"+exec;
+ Log.i("ROOT",exec);
+ Process process=localProcess.exec(exec+"\n");
+ BufferedReader reader=new BufferedReader(new InputStreamReader(process.getInputStream()));
+ String str="",tmp;
+ List list=new ArrayList<>();
+ while ((tmp=reader.readLine())!=null){
+ //str+=tmp;
+ list.add(tmp);
+ }
+ reader.close();
+ for (String string : list) {
+ Log.i("ROOT get",string);
+ }
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Utils.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Utils.java
new file mode 100644
index 0000000..5944aba
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Utils.java
@@ -0,0 +1,94 @@
+package com.yutou.jianrmg_v2.basemodel.Tools;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Environment;
+import android.util.DisplayMetrics;
+import android.view.WindowManager;
+import android.widget.Toast;
+
+import com.kaopiz.kprogresshud.KProgressHUD;
+import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
+import com.nostra13.universalimageloader.core.DisplayImageOptions;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
+import com.yutou.jianrmg_v2.basemodel.R;
+
+
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class Utils {
+ public static int getPixelsFromDp(Activity activity, int size){
+ DisplayMetrics metrics =new DisplayMetrics();
+ activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ return(size * metrics.densityDpi) / DisplayMetrics.DENSITY_DEFAULT;
+ }
+ public static void toast(Context context,String str){
+ Toast.makeText(context,str,Toast.LENGTH_LONG).show();
+ }
+ public static void setImmersion(Activity activity){
+ activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ }
+
+ public static String getSDCardPath(){
+ String path= Environment.getExternalStorageDirectory().getPath()+"/jianRMG";
+ return path;
+ }
+ private static DisplayImageOptions initDisplayOptions(){
+ DisplayImageOptions.Builder displayImageOptionsBuilder = new DisplayImageOptions.Builder();
+ displayImageOptionsBuilder.cacheInMemory(false);
+ displayImageOptionsBuilder.cacheOnDisk(true);
+ displayImageOptionsBuilder.showImageForEmptyUri(R.drawable.ic_launcher_background);
+ return displayImageOptionsBuilder.build();
+ }
+ public static ImageLoader initImageLoader(Context context){
+
+ ImageLoader imageLoader= ImageLoader.getInstance();
+ ImageLoaderConfiguration.Builder builder=new ImageLoaderConfiguration.Builder(context);
+ File cachePath=new File(getSDCardPath()+"/cache/");
+ if(!cachePath.exists()){
+ cachePath.exists();
+ }
+ //builder.memoryCache(new WeakMemoryCache());
+ builder.diskCache(new UnlimitedDiskCache(cachePath));
+ builder.defaultDisplayImageOptions(initDisplayOptions());
+
+ imageLoader.init(builder.build());
+ return imageLoader;
+ }
+ public static List ListRemoveNull(List list){
+ list.removeAll(Collections.singleton(null));
+ return list;
+ }
+
+ 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;
+ }
+ public static boolean testStringIsNull(String... strings){
+ for (String string : strings) {
+ if(null==string||"".equals(string)||string.length()==0){
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/services/DownloadService.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/services/DownloadService.java
new file mode 100644
index 0000000..ec577e8
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/services/DownloadService.java
@@ -0,0 +1,184 @@
+package com.yutou.jianrmg_v2.basemodel.services;
+
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Binder;
+import android.os.IBinder;
+import android.widget.RemoteViews;
+import android.widget.Toast;
+
+
+import com.yutou.jianrmg_v2.basemodel.Data.TModfile;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.DownloadFileInerface;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.DownloadInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class DownloadService extends Service {
+ private List list;
+ private DownloadInterface downloadInterface;
+ private NotificationManager notificationManager;
+ private String BUTTON_CLICK="com.yutou.jianrmg.download.notification.button";
+ private Download download;
+ private RemoteViews views;
+ private Notification notification;
+ private boolean puase=false;
+ public class ServiceBinder extends Binder{
+ public DownloadService getService(DownloadInterface downloadInterface){
+ DownloadService.this.downloadInterface=downloadInterface;
+ return DownloadService.this;
+ }
+ }
+
+ public DownloadService() {
+ list=new ArrayList<>();
+ }
+
+ private ServiceBinder binder=new ServiceBinder();
+ @Override
+ public IBinder onBind(Intent intent) {
+ // TODO: Return the communication channel to the service.
+ return binder;
+ }
+ public void setFiles(List list){
+ this.list=list;
+ }
+ public void setInterface(DownloadInterface downloadInterface){
+ this.downloadInterface=downloadInterface;
+ }
+
+ public int getDownloadList(){
+ return list.size();
+ }
+ public void start(List addList){
+ Log.i("启动下载服务");
+ puase=false;
+ list.addAll(addList);
+ downloadInterface.start();
+ download= new Download(this);
+
+ }
+ public void pause(){
+ puase=!puase;
+ }
+ private void startNotification(){
+ IntentFilter filter=new IntentFilter();
+ filter.addAction(BUTTON_CLICK);
+ registerReceiver(receiver,filter);
+ Intent intent=new Intent(BUTTON_CLICK);
+ PendingIntent buttonIntent=PendingIntent.getBroadcast(this,1,intent,PendingIntent.FLAG_UPDATE_CURRENT);
+
+ views=new RemoteViews(getPackageName(),R.layout.notification_download_layout);
+ views.setTextViewText(R.id.title,"开始下载");
+ views.setOnClickPendingIntent(R.id.button,buttonIntent);
+ views.setImageViewResource(R.id.imageView, R.mipmap.ic_launcher);
+
+ notificationManager= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ Notification.Builder builder=new Notification.Builder(getApplicationContext());
+ builder.setTicker("开始下载");
+ builder.setContentTitle("正在下载");
+ builder.setContent(views);
+ builder.setVisibility(Notification.VISIBILITY_PUBLIC);
+ //通知栏显示图标
+ builder.setSmallIcon(R.drawable.icon_download);
+
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
+ NotificationChannel channel=new NotificationChannel("channel_1","Message",NotificationManager.IMPORTANCE_HIGH);
+ builder.setChannelId(channel.getId());
+ notificationManager.createNotificationChannel(channel);
+ }
+
+ notification = builder.build();
+ notification.flags |= Notification.FLAG_AUTO_CANCEL;
+ notificationManager.notify(1,notification);
+ Utils.toast(getApplicationContext(),"展示通知栏");
+ }
+ private BroadcastReceiver receiver=new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Log.i("点击按钮");
+ puase=!puase;
+ }
+ };
+ private class Download extends Thread{
+ private Download download;
+ private DownloadService service;
+ private boolean isAlive=false,downloading=false;
+ public Download(DownloadService service){
+ download=this;
+ download.init(service);
+ }
+
+ private void init(DownloadService service){
+ if(!download.isAlive||!download.isAlive()||!download.isInterrupted())
+ {
+ this.service=service;
+ service.startNotification();
+ start();
+ }
+ }
+ @Override
+ public void run() {
+ super.run();
+ isAlive=true;
+ Log.i("准备下载");
+ while (service.list.size()>0){
+ if(downloading){
+ continue;
+ }
+ Log.i("开始下载:"+(downloading));
+ downloading=true;
+ final TModfile modfile=service.list.get(service.list.size()-1);
+ service.downloadInterface.getDownloadList(service.list.size());
+ Log.i("下载地址",modfile.getServiceurl());
+ HttpUtils.downloadFile(modfile.getServiceurl(), Utils.getSDCardPath() + "/" + modfile.getMid() + "/", new DownloadFileInerface() {
+ @Override
+ public boolean downloading(String fileName, int current, long length) {
+ service.views.setTextViewText(R.id.title,"正在下载:"+modfile.getFilename()+"("+length/1024+"kb)");
+ service.views.setProgressBar(R.id.progressBar, 100,current,false);
+ if(service.puase){
+ service.views.setTextViewText(R.id.button,"下载");
+ }else{
+ service.views.setTextViewText(R.id.button,"暂停");
+ }
+ service.notificationManager.notify(1,service.notification);
+ if(service.puase){
+
+ return false;
+ }else{
+ return true;
+ }
+ }
+
+ @Override
+ public void over(boolean isOver) {
+ if(isOver){
+ service.list.remove(modfile);
+ }
+ downloading=false;
+ }
+ });
+
+ }
+ service.views.setTextViewText(R.id.title,"全部下载完成");
+ service.views.setProgressBar(R.id.progressBar,10,10,false);
+ service.notificationManager.notify(1,service.notification);
+ service.downloadInterface.over();
+ isAlive=false;
+ Log.i("下载结束");
+ }
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/BaseActivity.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/BaseActivity.java
new file mode 100644
index 0000000..7e1a4b2
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/BaseActivity.java
@@ -0,0 +1,86 @@
+package com.yutou.jianrmg_v2.basemodel.views;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.widget.LinearLayout;
+
+import com.yutou.jianrmg_v2.basemodel.R;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import Interfaces.BaseActivityInterface;
+import dalvik.system.DexClassLoader;
+
+public class BaseActivity extends AppCompatActivity {
+ private BaseActivityInterface activityInterface;
+ private LinearLayout main_layut;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_base);
+ setTitle(R.string.app_name);
+ main_layut=findViewById(R.id.main_layut);
+ String baseActivityName=getIntent().getStringExtra("activityName");
+ String jar=getIntent().getStringExtra("jar");
+ DexClassLoader dexClassLoader= AppData.plugsin.get(jar);
+ try {
+ activityInterface= (BaseActivityInterface) dexClassLoader.loadClass(baseActivityName).newInstance();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ activityInterface.onCreate(savedInstanceState,main_layut,this,getIntent());
+ }
+
+ @Override
+ protected void onRestart() {
+ activityInterface.onRestart();
+ super.onRestart();
+ }
+
+ @Override
+ protected void onPause() {
+ activityInterface.onPause();
+ super.onPause();
+ }
+
+ @Override
+ protected void onResume() {
+ activityInterface.onResume();
+ super.onResume();
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ boolean tmp=activityInterface.onKeyDown(keyCode,event);
+ if(tmp){
+ return tmp;
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ boolean tmp=activityInterface.onKeyUp(keyCode, event);
+ if(tmp) {
+ return tmp;
+ }
+ return super.onKeyUp(keyCode,event);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ boolean tmp=activityInterface.onTouchEvent(event);
+ if(tmp)
+ return tmp;
+ return super.onTouchEvent(event);
+ }
+
+ @Override
+ protected void onDestroy() {
+ activityInterface.onDestroy();
+ super.onDestroy();
+ }
+
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/LoadingActivity.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/LoadingActivity.java
new file mode 100644
index 0000000..2e0eb94
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/LoadingActivity.java
@@ -0,0 +1,255 @@
+package com.yutou.jianrmg_v2.basemodel.views;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.yutou.jianrmg_v2.basemodel.R;
+
+import org.json.JSONObject;
+
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.MGamePackname;
+import com.yutou.jianrmg_v2.basemodel.Data.SConfig;
+import com.yutou.jianrmg_v2.basemodel.Data.User;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpApi;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.basemodel.Tools.ConfigUtils;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+/**
+ * Created by 58381 on 2018/1/18.
+ */
+
+public class LoadingActivity extends AppCompatActivity {
+ private LinearLayout loginLayout;
+ private Button login,reg;
+ private TextView notlogin,uname,password;
+ private ImageView icon;
+ private Handler handler;
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_loading);
+ Utils.setImmersion(this);
+ handler=new Handler();
+ initViews();
+ initData();
+
+ }
+ private void login(String name, String pass){
+ try{
+ JSONObject json=new JSONObject();
+ json.put("uname",name);
+ json.put("pass",pass);
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.USER_LOGIN, json, new HttpInterface() {
+ @Override
+ public void httpGetData(String string, int code) {
+ try{
+ JSONObject json=new JSONObject(string);
+ if(json.getInt("code")==100){
+ AppData.user=JSON.parseObject(json.getJSONObject("data").toString(),User.class);
+ AppData.Token=json.getString("token");
+ ConfigUtils.init().save(ConfigUtils.token,AppData.Token);
+ ConfigUtils.init().save(ConfigUtils.uid,AppData.user.getId());
+ start();
+ }
+ }catch (Exception e){
+
+ }
+
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ }catch (Exception e){
+
+ }
+ }
+ private void initData(){
+ /* if(RootUtils.su()) {
+ RootUtils root = RootUtils.init(this);
+ root.exec("cp /sdcard/jianRMG/1/aaa.txt /data/data/com.huanmeng.zhanjian2/");
+ root.exec("cp /sdcard/jianRMG/1/aaa.txt /data/data/com.huanmeng.zhanjian2/files/");
+ root.exec("mkdir /data/data/com.huanmeng.zhanjian2/files/bbb/");
+ }else{
+ Log.i("获取ROOT失败");
+ }*/
+
+ initGamePackName();
+ initConfig();
+ initUser();
+
+ }
+ private void initConfig(){
+ try{
+ HttpUtils.get(HttpApi.HOME_URL + HttpApi.MG_CONFIG, new HttpInterface() {
+ @Override
+ public void httpGetData(String string, int code) {
+ try {
+ JSONObject json=new JSONObject(string);
+ if(json!=null&&json.getInt("code")==100){
+ AppData.appConfig=JSON.parseObject(json.getJSONObject("data").toString(), SConfig.class);
+ }
+ ready(1);
+ }catch (Exception e){
+
+ }
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ }catch (Exception e){
+
+ }
+ }
+ private void initGamePackName(){
+ try{
+ HttpUtils.get(HttpApi.HOME_URL + HttpApi.MOD_GAME_PACKNAME, new HttpInterface() {
+ @Override
+ public void httpGetData(String string, int code) {
+ try {
+ Log.i(HttpApi.MOD_GAME_PACKNAME,string);
+ JSONObject json=new JSONObject(string);
+ AppData.packnames= JSON.parseArray(json.getJSONArray("data").toString(), MGamePackname.class);
+ ready(1);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ }catch (Exception e){
+
+ }
+ }
+ private void initUser(){
+ try {
+ JSONObject json=new JSONObject();
+ json.put("token",AppData.Token);
+ json.put("uid",AppData.user.getId());
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.USER_TEST, json, new HttpInterface() {
+ @Override
+ public void httpGetData(String string, int code) {
+ try{
+ JSONObject json=new JSONObject(string);
+ if(json.getInt("code")==100){
+ JSONObject data=json.getJSONObject("data").getJSONObject("data");
+ AppData.user=JSON.parseObject(data.getJSONObject("user").toString(),User.class);
+ ConfigUtils.init().save(ConfigUtils.collection,data.getJSONArray("collection"));
+ }
+ }catch (Exception e){
+
+ }
+ ready(1);
+ }
+
+ @Override
+ public void httpError(Exception e) {
+ ready(1);
+ }
+ });
+ }catch (Exception e){
+
+ }
+
+ }
+ private void initViews(){
+ loginLayout=findViewById(R.id.loginLayout);
+ login=findViewById(R.id.login);
+ notlogin=findViewById(R.id.notlogin);
+ icon=findViewById(R.id.icon);
+ uname=findViewById(R.id.uname);
+ password=findViewById(R.id.password);
+
+ notlogin.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ start();
+ }
+ });
+ login.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ String name=uname.getText().toString();
+ String pass=password.getText().toString();
+ if(Utils.testStringIsNull(name,pass)){
+ Utils.toast(LoadingActivity.this,"账号/密码 不能为空");
+ return;
+ }
+ login(name,pass);
+ }
+ });
+ }
+ public void start(){
+ Intent intent=new Intent(LoadingActivity.this,MainActivity.class);
+ startActivity(intent);
+ }
+ private void showLogin(){
+ Animation iconAnim= AnimationUtils.loadAnimation(this,R.anim.loading_icon);
+ Animation loginAnim=AnimationUtils.loadAnimation(this,R.anim.loading_login);
+ iconAnim.setAnimationListener(new MyAnimListener());
+ loginAnim.setAnimationListener(new MyAnimListener());
+ icon.startAnimation(iconAnim);
+ loginLayout.setAlpha(0f);
+ loginLayout.setVisibility(View.VISIBLE);
+ loginLayout.startAnimation(loginAnim);
+
+ }
+ private class MyAnimListener implements Animation.AnimationListener{
+
+ @Override
+ public void onAnimationStart(Animation animation) {
+
+ }
+
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ loginLayout.setAlpha(1f);
+ }
+
+ @Override
+ public void onAnimationRepeat(Animation animation) {
+
+ }
+ }
+ private int readys=0;
+ private void ready(int i){
+ readys+=i;
+ if(readys==3){
+ handler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ if(Utils.testStringIsNull(AppData.Token)){
+ showLogin();
+ }else{
+ start();
+ }
+
+ }
+ },0);
+ }
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/MainActivity.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/MainActivity.java
new file mode 100644
index 0000000..d4a197f
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/MainActivity.java
@@ -0,0 +1,72 @@
+package com.yutou.jianrmg_v2.basemodel.views;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.AppCompatActivity;
+
+import com.yutou.jianrmg_v2.basemodel.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.yutou.jianrmg_v2.basemodel.Adapters.ViewPagerAdapter;
+import com.yutou.jianrmg_v2.basemodel.Fragments.GameData;
+import com.yutou.jianrmg_v2.basemodel.Fragments.Home;
+import com.yutou.jianrmg_v2.basemodel.Fragments.MGList;
+import com.yutou.jianrmg_v2.basemodel.Fragments.My;
+import com.yutou.jianrmg_v2.basemodel.Tools.ActivitysManager;
+import me.majiajie.pagerbottomtabstrip.NavigationController;
+import me.majiajie.pagerbottomtabstrip.PageNavigationView;
+import me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectedListener;
+
+public class MainActivity extends AppCompatActivity {
+
+ private PageNavigationView tab;
+ private ViewPager viewPager;
+ private NavigationController navigationController;
+ private List list;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ ActivitysManager.finishActivity(LoadingActivity.class);
+ initViews();
+ }
+
+ private void initViews() {
+ tab = findViewById(R.id.tab);
+ viewPager = findViewById(R.id.pager);
+ list=new ArrayList<>();
+ list.add(Home.init(this));
+ list.add(GameData.init(this));
+ list.add(MGList.init(this));
+ list.add(My.init());
+
+ ViewPagerAdapter adapter=new ViewPagerAdapter(getSupportFragmentManager(),list);
+ viewPager.setAdapter(adapter);
+ viewPager.setCurrentItem(0);
+ navigationController = tab.material()
+ .addItem(R.drawable.icon_home, R.drawable.icon_home_select, "主页")
+ .addItem(R.drawable.icon_data, R.drawable.icon_data_select, "数据")
+ .addItem(R.drawable.icon_mg, R.drawable.icon_mg_select, "魔改")
+ .addItem(R.drawable.icon_my, R.drawable.icon_my_select, "个人中心")
+ .build();
+ navigationController.addTabItemSelectedListener(new OnTabItemSelectedListener() {
+ @Override
+ public void onSelected(int index, int old) {
+ switch (index) {
+ }
+ viewPager.setCurrentItem(index);
+ }
+
+ @Override
+ public void onRepeat(int index) {
+
+ }
+ });
+ navigationController.setupWithViewPager(viewPager);
+ navigationController.setSelect(0);
+
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/WebActivity.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/WebActivity.java
new file mode 100644
index 0000000..19f5d64
--- /dev/null
+++ b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/WebActivity.java
@@ -0,0 +1,71 @@
+package com.yutou.jianrmg_v2.basemodel.views;
+
+import android.net.http.SslError;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+import android.webkit.SslErrorHandler;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+import com.yutou.jianrmg_v2.basemodel.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+
+
+/**
+ * Created by 58381 on 2018/3/14.
+ */
+
+public class WebActivity extends AppCompatActivity{
+ private WebView webView;
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_web);
+ initView();
+ initWeb();
+ String url=getIntent().getStringExtra("url");
+ if(url==null)
+ url="http://www.jianrmod.cn";
+ Log.i("网页URL",url);
+ webView.loadUrl(url);
+ }
+ private void initView(){
+ webView=findViewById(R.id.webView);
+ }
+ private void initWeb(){
+ WebSettings settings = webView.getSettings();
+ settings.setJavaScriptEnabled(true);
+ settings.setUseWideViewPort(true);
+ settings.setAppCacheEnabled(true);
+ settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
+ webView.setWebViewClient(new WebViewClient() {
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ view.loadUrl(url);
+ return true;
+ }
+
+ @Override
+ public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
+ super.onReceivedSslError(view, handler, error);
+ handler.proceed();
+ }
+
+ @Override
+ public void onPageFinished(WebView view, String url) {
+ super.onPageFinished(view, url);
+ Log.i("加载完成",url);
+ WebActivity.this.setTitle(view.getTitle());
+ }
+
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
+ Log.i("即将打开1" + request.getUrl());
+ return super.shouldOverrideUrlLoading(view, request);
+ }
+ });
+ }
+}
diff --git a/BaseModel/src/main/res/anim/loading_icon.xml b/BaseModel/src/main/res/anim/loading_icon.xml
new file mode 100644
index 0000000..7821fce
--- /dev/null
+++ b/BaseModel/src/main/res/anim/loading_icon.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BaseModel/src/main/res/anim/loading_login.xml b/BaseModel/src/main/res/anim/loading_login.xml
new file mode 100644
index 0000000..6a20bff
--- /dev/null
+++ b/BaseModel/src/main/res/anim/loading_login.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/BaseModel/src/main/res/menu/mod_menu.xml b/BaseModel/src/main/res/menu/mod_menu.xml
new file mode 100644
index 0000000..143b354
--- /dev/null
+++ b/BaseModel/src/main/res/menu/mod_menu.xml
@@ -0,0 +1,34 @@
+
+
\ No newline at end of file
diff --git a/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BaseModel/src/main/res/mipmap-hdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a2f5908
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/BaseModel/src/main/res/mipmap-hdpi/ic_launcher_round.png b/BaseModel/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1b52399
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/BaseModel/src/main/res/mipmap-mdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..ff10afd
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/BaseModel/src/main/res/mipmap-mdpi/ic_launcher_round.png b/BaseModel/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..115a4c7
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..dcd3cd8
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..459ca60
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..8ca12fe
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..8e19b41
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b824ebd
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..4c19a13
Binary files /dev/null and b/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/BaseModel/src/main/res/values-za-rCN/strings.xml b/BaseModel/src/main/res/values-za-rCN/strings.xml
new file mode 100644
index 0000000..f631277
--- /dev/null
+++ b/BaseModel/src/main/res/values-za-rCN/strings.xml
@@ -0,0 +1,4 @@
+
+
+ 魔改宝盒
+
\ No newline at end of file
diff --git a/BaseModel/src/main/res/values/colors.xml b/BaseModel/src/main/res/values/colors.xml
new file mode 100644
index 0000000..607204a
--- /dev/null
+++ b/BaseModel/src/main/res/values/colors.xml
@@ -0,0 +1,8 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+ #f0f0f0
+ #FFFFFF
+
diff --git a/BaseModel/src/main/res/values/dimens.xml b/BaseModel/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..59a0b0c
--- /dev/null
+++ b/BaseModel/src/main/res/values/dimens.xml
@@ -0,0 +1,3 @@
+
+ 16dp
+
diff --git a/BaseModel/src/main/res/values/strings.xml b/BaseModel/src/main/res/values/strings.xml
new file mode 100644
index 0000000..517620a
--- /dev/null
+++ b/BaseModel/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ 魔改宝盒
+ BaseActivity
+
diff --git a/BaseModel/src/main/res/values/styles.xml b/BaseModel/src/main/res/values/styles.xml
new file mode 100644
index 0000000..2b3d463
--- /dev/null
+++ b/BaseModel/src/main/res/values/styles.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameDataModel/.gitignore b/GameDataModel/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/GameDataModel/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/GameDataModel/build.gradle b/GameDataModel/build.gradle
new file mode 100644
index 0000000..a9b5e47
--- /dev/null
+++ b/GameDataModel/build.gradle
@@ -0,0 +1,37 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 26
+
+
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+ //图表
+ implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
+ implementation project(path: ':ResModl')
+}
diff --git a/GameDataModel/proguard-rules.pro b/GameDataModel/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/GameDataModel/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/GameDataModel/src/androidTest/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleInstrumentedTest.java b/GameDataModel/src/androidTest/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..101f67e
--- /dev/null
+++ b/GameDataModel/src/androidTest/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.yutou.jianrmg_v2.gamedatamodel;
+
+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 Testing documentation
+ */
+@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.gamedatamodel.test", appContext.getPackageName());
+ }
+}
diff --git a/GameDataModel/src/main/AndroidManifest.xml b/GameDataModel/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..d909699
--- /dev/null
+++ b/GameDataModel/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/GameDataModel/src/main/java/Interfaces/BaseActivityInterface.java b/GameDataModel/src/main/java/Interfaces/BaseActivityInterface.java
new file mode 100644
index 0000000..bbfc063
--- /dev/null
+++ b/GameDataModel/src/main/java/Interfaces/BaseActivityInterface.java
@@ -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;
+
+ }
+}
diff --git a/GameDataModel/src/main/java/Interfaces/BaseFragmeneInerface.java b/GameDataModel/src/main/java/Interfaces/BaseFragmeneInerface.java
new file mode 100644
index 0000000..7371265
--- /dev/null
+++ b/GameDataModel/src/main/java/Interfaces/BaseFragmeneInerface.java
@@ -0,0 +1,14 @@
+package Interfaces;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public interface BaseFragmeneInerface {
+ void init(Context context);
+ View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);
+
+}
diff --git a/GameDataModel/src/main/java/com/yutou/jianrmg_v2/gamedatamodel/MainFragmene.java b/GameDataModel/src/main/java/com/yutou/jianrmg_v2/gamedatamodel/MainFragmene.java
new file mode 100644
index 0000000..8ef3e71
--- /dev/null
+++ b/GameDataModel/src/main/java/com/yutou/jianrmg_v2/gamedatamodel/MainFragmene.java
@@ -0,0 +1,60 @@
+package com.yutou.jianrmg_v2.gamedatamodel;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.annotation.Nullable;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.github.mikephil.charting.charts.PieChart;
+import com.github.mikephil.charting.data.PieData;
+import com.github.mikephil.charting.data.PieDataSet;
+import com.github.mikephil.charting.data.PieEntry;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import Interfaces.BaseActivityInterface;
+import Interfaces.BaseFragmeneInerface;
+
+
+public class MainFragmene implements BaseFragmeneInerface {
+ private Context context;
+ @Override
+ public void init(Context context) {
+ this.context=context;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ LinearLayout view=new LinearLayout(context);
+ LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+ view.setLayoutParams(params);
+ view.setOrientation(LinearLayout.HORIZONTAL);
+ PieChart pieChart=new PieChart(context);
+ view.addView(pieChart);
+ List entries = new ArrayList<>();
+
+ entries.add(new PieEntry(120000, "弹"));
+ entries.add(new PieEntry(230000, "钢"));
+ entries.add(new PieEntry(50000, "铝"));
+ entries.add(new PieEntry(80000, "油"));
+
+ PieDataSet set = new PieDataSet(entries, "当前资源");
+ PieData data = new PieData(set);
+ pieChart.setData(data);
+ pieChart.setLayoutParams(params);
+
+ pieChart.invalidate();
+
+ return view;
+ }
+}
diff --git a/GameDataModel/src/main/res/values/strings.xml b/GameDataModel/src/main/res/values/strings.xml
new file mode 100644
index 0000000..28bb0e1
--- /dev/null
+++ b/GameDataModel/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ GameDataModel
+
diff --git a/GameDataModel/src/main/res/values/values.xml b/GameDataModel/src/main/res/values/values.xml
new file mode 100644
index 0000000..3ea04e7
--- /dev/null
+++ b/GameDataModel/src/main/res/values/values.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/GameDataModel/src/test/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleUnitTest.java b/GameDataModel/src/test/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleUnitTest.java
new file mode 100644
index 0000000..a92d967
--- /dev/null
+++ b/GameDataModel/src/test/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.yutou.jianrmg_v2.gamedatamodel;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/MgListModel/.gitignore b/MgListModel/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/MgListModel/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/MgListModel/build.gradle b/MgListModel/build.gradle
new file mode 100644
index 0000000..6b6523e
--- /dev/null
+++ b/MgListModel/build.gradle
@@ -0,0 +1,52 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 26
+
+
+
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.1'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+ //图片流缓存
+ implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
+ //FastJson
+ implementation 'com.alibaba:fastjson:1.2.41'
+ //滑动Tabs
+ implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
+ implementation 'com.ogaclejapan.smarttablayout:utils-v13:1.6.1@aar'
+ //底端菜单
+ implementation 'me.majiajie:pager-bottom-tab-strip:2.2.5'
+ //富文本编辑器
+ implementation 'com.github.louisgeek:LouisMultiLineEditText:v1.0.0'
+ //富文本
+ implementation 'com.github.limedroid:XRichText:v1.0.0'
+ //富文本
+ implementation 'com.github.limedroid:XRichText:v1.0.0'
+ compile project(path: ':BaseModel')
+ compile project(path: ':ResModl')
+ compile project(path: ':RefreshRecyclerView')
+}
diff --git a/MgListModel/proguard-rules.pro b/MgListModel/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/MgListModel/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/MgListModel/src/main/AndroidManifest.xml b/MgListModel/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..127d51d
--- /dev/null
+++ b/MgListModel/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/MgListModel/src/main/java/Interfaces/BaseActivityInterface.java b/MgListModel/src/main/java/Interfaces/BaseActivityInterface.java
new file mode 100644
index 0000000..ebfcac1
--- /dev/null
+++ b/MgListModel/src/main/java/Interfaces/BaseActivityInterface.java
@@ -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;
+
+ }
+}
diff --git a/MgListModel/src/main/java/Interfaces/BaseFragmeneInerface.java b/MgListModel/src/main/java/Interfaces/BaseFragmeneInerface.java
new file mode 100644
index 0000000..65e2eee
--- /dev/null
+++ b/MgListModel/src/main/java/Interfaces/BaseFragmeneInerface.java
@@ -0,0 +1,15 @@
+package Interfaces;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public interface BaseFragmeneInerface {
+ void init(Context context);
+ View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);
+ void setIntent();
+
+}
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModListRecyclerAdapter.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModListRecyclerAdapter.java
new file mode 100644
index 0000000..891f0f2
--- /dev/null
+++ b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModListRecyclerAdapter.java
@@ -0,0 +1,83 @@
+package com.yutou.jianrmg_v2.mglistmodel.Adapters;
+
+import android.content.Context;
+import android.content.Intent;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.MAppMg;
+import com.yutou.jianrmg_v2.basemodel.views.BaseActivity;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+
+import cn.lemon.view.adapter.BaseViewHolder;
+import cn.lemon.view.adapter.RecyclerAdapter;
+import views.Test;
+
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class ModListRecyclerAdapter extends RecyclerAdapter {
+ private ImageLoader imageLoader;
+
+ public ModListRecyclerAdapter(Context context) {
+ super(context);
+ imageLoader = Utils.initImageLoader(getContext());
+ }
+
+ @Override
+ public BaseViewHolder onCreateBaseViewHolder(ViewGroup parent, int viewType) {
+ return new CardRecordHolder(parent, R.layout.item_home);
+ }
+
+ private class CardRecordHolder extends BaseViewHolder {
+ private ImageView icon;
+ private TextView name;
+
+ public CardRecordHolder(ViewGroup parent, int layoutId) {
+ super(parent, layoutId);
+ icon = findViewById(R.id.image);
+ name = findViewById(R.id.title);
+ }
+
+ @Override
+ public void setData(MAppMg data) {
+ super.setData(data);
+ if (data.getIcon() != null && "null".equals(data.getIcon()))
+ imageLoader.displayImage(AppData.appConfig.getDownloadhome() + data.getIcon(), icon);
+ name.setText(data.getName());
+ }
+
+ @Override
+ public void onItemViewClick(MAppMg data) {
+ super.onItemViewClick(data);
+ if (data.getUrl() != null) {
+ Intent intent = new Intent(getContext(), BaseActivity.class);
+ intent.putExtra("jar", data.getUrl().split("/")[data.getUrl().split("/").length - 1]);
+ intent.putExtra("activityName", data.getMainFunction());
+ getContext().startActivity(intent);
+ return;
+ }
+ if(!AppData.RxDeBug) {
+ Intent intent = new Intent(getContext(), BaseActivity.class);
+ intent.putExtra("jar", "mglist.jar");
+ intent.putExtra("activityName", "com.yutou.jianrmg_v2.mglistmodel.ModListActivity");
+ intent.putExtra("mg", JSON.toJSONString(data));
+ getContext().startActivity(intent);
+ }else{
+ Intent intent = new Intent(getContext(), Test.class);
+ intent.putExtra("activityName", "ModListActivity");
+ intent.putExtra("mg", JSON.toJSONString(data));
+ getContext().startActivity(intent);
+ }
+
+ }
+ }
+}
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModRecyclerAdapter.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModRecyclerAdapter.java
new file mode 100644
index 0000000..b7e6e5d
--- /dev/null
+++ b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModRecyclerAdapter.java
@@ -0,0 +1,88 @@
+package com.yutou.jianrmg_v2.mglistmodel.Adapters;
+
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.widget.PopupMenu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+
+import com.alibaba.fastjson.JSON;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.TMod;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import views.ModActivity;
+
+import cn.lemon.view.adapter.BaseViewHolder;
+import cn.lemon.view.adapter.RecyclerAdapter;
+import views.Test;
+
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class ModRecyclerAdapter extends RecyclerAdapter {
+ private ImageLoader imageLoader;
+
+ public ModRecyclerAdapter(Context context) {
+ super(context);
+ imageLoader = Utils.initImageLoader(getContext());
+ }
+
+ @Override
+ public BaseViewHolder onCreateBaseViewHolder(ViewGroup parent, int viewType) {
+ return new CardRecordHolder(parent, R.layout.item_mod_item);
+ }
+
+ private class CardRecordHolder extends BaseViewHolder {
+ private ImageView icon,select;
+ private TextView title;
+ private PopupMenu menu;
+
+ public CardRecordHolder(ViewGroup parent, int layoutId) {
+ super(parent, layoutId);
+ icon = findViewById(R.id.icon);
+ title = findViewById(R.id.title);
+ select=findViewById(R.id.select);
+ menu=new PopupMenu(getContext(),select);
+ menu.inflate(R.menu.mod_menu);
+ menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ if(item.getSubMenu()!=null){
+ menu.show();
+ }
+ return true;
+ }
+ });
+ select.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ menu.show();
+ }
+ });
+ }
+
+ @Override
+ public void setData(TMod data) {
+ super.setData(data);
+ imageLoader.displayImage( AppData.appConfig.getDownloadhome()+data.getIcon(),icon);
+ title.setText(data.getTitle());
+ }
+
+ @Override
+ public void onItemViewClick(TMod data) {
+ super.onItemViewClick(data);
+ Intent intent=new Intent(getContext(), Test.class);
+ intent.putExtra("activityName","ModActivity");
+ intent.putExtra("mod", JSON.toJSONString(data));
+ getContext().startActivity(intent);
+ }
+ }
+}
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/Mod.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/Mod.java
new file mode 100644
index 0000000..7621d45
--- /dev/null
+++ b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/Mod.java
@@ -0,0 +1,156 @@
+package com.yutou.jianrmg_v2.mglistmodel.Fragments;
+
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutCompat;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.yutou.jianrmg_v2.basemodel.Data.MAppMg;
+import com.yutou.jianrmg_v2.basemodel.Data.TMod;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpApi;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.mglistmodel.Adapters.ModRecyclerAdapter;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.lemon.view.RefreshRecyclerView;
+import cn.lemon.view.adapter.Action;
+
+/**
+ * Created by 58381 on 2018/1/25.
+ */
+
+public class Mod extends Fragment {
+ private static Mod mod;
+ private MAppMg mgList;
+ private RefreshRecyclerView recyclerView;
+ private ModRecyclerAdapter adapter;
+ private List datas;
+ private int min=0, max=10;
+ private boolean isInit=true;
+ private Handler handler;
+ private View view;
+ public static Mod init(MAppMg mgList){
+ if(mod==null){
+ mod=new Mod();
+ }
+ Log.i("mod",(mgList==null)+"");
+ if(mgList!=null)
+ Log.i("mod",mgList.getName());
+ mod.setActivity(mgList);
+ return mod;
+ }
+ private void setActivity(MAppMg mgList){
+ this.mgList=mgList;
+ }
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ view=inflater.inflate(R.layout.fragment_mg,null);
+ handler=new Handler();
+ initViews();
+ return view;
+ }
+ public void initViews(){
+ recyclerView=view.findViewById(R.id.recyclerView);
+ recyclerView.setSwipeRefreshColors(0xFF437845,0xFFE44F98,0xFF2FAC21);
+ recyclerView.setLayoutManager(new GridLayoutManager(getContext(),3));
+ adapter=new ModRecyclerAdapter(getContext());
+ TextView endText=new TextView(getContext());
+ endText.setLayoutParams(new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Utils.getPixelsFromDp(getActivity(),48)));
+ endText.setTextSize(16);
+ endText.setGravity(Gravity.CENTER);
+ endText.setText(" --已经没有了--");
+ adapter.setFooter(endText);
+ recyclerView.setAdapter(adapter);
+ recyclerView.setRefreshAction(new Action() {
+ @Override
+ public void onAction() {
+ min=0;
+ max=10;
+ isInit=true;
+ initData();
+ }
+ });
+ recyclerView.setLoadMoreAction(new Action() {
+ @Override
+ public void onAction() {
+ if(isInit){
+ recyclerView.showNoMore();
+ }else {
+ min = max;
+ max += 10;
+ initData();
+ }
+ }
+ });
+ recyclerView.showSwipeRefresh();
+ initData();
+ }
+ private void initData(){
+ try {
+ datas=new ArrayList<>();
+ Log.i("载入数据");
+ JSONObject json=new JSONObject();
+ json.put("min_str",min);
+ json.put("max_str",max);
+ if(mgList.getIndexs()>3)
+ json.put("jType",mgList.getIndexs());
+ else
+ json.put("mType",mgList.getIndexs());
+ final String url=mgList.getIndexs()==0? HttpApi.MOD_ALL:HttpApi.MOD_TYPE;
+ HttpUtils.post(HttpApi.HOME_URL + url, json, new HttpInterface() {
+ @Override
+ public void httpError(Exception e) {
+
+ }
+
+ @Override
+ public void httpGetData(String string, int code) {
+ Log.i(url,string);
+ try{
+ JSONObject json=new JSONObject(string);
+ if(json.getInt("code")==100){
+ datas= Utils.ListRemoveNull(JSON.parseArray(json.getString("data"), TMod.class));
+ }
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ setData();
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ private void setData(){
+ if(isInit){
+ adapter.clear();
+ adapter.addAll(datas);
+ recyclerView.getRecyclerView().scrollToPosition(0);
+ }else{
+ adapter.addAll(datas);
+ }
+ recyclerView.dismissSwipeRefresh();
+ }
+}
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/TestMod.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/TestMod.java
new file mode 100644
index 0000000..8719e2d
--- /dev/null
+++ b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/TestMod.java
@@ -0,0 +1,39 @@
+package com.yutou.jianrmg_v2.mglistmodel.Fragments;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+public class TestMod extends Fragment {
+ private static TestMod test;
+ private Activity activity;
+
+ public static TestMod init(Activity activity){
+ if(test==null){
+ test=new TestMod();
+ }
+ return test;
+ }
+
+ private void setActivity(Activity activity) {
+ this.activity = activity;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ TextView textView=new TextView(getContext());
+ textView.setLayoutParams(params);
+ textView.setGravity(Gravity.CENTER);
+ textView.setText("Hello World");
+ return textView;
+ }
+}
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/MainFragments.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/MainFragments.java
new file mode 100644
index 0000000..6f37e8d
--- /dev/null
+++ b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/MainFragments.java
@@ -0,0 +1,146 @@
+package com.yutou.jianrmg_v2.mglistmodel;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutCompat;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSON;
+
+import com.yutou.jianrmg_v2.basemodel.Data.MAppMg;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpApi;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.mglistmodel.Adapters.ModListRecyclerAdapter;
+import com.yutou.jianrmg_v2.resmodl.R;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import Interfaces.BaseFragmeneInerface;
+import cn.lemon.view.RefreshRecyclerView;
+import cn.lemon.view.adapter.Action;
+
+public class MainFragments implements BaseFragmeneInerface {
+ private RefreshRecyclerView recyclerView;
+ private ModListRecyclerAdapter adapter;
+ private List datas;
+ private int min=0, max=10;
+ private boolean isInit=true;
+ private Handler handler;
+ private View view;
+ private Context context;
+ @Override
+ public void init(Context context) {
+ this.context=context;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ if(view!=null)
+ return view;
+ view=inflater.inflate(R.layout.fragment_mg,null);
+ handler=new Handler();
+ initView(view);
+ return view;
+ }
+
+ @Override
+ public void setIntent() {
+
+ }
+ private void initView(View view){
+ recyclerView=view.findViewById(R.id.recyclerView);
+ recyclerView.setSwipeRefreshColors(0xFF437845,0xFFE44F98,0xFF2FAC21);
+ recyclerView.setLayoutManager(new GridLayoutManager(context,3));
+ adapter=new ModListRecyclerAdapter(context);
+ TextView endText=new TextView(context);
+ endText.setLayoutParams(new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Utils.getPixelsFromDp(((Activity)context),48)));
+ endText.setTextSize(16);
+ endText.setGravity(Gravity.CENTER);
+ endText.setText(" --已经没有了--");
+ adapter.setFooter(endText);
+ recyclerView.setAdapter(adapter);
+ recyclerView.setRefreshAction(new Action() {
+ @Override
+ public void onAction() {
+ min=0;
+ max=10;
+ isInit=true;
+ initData();
+ }
+ });
+ recyclerView.setLoadMoreAction(new Action() {
+ @Override
+ public void onAction() {
+ if(isInit){
+ recyclerView.showNoMore();
+ }else {
+ min = max;
+ max += 10;
+ initData();
+ }
+ }
+ });
+ recyclerView.showSwipeRefresh();
+ initData();
+ }
+ private void initData(){
+ try {
+ datas=new ArrayList<>();
+ Log.i("载入数据");
+ JSONObject json=new JSONObject();
+ json.put("min",min);
+ json.put("max",max);
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.MG_MG_LIST, json, new HttpInterface() {
+ @Override
+ public void httpError(Exception e) {
+
+ }
+
+ @Override
+ public void httpGetData(String string, int code) {
+ Log.i(HttpApi.MG_MG_LIST,string);
+ try{
+ JSONObject json=new JSONObject(string);
+ if(json.getInt("code")==100){
+ datas= JSON.parseArray(json.getString("data"), MAppMg.class);
+ }
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ setData();
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ });
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ private void setData(){
+ if(datas.size()>0){
+ adapter.clear();
+ adapter.addAll(datas);
+ recyclerView.dismissSwipeRefresh();
+ recyclerView.getRecyclerView().scrollToPosition(0);
+ }else{
+ adapter.addAll(datas);
+ }
+ }
+}
diff --git a/MgListModel/src/main/java/views/ModActivity.java b/MgListModel/src/main/java/views/ModActivity.java
new file mode 100644
index 0000000..1847d35
--- /dev/null
+++ b/MgListModel/src/main/java/views/ModActivity.java
@@ -0,0 +1,317 @@
+package views;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.basemodel.Data.AppData;
+import com.yutou.jianrmg_v2.basemodel.Data.TMod;
+import com.yutou.jianrmg_v2.basemodel.Data.TModtag;
+import com.yutou.jianrmg_v2.basemodel.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpApi;
+import com.yutou.jianrmg_v2.basemodel.Network.HttpUtils;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+import com.yutou.jianrmg_v2.basemodel.Tools.ModUtils;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import Interfaces.BaseActivityInterface;
+import cn.droidlover.xrichtext.XRichText;
+
+
+/**
+ * Created by 58381 on 2018/1/26.
+ */
+
+public class ModActivity implements BaseActivityInterface {
+ private TMod tMod;
+ private ImageView modImage, icon, collection_img;
+ private TextView title, by, downloadText;
+ private XRichText richText;
+ private LinearLayout tagsLayout;
+ private FrameLayout collection, share, download;
+ private ListView quote;
+
+ private ImageLoader imageLoader;
+ private Handler handler;
+ private ModUtils modUtils;
+
+ private List remods;
+ private LinearLayout mainLayot;
+ private Context context;
+ private Intent intent;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState, LinearLayout layout, Context context,Intent intent) {
+ layout.addView(LayoutInflater.from(context).inflate(R.layout.activity_mod, null));
+ mainLayot = layout;
+ this.context=context;
+ tMod = JSON.parseObject(intent.getStringExtra("mod"), TMod.class);
+
+ imageLoader = Utils.initImageLoader(context);
+ handler = new Handler();
+ modUtils = ModUtils.init(context);
+ modUtils.setMod(tMod);
+ initViews();
+ initData(tMod);
+ initTags(tMod.getId());
+ getRemod();
+ }
+
+ @Override
+ public void onRestart() {
+
+ }
+
+ @Override
+ public void onResume() {
+
+ }
+
+ @Override
+ public void onPause() {
+
+ }
+
+ @Override
+ public void onDestroy() {
+
+ }
+
+ @Override
+ public void getIntent(Intent intent) {
+ this.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;
+ }
+
+ private void initViews() {
+ modImage = mainLayot.findViewById(R.id.ModImage);
+ icon = mainLayot.findViewById(R.id.icon);
+ collection_img = mainLayot.findViewById(R.id.collection_img);
+ title = mainLayot.findViewById(R.id.title);
+ by = mainLayot.findViewById(R.id.by);
+ richText =mainLayot.findViewById(R.id.richText);
+ tagsLayout = mainLayot.findViewById(R.id.tags);
+ collection = mainLayot.findViewById(R.id.collection);
+ share = mainLayot.findViewById(R.id.share);
+ download = mainLayot.findViewById(R.id.download);
+ downloadText = download.findViewById(R.id.downloadText);
+ quote = mainLayot.findViewById(R.id.quote);
+ }
+
+ private void initData(final TMod tMod) {
+ imageLoader.displayImage(AppData.appConfig.getDownloadhome() + tMod.getImage(), modImage);
+ imageLoader.displayImage(AppData.appConfig.getDownloadhome() + tMod.getIcon(), icon);
+ title.setText(tMod.getTitle());
+ by.setText("@" + tMod.getByuser());
+ richText.text(tMod.getInfo());
+ downloadText.setTag(0);
+ if (ModUtils.getModPath(tMod).listFiles().length > 0) {
+ downloadText.setText("安装");
+ downloadText.setTag(2);
+ }
+ if(ModUtils.isInstallMod(tMod)){
+ downloadText.setText("还原");
+ downloadText.setTag(1);
+ }
+ download.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ downloadButtonClick();
+ }
+ });
+ collection.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (Utils.testStringIsNull(AppData.Token)) {
+ Utils.toast(context, "登录状态未知,请登录哦");
+ return;
+ }
+ try {
+ JSONObject json = new JSONObject();
+ json.put("uid", AppData.user.getId());
+ json.put("mid", tMod.getId() + "");
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.MOD_COLLCETION, json, new HttpInterface() {
+ private String state = "收藏失败,未知错误";
+
+ @Override
+ public void httpGetData(String string, int code) {
+
+ try {
+ JSONObject json = new JSONObject(string);
+ if (json.getInt("code") == 100) {
+ switch (json.getInt("data")) {
+ case 0:
+ state = "收藏失败";
+ break;
+ case 1:
+ state = "收藏成功";
+ break;
+ case -1:
+ state = "提督您已经收藏过了哦";
+ break;
+ }
+ }
+ } catch (Exception e) {
+
+ }
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (state.equals("收藏成功")) {
+ collection_img.setImageResource(R.drawable.icon_collection_ok);
+ }
+ Utils.toast(context, state);
+ }
+ });
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ } catch (Exception e) {
+
+ }
+ }
+ });
+
+ }
+
+ private void getRemod() {
+ remods = new ArrayList<>();
+ try {
+ JSONObject json = new JSONObject();
+ json.put("mid", tMod.getId());
+ json.put("remid", tMod.getRemod());
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.MOD_REMOD, json, new HttpInterface() {
+ @Override
+ public void httpGetData(String string, int code) {
+ try {
+ JSONObject json = new JSONObject(string);
+ if (json.getInt("code") == 100) {
+ remods = JSON.parseArray(json.getJSONArray("data").toString(), TMod.class);
+ }
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ ReModListAdapter adapter = new ReModListAdapter(context, remods);
+ quote.setAdapter(adapter);
+ }
+ });
+ } catch (Exception e) {
+
+ }
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ } catch (Exception e) {
+
+ }
+ }
+
+ private void downloadButtonClick() {
+ switch (((int) downloadText.getTag())) {
+ case -1:
+
+ break;
+ case 1:
+ modUtils.reBackMod(tMod);
+ break;
+ case 0:
+ case 2:
+ modUtils.installMod(tMod);
+ break;
+ }
+ }
+
+ private void initTags(int mid) {
+ try {
+ JSONObject json = new JSONObject();
+ json.put("mid", mid);
+ HttpUtils.post(HttpApi.HOME_URL + HttpApi.MOD_TAG, json, new HttpInterface() {
+ List tags;
+
+ @Override
+ public void httpGetData(String string, int code) {
+ Log.i(HttpApi.MOD_TAG, string);
+ try {
+ JSONObject json = new JSONObject(string);
+ if (json.getInt("code") == 100) {
+ tags = JSON.parseArray(json.getJSONArray("data").toString(), TModtag.class);
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ for (TModtag tag : tags) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(Utils.getPixelsFromDp(((Activity)context), 50), Utils.getPixelsFromDp(((Activity)context), 15));
+ params.setMargins(Utils.getPixelsFromDp(((Activity)context), 10), 0, 0, 0);
+ Button button = new Button(context);
+ button.setText(tag.getTag());
+ button.setTextSize(8);
+ button.setBackgroundResource(R.drawable.frame_button);
+ button.setLayoutParams(params);
+ tagsLayout.addView(button);
+ }
+
+ }
+ });
+ }
+ } catch (Exception e) {
+
+ }
+ }
+
+ @Override
+ public void httpError(Exception e) {
+
+ }
+ });
+ } catch (Exception e) {
+
+ }
+ }
+}
diff --git a/MgListModel/src/main/java/views/ModListActivity.java b/MgListModel/src/main/java/views/ModListActivity.java
new file mode 100644
index 0000000..2096293
--- /dev/null
+++ b/MgListModel/src/main/java/views/ModListActivity.java
@@ -0,0 +1,136 @@
+package views;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.AppCompatActivity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.yutou.jianrmg_v2.basemodel.Adapters.ViewPagerAdapter;
+import com.yutou.jianrmg_v2.basemodel.Data.MAppMg;
+import com.yutou.jianrmg_v2.mglistmodel.Fragments.Mod;
+import com.yutou.jianrmg_v2.mglistmodel.Fragments.TestMod;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Log;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import Interfaces.BaseActivityInterface;
+import me.majiajie.pagerbottomtabstrip.NavigationController;
+import me.majiajie.pagerbottomtabstrip.PageNavigationView;
+import me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectedListener;
+
+/**
+ * Created by 58381 on 2018/1/25.
+ */
+
+public class ModListActivity implements BaseActivityInterface {
+ private PageNavigationView tab;
+ private ViewPager viewPager;
+ private NavigationController navigationController;
+ private List list;
+ private MAppMg appMg;
+ private LinearLayout mainView;
+ private Context context;
+ private Intent intent;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState, LinearLayout layout, Context context,Intent intent) {
+ layout.addView(LayoutInflater.from(context).inflate(R.layout.activity_mod_list,null));
+ mainView=layout;
+ this.context=context;
+ appMg= JSON.parseObject(intent.getStringExtra("mg"),MAppMg.class);
+ Log.i("接受到的魔改:"+appMg.toString());
+ initViews();
+ }
+ private void initViews() {
+ tab = mainView.findViewById(R.id.tab);
+ viewPager = mainView.findViewById(R.id.pager);
+ list=new ArrayList<>();
+ list.add(Mod.init(appMg));
+ list.add(new TestMod());
+ list.add(new TestMod());
+ ViewPagerAdapter adapter=new ViewPagerAdapter(((AppCompatActivity)context).getSupportFragmentManager(),list);
+ viewPager.setAdapter(adapter);
+ viewPager.setCurrentItem(0);
+ navigationController = tab.material()
+ .addItem(R.drawable.icon_mod_new, "最新")
+ .addItem(R.drawable.icon_mod_lh,"仅立绘")
+ .addItem(R.drawable.icon_mod_q,"仅Q版")
+ .build();
+ navigationController.addTabItemSelectedListener(new OnTabItemSelectedListener() {
+ @Override
+ public void onSelected(int index, int old) {
+ switch (index) {
+ }
+ viewPager.setCurrentItem(index);
+ }
+
+ @Override
+ public void onRepeat(int index) {
+
+ }
+ });
+ navigationController.setupWithViewPager(viewPager);
+ navigationController.setSelect(0);
+
+ }
+
+ @Override
+ public void onRestart() {
+
+ }
+
+ @Override
+ public void onResume() {
+
+ }
+
+ @Override
+ public void onPause() {
+
+ }
+
+ @Override
+ public void onDestroy() {
+
+ }
+
+ @Override
+ public void getIntent(Intent intent) {
+ this.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;
+ }
+}
diff --git a/MgListModel/src/main/java/views/ReModListAdapter.java b/MgListModel/src/main/java/views/ReModListAdapter.java
new file mode 100644
index 0000000..9f8f3e3
--- /dev/null
+++ b/MgListModel/src/main/java/views/ReModListAdapter.java
@@ -0,0 +1,83 @@
+package views;
+
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.nostra13.universalimageloader.core.ImageLoader;
+import com.yutou.jianrmg_v2.basemodel.Data.TMod;
+import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+
+
+import java.util.List;
+
+
+/**
+ * Created by 58381 on 2018/2/14.
+ */
+
+public class ReModListAdapter extends BaseAdapter {
+ private Context context;
+ private ImageLoader imageLoader;
+ private List list;
+
+ public ReModListAdapter(Context context,List list) {
+ this.list = list;
+ this.context=context;
+ imageLoader= Utils.initImageLoader(context);
+ }
+
+ @Override
+ public int getCount() {
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int i) {
+ return list.get(i);
+ }
+
+ @Override
+ public long getItemId(int i) {
+ return i;
+ }
+
+ @Override
+ public View getView(final int i, View view, ViewGroup viewGroup) {
+ Items items;
+ if(view==null){
+ view= LayoutInflater.from(context).inflate(R.layout.item_remod,null);
+ items=new Items();
+ items.title=view.findViewById(R.id.title);
+ items.info=view.findViewById(R.id.info);
+ items.icon=view.findViewById(R.id.icon);
+ view.setTag(items);
+ }else{
+ items= (Items) view.getTag();
+ }
+ items.title.setText(list.get(i).getTitle());
+ items.info.setText(list.get(i).getOverview());
+ imageLoader.displayImage(list.get(i).getIcon(),items.icon);
+ view.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent=new Intent(context, Test.class);
+ intent.putExtra("activityName","ModActivity");
+ intent.putExtra("mod", JSON.toJSONString(list.get(i)));
+ context.startActivity(intent);
+ }
+ });
+ return view;
+ }
+ private class Items{
+ private ImageView icon;
+ private TextView title,info;
+ }
+}
diff --git a/MgListModel/src/main/java/views/Test.java b/MgListModel/src/main/java/views/Test.java
new file mode 100644
index 0000000..c3a244e
--- /dev/null
+++ b/MgListModel/src/main/java/views/Test.java
@@ -0,0 +1,92 @@
+package views;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.widget.LinearLayout;
+
+import com.yutou.jianrmg_v2.resmodl.R;
+
+import Interfaces.BaseActivityInterface;
+
+public class Test extends AppCompatActivity {
+ private BaseActivityInterface activityInterface;
+ private LinearLayout main_layut;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_base);
+ main_layut = findViewById(R.id.main_layut);
+ String baseActivityName=getIntent().getStringExtra("activityName");
+ try {
+ switch (baseActivityName){
+ case "ModListActivity":
+ activityInterface = new ModListActivity();
+ break;
+ case "ModActivity":
+ activityInterface = new ModActivity();
+ break;
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ activityInterface.onCreate(savedInstanceState, main_layut, this, getIntent());
+
+ }
+
+ @Override
+ protected void onRestart() {
+ activityInterface.onRestart();
+ super.onRestart();
+ }
+
+ @Override
+ protected void onPause() {
+ activityInterface.onPause();
+ super.onPause();
+ }
+
+ @Override
+ protected void onResume() {
+ activityInterface.onResume();
+ super.onResume();
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ boolean tmp = activityInterface.onKeyDown(keyCode, event);
+ if (tmp) {
+ return tmp;
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ boolean tmp = activityInterface.onKeyUp(keyCode, event);
+ if (tmp) {
+ return tmp;
+ }
+ return super.onKeyUp(keyCode, event);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ boolean tmp = activityInterface.onTouchEvent(event);
+ if (tmp)
+ return tmp;
+ return super.onTouchEvent(event);
+ }
+
+ @Override
+ protected void onDestroy() {
+ activityInterface.onDestroy();
+ super.onDestroy();
+ }
+
+}
diff --git a/MgListModel/src/main/res/values/strings.xml b/MgListModel/src/main/res/values/strings.xml
new file mode 100644
index 0000000..4bb9dbe
--- /dev/null
+++ b/MgListModel/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ MgListModel
+
diff --git a/RefreshRecyclerView/.gitignore b/RefreshRecyclerView/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/RefreshRecyclerView/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/RefreshRecyclerView/build.gradle b/RefreshRecyclerView/build.gradle
new file mode 100644
index 0000000..eb4902b
--- /dev/null
+++ b/RefreshRecyclerView/build.gradle
@@ -0,0 +1,49 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion '27.0.3'
+
+ defaultConfig {
+ minSdkVersion 16
+ targetSdkVersion 26
+ versionCode 5
+ versionName "1.2.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile 'com.android.support:recyclerview-v7:26+'
+}
+
+ext {
+ bintrayRepo = 'maven'
+ bintrayName = 'refresh-recycler-view' //bintray上的项目名
+
+ publishedGroupId = 'cn.lemon'
+ artifact = 'RefreshRecyclerView'
+ libraryVersion = '1.2.0'
+
+ siteUrl = 'https://github.com/llxdaxia/RefreshRecyclerView'
+ gitUrl = 'https://github.com/llxdaxia/RefreshRecyclerView.git'
+
+ libraryName = 'RefreshRecyclerView' //项目名字,没什么用
+ libraryDescription = 'A pull refresh , push load more data for RecyclerView' //项目描述,没什么用
+
+ developerId = 'Lemon'
+ developerName = 'Lemon'
+ developerEmail = 'daxiallx@gmail.com'
+
+ licenseName = 'The Apache Software License, Version 2.0'
+ licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ allLicenses = ["Apache-2.0"]
+}
+
+//apply from: 'https://raw.githubusercontent.com/llxdaxia/GradleScript/master/install_v1.gradle'
+//apply from: 'https://raw.githubusercontent.com/llxdaxia/GradleScript/master/bintray_v1.gradle'
\ No newline at end of file
diff --git a/RefreshRecyclerView/proguard-rules.pro b/RefreshRecyclerView/proguard-rules.pro
new file mode 100644
index 0000000..4b7fd74
--- /dev/null
+++ b/RefreshRecyclerView/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in F:\SoftWare\android-sdk-windows/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/RefreshRecyclerView/src/main/AndroidManifest.xml b/RefreshRecyclerView/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..d1fcf13
--- /dev/null
+++ b/RefreshRecyclerView/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/RefreshRecyclerView/src/main/java/cn/lemon/view/RefreshRecyclerView.java b/RefreshRecyclerView/src/main/java/cn/lemon/view/RefreshRecyclerView.java
new file mode 100644
index 0000000..3729514
--- /dev/null
+++ b/RefreshRecyclerView/src/main/java/cn/lemon/view/RefreshRecyclerView.java
@@ -0,0 +1,137 @@
+package cn.lemon.view;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.support.annotation.ColorInt;
+import android.support.annotation.ColorRes;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.TextView;
+
+import cn.lemon.view.adapter.Action;
+import cn.lemon.view.adapter.RecyclerAdapter;
+
+
+/**
+ * Created by linlongxin on 2016/1/24.
+ */
+public class RefreshRecyclerView extends FrameLayout {
+
+ private final String TAG = "RefreshRecyclerView";
+ private SwipeRefreshLayout mSwipeRefreshLayout;
+ private RecyclerView mRecyclerView;
+ private RecyclerAdapter mAdapter;
+ private boolean loadMoreAble;
+
+ public RefreshRecyclerView(Context context) {
+ this(context, null);
+ }
+
+ public RefreshRecyclerView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public RefreshRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ View view = inflate(context, R.layout.view_refresh_recycler, this);
+ mRecyclerView = view.findViewById(cn.lemon.view.R.id.recycler_view);
+ mSwipeRefreshLayout = view.findViewById(R.id.refresh_layout);
+ TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RefreshRecyclerView);
+ boolean refreshAble = typedArray.getBoolean(R.styleable.RefreshRecyclerView_refresh_able, true);
+ loadMoreAble = typedArray.getBoolean(R.styleable.RefreshRecyclerView_load_more_able, true);
+ if (!refreshAble) {
+ mSwipeRefreshLayout.setEnabled(false);
+ }
+ }
+
+ public void setAdapter(RecyclerAdapter adapter) {
+ mRecyclerView.setAdapter(adapter);
+ mAdapter = adapter;
+ mAdapter.loadMoreAble = loadMoreAble;
+ }
+
+ public void setLayoutManager(final RecyclerView.LayoutManager layoutManager) {
+ mRecyclerView.setLayoutManager(layoutManager);
+ if (layoutManager instanceof GridLayoutManager) {
+ ((GridLayoutManager) layoutManager).setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
+ @Override
+ public int getSpanSize(int position) {
+ int type = mAdapter.getItemViewType(position);
+ if (type == RecyclerAdapter.HEADER_TYPE
+ || type == RecyclerAdapter.FOOTER_TYPE
+ || type == RecyclerAdapter.STATUS_TYPE) {
+ return ((GridLayoutManager) layoutManager).getSpanCount();
+ } else {
+ return 1;
+ }
+ }
+ });
+ }
+ }
+
+ public void setRefreshAction(final Action action) {
+ mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+ @Override
+ public void onRefresh() {
+ action.onAction();
+ }
+ });
+ }
+
+ public void setLoadMoreAction(final Action action) {
+ Log.d(TAG, "setLoadMoreAction");
+ if (mAdapter.isShowNoMore || !loadMoreAble) {
+ return;
+ }
+ mAdapter.loadMoreAble = true;
+ mAdapter.setLoadMoreAction(action);
+ }
+
+ public void showNoMore() {
+ mAdapter.showNoMore();
+ }
+
+ public void setItemSpace(int left, int top, int right, int bottom) {
+ mRecyclerView.addItemDecoration(new SpaceItemDecoration(left, top, right, bottom));
+ }
+
+ public void addItemDecoration(RecyclerView.ItemDecoration itemDecoration) {
+ mRecyclerView.addItemDecoration(itemDecoration);
+ }
+
+ public RecyclerView getRecyclerView() {
+ return mRecyclerView;
+ }
+
+ public SwipeRefreshLayout getSwipeRefreshLayout() {
+ return mSwipeRefreshLayout;
+ }
+
+ public TextView getNoMoreView() {
+ return mAdapter.mNoMoreView;
+ }
+
+ public void setSwipeRefreshColorsFromRes(@ColorRes int... colors) {
+ mSwipeRefreshLayout.setColorSchemeResources(colors);
+ }
+
+ /**
+ * 8位16进制数 ARGB
+ */
+ public void setSwipeRefreshColors(@ColorInt int... colors) {
+ mSwipeRefreshLayout.setColorSchemeColors(colors);
+ }
+
+ public void showSwipeRefresh() {
+ mSwipeRefreshLayout.setRefreshing(true);
+ }
+
+ public void dismissSwipeRefresh() {
+ mSwipeRefreshLayout.setRefreshing(false);
+ }
+}
diff --git a/RefreshRecyclerView/src/main/java/cn/lemon/view/SpaceItemDecoration.java b/RefreshRecyclerView/src/main/java/cn/lemon/view/SpaceItemDecoration.java
new file mode 100644
index 0000000..3dff85d
--- /dev/null
+++ b/RefreshRecyclerView/src/main/java/cn/lemon/view/SpaceItemDecoration.java
@@ -0,0 +1,31 @@
+package cn.lemon.view;
+
+import android.graphics.Rect;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+/**
+ * Created by linlongxin on 2015/12/19.
+ */
+
+public class SpaceItemDecoration extends RecyclerView.ItemDecoration {
+
+ private int top;
+ private int left;
+ private int right;
+ private int bottom;
+
+ public SpaceItemDecoration(int left, int top, int right, int bottom) {
+ this.left = left;
+ this.top = top;
+ this.right = right;
+ this.bottom = bottom;
+ }
+
+ @Override
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+ outRect.left = left;
+ outRect.top = top;
+ outRect.right = right;
+ outRect.bottom = bottom;
+ }
+}
diff --git a/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/Action.java b/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/Action.java
new file mode 100644
index 0000000..31ca508
--- /dev/null
+++ b/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/Action.java
@@ -0,0 +1,8 @@
+package cn.lemon.view.adapter;
+
+/**
+ * Created by linlongxin on 2016/1/25.
+ */
+public interface Action {
+ void onAction();
+}
diff --git a/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/BaseViewHolder.java b/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/BaseViewHolder.java
new file mode 100644
index 0000000..a04b9ec
--- /dev/null
+++ b/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/BaseViewHolder.java
@@ -0,0 +1,51 @@
+package cn.lemon.view.adapter;
+
+import android.support.annotation.IdRes;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * BaseViewHolder 顶级父类
+ * Created by linlongxin on 2015/12/19.
+ */
+public class BaseViewHolder extends RecyclerView.ViewHolder{
+
+ private final String TAG = "BaseViewHolder";
+
+ public BaseViewHolder(View itemView) {
+ super(itemView);
+ }
+
+ public BaseViewHolder(ViewGroup parent, int layoutId) {
+ super(LayoutInflater.from(parent.getContext()).inflate(layoutId, parent, false));
+ onInitializeView();
+ }
+
+ public void onInitializeView() {
+
+ }
+
+ public T findViewById(@IdRes int resId) {
+ return (T) itemView.findViewById(resId);
+ }
+
+ public void setData(final T data) {
+ itemView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ onItemViewClick(data);
+ }
+ });
+ }
+
+ public void onItemViewClick(T data) {
+
+ }
+
+ public void setTag(Object tag){
+ itemView.setTag(tag);
+ }
+
+}
diff --git a/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/MultiTypeAdapter.java b/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/MultiTypeAdapter.java
new file mode 100644
index 0000000..8548afb
--- /dev/null
+++ b/RefreshRecyclerView/src/main/java/cn/lemon/view/adapter/MultiTypeAdapter.java
@@ -0,0 +1,144 @@
+package cn.lemon.view.adapter;
+
+import android.content.Context;
+import android.util.Log;
+import android.util.SparseIntArray;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 复杂的数据类型列表 Adapter , 没有 Header , Footer 的概念,所有的 item 都对应一个 ViewHolder
+ * Created by linlongxin on 2016/8/22.
+ */
+
+public class MultiTypeAdapter extends RecyclerAdapter {
+
+ private final String TAG = "MultiTypeAdapter";
+ private List