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 @@ - - - - - - - - - - - -