Skip to content

Commit

Permalink
2018.6.12
Browse files Browse the repository at this point in the history
  • Loading branch information
tome34 committed Jun 12, 2018
1 parent 19dc80d commit eb7d1df
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
implementation project(':component_data')
implementation project(':component_base')

if (!rootProject.ext.appDebug) {
if (!rootProject.ext.isModule) {
implementation project(':module_shop_mall')
implementation project(':module_shop_cart')
implementation project(':module_welfare')
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:icon="@mipmap/title_logo"
android:label="@string/app_main_name"
android:roundIcon="@mipmap/title_logo"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!-- <activity android:name=".MainActivity">
Expand Down
Binary file added app/src/main/res/mipmap-xhdpi/title_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">frameDemoMo2</string>
<string name="app_main_name">frameDemo</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>

<string name="app_name">AndroidFrame</string>
</resources>
1 change: 1 addition & 0 deletions component_base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ android {
}

dependencies {
//把implementation 用api代替,它是对外部公开的, 所有其他的module就不需要添加该依赖
implementation fileTree(dir: 'libs', include: ['*.jar'])
api rootProject.ext.dependencies["appcompat_v7"]
api rootProject.ext.dependencies["constraint_layout"]
Expand Down
11 changes: 1 addition & 10 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*全局配置信息及第三方依赖统一管理*/
ext{
appDebug = false
isModule = false
moduleShopMall = false
moduleShopCart = false
moduleWelfare = false
Expand Down Expand Up @@ -59,7 +59,6 @@ ext{
"rxbinding2" : 'com.jakewharton.rxbinding2:rxbinding:2.1.0',
//日志
"logger" : 'com.orhanobut:logger:2.1.1',

//图片
"glide" : 'com.github.bumptech.glide:glide:4.5.0',
"glide:okhttp3" : 'com.github.bumptech.glide:okhttp3-integration:4.5.0',
Expand All @@ -69,36 +68,28 @@ ext{
"photoview" : 'com.github.chrisbanes.photoview:library:1.2.4',
//时间,地址,条件选择器
"pickerView" : 'com.contrarywind:Android-PickerView:3.2.6',

//SmartRefreshLayout
"smartRefreshLayout" : 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.5.1',
"SmartRefreshHeader" : 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.5.1',

//banner
"banner" : 'com.youth.banner:banner:1.4.10',

//eventbus
"eventbus" : 'org.greenrobot:eventbus:3.0.0',

//baseRecyclerViewAdapterHelper
"baseRecyclerViewAdapterHelper" : 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.22',

//Bugly集成
"bugly" : 'com.tencent.bugly:crashreport_upgrade:latest.release',
//仿ios进度条
"kprogresshud" : 'com.kaopiz:kprogresshud:1.1.0',
//6.0权限管理
"permissionsdispatcher" : 'com.github.hotchemi:permissionsdispatcher:3.0.1',
"permissionsdispatcher_processor": 'com.github.hotchemi:permissionsdispatcher-processor:3.0.1',

//dagger 暂时没用
"dagger" : 'com.google.dagger:dagger:2.0.2',
"dagger-compiler" : 'com.google.dagger:dagger-compiler:2.0.2',
"javax-annotation" : 'org.glassfish:javax.annotation:10.0-b28',

//greendao
"greendao" : 'org.greenrobot:greendao:3.2.2',

//Android屏幕适配
"autolayout" : 'com.zhy:autolayout:1.4.5',
//安卓调试神器-Stetho
Expand Down
2 changes: 1 addition & 1 deletion module_shop_cart/src/main/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!--android:name属性——是用来设置所有activity属于哪个application的,默认是android.app.Application。-->
<application
android:name="com.example.tome.debug.MyAppCart"
android:name="com.example.tome.module.MyAppCart"
android:allowBackup="true"
android:label="购物车"
android:supportsRtl="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.tome.debug;
package com.example.tome.module;


import com.example.tome.component_base.arouter.RouterConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ protected void onCreate(Bundle savedInstanceState) {
}

private void initView() {
mTvCartTest.setText("我来了");
mTvCartTest.setText("我是购物车模块");
}
}
8 changes: 4 additions & 4 deletions module_shop_mall/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ android {
}
}

/*java插件引入了一个概念叫做SourceSets,通过修改SourceSets中的属性,可以指定哪些源文件(或文件夹下的源文件)要被编译,哪些源文件要被排除。*/
/*java插件引入了一个概念叫做SourceSets,通过修改SourceSets中的属性,可以指定哪些源文件
(或文件夹下的源文件)要被编译,哪些源文件要被排除。*/
sourceSets {
main {
if (rootProject.ext.moduleShopMall) {
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
manifest.srcFile 'src/main/module/AndroidManifest.xml'
} else {
manifest.srcFile 'src/main/AndroidManifest.xml'
java {
//排除java/debug文件夹下的所有文件
exclude '*debug'
exclude '*module'
}
}

}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.tome.debug;
package com.example.tome.module;


import com.example.tome.component_base.arouter.RouterConfig;
Expand All @@ -15,6 +15,6 @@ public class MyApp extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
RouterConfig.init(this, true);
//RouterConfig.init(this, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package="com.example.tome.module_shop_mall">
<!--android:name属性——是用来设置所有activity属于哪个application的,默认是android.app.Application。-->
<application
android:name="com.example.tome.debug.MyAppCart"
android:name="com.example.tome.module.MyApp"
android:allowBackup="true"
android:label="商品模板"
android:supportsRtl="true"
Expand Down
2 changes: 2 additions & 0 deletions module_shop_mall/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<string name="mall_app_logo">AndroidFrame</string>
<string name="mall_shop_mall_app_name">module_shop_mall</string>
<string name="mall_home_page">首页</string>
<string name="mall_home_shop">商品</string>
Expand Down
2 changes: 0 additions & 2 deletions module_welfare/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])


//Arouter路由
annotationProcessor rootProject.ext.dependencies["arouter_compiler"]
//黄油刀
Expand Down
2 changes: 2 additions & 0 deletions module_welfare/src/main/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
</intent-filter>
</activity>

<activity android:name="com.example.welfare.module_welfare.activity.ImagePreviewActivity"></activity>

<!-- autolayout meta
配置设计图的宽高,配合AutoLauout控件使用,在设计图尺寸以外的其它尺寸手机上,也能达到和设计图一样的效果
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.alibaba.android.arouter.launcher.ARouter;
import com.example.tome.component_base.base.BaseMVPActivity;
import com.example.tome.component_base.base.BasePermissionActivity;
import com.example.tome.component_base.base.BasePresenter;
import com.example.tome.component_base.base.inter.AbstractPresenter;
import com.example.tome.component_base.util.L;
import com.example.tome.component_data.d_arouter.IntentKV;
Expand All @@ -20,6 +21,8 @@
import com.example.welfare.module_welfare.R2;
import com.example.welfare.module_welfare.adapter.ImagePreviewAdapter;
import com.example.welfare.module_welfare.bean.PreviewBean;
import com.example.welfare.module_welfare.contract.SaveImageContract;
import com.example.welfare.module_welfare.presenter.SaveImagePresenter;
import com.example.welfare.module_welfare.widget.HackyViewPager;

import java.util.ArrayList;
Expand All @@ -28,7 +31,7 @@
import butterknife.ButterKnife;

@Route(path = RouterURLS.WELFARE_PREVIEW)
public class ImagePreviewActivity extends BasePermissionActivity implements View.OnClickListener {
public class ImagePreviewActivity extends BasePermissionActivity<SaveImagePresenter> implements SaveImageContract.View, View.OnClickListener {

@BindView(R2.id.view_pager)
HackyViewPager mViewPager;
Expand All @@ -45,9 +48,10 @@ public class ImagePreviewActivity extends BasePermissionActivity implements View
public int posit ;
public int cuccentPosit ;


@Override
protected AbstractPresenter getPresenter() {
return null;
protected SaveImagePresenter getPresenter() {
return new SaveImagePresenter();
}

@Override
Expand Down Expand Up @@ -108,5 +112,10 @@ public void onClick(View v) {
}


}

@Override
public void showSaveSuccess() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.welfare.module_welfare.contract;

import com.example.tome.component_base.base.inter.AbstractPresenter;
import com.example.tome.component_base.base.inter.BaseView;

/**
* @Created by TOME .
* @时间 2018/6/12 16:41
* @描述 ${TODO}
*/

public interface SaveImageContract {
interface View extends BaseView{
void showSaveSuccess();
}

interface Presenter extends AbstractPresenter<View>{
void downloadImage();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.example.welfare.module_welfare.presenter;

import com.example.tome.component_base.base.BasePresenter;
import com.example.welfare.module_welfare.api.ApiService;
import com.example.welfare.module_welfare.api.INetCallback;
import com.example.welfare.module_welfare.api.ModelService;
import com.example.welfare.module_welfare.contract.SaveImageContract;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
* @Created by TOME .
* @时间 2018/6/12 16:37
* @描述 ${下载图片}
*/

public class SaveImagePresenter extends BasePresenter<SaveImageContract.View> implements SaveImageContract.Presenter {

@Override
public void downloadImage() {
addSubscribe(ModelService.getRemoteData(true, mView, new ModelService.MethodSelect<ResponseBody>() {
@Override
public Observable<ResponseBody> selectM(ApiService service) {
return service.downPic("1");
}
}, new INetCallback<ResponseBody>() {
@Override
public void onSuccess(ResponseBody result) {

}
}));
}
}

0 comments on commit eb7d1df

Please sign in to comment.