回归为完整APP,ROOT安装和免ROOT安装没问题
@ -8,13 +8,7 @@
|
|||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/AppHome" />
|
|
||||||
<option value="$PROJECT_DIR$/BaseModel" />
|
|
||||||
<option value="$PROJECT_DIR$/GameDataModel" />
|
|
||||||
<option value="$PROJECT_DIR$/MgListModel" />
|
|
||||||
<option value="$PROJECT_DIR$/RefreshRecyclerView" />
|
<option value="$PROJECT_DIR$/RefreshRecyclerView" />
|
||||||
<option value="$PROJECT_DIR$/ResModl" />
|
|
||||||
<option value="$PROJECT_DIR$/UserModel" />
|
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
@ -2,13 +2,7 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/AppHome/AppHome.iml" filepath="$PROJECT_DIR$/AppHome/AppHome.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/BaseModel/BaseModel.iml" filepath="$PROJECT_DIR$/BaseModel/BaseModel.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/GameDataModel/GameDataModel.iml" filepath="$PROJECT_DIR$/GameDataModel/GameDataModel.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/MgListModel/MgListModel.iml" filepath="$PROJECT_DIR$/MgListModel/MgListModel.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/RefreshRecyclerView/RefreshRecyclerView.iml" filepath="$PROJECT_DIR$/RefreshRecyclerView/RefreshRecyclerView.iml" />
|
<module fileurl="file://$PROJECT_DIR$/RefreshRecyclerView/RefreshRecyclerView.iml" filepath="$PROJECT_DIR$/RefreshRecyclerView/RefreshRecyclerView.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/ResModl/ResModl.iml" filepath="$PROJECT_DIR$/ResModl/ResModl.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/UserModel/UserModel.iml" filepath="$PROJECT_DIR$/UserModel/UserModel.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/gamedatamodel/gamedatamodel.iml" filepath="$PROJECT_DIR$/gamedatamodel/gamedatamodel.iml" />
|
<module fileurl="file://$PROJECT_DIR$/gamedatamodel/gamedatamodel.iml" filepath="$PROJECT_DIR$/gamedatamodel/gamedatamodel.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/jianrmg_v2.iml" filepath="$PROJECT_DIR$/jianrmg_v2.iml" />
|
<module fileurl="file://$PROJECT_DIR$/jianrmg_v2.iml" filepath="$PROJECT_DIR$/jianrmg_v2.iml" />
|
||||||
|
1
AppHome/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -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')
|
|
||||||
}
|
|
21
AppHome/proguard-rules.pro
vendored
@ -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
|
|
@ -1,3 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.yutou.jianrmg_v2.apphome" >
|
|
||||||
</manifest>
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -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();
|
|
||||||
|
|
||||||
}
|
|
@ -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<MAppHome> {
|
|
||||||
private ImageLoader imageLoader;
|
|
||||||
private Activity activity;
|
|
||||||
|
|
||||||
public HomeRecyclerAdapter(Context context) {
|
|
||||||
super(context);
|
|
||||||
this.activity= (Activity) context;
|
|
||||||
imageLoader = Utils.initImageLoader(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BaseViewHolder<MAppHome> onCreateBaseViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
return new CardRecordHolder(parent, R.layout.item_home);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class CardRecordHolder extends BaseViewHolder<MAppHome> {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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<MAppHome> 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<MBanner> 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<MBanner> 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<MBanner> {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">AppHome</string>
|
|
||||||
</resources>
|
|
1
BaseModel/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -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')
|
|
||||||
}
|
|
21
BaseModel/proguard-rules.pro
vendored
@ -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
|
|
@ -1,9 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.yutou.jianrmg_v2.basemodel" >
|
|
||||||
<application>
|
|
||||||
<activity android:name=".Test">
|
|
||||||
|
|
||||||
</activity>
|
|
||||||
<activity android:name=".views.WebActivity"/>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -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();
|
|
||||||
|
|
||||||
}
|
|
@ -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<ItemData> list;
|
|
||||||
private Context context;
|
|
||||||
|
|
||||||
public MyItemGridViewAdapter(List<ItemData> 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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -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 <T> List<T> ListRemoveNull(List<T> 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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/admin"
|
|
||||||
android:title="管理员">
|
|
||||||
<menu>
|
|
||||||
<item
|
|
||||||
android:id="@+id/audit"
|
|
||||||
android:title="审核">
|
|
||||||
<menu>
|
|
||||||
<item
|
|
||||||
android:id="@+id/audit_ok"
|
|
||||||
android:title="通过" />
|
|
||||||
<item
|
|
||||||
android:id="@+id/audit_no"
|
|
||||||
android:title="不通过" />
|
|
||||||
</menu>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/move"
|
|
||||||
android:title="移动到.." />
|
|
||||||
</menu>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/collection"
|
|
||||||
android:title="收藏" />
|
|
||||||
<item
|
|
||||||
android:id="@+id/download"
|
|
||||||
android:title="下载" />
|
|
||||||
</menu>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 15 KiB |
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="app_name">魔改宝盒</string>
|
|
||||||
</resources>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="colorPrimary">#3F51B5</color>
|
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
|
||||||
<color name="colorAccent">#FF4081</color>
|
|
||||||
<color name="colorAictvictBack">#f0f0f0</color>
|
|
||||||
<color name="white">#FFFFFF</color>
|
|
||||||
</resources>
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
|
||||||
</resources>
|
|
@ -1,4 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">魔改宝盒</string>
|
|
||||||
<string name="title_activity_base">BaseActivity</string>
|
|
||||||
</resources>
|
|
@ -1,21 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
|
||||||
<item name="android:windowBackground">@color/colorAictvictBack</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBar">
|
|
||||||
<item name="windowActionBar">false</item>
|
|
||||||
<item name="windowNoTitle">true</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
|
||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
|
||||||
|
|
||||||
</resources>
|
|
1
GameDataModel/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -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')
|
|
||||||
}
|
|
21
GameDataModel/proguard-rules.pro
vendored
@ -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
|
|
@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("com.yutou.jianrmg_v2.gamedatamodel.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.yutou.jianrmg_v2.gamedatamodel" />
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -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);
|
|
||||||
|
|
||||||
}
|
|
@ -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<PieEntry> 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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">GameDataModel</string>
|
|
||||||
</resources>
|
|
@ -1,2 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources></resources>
|
|
@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
1
MgListModel/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -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')
|
|
||||||
}
|
|
21
MgListModel/proguard-rules.pro
vendored
@ -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
|
|
@ -1,6 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.yutou.jianrmg_v2.mglistmodel" >
|
|
||||||
<application>
|
|
||||||
<activity android:name="views.Test"/>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -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();
|
|
||||||
|
|
||||||
}
|
|
@ -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<MAppMg> 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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<Fragment> 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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">MgListModel</string>
|
|
||||||
</resources>
|
|
1
ResModl/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -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'
|
|
||||||
}
|
|
21
ResModl/proguard-rules.pro
vendored
@ -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
|
|
@ -1,2 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.yutou.jianrmg_v2.resmodl" />
|
|
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:fillAfter="true"
|
|
||||||
android:fillBefore="false"
|
|
||||||
android:duration="2000">
|
|
||||||
<translate
|
|
||||||
android:toYDelta="-10%p"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</set>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:fillAfter="true"
|
|
||||||
android:duration="2000">
|
|
||||||
<alpha
|
|
||||||
android:toAlpha="1"
|
|
||||||
/>
|
|
||||||
</set>
|
|
@ -1,34 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/admin"
|
|
||||||
android:title="管理员">
|
|
||||||
<menu>
|
|
||||||
<item
|
|
||||||
android:id="@+id/audit"
|
|
||||||
android:title="审核">
|
|
||||||
<menu>
|
|
||||||
<item
|
|
||||||
android:id="@+id/audit_ok"
|
|
||||||
android:title="通过" />
|
|
||||||
<item
|
|
||||||
android:id="@+id/audit_no"
|
|
||||||
android:title="不通过" />
|
|
||||||
</menu>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/move"
|
|
||||||
android:title="移动到.." />
|
|
||||||
</menu>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/collection"
|
|
||||||
android:title="收藏" />
|
|
||||||
<item
|
|
||||||
android:id="@+id/download"
|
|
||||||
android:title="下载" />
|
|
||||||
</menu>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 15 KiB |
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="app_name">魔改宝盒</string>
|
|
||||||
</resources>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="colorPrimary">#3F51B5</color>
|
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
|
||||||
<color name="colorAccent">#FF4081</color>
|
|
||||||
<color name="colorAictvictBack">#f0f0f0</color>
|
|
||||||
<color name="white">#FFFFFF</color>
|
|
||||||
</resources>
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
|
||||||
</resources>
|
|
@ -1,4 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">魔改宝盒</string>
|
|
||||||
<string name="title_activity_base">BaseActivity</string>
|
|
||||||
</resources>
|
|
@ -1,21 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
|
||||||
<item name="android:windowBackground">@color/colorAictvictBack</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBar">
|
|
||||||
<item name="windowActionBar">false</item>
|
|
||||||
<item name="windowNoTitle">true</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
|
||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
|
||||||
|
|
||||||
</resources>
|
|
1
UserModel/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -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')
|
|
||||||
}
|
|
21
UserModel/proguard-rules.pro
vendored
@ -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
|
|
@ -1,2 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.jobs.usermodel" />
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -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();
|
|
||||||
|
|
||||||
}
|
|
@ -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<MyItemGridViewAdapter.ItemData> getItemData(){
|
|
||||||
List<MyItemGridViewAdapter.ItemData> 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() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">UserModel</string>
|
|
||||||
</resources>
|
|
@ -4,7 +4,7 @@ android {
|
|||||||
compileSdkVersion 26
|
compileSdkVersion 26
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.yutou.jianrmg_v2"
|
applicationId "com.yutou.jianrmg_v2"
|
||||||
minSdkVersion 21
|
minSdkVersion 19
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
@ -62,12 +62,14 @@ dependencies {
|
|||||||
implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
|
implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
|
||||||
//毛玻璃
|
//毛玻璃
|
||||||
implementation 'jp.wasabeef:glide-transformations:3.0.0'
|
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: ':GameDataModel')
|
||||||
api project(path: ':AppHome')
|
api project(path: ':AppHome')
|
||||||
api project(path: ':MgListModel')
|
api project(path: ':MgListModel')
|
||||||
api project(path: ':ResModl')
|
api project(path: ':ResModl')
|
||||||
api project(path: ':UserModel')
|
api project(path: ':UserModel')*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".basemodel.Application"
|
android:name=".Application"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
@ -37,19 +37,20 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".basemodel.views.MainActivity" />
|
|
||||||
<activity android:name=".MainActivity" />
|
<activity android:name=".MainActivity" />
|
||||||
<activity android:name="views.Test"/>
|
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".basemodel.services.DownloadService"
|
android:name=".services.DownloadService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".basemodel.views.BaseActivity"></activity>
|
android:name=".views.BaseActivity"></activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".basemodel.views.WebActivity"></activity>
|
android:name=".views.WebActivity"></activity>
|
||||||
|
<activity android:name=".views.ModListActivity"/>
|
||||||
|
<activity android:name=".views.ModActivity"/>
|
||||||
|
<activity android:name=".views.DownloadListActivity"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|