diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index da7a4db..d5e8084 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index e28dbd3..be86ad0 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -8,13 +8,7 @@
diff --git a/.idea/misc.xml b/.idea/misc.xml
index c0f68ed..99202cc 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 766765a..dbf27ef 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,13 +2,7 @@
-
-
-
-
-
-
diff --git a/AppHome/.gitignore b/AppHome/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/AppHome/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/AppHome/build.gradle b/AppHome/build.gradle
deleted file mode 100644
index a15486e..0000000
--- a/AppHome/build.gradle
+++ /dev/null
@@ -1,47 +0,0 @@
-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'
- implementation 'com.android.support:recyclerview-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'
-
- api project(path: ':BaseModel')
- api project(path: ':ResModl')
- api project(path: ':RefreshRecyclerView')
-}
diff --git a/AppHome/proguard-rules.pro b/AppHome/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/AppHome/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
deleted file mode 100644
index 278ada6..0000000
--- a/AppHome/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/AppHome/src/main/java/Interfaces/BaseActivityInterface.java b/AppHome/src/main/java/Interfaces/BaseActivityInterface.java
deleted file mode 100644
index bbfc063..0000000
--- a/AppHome/src/main/java/Interfaces/BaseActivityInterface.java
+++ /dev/null
@@ -1,31 +0,0 @@
-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
deleted file mode 100644
index 65e2eee..0000000
--- a/AppHome/src/main/java/Interfaces/BaseFragmeneInerface.java
+++ /dev/null
@@ -1,15 +0,0 @@
-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
deleted file mode 100644
index b643aab..0000000
--- a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Adapters/HomeRecyclerAdapter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-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/MainFragmene.java b/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/MainFragmene.java
deleted file mode 100644
index 33dd04f..0000000
--- a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/MainFragmene.java
+++ /dev/null
@@ -1,249 +0,0 @@
-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
deleted file mode 100644
index bf86693..0000000
--- a/AppHome/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- AppHome
-
diff --git a/BaseModel/.gitignore b/BaseModel/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/BaseModel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/BaseModel/build.gradle b/BaseModel/build.gradle
deleted file mode 100644
index 5a7732b..0000000
--- a/BaseModel/build.gradle
+++ /dev/null
@@ -1,70 +0,0 @@
-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')
- api project(path: ':ResModl')
-}
diff --git a/BaseModel/proguard-rules.pro b/BaseModel/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/BaseModel/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
deleted file mode 100644
index 3038acb..0000000
--- a/BaseModel/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/BaseModel/src/main/java/Interfaces/BaseActivityInterface.java b/BaseModel/src/main/java/Interfaces/BaseActivityInterface.java
deleted file mode 100644
index bbfc063..0000000
--- a/BaseModel/src/main/java/Interfaces/BaseActivityInterface.java
+++ /dev/null
@@ -1,31 +0,0 @@
-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
deleted file mode 100644
index 65e2eee..0000000
--- a/BaseModel/src/main/java/Interfaces/BaseFragmeneInerface.java
+++ /dev/null
@@ -1,15 +0,0 @@
-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
deleted file mode 100644
index e1d4571..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/MyItemGridViewAdapter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-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/Data/MAppHome.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppHome.java
deleted file mode 100644
index dd071b1..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppHome.java
+++ /dev/null
@@ -1,120 +0,0 @@
-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/Fragments/GameData.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/GameData.java
deleted file mode 100644
index 928bef3..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/GameData.java
+++ /dev/null
@@ -1,90 +0,0 @@
-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
deleted file mode 100644
index 64d88ba..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/Home.java
+++ /dev/null
@@ -1,77 +0,0 @@
-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
deleted file mode 100644
index 463eff2..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/MGList.java
+++ /dev/null
@@ -1,75 +0,0 @@
-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
deleted file mode 100644
index 13a9587..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Fragments/My.java
+++ /dev/null
@@ -1,92 +0,0 @@
-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.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.Log;
-import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import Interfaces.BaseFragmeneInerface;
-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;
- private BaseFragmeneInerface baseFragmeneInerface;
- public static My init(Activity activity){
- if(my==null){
- my=new My();
- }
- return my;
- }
- public My(){
- try {
- this.baseFragmeneInerface = (BaseFragmeneInerface) AppData.plugsin.get("my.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/Test.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Test.java
deleted file mode 100644
index 2256781..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Test.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.yutou.jianrmg_v2.basemodel;
-
-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.basemodel.Data.AppData;
-import com.yutou.jianrmg_v2.basemodel.Tools.Log;
-
-import Interfaces.BaseActivityInterface;
-import dalvik.system.DexClassLoader;
-
-import com.yutou.jianrmg_v2.resmodl.R;
-
-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);
- setTitle(R.string.app_name);
- main_layut = findViewById(R.id.main_layut);
-
- activityInterface = (BaseActivityInterface) getIntent().getSerializableExtra("activity");
- Intent intent = getIntent();
- Log.i("测试", (activityInterface == null) + "");
- activityInterface.onCreate(savedInstanceState, main_layut, this, intent);
- }
-
- @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/Tools/Utils.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Utils.java
deleted file mode 100644
index 5944aba..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Utils.java
+++ /dev/null
@@ -1,94 +0,0 @@
-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/views/LoadingActivity.java b/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/LoadingActivity.java
deleted file mode 100644
index 2e0eb94..0000000
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/LoadingActivity.java
+++ /dev/null
@@ -1,255 +0,0 @@
-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/res/menu/mod_menu.xml b/BaseModel/src/main/res/menu/mod_menu.xml
deleted file mode 100644
index 143b354..0000000
--- a/BaseModel/src/main/res/menu/mod_menu.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
\ 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
deleted file mode 100644
index eca70cf..0000000
--- a/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ 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
deleted file mode 100644
index eca70cf..0000000
--- a/BaseModel/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ 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
deleted file mode 100644
index a2f5908..0000000
Binary files a/BaseModel/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null 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
deleted file mode 100644
index 1b52399..0000000
Binary files a/BaseModel/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/BaseModel/src/main/res/mipmap-mdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index ff10afd..0000000
Binary files a/BaseModel/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null 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
deleted file mode 100644
index 115a4c7..0000000
Binary files a/BaseModel/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index dcd3cd8..0000000
Binary files a/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null 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
deleted file mode 100644
index 459ca60..0000000
Binary files a/BaseModel/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 8ca12fe..0000000
Binary files a/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null 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
deleted file mode 100644
index 8e19b41..0000000
Binary files a/BaseModel/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index b824ebd..0000000
Binary files a/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null 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
deleted file mode 100644
index 4c19a13..0000000
Binary files a/BaseModel/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/BaseModel/src/main/res/values-za-rCN/strings.xml b/BaseModel/src/main/res/values-za-rCN/strings.xml
deleted file mode 100644
index f631277..0000000
--- a/BaseModel/src/main/res/values-za-rCN/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 魔改宝盒
-
\ No newline at end of file
diff --git a/BaseModel/src/main/res/values/colors.xml b/BaseModel/src/main/res/values/colors.xml
deleted file mode 100644
index 607204a..0000000
--- a/BaseModel/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- #3F51B5
- #303F9F
- #FF4081
- #f0f0f0
- #FFFFFF
-
diff --git a/BaseModel/src/main/res/values/dimens.xml b/BaseModel/src/main/res/values/dimens.xml
deleted file mode 100644
index 59a0b0c..0000000
--- a/BaseModel/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- 16dp
-
diff --git a/BaseModel/src/main/res/values/strings.xml b/BaseModel/src/main/res/values/strings.xml
deleted file mode 100644
index 517620a..0000000
--- a/BaseModel/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
- 魔改宝盒
- BaseActivity
-
diff --git a/BaseModel/src/main/res/values/styles.xml b/BaseModel/src/main/res/values/styles.xml
deleted file mode 100644
index 2b3d463..0000000
--- a/BaseModel/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/GameDataModel/.gitignore b/GameDataModel/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/GameDataModel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/GameDataModel/build.gradle b/GameDataModel/build.gradle
deleted file mode 100644
index ab3abc5..0000000
--- a/GameDataModel/build.gradle
+++ /dev/null
@@ -1,37 +0,0 @@
-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'
- api project(path: ':ResModl')
-}
diff --git a/GameDataModel/proguard-rules.pro b/GameDataModel/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/GameDataModel/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
deleted file mode 100644
index 101f67e..0000000
--- a/GameDataModel/src/androidTest/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-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
deleted file mode 100644
index d909699..0000000
--- a/GameDataModel/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
diff --git a/GameDataModel/src/main/java/Interfaces/BaseActivityInterface.java b/GameDataModel/src/main/java/Interfaces/BaseActivityInterface.java
deleted file mode 100644
index bbfc063..0000000
--- a/GameDataModel/src/main/java/Interfaces/BaseActivityInterface.java
+++ /dev/null
@@ -1,31 +0,0 @@
-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
deleted file mode 100644
index 7371265..0000000
--- a/GameDataModel/src/main/java/Interfaces/BaseFragmeneInerface.java
+++ /dev/null
@@ -1,14 +0,0 @@
-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
deleted file mode 100644
index 8ef3e71..0000000
--- a/GameDataModel/src/main/java/com/yutou/jianrmg_v2/gamedatamodel/MainFragmene.java
+++ /dev/null
@@ -1,60 +0,0 @@
-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
deleted file mode 100644
index 28bb0e1..0000000
--- a/GameDataModel/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- GameDataModel
-
diff --git a/GameDataModel/src/main/res/values/values.xml b/GameDataModel/src/main/res/values/values.xml
deleted file mode 100644
index 3ea04e7..0000000
--- a/GameDataModel/src/main/res/values/values.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
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
deleted file mode 100644
index a92d967..0000000
--- a/GameDataModel/src/test/java/com/yutou/jianrmg_v2/gamedatamodel/ExampleUnitTest.java
+++ /dev/null
@@ -1,17 +0,0 @@
-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
deleted file mode 100644
index 796b96d..0000000
--- a/MgListModel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/MgListModel/build.gradle b/MgListModel/build.gradle
deleted file mode 100644
index 4a5030f..0000000
--- a/MgListModel/build.gradle
+++ /dev/null
@@ -1,53 +0,0 @@
-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'
- implementation 'com.android.support:recyclerview-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'
- api project(path: ':BaseModel')
- api project(path: ':ResModl')
- api project(path: ':RefreshRecyclerView')
-}
diff --git a/MgListModel/proguard-rules.pro b/MgListModel/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/MgListModel/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
deleted file mode 100644
index 127d51d..0000000
--- a/MgListModel/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
diff --git a/MgListModel/src/main/java/Interfaces/BaseActivityInterface.java b/MgListModel/src/main/java/Interfaces/BaseActivityInterface.java
deleted file mode 100644
index ebfcac1..0000000
--- a/MgListModel/src/main/java/Interfaces/BaseActivityInterface.java
+++ /dev/null
@@ -1,31 +0,0 @@
-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
deleted file mode 100644
index 65e2eee..0000000
--- a/MgListModel/src/main/java/Interfaces/BaseFragmeneInerface.java
+++ /dev/null
@@ -1,15 +0,0 @@
-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/MainFragments.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/MainFragments.java
deleted file mode 100644
index 6f37e8d..0000000
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/MainFragments.java
+++ /dev/null
@@ -1,146 +0,0 @@
-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/com/yutou/jianrmg_v2/mglistmodel/views/ModListActivity.java b/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/views/ModListActivity.java
deleted file mode 100644
index 0a9b7c8..0000000
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/views/ModListActivity.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package com.yutou.jianrmg_v2.mglistmodel.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.io.Serializable;
-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 , Serializable{
- 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) {
- Log.i((layout==null)+" "+(intent==null));
- 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/res/values/strings.xml b/MgListModel/src/main/res/values/strings.xml
deleted file mode 100644
index 4bb9dbe..0000000
--- a/MgListModel/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- MgListModel
-
diff --git a/ResModl/.gitignore b/ResModl/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/ResModl/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/ResModl/build.gradle b/ResModl/build.gradle
deleted file mode 100644
index 6d9a8fe..0000000
--- a/ResModl/build.gradle
+++ /dev/null
@@ -1,34 +0,0 @@
-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'
-}
diff --git a/ResModl/proguard-rules.pro b/ResModl/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/ResModl/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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/ResModl/src/main/AndroidManifest.xml b/ResModl/src/main/AndroidManifest.xml
deleted file mode 100644
index b355ca0..0000000
--- a/ResModl/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
diff --git a/ResModl/src/main/res/anim/loading_icon.xml b/ResModl/src/main/res/anim/loading_icon.xml
deleted file mode 100644
index 7821fce..0000000
--- a/ResModl/src/main/res/anim/loading_icon.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/ResModl/src/main/res/anim/loading_login.xml b/ResModl/src/main/res/anim/loading_login.xml
deleted file mode 100644
index 6a20bff..0000000
--- a/ResModl/src/main/res/anim/loading_login.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/ResModl/src/main/res/menu/mod_menu.xml b/ResModl/src/main/res/menu/mod_menu.xml
deleted file mode 100644
index 143b354..0000000
--- a/ResModl/src/main/res/menu/mod_menu.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ResModl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/ResModl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index eca70cf..0000000
--- a/ResModl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/ResModl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/ResModl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index eca70cf..0000000
--- a/ResModl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/ResModl/src/main/res/mipmap-hdpi/ic_launcher.png b/ResModl/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index a2f5908..0000000
Binary files a/ResModl/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-hdpi/ic_launcher_round.png b/ResModl/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index 1b52399..0000000
Binary files a/ResModl/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-mdpi/ic_launcher.png b/ResModl/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index ff10afd..0000000
Binary files a/ResModl/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-mdpi/ic_launcher_round.png b/ResModl/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted file mode 100644
index 115a4c7..0000000
Binary files a/ResModl/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-xhdpi/ic_launcher.png b/ResModl/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index dcd3cd8..0000000
Binary files a/ResModl/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/ResModl/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted file mode 100644
index 459ca60..0000000
Binary files a/ResModl/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ResModl/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 8ca12fe..0000000
Binary files a/ResModl/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/ResModl/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted file mode 100644
index 8e19b41..0000000
Binary files a/ResModl/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/ResModl/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index b824ebd..0000000
Binary files a/ResModl/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/ResModl/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/ResModl/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted file mode 100644
index 4c19a13..0000000
Binary files a/ResModl/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/ResModl/src/main/res/values-za-rCN/strings.xml b/ResModl/src/main/res/values-za-rCN/strings.xml
deleted file mode 100644
index f631277..0000000
--- a/ResModl/src/main/res/values-za-rCN/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 魔改宝盒
-
\ No newline at end of file
diff --git a/ResModl/src/main/res/values/colors.xml b/ResModl/src/main/res/values/colors.xml
deleted file mode 100644
index 607204a..0000000
--- a/ResModl/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- #3F51B5
- #303F9F
- #FF4081
- #f0f0f0
- #FFFFFF
-
diff --git a/ResModl/src/main/res/values/dimens.xml b/ResModl/src/main/res/values/dimens.xml
deleted file mode 100644
index 59a0b0c..0000000
--- a/ResModl/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- 16dp
-
diff --git a/ResModl/src/main/res/values/strings.xml b/ResModl/src/main/res/values/strings.xml
deleted file mode 100644
index 517620a..0000000
--- a/ResModl/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
- 魔改宝盒
- BaseActivity
-
diff --git a/ResModl/src/main/res/values/styles.xml b/ResModl/src/main/res/values/styles.xml
deleted file mode 100644
index 2b3d463..0000000
--- a/ResModl/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/UserModel/.gitignore b/UserModel/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/UserModel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/UserModel/build.gradle b/UserModel/build.gradle
deleted file mode 100644
index 5acffd0..0000000
--- a/UserModel/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-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'
- //毛玻璃
- implementation 'jp.wasabeef:glide-transformations:3.0.0'
- api project(path: ':BaseModel')
- api project(path: ':ResModl')
-}
diff --git a/UserModel/proguard-rules.pro b/UserModel/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/UserModel/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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/UserModel/src/main/AndroidManifest.xml b/UserModel/src/main/AndroidManifest.xml
deleted file mode 100644
index 0bc3a2e..0000000
--- a/UserModel/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
diff --git a/UserModel/src/main/java/Interfaces/BaseActivityInterface.java b/UserModel/src/main/java/Interfaces/BaseActivityInterface.java
deleted file mode 100644
index bbfc063..0000000
--- a/UserModel/src/main/java/Interfaces/BaseActivityInterface.java
+++ /dev/null
@@ -1,31 +0,0 @@
-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/UserModel/src/main/java/Interfaces/BaseFragmeneInerface.java b/UserModel/src/main/java/Interfaces/BaseFragmeneInerface.java
deleted file mode 100644
index 65e2eee..0000000
--- a/UserModel/src/main/java/Interfaces/BaseFragmeneInerface.java
+++ /dev/null
@@ -1,15 +0,0 @@
-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/UserModel/src/main/java/com/jianrmg_v2/usermodel/MainFragments.java b/UserModel/src/main/java/com/jianrmg_v2/usermodel/MainFragments.java
deleted file mode 100644
index c6591c9..0000000
--- a/UserModel/src/main/java/com/jianrmg_v2/usermodel/MainFragments.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.jianrmg_v2.usermodel;
-
-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;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.TextView;
-
-
-import com.bumptech.glide.Glide;
-import com.jianrmg_v2.usermodel.Adapters.MyItemGridViewAdapter;
-import com.nostra13.universalimageloader.core.ImageLoader;
-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.Tools.Utils;
-import com.yutou.jianrmg_v2.resmodl.R;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import Interfaces.BaseFragmeneInerface;
-import jp.wasabeef.glide.transformations.BlurTransformation;
-
-import static com.bumptech.glide.request.RequestOptions.bitmapTransform;
-
-public class MainFragments implements BaseFragmeneInerface {
- private Context context;
- private ImageLoader imageLoader;
- private View view;
- private User user;
- private UUserdata udata;
- private TextView uname,item_title;
- private ImageView icon,item_icon,image_top;
- // private LinearLayout items;
- private ListView myItems;
- @Override
- public void init(Context context) {
- this.context=context;
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- if(view==null){
- view=LayoutInflater.from(context).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(context);
- 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(context).load(udata.getImage()).apply(bitmapTransform(new BlurTransformation(25))).into(image_top);
- }catch (Exception e){
- e.printStackTrace();
- }
- myItems.setAdapter(new MyItemGridViewAdapter(getItemData(),context));
- }
- 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;
- }
- @Override
- public void setIntent() {
-
- }
-}
diff --git a/UserModel/src/main/res/values/strings.xml b/UserModel/src/main/res/values/strings.xml
deleted file mode 100644
index 210264d..0000000
--- a/UserModel/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- UserModel
-
diff --git a/app/build.gradle b/app/build.gradle
index 8fea898..89fb0e1 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,7 +4,7 @@ android {
compileSdkVersion 26
defaultConfig {
applicationId "com.yutou.jianrmg_v2"
- minSdkVersion 21
+ minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
@@ -62,12 +62,14 @@ dependencies {
implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
//毛玻璃
implementation 'jp.wasabeef:glide-transformations:3.0.0'
+ //图表
+ implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
//
- api project(path: ':BaseModel')
+ /* api project(path: ':BaseModel')
api project(path: ':GameDataModel')
api project(path: ':AppHome')
api project(path: ':MgListModel')
api project(path: ':ResModl')
- api project(path: ':UserModel')
+ api project(path: ':UserModel')*/
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 594e9ea..e2b4e21 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,7 +12,7 @@
-
-
+ android:name=".views.BaseActivity">
+ android:name=".views.WebActivity">
+
+
+
\ No newline at end of file
diff --git a/app/src/main/assets/busybox-armv7l b/app/src/main/assets/busybox-armv7l
new file mode 100644
index 0000000..e720089
Binary files /dev/null and b/app/src/main/assets/busybox-armv7l differ
diff --git a/UserModel/src/main/java/com/jianrmg_v2/usermodel/Adapters/DownloadItemAdapter.java b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/DownloadItemAdapter.java
similarity index 87%
rename from UserModel/src/main/java/com/jianrmg_v2/usermodel/Adapters/DownloadItemAdapter.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Adapters/DownloadItemAdapter.java
index 4fa5031..983ee1d 100644
--- a/UserModel/src/main/java/com/jianrmg_v2/usermodel/Adapters/DownloadItemAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/DownloadItemAdapter.java
@@ -1,4 +1,4 @@
-package com.jianrmg_v2.usermodel.Adapters;
+package com.yutou.jianrmg_v2.Adapters;
import android.content.Context;
import android.view.LayoutInflater;
@@ -8,6 +8,8 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
+import com.yutou.jianrmg_v2.R;
+
import java.util.List;
public class DownloadItemAdapter extends BaseAdapter {
@@ -38,7 +40,7 @@ public class DownloadItemAdapter extends BaseAdapter {
public View getView(int i, View view, ViewGroup viewGroup) {
Items items;
if(view==null){
- view= LayoutInflater.from(context).inflate(com.yutou.jianrmg_v2.resmodl.R.layout.item_download,null);
+ view= LayoutInflater.from(context).inflate(R.layout.item_download,null);
items=new Items();
view.setTag(items);
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Adapters/HomeRecyclerAdapter.java b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/HomeRecyclerAdapter.java
index f41df33..2f5e83b 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/Adapters/HomeRecyclerAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/HomeRecyclerAdapter.java
@@ -1,19 +1,19 @@
package com.yutou.jianrmg_v2.Adapters;
+import android.app.Activity;
import android.content.Context;
import android.content.Intent;
-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.Data.MAppHome;
import com.yutou.jianrmg_v2.R;
-import com.yutou.jianrmg_v2.basemodel.Data.MAppHome;
-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.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
+import com.yutou.jianrmg_v2.views.WebActivity;
import cn.lemon.view.adapter.BaseViewHolder;
@@ -27,16 +27,16 @@ import cn.lemon.view.adapter.RecyclerAdapter;
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) {
- View view=new View(getContext());
- Log.i("首页数据",getData().size()+"");
return new CardRecordHolder(parent, R.layout.item_home);
}
@@ -45,8 +45,8 @@ public class HomeRecyclerAdapter extends RecyclerAdapter {
private TextView name;
- public CardRecordHolder(ViewGroup view,int layoutId) {
- super(view,layoutId);
+ public CardRecordHolder(ViewGroup parent, int layoutId) {
+ super(parent, layoutId);
icon = findViewById(R.id.image);
name = findViewById(R.id.title);
@@ -66,7 +66,7 @@ public class HomeRecyclerAdapter extends RecyclerAdapter {
public void onItemViewClick(MAppHome data) {
super.onItemViewClick(data);
if (data.getUrl() != null && data.getUrl().contains("webhttp")) {
- Intent intent = new Intent(getContext(),WebActivity.class);
+ 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"));
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModListRecyclerAdapter.java b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ModListRecyclerAdapter.java
similarity index 64%
rename from MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModListRecyclerAdapter.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Adapters/ModListRecyclerAdapter.java
index 9600471..b5ad23b 100644
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModListRecyclerAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ModListRecyclerAdapter.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.mglistmodel.Adapters;
+package com.yutou.jianrmg_v2.Adapters;
import android.content.Context;
import android.content.Intent;
@@ -8,13 +8,12 @@ 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.Test;
-import com.yutou.jianrmg_v2.basemodel.views.BaseActivity;
-import com.yutou.jianrmg_v2.mglistmodel.views.ModListActivity;
-import com.yutou.jianrmg_v2.resmodl.R;
-import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Utils;
+import com.yutou.jianrmg_v2.views.BaseActivity;
+import com.yutou.jianrmg_v2.views.ModListActivity;
import cn.lemon.view.adapter.BaseViewHolder;
@@ -66,18 +65,9 @@ public class ModListRecyclerAdapter extends RecyclerAdapter {
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("activity", new ModListActivity());
- intent.putExtra("mg", JSON.toJSONString(data));
- getContext().startActivity(intent);
- }
+ Intent intent = new Intent(getContext(), ModListActivity.class);
+ 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/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ModRecyclerAdapter.java
similarity index 80%
rename from MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModRecyclerAdapter.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Adapters/ModRecyclerAdapter.java
index 9eb9a1d..c4ea009 100644
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ModRecyclerAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ModRecyclerAdapter.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.mglistmodel.Adapters;
+package com.yutou.jianrmg_v2.Adapters;
import android.content.Context;
import android.content.Intent;
@@ -9,24 +9,19 @@ 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.basemodel.Test;
-import com.yutou.jianrmg_v2.basemodel.Tools.Log;
-import com.yutou.jianrmg_v2.mglistmodel.views.ModActivity;
-import com.yutou.jianrmg_v2.mglistmodel.views.ModListActivity;
-import com.yutou.jianrmg_v2.resmodl.R;
-import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.TMod;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Utils;
+import com.yutou.jianrmg_v2.views.ModActivity;
import cn.lemon.view.adapter.BaseViewHolder;
import cn.lemon.view.adapter.RecyclerAdapter;
-
/**
* Created by 58381 on 2018/1/20.
*/
@@ -83,8 +78,7 @@ public class ModRecyclerAdapter extends RecyclerAdapter {
@Override
public void onItemViewClick(TMod data) {
super.onItemViewClick(data);
- Intent intent=new Intent(getContext(), Test.class);
- intent.putExtra("activity",new ModActivity());
+ Intent intent=new Intent(getContext(), ModActivity.class);
intent.putExtra("mod", JSON.toJSONString(data));
getContext().startActivity(intent);
}
diff --git a/UserModel/src/main/java/com/jianrmg_v2/usermodel/Adapters/MyItemGridViewAdapter.java b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/MyItemGridViewAdapter.java
similarity index 83%
rename from UserModel/src/main/java/com/jianrmg_v2/usermodel/Adapters/MyItemGridViewAdapter.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Adapters/MyItemGridViewAdapter.java
index c52fd8c..21df1ee 100644
--- a/UserModel/src/main/java/com/jianrmg_v2/usermodel/Adapters/MyItemGridViewAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/MyItemGridViewAdapter.java
@@ -1,8 +1,7 @@
-package com.jianrmg_v2.usermodel.Adapters;
+package com.yutou.jianrmg_v2.Adapters;
import android.content.Context;
import android.content.Intent;
-import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -10,11 +9,10 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
-import com.jianrmg_v2.usermodel.Views.DownloadListActivity;
-import com.yutou.jianrmg_v2.basemodel.R;
-import com.yutou.jianrmg_v2.basemodel.Test;
-import com.yutou.jianrmg_v2.basemodel.Tools.Log;
-import com.yutou.jianrmg_v2.basemodel.services.DownloadService;
+
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.views.DownloadListActivity;
import java.util.List;
@@ -81,12 +79,13 @@ public class MyItemGridViewAdapter extends BaseAdapter {
@Override
public void onClick(View view) {
Log.i("点击"+list.get(i).getTitle());
- Intent intent=new Intent(context, Test.class);
+ Intent intent=null;
switch (i){
case 0:
- intent.putExtra("activity",new DownloadListActivity());
+ intent=new Intent(context, DownloadListActivity.class);
break;
}
+ if(intent!=null)
context.startActivity(intent);
}
});
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ReModListAdapter.java b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ReModListAdapter.java
similarity index 85%
rename from MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ReModListAdapter.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Adapters/ReModListAdapter.java
index 2dd9698..c723544 100644
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Adapters/ReModListAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ReModListAdapter.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.mglistmodel.Adapters;
+package com.yutou.jianrmg_v2.Adapters;
import android.content.Context;
import android.content.Intent;
@@ -11,10 +11,10 @@ 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.basemodel.Test;
-import com.yutou.jianrmg_v2.resmodl.R;
-import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.Data.TMod;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Utils;
+import com.yutou.jianrmg_v2.views.ModActivity;
import java.util.List;
@@ -69,8 +69,7 @@ public class ReModListAdapter extends BaseAdapter {
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- Intent intent=new Intent(context, Test.class);
- intent.putExtra("activityName","ModActivity");
+ Intent intent=new Intent(context, ModActivity.class);
intent.putExtra("mod", JSON.toJSONString(list.get(i)));
context.startActivity(intent);
}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/ViewPagerAdapter.java b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ViewPagerAdapter.java
similarity index 92%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/ViewPagerAdapter.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Adapters/ViewPagerAdapter.java
index 7554b59..485b956 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Adapters/ViewPagerAdapter.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Adapters/ViewPagerAdapter.java
@@ -1,10 +1,9 @@
-package com.yutou.jianrmg_v2.basemodel.Adapters;
+package com.yutou.jianrmg_v2.Adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
-
import java.util.List;
/**
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Application.java b/app/src/main/java/com/yutou/jianrmg_v2/Application.java
similarity index 84%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Application.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Application.java
index c38b746..a0f0aa6 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Application.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Application.java
@@ -1,21 +1,20 @@
-package com.yutou.jianrmg_v2.basemodel;
+package com.yutou.jianrmg_v2;
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 com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.User;
+import com.yutou.jianrmg_v2.Tools.ActivitysManager;
+import com.yutou.jianrmg_v2.Tools.ConfigUtils;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
-
import dalvik.system.DexClassLoader;
/**
@@ -32,7 +31,7 @@ public class Application extends android.app.Application {
}
private void initPlugsin(){
Map plugsin=new HashMap<>();
- File path=new File(Utils.getSDCardPath()+"/plugin/");
+ File path=new File(Utils.getAppPath()+"/plugin/");
for (File file : path.listFiles()) {
if(file.getName().contains(".jar")){
DexClassLoader dexClassLoader=new DexClassLoader(file.getAbsolutePath(),"/data/data/"+getPackageName()+"/",null,getClassLoader());
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/AppData.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/AppData.java
similarity index 90%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/AppData.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/AppData.java
index 6b55c87..ae139f8 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/AppData.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/AppData.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
import java.util.List;
import java.util.Map;
diff --git a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Datas/MAppHome.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/MAppHome.java
similarity index 98%
rename from AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Datas/MAppHome.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/MAppHome.java
index 089ed22..5f4f3e2 100644
--- a/AppHome/src/main/java/com/yutou/jianrmg_v2/apphome/Datas/MAppHome.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/MAppHome.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.apphome.Datas;
+package com.yutou.jianrmg_v2.Data;
public class MAppHome {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppMg.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/MAppMg.java
similarity index 99%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppMg.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/MAppMg.java
index 805b2a4..b40e83d 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MAppMg.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/MAppMg.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class MAppMg{
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MBanner.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/MBanner.java
similarity index 98%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MBanner.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/MBanner.java
index a1cf934..b321f44 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MBanner.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/MBanner.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class MBanner {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MGamePackname.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/MGamePackname.java
similarity index 94%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MGamePackname.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/MGamePackname.java
index 7e24ee6..d72d1e2 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/MGamePackname.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/MGamePackname.java
@@ -1,6 +1,15 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class MGamePackname {
+ private boolean isRoot;
+
+ public boolean isRoot() {
+ return isRoot;
+ }
+
+ public void setRoot(boolean root) {
+ isRoot = root;
+ }
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column m_game_packname.id
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/SConfig.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/SConfig.java
similarity index 99%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/SConfig.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/SConfig.java
index 14da4d7..21ee4c7 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/SConfig.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/SConfig.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class SConfig {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TMod.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/TMod.java
similarity index 96%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TMod.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/TMod.java
index bb2f946..7e5b2b6 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TMod.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/TMod.java
@@ -1,6 +1,8 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
-public class TMod {
+import android.support.annotation.NonNull;
+
+public class TMod implements Comparable{
@Override
public String toString() {
@@ -80,7 +82,7 @@ public class TMod {
* 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;
+ private Long updatetime=-1l;
/**
* 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
@@ -425,4 +427,16 @@ public class TMod {
public void setRemod(Integer remod) {
this.remod = remod;
}
+
+ @Override
+ public int compareTo(@NonNull TMod tMod) {
+ if(this.updatetime==-1&&tMod.updatetime==-1) {
+ return tMod.getCreatetime().compareTo(this.createtime);
+ }else if(this.updatetime==-1){
+ return tMod.updatetime.compareTo(this.createtime);
+ }else if(tMod.updatetime==-1){
+ return tMod.createtime.compareTo(this.updatetime);
+ }
+ return tMod.getUpdatetime().compareTo(this.updatetime);
+ }
}
\ No newline at end of file
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModfile.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/TModfile.java
similarity index 99%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModfile.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/TModfile.java
index 224a876..e8db7bc 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModfile.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/TModfile.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class TModfile {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModtag.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/TModtag.java
similarity index 97%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModtag.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/TModtag.java
index 68d7369..3715114 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/TModtag.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/TModtag.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class TModtag {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUsercollection.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/UUsercollection.java
similarity index 98%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUsercollection.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/UUsercollection.java
index d1fb2ae..427cba2 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUsercollection.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/UUsercollection.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class UUsercollection {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUserdata.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/UUserdata.java
similarity index 98%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUserdata.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/UUserdata.java
index bf52046..c1789cd 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/UUserdata.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/UUserdata.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class UUserdata {
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/User.java b/app/src/main/java/com/yutou/jianrmg_v2/Data/User.java
similarity index 98%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/User.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Data/User.java
index a1ae934..0c03950 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Data/User.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Data/User.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Data;
+package com.yutou.jianrmg_v2.Data;
public class User {
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/GameData.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/GameData.java
index 9519693..e75e347 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/GameData.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/GameData.java
@@ -1,65 +1,53 @@
package com.yutou.jianrmg_v2.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 com.yutou.jianrmg_v2.basemodel.services.DownloadService;
-import com.yutou.jianrmg_v2.gamedatamodel.MainFragmene;
+
+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 com.yutou.jianrmg_v2.R;
+
+import java.util.ArrayList;
+import java.util.List;
import Interfaces.BaseFragmeneInerface;
-/**
- * Created by 58381 on 2018/1/21.
- */
-
public class GameData extends Fragment {
+ private Context context;
private static GameData gameData;
- private DownloadService service;
- private Activity activity;
- private BaseFragmeneInerface baseFragmene;
-
- public static GameData init(Activity activity){
+ public static GameData init(){
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 MainFragmene();
- }
- }
-
- private void setActivity(Activity activity) {
- this.activity = activity;
- }
-
- @Nullable
+ private View view;
@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);
+ if(view!=null)
+ return view;
+ view=inflater.inflate(R.layout.fragment_game_data,null);
+ PieChart pieChart=view.findViewById(R.id.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.invalidate();
+ return view;
}
}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/Home.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/Home.java
index ba400de..42fb334 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/Home.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/Home.java
@@ -1,24 +1,45 @@
package com.yutou.jianrmg_v2.Fragments;
-import android.app.Activity;
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.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.ImageView;
import android.widget.LinearLayout;
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.Adapters.HomeRecyclerAdapter;
+import com.yutou.jianrmg_v2.Data.MAppHome;
+import com.yutou.jianrmg_v2.Data.MBanner;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
+
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
-import com.yutou.jianrmg_v2.basemodel.Data.AppData;
-import com.yutou.jianrmg_v2.basemodel.Tools.Log;
-import com.yutou.jianrmg_v2.apphome.MainFragmene;
-
-import Interfaces.BaseFragmeneInerface;
+import cn.lemon.view.RefreshRecyclerView;
+import cn.lemon.view.adapter.Action;
/**
* Created by 58381 on 2018/1/20.
@@ -26,36 +47,191 @@ import Interfaces.BaseFragmeneInerface;
public class Home extends Fragment {
private static Home home;
+ 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;
-
- private BaseFragmeneInerface baseFragmene;
-
- public static Home init(Activity activity){
- Toast.makeText(activity,"默认主页",Toast.LENGTH_LONG).show();
+ public static Home init(){
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 MainFragmene();
- }
- baseFragmene.init(getContext());
- }
-
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- return baseFragmene.onCreateView(inflater, container, savedInstanceState);
+ if(view!=null)
+ return view;
+ view= inflater.inflate(R.layout.fragment_home,null);
+ imageLoader= Utils.initImageLoader(getContext());
+ handler=new Handler();
+ initBanner();
+ initView(view);
+ TextView textView=new TextView(getContext());
+ textView.setText("a");
+ return 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(getContext());
+ ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,400);
+ banner.setLayoutParams(params);
+ recyclerView=view.findViewById(R.id.recyclerView);
+ recyclerView.setSwipeRefreshColors(0xFF437845,0xFFE44F98,0xFF2FAC21);
+ recyclerView.setLayoutManager(new GridLayoutManager(getContext(),3));
+ adapter=new HomeRecyclerAdapter(getContext());
+ adapter.setHeader(banner);
+ 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();
+ 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(Context context, int position,final MBanner data) {
+ imageLoader.displayImage(data.getUrl(),imageView);
+ imageView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent=new Intent();
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setData(Uri.parse(data.getClick()));
+ startActivity(intent);
+ }
+ });
+ }
+ }
}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/MGList.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/MGList.java
index c441afd..f63d358 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/MGList.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/MGList.java
@@ -1,23 +1,34 @@
package com.yutou.jianrmg_v2.Fragments;
-import android.app.Activity;
-import android.content.Context;
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.LinearLayout;
import android.widget.TextView;
-import com.yutou.jianrmg_v2.basemodel.Data.AppData;
-import com.yutou.jianrmg_v2.basemodel.Tools.Log;
-import com.yutou.jianrmg_v2.mglistmodel.MainFragments;
+import com.alibaba.fastjson.JSON;
+import com.yutou.jianrmg_v2.Adapters.ModListRecyclerAdapter;
+import com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
-import Interfaces.BaseFragmeneInerface;
+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/23.
@@ -25,29 +36,109 @@ import Interfaces.BaseFragmeneInerface;
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);
+ 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;
+ public static MGList init(){
+ if(modView==null){
+ modView=new MGList();
}
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 MainFragments();
- }
- }
-
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- return baseFragmeneInerface.onCreateView(inflater, container, savedInstanceState);
+ if(view!=null)
+ return view;
+ view=inflater.inflate(R.layout.fragment_mg,null);
+ handler=new Handler();
+ initView(view);
+ return view;
+ }
+ private void initView(View view){
+ recyclerView=view.findViewById(R.id.recyclerView);
+ recyclerView.setSwipeRefreshColors(0xFF437845,0xFFE44F98,0xFF2FAC21);
+ recyclerView.setLayoutManager(new GridLayoutManager(getContext(),3));
+ adapter=new ModListRecyclerAdapter(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",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/com/yutou/jianrmg_v2/mglistmodel/Fragments/Mod.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragmentData.java
similarity index 65%
rename from MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/Mod.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragmentData.java
index 7621d45..0912789 100644
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/Mod.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragmentData.java
@@ -1,9 +1,8 @@
-package com.yutou.jianrmg_v2.mglistmodel.Fragments;
+package com.yutou.jianrmg_v2.Fragments;
-import android.os.Bundle;
+import android.app.Activity;
+import android.content.Context;
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;
@@ -13,66 +12,60 @@ 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 com.yutou.jianrmg_v2.Adapters.ModRecyclerAdapter;
+import com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.Data.TMod;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
import org.json.JSONObject;
import java.util.ArrayList;
+import java.util.Collections;
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;
+public class ModListFragmentData {
private MAppMg mgList;
private RefreshRecyclerView recyclerView;
private ModRecyclerAdapter adapter;
private List datas;
- private int min=0, max=10;
+ private int min=0, max=10,index=-1;
private boolean isInit=true;
private Handler handler;
private View view;
- public static Mod init(MAppMg mgList){
- if(mod==null){
- mod=new Mod();
+ private Context context;
+ private Activity activity;
+ public View onCreateView(Context context,Activity activity,LayoutInflater inflater){
+ this.context=context;
+ this.activity=activity;
+ if(view!=null){
+ return view;
}
- 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 setMgList(MAppMg mgList){
+ this.mgList=mgList;
+ }
+ public void setIndex(int index){
+ this.index=index;
+ }
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)));
+ recyclerView.setLayoutManager(new GridLayoutManager(context,3));
+ adapter=new ModRecyclerAdapter(context);
+ TextView endText=new TextView(context);
+ endText.setLayoutParams(new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Utils.getPixelsFromDp(activity,48)));
endText.setTextSize(16);
endText.setGravity(Gravity.CENTER);
endText.setText(" --已经没有了--");
@@ -113,7 +106,7 @@ public class Mod extends Fragment {
json.put("jType",mgList.getIndexs());
else
json.put("mType",mgList.getIndexs());
- final String url=mgList.getIndexs()==0? HttpApi.MOD_ALL:HttpApi.MOD_TYPE;
+ 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) {
@@ -127,6 +120,18 @@ public class Mod extends Fragment {
JSONObject json=new JSONObject(string);
if(json.getInt("code")==100){
datas= Utils.ListRemoveNull(JSON.parseArray(json.getString("data"), TMod.class));
+ Collections.sort(datas);
+ if(index!=-1) {
+ List tmp = new ArrayList<>();
+ for (TMod data : datas) {
+ if (!data.getModtype().equals(index + "")) {
+ tmp.add(data);
+ }
+ }
+ datas.removeAll(tmp);
+ tmp.clear();
+ tmp = null;
+ }
}
handler.post(new Runnable() {
@Override
@@ -151,6 +156,6 @@ public class Mod extends Fragment {
}else{
adapter.addAll(datas);
}
- recyclerView.dismissSwipeRefresh();
+ recyclerView.dismissSwipeRefresh();
}
}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_0.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_0.java
new file mode 100644
index 0000000..ccf6c40
--- /dev/null
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_0.java
@@ -0,0 +1,47 @@
+package com.yutou.jianrmg_v2.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 com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.Tools.Log;
+
+/**
+ * Created by 58381 on 2018/1/25.
+ */
+
+public class ModListFragment_0 extends Fragment {
+ private static ModListFragment_0 mod;
+ private ModListFragmentData modData;
+ private int index=-1;
+ public ModListFragment_0(){
+ this.modData=new ModListFragmentData();
+ }
+ public static ModListFragment_0 init(MAppMg mgList){
+ if(mod==null){
+ mod=new ModListFragment_0();
+
+ }
+ if(mgList!=null)
+ Log.i("mod",mgList.getName());
+ mod.setMgList(mgList);
+ mod.setIndex(mod.index);
+ return mod;
+ }
+ private void setIndex(int index){
+ modData.setIndex(index);
+ }
+ private void setMgList(MAppMg mgList){
+ modData.setMgList(mgList);
+ }
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ return modData.onCreateView(getContext(),getActivity(),inflater);
+ }
+
+}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_1.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_1.java
new file mode 100644
index 0000000..0e6a8b8
--- /dev/null
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_1.java
@@ -0,0 +1,47 @@
+package com.yutou.jianrmg_v2.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 com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.Tools.Log;
+
+/**
+ * Created by 58381 on 2018/1/25.
+ */
+
+public class ModListFragment_1 extends Fragment {
+ private static ModListFragment_1 mod;
+ private ModListFragmentData modData;
+ private int index=1;
+ public ModListFragment_1(){
+ this.modData=new ModListFragmentData();
+ }
+ public static ModListFragment_1 init(MAppMg mgList){
+ if(mod==null){
+ mod=new ModListFragment_1();
+
+ }
+ if(mgList!=null)
+ Log.i("mod",mgList.getName());
+ mod.setMgList(mgList);
+ mod.setIndex(mod.index);
+ return mod;
+ }
+ private void setIndex(int index){
+ modData.setIndex(index);
+ }
+ private void setMgList(MAppMg mgList){
+ modData.setMgList(mgList);
+ }
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ return modData.onCreateView(getContext(),getActivity(),inflater);
+ }
+
+}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_2.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_2.java
new file mode 100644
index 0000000..f38b455
--- /dev/null
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/ModListFragment_2.java
@@ -0,0 +1,47 @@
+package com.yutou.jianrmg_v2.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 com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.Tools.Log;
+
+/**
+ * Created by 58381 on 2018/1/25.
+ */
+
+public class ModListFragment_2 extends Fragment {
+ private static ModListFragment_2 mod;
+ private ModListFragmentData modData;
+ private int index=2;
+ public ModListFragment_2(){
+ this.modData=new ModListFragmentData();
+ }
+ public static ModListFragment_2 init(MAppMg mgList){
+ if(mod==null){
+ mod=new ModListFragment_2();
+
+ }
+ if(mgList!=null)
+ Log.i("mod",mgList.getName());
+ mod.setMgList(mgList);
+ mod.setIndex(mod.index);
+ return mod;
+ }
+ private void setIndex(int index){
+ modData.setIndex(index);
+ }
+ private void setMgList(MAppMg mgList){
+ modData.setMgList(mgList);
+ }
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ return modData.onCreateView(getContext(),getActivity(),inflater);
+ }
+
+}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/My.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/My.java
index bc496d4..3a3b386 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/Fragments/My.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/My.java
@@ -16,13 +16,13 @@ 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.Log;
-import com.yutou.jianrmg_v2.basemodel.Tools.Utils;
+import com.yutou.jianrmg_v2.Adapters.MyItemGridViewAdapter;
+import com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.UUserdata;
+import com.yutou.jianrmg_v2.Data.User;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Utils;
+
import java.util.ArrayList;
import java.util.List;
@@ -38,30 +38,70 @@ import static com.bumptech.glide.request.RequestOptions.bitmapTransform;
*/
public class My extends Fragment {
- public static My my;
- private BaseFragmeneInerface baseFragmeneInerface;
- public static My init(Activity activity){
+ private ImageLoader imageLoader;
+ private View view;
+ private User user;
+ private UUserdata udata;
+ private TextView uname,item_title;
+ private ImageView icon,item_icon,image_top;
+ // private LinearLayout items;
+ private ListView myItems;
+
+ private static My my;
+ public static My init() {
if(my==null){
my=new My();
- my.baseFragmeneInerface.init(activity);
}
return my;
}
- public My(){
- try {
- this.baseFragmeneInerface = (BaseFragmeneInerface) AppData.plugsin.get("my.jar").loadClass("com.yutou.jianrmg_v2.mglistmodel.MainFragments").newInstance();
- } catch (Exception e) {
- e.printStackTrace();
- Log.i("个人中心插件加载失败");
- baseFragmeneInerface =new com.jianrmg_v2.usermodel.MainFragments();
- }
- }
-
- @Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
-
- return baseFragmeneInerface.onCreateView(inflater, container, 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(getContext()).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/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/TestMod.java b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/Test.java
similarity index 59%
rename from MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/TestMod.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Fragments/Test.java
index 8719e2d..a0ff604 100644
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/Fragments/TestMod.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Fragments/Test.java
@@ -1,23 +1,37 @@
-package com.yutou.jianrmg_v2.mglistmodel.Fragments;
+package com.yutou.jianrmg_v2.Fragments;
import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.ServiceConnection;
import android.os.Bundle;
+import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
+import android.support.v7.widget.PopupMenu;
import android.view.Gravity;
import android.view.LayoutInflater;
+import android.view.MenuItem;
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;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.services.DownloadService;
+
+/**
+ * Created by 58381 on 2018/1/21.
+ */
+
+public class Test extends Fragment {
+ private static Test test;
+ private DownloadService service;
private Activity activity;
- public static TestMod init(Activity activity){
+ public static Test init(Activity activity){
if(test==null){
- test=new TestMod();
+ test=new Test();
}
return test;
}
@@ -31,8 +45,8 @@ public class TestMod extends Fragment {
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.setLayoutParams(params);
+ textView.setGravity(Gravity.CENTER);
textView.setText("Hello World");
return textView;
}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadFileInerface.java b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/DownloadFileInerface.java
similarity index 78%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadFileInerface.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Interfaces/DownloadFileInerface.java
index 9ff3ea9..25e45fb 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadFileInerface.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/DownloadFileInerface.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Interfaces;
+package com.yutou.jianrmg_v2.Interfaces;
/**
* Created by 58381 on 2018/2/5.
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadInterface.java b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/DownloadInterface.java
similarity index 72%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadInterface.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Interfaces/DownloadInterface.java
index 41a1e41..c221a59 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/DownloadInterface.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/DownloadInterface.java
@@ -1,7 +1,7 @@
-package com.yutou.jianrmg_v2.basemodel.Interfaces;
+package com.yutou.jianrmg_v2.Interfaces;
-import com.yutou.jianrmg_v2.basemodel.Data.TModfile;
+import com.yutou.jianrmg_v2.Data.TModfile;
/**
* Created by 58381 on 2018/2/2.
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/HttpInterface.java b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/HttpInterface.java
similarity index 75%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/HttpInterface.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Interfaces/HttpInterface.java
index 8ac89ee..d6afa42 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Interfaces/HttpInterface.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/HttpInterface.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Interfaces;
+package com.yutou.jianrmg_v2.Interfaces;
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/ModInterface.java b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/ModInterface.java
new file mode 100644
index 0000000..51307c7
--- /dev/null
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Interfaces/ModInterface.java
@@ -0,0 +1,5 @@
+package com.yutou.jianrmg_v2.Interfaces;
+
+public interface ModInterface {
+ void onAction(boolean flag,int type);
+}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/LoadingActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/LoadingActivity.java
index 67e5f06..82596c6 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/LoadingActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/LoadingActivity.java
@@ -7,6 +7,8 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.content.res.AssetManager;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
@@ -19,60 +21,67 @@ 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.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.R;
-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 com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.MGamePackname;
+import com.yutou.jianrmg_v2.Data.SConfig;
+import com.yutou.jianrmg_v2.Data.User;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.ConfigUtils;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
import org.json.JSONObject;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
/**
* 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 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();
+ 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);
+
+ 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());
+ 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){
+ } catch (Exception e) {
e.printStackTrace();
}
@@ -80,14 +89,15 @@ public class LoadingActivity extends AppCompatActivity {
@Override
public void httpError(Exception e) {
- e.printStackTrace();
+ e.printStackTrace();
}
});
- }catch (Exception e){
- e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
- private void initData(){
+
+ private void initData() {
/* if(RootUtils.su()) {
RootUtils root = RootUtils.init(this);
root.exec("cp /sdcard/jianRMG/1/aaa.txt /data/data/com.huanmeng.zhanjian2/");
@@ -96,48 +106,49 @@ public class LoadingActivity extends AppCompatActivity {
}else{
Log.i("获取ROOT失败");
}*/
-
+ AssetManager manager = getResources().getAssets();
+ try {
+ String[] strs = manager.list("");
+ for (int i = 0; i < strs.length; i++) {
+ System.out.println(strs[i]);
+ }
+ String fileName;
+ switch (Build.CPU_ABI) {
+ case "armeabi-v7a":
+ fileName="busybox-armv7l";
+ break;
+ default: fileName="busybox-armv7l";
+ }
+ InputStream inputStream = manager.open(fileName);
+ //jar.createNewFile();
+ FileOutputStream outputStream = new FileOutputStream("/data/data/" + this.getPackageName() + "/files/busybox");
+ int len = 0;
+ byte[] bytes = new byte[inputStream.available()];
+ while ((len = inputStream.read(bytes)) != -1) {
+ outputStream.write(bytes, 0, len);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ Utils.toast(this, Build.CPU_ABI);
initGamePackName();
initConfig();
initUser();
}
- private void initConfig(){
- try{
+
+ 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);
+ 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){
- e.printStackTrace();
- }
- }
-
- @Override
- public void httpError(Exception e) {
- e.printStackTrace();
- }
- });
- }catch (Exception e){
- e.printStackTrace();
- }
- }
- 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){
+ } catch (Exception e) {
e.printStackTrace();
}
}
@@ -147,26 +158,52 @@ public class LoadingActivity extends AppCompatActivity {
e.printStackTrace();
}
});
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
- private void initUser(){
+
+ private void initGamePackName() {
try {
- JSONObject json=new JSONObject();
- json.put("token",AppData.Token);
- json.put("uid",AppData.user.getId());
+ 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) {
+ e.printStackTrace();
+ }
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ 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"));
+ 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){
+ } catch (Exception e) {
}
ready(1);
@@ -177,45 +214,48 @@ public class LoadingActivity extends AppCompatActivity {
ready(1);
}
});
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
}
- 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);
+
+ 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();
+ 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,"账号/密码 不能为空");
+ String name = uname.getText().toString();
+ String pass = password.getText().toString();
+ if (Utils.testStringIsNull(name, pass)) {
+ Utils.toast(LoadingActivity.this, "账号/密码 不能为空");
return;
}
- login(name,pass);
+ login(name, pass);
}
});
}
- public void start(){
- Intent intent=new Intent(LoadingActivity.this,MainActivity.class);
+
+ 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);
+
+ 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);
@@ -224,7 +264,8 @@ public class LoadingActivity extends AppCompatActivity {
loginLayout.startAnimation(loginAnim);
}
- private class MyAnimListener implements Animation.AnimationListener{
+
+ private class MyAnimListener implements Animation.AnimationListener {
@Override
public void onAnimationStart(Animation animation) {
@@ -241,22 +282,24 @@ public class LoadingActivity extends AppCompatActivity {
}
}
- private int readys=0;
- private void ready(int i){
- readys+=i;
- Log.i(readys+"");
- if(readys==3){
+
+ private int readys = 0;
+
+ private synchronized void ready(int i) {
+ readys += i;
+ Log.i(readys + "");
+ if (readys == 3) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
- if(Utils.testStringIsNull(AppData.Token)){
+ if (Utils.testStringIsNull(AppData.Token)) {
showLogin();
- }else{
+ } else {
start();
}
}
- },0);
+ }, 0);
}
}
}
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/MainActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/MainActivity.java
index cc0934f..860b728 100644
--- a/app/src/main/java/com/yutou/jianrmg_v2/MainActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/MainActivity.java
@@ -9,10 +9,10 @@ import com.yutou.jianrmg_v2.Fragments.GameData;
import com.yutou.jianrmg_v2.Fragments.Home;
import com.yutou.jianrmg_v2.Fragments.MGList;
import com.yutou.jianrmg_v2.Fragments.My;
-import com.yutou.jianrmg_v2.basemodel.Adapters.ViewPagerAdapter;
-import com.yutou.jianrmg_v2.resmodl.R;
-import com.yutou.jianrmg_v2.basemodel.Tools.ActivitysManager;
-import com.yutou.jianrmg_v2.basemodel.views.LoadingActivity;
+import com.yutou.jianrmg_v2.Adapters.ViewPagerAdapter;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.ActivitysManager;
+import com.yutou.jianrmg_v2.LoadingActivity;
import java.util.ArrayList;
import java.util.List;
@@ -39,10 +39,10 @@ public class MainActivity extends AppCompatActivity {
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(this));
+ list.add(Home.init());
+ list.add(GameData.init());
+ list.add(MGList.init());
+ list.add(My.init());
ViewPagerAdapter adapter=new ViewPagerAdapter(getSupportFragmentManager(),list);
viewPager.setAdapter(adapter);
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpApi.java b/app/src/main/java/com/yutou/jianrmg_v2/Network/HttpApi.java
similarity index 96%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpApi.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Network/HttpApi.java
index f4a8bff..8c3cd4b 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpApi.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Network/HttpApi.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Network;
+package com.yutou.jianrmg_v2.Network;
/**
* Created by 58381 on 2018/1/20.
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpUtils.java b/app/src/main/java/com/yutou/jianrmg_v2/Network/HttpUtils.java
similarity index 95%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpUtils.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Network/HttpUtils.java
index b5d8766..17bcbb7 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Network/HttpUtils.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Network/HttpUtils.java
@@ -1,9 +1,11 @@
-package com.yutou.jianrmg_v2.basemodel.Network;
+package com.yutou.jianrmg_v2.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 com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Interfaces.DownloadFileInerface;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Tools.Log;
import org.json.JSONException;
import org.json.JSONObject;
@@ -15,7 +17,6 @@ import java.io.InputStream;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;
-
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ActivitysManager.java b/app/src/main/java/com/yutou/jianrmg_v2/Tools/ActivitysManager.java
similarity index 89%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ActivitysManager.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Tools/ActivitysManager.java
index 275b9e4..1480d64 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ActivitysManager.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Tools/ActivitysManager.java
@@ -1,6 +1,5 @@
-package com.yutou.jianrmg_v2.basemodel.Tools;
+package com.yutou.jianrmg_v2.Tools;
-import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
@@ -46,10 +45,6 @@ public class ActivitysManager {
activity.finish();
}
}
- if(activityStack.empty()){
- Log.i("Activity管理器","已清空");
- System.exit(0);
- }
}
/**
@@ -79,7 +74,6 @@ public class ActivitysManager {
/**
* 退出应用程序
*/
- @SuppressLint("MissingPermission")
public static void AppExit(Context context) {
try {
finishAllActivity();
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ConfigUtils.java b/app/src/main/java/com/yutou/jianrmg_v2/Tools/ConfigUtils.java
similarity index 98%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ConfigUtils.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Tools/ConfigUtils.java
index eb2dd50..2fb06c8 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ConfigUtils.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Tools/ConfigUtils.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Tools;
+package com.yutou.jianrmg_v2.Tools;
import org.json.JSONException;
import org.json.JSONObject;
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Log.java b/app/src/main/java/com/yutou/jianrmg_v2/Tools/Log.java
similarity index 96%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Log.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Tools/Log.java
index 71a71e0..1b8ccbd 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/Log.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Tools/Log.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Tools;
+package com.yutou.jianrmg_v2.Tools;
import java.io.PrintWriter;
import java.io.StringWriter;
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ModUtils.java b/app/src/main/java/com/yutou/jianrmg_v2/Tools/ModUtils.java
similarity index 56%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ModUtils.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Tools/ModUtils.java
index ce8d408..4911e76 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/ModUtils.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Tools/ModUtils.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.Tools;
+package com.yutou.jianrmg_v2.Tools;
import android.content.ComponentName;
import android.content.Context;
@@ -9,26 +9,30 @@ import android.os.IBinder;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
+import android.widget.Button;
import android.widget.ListView;
+import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.fastjson.JSON;
import com.kaopiz.kprogresshud.KProgressHUD;
-import com.yutou.jianrmg_v2.basemodel.Application;
-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 com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.MGamePackname;
+import com.yutou.jianrmg_v2.Data.TMod;
+import com.yutou.jianrmg_v2.Data.TModfile;
+import com.yutou.jianrmg_v2.Interfaces.DownloadInterface;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Interfaces.ModInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.services.DownloadService;
import org.json.JSONObject;
+import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
@@ -41,6 +45,11 @@ import me.drakeet.materialdialog.MaterialDialog;
*/
public class ModUtils {
+ public static final int MOD_INSTALL = 1;
+ public static final int MOD_BACKUP = 2;
+ public static final int MOD_UNINSTALL = 3;
+
+ private static final String TAG = "ModUtils";
private static ModUtils modUtils;
private Context context;
private Handler handler;
@@ -74,20 +83,28 @@ public class ModUtils {
return modfiles;
}
- public void installMod(TMod mod) {
+ public void installMod(TMod mod, ModInterface modInterface) {
this.mod = mod;
- install();
+ if (modInterface == null) {
+ modInterface = new ModInterface() {
+ @Override
+ public void onAction(boolean flag, int type) {
+
+ }
+ };
+ }
+ install(modInterface);
}
- private void install() {
+ private void install(ModInterface modInterface) {
if (modfiles == null) {
Toast.makeText(context, "正在加载数据,请稍后再试", Toast.LENGTH_LONG).show();
getModDownloadInfo();
return;
}
- Log.i("安装mod", (!isInstallMod(mod)) + " " + changeMod(mod, modfiles) + "");
+ Log.i("安装mod", changeMod(mod, modfiles) + "");
if (!isInstallMod(mod) && changeMod(mod, modfiles)) {
- install(mod);
+ install(mod, modInterface);
} else {
if (getModPath(mod).listFiles().length > 0 && !changeMod(mod, modfiles)) {
final MaterialDialog dialog = new MaterialDialog(context);
@@ -113,7 +130,7 @@ public class ModUtils {
}
}
- private void install(final TMod mod) {
+ private void install(final TMod mod, final ModInterface modInterface) {
List clientList = new ArrayList<>();
for (MGamePackname packname : AppData.packnames) {
clientList.add(packname.getZhname() + "(" + packname.getPackname() + ")");
@@ -127,23 +144,54 @@ public class ModUtils {
public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
MGamePackname packname = AppData.packnames.get(i);
hud.show();
+ boolean isRoot = false;
for (TModfile modfile : modfiles) {
File file = getModPath(mod, modfile.getFilename());
if (packname.getZhname().contains("[ROOT]")) {
+ if (!RootUtils.su()) {
+ hud.dismiss();
+ 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();
+ modInterface.onAction(false, MOD_INSTALL);
+ return;
+ }
+ isRoot = true;
backupOrRoot(file, "/data/data/" + packname.getPackname() + modfile.getInstallpathid(), packname.getPackname(), mod);
rootInstall(file, "/data/data/" + packname.getPackname() + modfile.getInstallpathid());
} else {
-
+ isRoot = false;
+ Log.i(TAG, "免ROOT安装");
+ notRootInstall(file, Utils.getSDCardPath() + "Android/data/" + packname.getPackname() + modfile.getInstallpathid());
}
}
try {
new File(getModInstallPath(mod) + packname.getPackname() + ".lock").createNewFile();
- } catch (IOException e) {
+ JSONObject json = new JSONObject();
+ json.put("root", isRoot);
+ json.put("packname", packname.getPackname());
+ json.put("zhname", packname.getZhname());
+ Utils.writerFile(getModInstallPath(mod) + packname.getPackname() + ".lock", json.toString());
+ } catch (Exception e) {
e.printStackTrace();
}
hud.dismiss();
dialog.dismiss();
Toast.makeText(context, "安装成功,重启游戏生效", Toast.LENGTH_LONG).show();
+ modInterface.onAction(true, MOD_INSTALL);
}
});
dialog.setContentView(listView);
@@ -157,59 +205,76 @@ public class ModUtils {
}
- private void notRootInstall(File src, String path) {
-
+ private boolean notRootInstall(File src, String path) {
+ if (src.exists()) {
+ boolean flag = Utils.copyFile(src.getAbsolutePath(), path, true);
+ return flag;
+ } else {
+ Log.i(TAG, "找不到文件:" + src.getAbsolutePath());
+ }
+ return false;
}
- private void rootInstall(File src, String path) {
+ private boolean 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();
+ File tmpFile=new File("/data/data/"+context.getPackageName()+"/mods/");
+ if(!tmpFile.getParentFile().exists())
+ tmpFile.getParentFile().mkdirs();
+ if(tmpFile.exists())
+ tmpFile.delete();
+ Utils.copyFile(src.getAbsolutePath(),tmpFile.getAbsolutePath(),true);
+ root.exec("mkdir -p "+path);
+ root.exec("cp -f " + tmpFile.getAbsolutePath()+"/"+src.getName() + " " + path);
+ root.exec("chmod 777 " + path + src.getName());
}
+ return true;
}
- public void reBackMod(TMod tMod) {
+ public void reBackMod(TMod tMod, final ModInterface modInterface) {
final MaterialDialog dialog = new MaterialDialog(context);
dialog.setTitle("将还原 " + tMod.getTitle());
- final List clientList = getInstallClens();
+ final List clientList = getInstallClens();
+ List titles = new ArrayList<>();
+ for (MGamePackname packname : clientList) {
+ titles.add("[" + (packname.isRoot() ? "ROOT" : "免ROOT") + "]" + packname.getZhname());
+ }
ListView listView = new ListView(context);
- listView.setAdapter(new ArrayAdapter(context, android.R.layout.simple_list_item_1, clientList));
+ listView.setAdapter(new ArrayAdapter(context, android.R.layout.simple_list_item_1, titles));
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());
+ if (clientList.get(i).isRoot()) {
+ RootUtils root = RootUtils.init(context);
+ for (TModfile modfile : modfiles) {
+ if (getModPath(mod, "backup/" + clientList.get(i).getPackname() + "/" + modfile.getFilename()).exists()) {
+ root.exec("cp -f " + getModInstallPath(mod) + "backup/" + clientList.get(i).getPackname() + "/" + modfile.getFilename() + " " + "/data/data/" + clientList.get(i).getPackname() + modfile.getInstallpathid());
+ } else {
+ root.exec("rm -f " + "/data/data/" + clientList.get(i).getPackname() + modfile.getInstallpathid() + modfile.getFilename());
+ }
+ }
+ } else {
+ for (TModfile modfile : modfiles) {
+ String filePath = Utils.getSDCardPath() + "Android/data/" + clientList.get(i).getPackname() + modfile.getInstallpathid() + modfile.getFilename();
+ Log.i(TAG, "删除:" + filePath);
+ File file = new File(filePath);
+ if (file.exists()) {
+ file.delete();
+ }
}
}
+ new File(getModPath(mod).getAbsolutePath() + "/" + clientList.get(i).getPackname() + ".lock").delete();
+ if (modInterface != null)
+ modInterface.onAction(true, MOD_UNINSTALL);
dialog.dismiss();
}
});
- dialog.dismiss();
+ dialog.setContentView(listView);
dialog.setNegativeButton("放弃", new View.OnClickListener() {
@Override
public void onClick(View view) {
+ if (modInterface != null)
+ modInterface.onAction(false, MOD_UNINSTALL);
dialog.dismiss();
;
}
@@ -230,8 +295,14 @@ public class ModUtils {
Log.i("获取ROOT", "2");
backup.mkdirs();
}
- root.exec("chmod 777 " + srcPath + srcFile.getName());
- root.exec("\\cp -f" + srcPath + srcFile.getName() + " " + backup + "/");
+ File tmpFile=new File("/data/data/"+context.getPackageName()+"/mods/"+srcFile.getName());
+ if(tmpFile.exists())
+ tmpFile.delete();
+ tmpFile.getParentFile().mkdirs();
+ root.exec("mkdir -p "+srcPath);
+ root.exec("chmod 7777 " + srcPath + srcFile.getName());
+ root.exec("cp -f " + srcPath + srcFile.getName() + " " + tmpFile);
+ root.println("cp -f "+tmpFile.getAbsolutePath()+" "+backup.getAbsolutePath());
} else {
}
}
@@ -267,12 +338,12 @@ public class ModUtils {
@Override
public void over() {
- Utils.toast(context, "下载完成");
+
}
@Override
public void start() {
- Utils.toast(context, "开始下载");
+
}
});
service.start(modfiles);
@@ -317,11 +388,11 @@ public class ModUtils {
}
public static String getModInstallPath(TMod mod) {
- return Utils.getSDCardPath() + "/" + mod.getId() + "/";
+ return Utils.getAppPath() + "/" + mod.getId() + "/";
}
public static boolean isInstallMod(TMod mod) {
- File modPath = new File(Utils.getSDCardPath() + "/" + mod.getId() + "/");
+ File modPath = new File(Utils.getAppPath() + "/" + 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")) {
@@ -333,14 +404,12 @@ public class ModUtils {
}
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()).isFile())
- if (!new File(Utils.getSDCardPath() + "/" + mod.getId() + "/" + modfile.getFilename()).exists()) {
- Log.i("不完整的", "位置:" + Utils.getSDCardPath() + "/" + mod.getId() + "/" + " exists:" + modPath.exists());
- return false;
- }
+ if (!new File(Utils.getAppPath() + "/" + mod.getId() + "/" + modfile.getFilename()).exists()) {
+ Log.i(TAG,"mod不完整:"+Utils.getAppPath() + "/" + mod.getId() + "/" + modfile.getFilename());
+ Log.i(TAG,JSON.toJSONString(modfile));
+ return false;
+ }
}
return true;
}
@@ -350,7 +419,7 @@ public class ModUtils {
}
public static File getModPath(TMod mod, String name) {
- File path = new File(Utils.getSDCardPath() + "/" + mod.getId() + "/" + name);
+ File path = new File(Utils.getAppPath() + "/" + mod.getId() + "/" + name);
if (!path.exists()) {
path.mkdirs();
}
@@ -358,13 +427,14 @@ public class ModUtils {
}
- public List getInstallClens() {
- List installClens = new ArrayList<>();
+ 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]);
+ Log.i(TAG, modPath.listFiles()[i].getName().split("\\.lock")[0]);
+ installClens.add(JSON.parseObject(Utils.readFile(modPath.listFiles()[i].getAbsolutePath()), MGamePackname.class));
}
}
}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/RootUtils.java b/app/src/main/java/com/yutou/jianrmg_v2/Tools/RootUtils.java
similarity index 91%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/RootUtils.java
rename to app/src/main/java/com/yutou/jianrmg_v2/Tools/RootUtils.java
index 5a83ae7..b378453 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/Tools/RootUtils.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Tools/RootUtils.java
@@ -1,11 +1,16 @@
-package com.yutou.jianrmg_v2.basemodel.Tools;
+package com.yutou.jianrmg_v2.Tools;
import android.content.Context;
+import java.io.BufferedOutputStream;
import java.io.BufferedReader;
+import java.io.DataInputStream;
import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
@@ -24,6 +29,7 @@ public class RootUtils {
if(rootUtils==null){
rootUtils=new RootUtils(context);
rootUtils.init();
+ rootUtils.println("chmod 7777 /data/data/com.yutou.jianrmg_v2/files/busybox");
}
return rootUtils;
}
@@ -76,7 +82,7 @@ public class RootUtils {
}
public boolean exec(String exec){
try {
- exec="./data/data/"+context.getPackageName()+"/files/busybox-armv6l "+exec;
+ exec="./data/data/"+context.getPackageName()+"/files/busybox "+exec;
Log.i("ROOT",exec);
stream.writeBytes(exec+"\n");
stream.flush();
@@ -89,7 +95,6 @@ public class RootUtils {
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()));
diff --git a/app/src/main/java/com/yutou/jianrmg_v2/Tools/Utils.java b/app/src/main/java/com/yutou/jianrmg_v2/Tools/Utils.java
new file mode 100644
index 0000000..43a6e7d
--- /dev/null
+++ b/app/src/main/java/com/yutou/jianrmg_v2/Tools/Utils.java
@@ -0,0 +1,220 @@
+package com.yutou.jianrmg_v2.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.R;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+
+/**
+ * Created by 58381 on 2018/1/20.
+ */
+
+public class Utils {
+ private static final String TAG = "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() + "/";
+ return path;
+ }
+
+ public static String getAppPath() {
+ 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(getAppPath() + "/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;
+ }
+
+ /**
+ * 复制单个文件
+ *
+ * @param srcFileName 待复制的文件名
+ * @param destFileName 目标文件名
+ * @param overlay 如果目标文件存在,是否覆盖
+ * @return 如果复制成功返回true,否则返回false
+ */
+ public static boolean copyFile(String srcFileName, String destFileName,
+ boolean overlay) {
+ File srcFile = new File(srcFileName);
+ String MESSAGE = "";
+ // 判断源文件是否存在
+ if (!srcFile.exists()) {
+ MESSAGE = "源文件:" + srcFileName + "不存在!";
+ Log.i(TAG, MESSAGE);
+ return false;
+ } else if (!srcFile.isFile()) {
+ MESSAGE = "复制文件失败,源文件:" + srcFileName + "不是一个文件!";
+ Log.i(TAG, MESSAGE);
+ return false;
+ }
+
+ // 判断目标文件是否存在
+ File destFile = new File(destFileName);
+ // 如果目标文件所在目录不存在,则创建目录
+ Log.i(TAG,"目标文件夹:"+destFileName+" exists:"+destFile.exists());
+ if (!destFile.exists()) {
+ // 目标文件所在目录不存在
+ Log.i(TAG,"目标文件所在目录不存在"+destFile.getAbsolutePath());
+ if (!destFile.mkdirs()) {
+ // 复制文件失败:创建目标文件所在目录失败
+ Log.i(TAG, " 复制文件失败:创建目标文件所在目录失败:" + destFileName);
+ return false;
+ }
+
+ }
+
+ // 复制文件
+ int byteread = 0; // 读取的字节数
+ InputStream in = null;
+ OutputStream out = null;
+
+ try {
+ in = new FileInputStream(srcFile);
+ out = new FileOutputStream(destFile+"/"+srcFile.getName());
+ byte[] buffer = new byte[1024];
+
+ while ((byteread = in.read(buffer)) != -1) {
+ out.write(buffer, 0, byteread);
+ }
+ return true;
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ return false;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ } finally {
+ try {
+ if (out != null)
+ out.close();
+ if (in != null)
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ public static boolean writerFile(String srcFile,String data){
+ File file=new File(srcFile);
+ if(!file.exists()){
+ return false;
+ }
+ try {
+ PrintWriter writer=new PrintWriter(file);
+ writer.write(data);
+ writer.flush();
+ writer.close();
+ return true;
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+ public static String readFile(String srcFile){
+ File file=new File(srcFile);
+ if(!file.exists()){
+ return null;
+ }
+ try {
+ BufferedReader reader=new BufferedReader(new FileReader(file));
+ String tmp,str="";
+ while ((tmp=reader.readLine())!=null){
+ str+=tmp;
+ }
+ return str;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/services/DownloadService.java b/app/src/main/java/com/yutou/jianrmg_v2/services/DownloadService.java
similarity index 90%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/services/DownloadService.java
rename to app/src/main/java/com/yutou/jianrmg_v2/services/DownloadService.java
index c90fb04..e252e6f 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/services/DownloadService.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/services/DownloadService.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.services;
+package com.yutou.jianrmg_v2.services;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -10,18 +10,19 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Binder;
+import android.os.Build;
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 com.yutou.jianrmg_v2.Data.TModfile;
+import com.yutou.jianrmg_v2.Interfaces.DownloadFileInerface;
+import com.yutou.jianrmg_v2.Interfaces.DownloadInterface;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.Utils;
import java.util.ArrayList;
import java.util.List;
@@ -92,11 +93,13 @@ public class DownloadService extends Service {
builder.setTicker("开始下载");
builder.setContentTitle("正在下载");
builder.setContent(views);
- builder.setVisibility(Notification.VISIBILITY_PUBLIC);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ builder.setVisibility(Notification.VISIBILITY_PUBLIC);
+ }
//通知栏显示图标
builder.setSmallIcon(R.drawable.icon_download);
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel=new NotificationChannel("channel_1","Message",NotificationManager.IMPORTANCE_HIGH);
builder.setChannelId(channel.getId());
notificationManager.createNotificationChannel(channel);
@@ -144,7 +147,7 @@ public class DownloadService extends Service {
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() {
+ HttpUtils.downloadFile(modfile.getServiceurl(), Utils.getAppPath() + "/" + 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)");
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/BaseActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/views/BaseActivity.java
similarity index 94%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/BaseActivity.java
rename to app/src/main/java/com/yutou/jianrmg_v2/views/BaseActivity.java
index 7e1a4b2..1433208 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/BaseActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/views/BaseActivity.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.views;
+package com.yutou.jianrmg_v2.views;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
@@ -6,9 +6,9 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.widget.LinearLayout;
-import com.yutou.jianrmg_v2.basemodel.R;
+import com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.R;
-import com.yutou.jianrmg_v2.basemodel.Data.AppData;
import Interfaces.BaseActivityInterface;
import dalvik.system.DexClassLoader;
diff --git a/UserModel/src/main/java/com/jianrmg_v2/usermodel/Views/DownloadListActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/views/DownloadListActivity.java
similarity index 53%
rename from UserModel/src/main/java/com/jianrmg_v2/usermodel/Views/DownloadListActivity.java
rename to app/src/main/java/com/yutou/jianrmg_v2/views/DownloadListActivity.java
index e209147..4a88734 100644
--- a/UserModel/src/main/java/com/jianrmg_v2/usermodel/Views/DownloadListActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/views/DownloadListActivity.java
@@ -1,8 +1,10 @@
-package com.jianrmg_v2.usermodel.Views;
+package com.yutou.jianrmg_v2.views;
import android.content.Context;
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.LayoutInflater;
import android.view.MotionEvent;
@@ -10,11 +12,11 @@ import android.view.View;
import android.widget.LinearLayout;
import android.widget.ListView;
-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.Utils;
-import com.yutou.jianrmg_v2.resmodl.R;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.Tools.Utils;
+import com.yutou.jianrmg_v2.R;
import org.json.JSONArray;
import org.json.JSONException;
@@ -22,26 +24,26 @@ import org.json.JSONObject;
import java.io.File;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
import Interfaces.BaseActivityInterface;
-public class DownloadListActivity implements BaseActivityInterface ,Serializable {
+public class DownloadListActivity extends AppCompatActivity {
private Context context;
- private View view;
private ListView listView;
+
+
@Override
- public void onCreate(Bundle savedInstanceState, LinearLayout layout, Context context, Intent intent) {
- this.context=context;
- this.view= LayoutInflater.from(context).inflate(R.layout.activity_download_list,null);
- getDownloadFileList();
- initViews();
- layout.addView(view);
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_download_list);
+ this.context = this;
+
+ getDownloadFileList();
+ initViews();
}
private void getDownloadFileList(){
JSONObject json=new JSONObject();
- File rootPath=new File(Utils.getSDCardPath());
+ File rootPath=new File(Utils.getAppPath());
try{
JSONArray array=new JSONArray();
for (File path : rootPath.listFiles()) {
@@ -76,52 +78,8 @@ public class DownloadListActivity implements BaseActivityInterface ,Serializable
return;
}
private void initViews(){
- listView=view.findViewById(R.id.listView);
+ listView=findViewById(R.id.listView);
}
- @Override
- public void onRestart() {
-
- }
-
- @Override
- public void onResume() {
-
- }
-
- @Override
- public void onPause() {
-
- }
-
- @Override
- public void onDestroy() {
-
- }
-
- @Override
- public void getIntent(Intent intent) {
-
- }
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- return false;
- }
-
- @Override
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- return false;
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- return false;
- }
-
- @Override
- public Data getData() {
- return null;
- }
}
diff --git a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/views/ModActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/views/ModActivity.java
similarity index 78%
rename from MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/views/ModActivity.java
rename to app/src/main/java/com/yutou/jianrmg_v2/views/ModActivity.java
index 5a1f992..73c1024 100644
--- a/MgListModel/src/main/java/com/yutou/jianrmg_v2/mglistmodel/views/ModActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/views/ModActivity.java
@@ -1,10 +1,12 @@
-package com.yutou.jianrmg_v2.mglistmodel.views;
+package com.yutou.jianrmg_v2.views;
import android.app.Activity;
import android.content.Context;
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.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -18,17 +20,18 @@ 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.mglistmodel.Adapters.ReModListAdapter;
-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 com.yutou.jianrmg_v2.Adapters.ReModListAdapter;
+import com.yutou.jianrmg_v2.Data.AppData;
+import com.yutou.jianrmg_v2.Data.TMod;
+import com.yutou.jianrmg_v2.Data.TModtag;
+import com.yutou.jianrmg_v2.Interfaces.HttpInterface;
+import com.yutou.jianrmg_v2.Interfaces.ModInterface;
+import com.yutou.jianrmg_v2.Network.HttpApi;
+import com.yutou.jianrmg_v2.Network.HttpUtils;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+import com.yutou.jianrmg_v2.Tools.ModUtils;
+import com.yutou.jianrmg_v2.Tools.Utils;
import org.json.JSONObject;
@@ -45,7 +48,7 @@ import cn.droidlover.xrichtext.XRichText;
* Created by 58381 on 2018/1/26.
*/
-public class ModActivity implements BaseActivityInterface ,Serializable{
+public class ModActivity extends AppCompatActivity{
private TMod tMod;
private ImageView modImage, icon, collection_img;
private TextView title, by, downloadText;
@@ -59,19 +62,23 @@ public class ModActivity implements BaseActivityInterface ,Serializable{
private ModUtils modUtils;
private List remods;
- private LinearLayout mainLayot;
private Context context;
private Intent intent;
+ private static final String TAG="ModActivity";
+
public ModActivity(){
Log.i("初始化mod列表");
}
- @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);
+
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_mod);
+ intent=getIntent();
+ tMod = JSON.parseObject(intent.getStringExtra("mod"), TMod.class);
+ context=this;
imageLoader = Utils.initImageLoader(context);
handler = new Handler();
modUtils = ModUtils.init(context);
@@ -82,64 +89,21 @@ public class ModActivity implements BaseActivityInterface ,Serializable{
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);
+ modImage = findViewById(R.id.ModImage);
+ icon = findViewById(R.id.icon);
+ collection_img = findViewById(R.id.collection_img);
+ title = findViewById(R.id.title);
+ by = findViewById(R.id.by);
+ richText =findViewById(R.id.richText);
+ tagsLayout = findViewById(R.id.tags);
+ collection = findViewById(R.id.collection);
+ share = findViewById(R.id.share);
+ download = findViewById(R.id.download);
downloadText = download.findViewById(R.id.downloadText);
- quote = mainLayot.findViewById(R.id.quote);
+ quote = findViewById(R.id.quote);
}
private void initData(final TMod tMod) {
@@ -264,11 +228,23 @@ public class ModActivity implements BaseActivityInterface ,Serializable{
break;
case 1:
- modUtils.reBackMod(tMod);
+ modUtils.reBackMod(tMod,new ModInterface(){
+ @Override
+ public void onAction(boolean flag, int type) {
+ Log.i(TAG,"还原mod:"+flag);
+ }
+ });
+
break;
case 0:
case 2:
- modUtils.installMod(tMod);
+ modUtils.installMod(tMod,new ModInterface(){
+
+ @Override
+ public void onAction(boolean flag, int type) {
+ Log.i(TAG,"安装mod:"+flag);
+ }
+ });
break;
}
}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/MainActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/views/ModListActivity.java
similarity index 50%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/MainActivity.java
rename to app/src/main/java/com/yutou/jianrmg_v2/views/ModListActivity.java
index f41ab24..de14773 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/MainActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/views/ModListActivity.java
@@ -1,56 +1,68 @@
-package com.yutou.jianrmg_v2.basemodel.views;
+package com.yutou.jianrmg_v2.views;
+import android.content.Context;
+import android.content.Intent;
import android.os.Bundle;
+import android.support.annotation.Nullable;
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 com.alibaba.fastjson.JSON;
+import com.yutou.jianrmg_v2.Adapters.ViewPagerAdapter;
+import com.yutou.jianrmg_v2.Data.MAppMg;
+import com.yutou.jianrmg_v2.Fragments.ModListFragment_0;
+import com.yutou.jianrmg_v2.Fragments.ModListFragment_1;
+import com.yutou.jianrmg_v2.Fragments.ModListFragment_2;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
+
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 {
+/**
+ * Created by 58381 on 2018/1/25.
+ */
+public class ModListActivity extends AppCompatActivity{
private PageNavigationView tab;
private ViewPager viewPager;
- private NavigationController navigationController;
- private List list;
+ private NavigationController navigationController;
+ private List list;
+ private MAppMg appMg;
+ private Context context;
+ private Intent intent;
+
+
@Override
- protected void onCreate(Bundle savedInstanceState) {
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- ActivitysManager.finishActivity(LoadingActivity.class);
+ setContentView(R.layout.activity_mod_list);
+ this.context = context;
+ intent=getIntent();
+ appMg = JSON.parseObject(intent.getStringExtra("mg"), MAppMg.class);
+ Log.i("接受到的魔改:" + appMg.toString());
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(this));
-
+ list.add(ModListFragment_0.init(appMg));
+ list.add(ModListFragment_1.init(appMg));
+ list.add(ModListFragment_2.init(appMg));
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, "个人中心")
+ .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
@@ -69,4 +81,6 @@ public class MainActivity extends AppCompatActivity {
navigationController.setSelect(0);
}
+
+
}
diff --git a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/WebActivity.java b/app/src/main/java/com/yutou/jianrmg_v2/views/WebActivity.java
similarity index 94%
rename from BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/WebActivity.java
rename to app/src/main/java/com/yutou/jianrmg_v2/views/WebActivity.java
index 19f5d64..edab285 100644
--- a/BaseModel/src/main/java/com/yutou/jianrmg_v2/basemodel/views/WebActivity.java
+++ b/app/src/main/java/com/yutou/jianrmg_v2/views/WebActivity.java
@@ -1,4 +1,4 @@
-package com.yutou.jianrmg_v2.basemodel.views;
+package com.yutou.jianrmg_v2.views;
import android.net.http.SslError;
import android.os.Bundle;
@@ -10,8 +10,8 @@ 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;
+import com.yutou.jianrmg_v2.R;
+import com.yutou.jianrmg_v2.Tools.Log;
/**
diff --git a/BaseModel/src/main/res/anim/loading_icon.xml b/app/src/main/res/anim/loading_icon.xml
similarity index 100%
rename from BaseModel/src/main/res/anim/loading_icon.xml
rename to app/src/main/res/anim/loading_icon.xml
diff --git a/BaseModel/src/main/res/anim/loading_login.xml b/app/src/main/res/anim/loading_login.xml
similarity index 100%
rename from BaseModel/src/main/res/anim/loading_login.xml
rename to app/src/main/res/anim/loading_login.xml
diff --git a/ResModl/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/ic_launcher_foreground.xml
rename to app/src/main/res/drawable-v24/ic_launcher_foreground.xml
diff --git a/ResModl/src/main/res/drawable-v24/icon_data.png b/app/src/main/res/drawable-v24/icon_data.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_data.png
rename to app/src/main/res/drawable-v24/icon_data.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_data_select.png b/app/src/main/res/drawable-v24/icon_data_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_data_select.png
rename to app/src/main/res/drawable-v24/icon_data_select.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_home.png b/app/src/main/res/drawable-v24/icon_home.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_home.png
rename to app/src/main/res/drawable-v24/icon_home.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_home_select.png b/app/src/main/res/drawable-v24/icon_home_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_home_select.png
rename to app/src/main/res/drawable-v24/icon_home_select.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_mg.png b/app/src/main/res/drawable-v24/icon_mg.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_mg.png
rename to app/src/main/res/drawable-v24/icon_mg.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_mg_select.png b/app/src/main/res/drawable-v24/icon_mg_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_mg_select.png
rename to app/src/main/res/drawable-v24/icon_mg_select.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_my.png b/app/src/main/res/drawable-v24/icon_my.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_my.png
rename to app/src/main/res/drawable-v24/icon_my.png
diff --git a/ResModl/src/main/res/drawable-v24/icon_my_select.png b/app/src/main/res/drawable-v24/icon_my_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable-v24/icon_my_select.png
rename to app/src/main/res/drawable-v24/icon_my_select.png
diff --git a/ResModl/src/main/res/drawable/frame_button.xml b/app/src/main/res/drawable/frame_button.xml
similarity index 100%
rename from ResModl/src/main/res/drawable/frame_button.xml
rename to app/src/main/res/drawable/frame_button.xml
diff --git a/ResModl/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
similarity index 100%
rename from ResModl/src/main/res/drawable/ic_launcher_background.xml
rename to app/src/main/res/drawable/ic_launcher_background.xml
diff --git a/ResModl/src/main/res/drawable/icon_collection_not.png b/app/src/main/res/drawable/icon_collection_not.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_collection_not.png
rename to app/src/main/res/drawable/icon_collection_not.png
diff --git a/ResModl/src/main/res/drawable/icon_collection_ok.png b/app/src/main/res/drawable/icon_collection_ok.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_collection_ok.png
rename to app/src/main/res/drawable/icon_collection_ok.png
diff --git a/ResModl/src/main/res/drawable/icon_data.png b/app/src/main/res/drawable/icon_data.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_data.png
rename to app/src/main/res/drawable/icon_data.png
diff --git a/ResModl/src/main/res/drawable/icon_data_select.png b/app/src/main/res/drawable/icon_data_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_data_select.png
rename to app/src/main/res/drawable/icon_data_select.png
diff --git a/ResModl/src/main/res/drawable/icon_download.png b/app/src/main/res/drawable/icon_download.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_download.png
rename to app/src/main/res/drawable/icon_download.png
diff --git a/ResModl/src/main/res/drawable/icon_home.png b/app/src/main/res/drawable/icon_home.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_home.png
rename to app/src/main/res/drawable/icon_home.png
diff --git a/ResModl/src/main/res/drawable/icon_home_select.png b/app/src/main/res/drawable/icon_home_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_home_select.png
rename to app/src/main/res/drawable/icon_home_select.png
diff --git a/ResModl/src/main/res/drawable/icon_mg.png b/app/src/main/res/drawable/icon_mg.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_mg.png
rename to app/src/main/res/drawable/icon_mg.png
diff --git a/ResModl/src/main/res/drawable/icon_mg_select.png b/app/src/main/res/drawable/icon_mg_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_mg_select.png
rename to app/src/main/res/drawable/icon_mg_select.png
diff --git a/ResModl/src/main/res/drawable/icon_mod_lh.png b/app/src/main/res/drawable/icon_mod_lh.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_mod_lh.png
rename to app/src/main/res/drawable/icon_mod_lh.png
diff --git a/ResModl/src/main/res/drawable/icon_mod_new.png b/app/src/main/res/drawable/icon_mod_new.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_mod_new.png
rename to app/src/main/res/drawable/icon_mod_new.png
diff --git a/ResModl/src/main/res/drawable/icon_mod_q.png b/app/src/main/res/drawable/icon_mod_q.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_mod_q.png
rename to app/src/main/res/drawable/icon_mod_q.png
diff --git a/ResModl/src/main/res/drawable/icon_mod_select.png b/app/src/main/res/drawable/icon_mod_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_mod_select.png
rename to app/src/main/res/drawable/icon_mod_select.png
diff --git a/ResModl/src/main/res/drawable/icon_my.png b/app/src/main/res/drawable/icon_my.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_my.png
rename to app/src/main/res/drawable/icon_my.png
diff --git a/ResModl/src/main/res/drawable/icon_my_select.png b/app/src/main/res/drawable/icon_my_select.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_my_select.png
rename to app/src/main/res/drawable/icon_my_select.png
diff --git a/ResModl/src/main/res/drawable/icon_share.png b/app/src/main/res/drawable/icon_share.png
similarity index 100%
rename from ResModl/src/main/res/drawable/icon_share.png
rename to app/src/main/res/drawable/icon_share.png
diff --git a/ResModl/src/main/res/drawable/item_remod_list.xml b/app/src/main/res/drawable/item_remod_list.xml
similarity index 100%
rename from ResModl/src/main/res/drawable/item_remod_list.xml
rename to app/src/main/res/drawable/item_remod_list.xml
diff --git a/ResModl/src/main/res/layout/activity_base.xml b/app/src/main/res/layout/activity_base.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_base.xml
rename to app/src/main/res/layout/activity_base.xml
diff --git a/ResModl/src/main/res/layout/activity_download_list.xml b/app/src/main/res/layout/activity_download_list.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_download_list.xml
rename to app/src/main/res/layout/activity_download_list.xml
diff --git a/ResModl/src/main/res/layout/activity_loading.xml b/app/src/main/res/layout/activity_loading.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_loading.xml
rename to app/src/main/res/layout/activity_loading.xml
diff --git a/ResModl/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_main.xml
rename to app/src/main/res/layout/activity_main.xml
diff --git a/ResModl/src/main/res/layout/activity_mod.xml b/app/src/main/res/layout/activity_mod.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_mod.xml
rename to app/src/main/res/layout/activity_mod.xml
diff --git a/ResModl/src/main/res/layout/activity_mod_list.xml b/app/src/main/res/layout/activity_mod_list.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_mod_list.xml
rename to app/src/main/res/layout/activity_mod_list.xml
diff --git a/ResModl/src/main/res/layout/activity_web.xml b/app/src/main/res/layout/activity_web.xml
similarity index 100%
rename from ResModl/src/main/res/layout/activity_web.xml
rename to app/src/main/res/layout/activity_web.xml
diff --git a/app/src/main/res/layout/fragment_game_data.xml b/app/src/main/res/layout/fragment_game_data.xml
new file mode 100644
index 0000000..d5c2d22
--- /dev/null
+++ b/app/src/main/res/layout/fragment_game_data.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/ResModl/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
similarity index 100%
rename from ResModl/src/main/res/layout/fragment_home.xml
rename to app/src/main/res/layout/fragment_home.xml
diff --git a/ResModl/src/main/res/layout/fragment_mg.xml b/app/src/main/res/layout/fragment_mg.xml
similarity index 100%
rename from ResModl/src/main/res/layout/fragment_mg.xml
rename to app/src/main/res/layout/fragment_mg.xml
diff --git a/ResModl/src/main/res/layout/fragment_my.xml b/app/src/main/res/layout/fragment_my.xml
similarity index 100%
rename from ResModl/src/main/res/layout/fragment_my.xml
rename to app/src/main/res/layout/fragment_my.xml
diff --git a/ResModl/src/main/res/layout/item_download.xml b/app/src/main/res/layout/item_download.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_download.xml
rename to app/src/main/res/layout/item_download.xml
diff --git a/ResModl/src/main/res/layout/item_home.xml b/app/src/main/res/layout/item_home.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_home.xml
rename to app/src/main/res/layout/item_home.xml
diff --git a/ResModl/src/main/res/layout/item_mod_item.xml b/app/src/main/res/layout/item_mod_item.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_mod_item.xml
rename to app/src/main/res/layout/item_mod_item.xml
diff --git a/ResModl/src/main/res/layout/item_my_gridview.xml b/app/src/main/res/layout/item_my_gridview.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_my_gridview.xml
rename to app/src/main/res/layout/item_my_gridview.xml
diff --git a/ResModl/src/main/res/layout/item_my_list.xml b/app/src/main/res/layout/item_my_list.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_my_list.xml
rename to app/src/main/res/layout/item_my_list.xml
diff --git a/ResModl/src/main/res/layout/item_my_user.xml b/app/src/main/res/layout/item_my_user.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_my_user.xml
rename to app/src/main/res/layout/item_my_user.xml
diff --git a/ResModl/src/main/res/layout/item_normal.xml b/app/src/main/res/layout/item_normal.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_normal.xml
rename to app/src/main/res/layout/item_normal.xml
diff --git a/ResModl/src/main/res/layout/item_remod.xml b/app/src/main/res/layout/item_remod.xml
similarity index 100%
rename from ResModl/src/main/res/layout/item_remod.xml
rename to app/src/main/res/layout/item_remod.xml
diff --git a/ResModl/src/main/res/layout/layout_mod_bottom.xml b/app/src/main/res/layout/layout_mod_bottom.xml
similarity index 100%
rename from ResModl/src/main/res/layout/layout_mod_bottom.xml
rename to app/src/main/res/layout/layout_mod_bottom.xml
diff --git a/ResModl/src/main/res/layout/notification_download_layout.xml b/app/src/main/res/layout/notification_download_layout.xml
similarity index 100%
rename from ResModl/src/main/res/layout/notification_download_layout.xml
rename to app/src/main/res/layout/notification_download_layout.xml
diff --git a/ResModl/src/main/res/layout/switch_item.xml b/app/src/main/res/layout/switch_item.xml
similarity index 100%
rename from ResModl/src/main/res/layout/switch_item.xml
rename to app/src/main/res/layout/switch_item.xml
diff --git a/settings.gradle b/settings.gradle
index 85e39e2..bf2dd07 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app', ':GameDataModel', ':AppHome', ':BaseModel', ':ResModl', ':MgListModel', ':UserModel', ":RefreshRecyclerView"
+include ':app', ":RefreshRecyclerView"