Skip to content

Commit

Permalink
阿里路由地址、style
Browse files Browse the repository at this point in the history
  • Loading branch information
haife committed Jul 14, 2020
1 parent 7f9365b commit 6844fed
Show file tree
Hide file tree
Showing 39 changed files with 1,114 additions and 29 deletions.
6 changes: 0 additions & 6 deletions app/src/main/res/values/colors.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Mcas</string>
</resources>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values/style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

</style>
</resources>
11 changes: 0 additions & 11 deletions app/src/main/res/values/styles.xml

This file was deleted.

2 changes: 1 addition & 1 deletion mcas/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ dependencies {
kapt rootProject.ext.dependencies["dagger2-compiler"]
api rootProject.ext.dependencies["butterknife"]
kapt rootProject.ext.dependencies["butterknife-compiler"]

implementation rootProject.ext.dependencies["banner"]
//test
api rootProject.ext.dependencies["timber"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,6 @@ public <T extends ISupportFragment> T findChildFragment(Class<T> fragmentClass)
return SupportHelper.findFragment(getChildFragmentManager(), fragmentClass);
}



}
32 changes: 22 additions & 10 deletions mcas/src/main/java/com/haife/mcas/di/module/AppModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.haife.mcas.integration.cache.Cache;
import com.haife.mcas.integration.cache.CacheType;
import com.haife.mcas.integration.lifecycle.ActivityLifecycleForRxLifecycle;

import com.qmuiteam.qmui.widget.dialog.QMUITipDialog;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -31,11 +31,12 @@

/**
* Copyright © KaiWu Technology Company
*
* @author Haife
* @job Android Development
* @company KW | 开物科技
* @time 2019/7/1
* @desc 提供一些框架必须的实例的 {@link Module}
* @desc 提供一些框架必须的实例的 {@link Module}
*/
@Module
public abstract class AppModule {
Expand Down Expand Up @@ -63,15 +64,32 @@ static AppManager provideAppManager(Application application) {
return AppManager.getAppManager().init(application);
}

@Binds
abstract IRepositoryManager bindRepositoryManager(RepositoryManager repositoryManager);
@Singleton
@Provides
static QMUITipDialog provideQmuiLoadingDialog(Application application) {
QMUITipDialog mTipDialog = new QMUITipDialog.Builder(application)
.setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING)
.setTipWord("加载中")
.create();
mTipDialog.show();
return mTipDialog;
}

@Singleton
@Provides
static Cache<String, Object> provideExtras(Cache.Factory cacheFactory) {
return cacheFactory.build(CacheType.EXTRAS);
}

@Singleton
@Provides
static List<FragmentManager.FragmentLifecycleCallbacks> provideFragmentLifecycles() {
return new ArrayList<>();
}

@Binds
abstract IRepositoryManager bindRepositoryManager(RepositoryManager repositoryManager);

@Binds
@Named("ActivityLifecycle")
abstract Application.ActivityLifecycleCallbacks bindActivityLifecycle(ActivityLifecycle activityLifecycle);
Expand All @@ -83,12 +101,6 @@ static Cache<String, Object> provideExtras(Cache.Factory cacheFactory) {
@Binds
abstract FragmentManager.FragmentLifecycleCallbacks bindFragmentLifecycle(FragmentLifecycle fragmentLifecycle);

@Singleton
@Provides
static List<FragmentManager.FragmentLifecycleCallbacks> provideFragmentLifecycles() {
return new ArrayList<>();
}

public interface GsonConfiguration {
void configGson(@NonNull Context context, @NonNull GsonBuilder builder);
}
Expand Down
21 changes: 21 additions & 0 deletions mcas/src/main/java/com/haife/mcas/http/ArouteUrl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.haife.mcas.http;

/**
* Copyright © LingLingYi Technology Company
*
* @author Haife
* @job Android Development
* 路由地址
*/
public class ArouteUrl {

/**
* 智能款款
*/
public static final String LOGIN_URL = "/repayment/level1";





}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.haife.mcas.http.imageloader

import android.content.Context
import android.widget.ImageView
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.haife.mcas.http.imageloader.glide.GlideArms
import com.youth.banner.loader.ImageLoader

/**
* Copyright © LingLingYi Technology Company
*
* @author Haife
* @job Android Development
* Banner ImageLoader
*/
class BannerImageLoader : ImageLoader() {
override fun displayImage(context: Context?, path: Any?, imageView: ImageView?) {
if (imageView != null) {
GlideArms.with(context!!.applicationContext)
.load(path)
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(imageView)
}

}

}
15 changes: 15 additions & 0 deletions mcas/src/main/java/com/haife/mcas/mvp/IView.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.haife.mcas.mvp;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;

import com.haife.mcas.base.App;
import com.haife.mcas.utils.McaUtils;

import static com.haife.mcas.utils.Preconditions.checkNotNull;
Expand All @@ -23,6 +25,7 @@
*/
public interface IView {


/**
* 显示加载
*/
Expand All @@ -37,6 +40,14 @@ default void hideLoading() {

}

/**
* 获取服务器数据
* @param data 服务器返回的数据
*/
default void onGetServerEntity(@NonNull Object data){

}

/**
* 显示信息
*
Expand All @@ -54,10 +65,14 @@ default void launchActivity(@NonNull Intent intent) {
McaUtils.startActivity(intent);
}



/**
* 杀死自己
*/
default void killMyself() {

}


}
31 changes: 31 additions & 0 deletions mcas/src/main/res/anim/anim_slide_activity_close_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Tencent is pleased to support the open source community by making QMUI_Android available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_factor_interpolator">

<translate
android:duration="@integer/qmui_anim_duration"
android:fromXDelta="-100%p"
android:toXDelta="0%p" />

<alpha
android:duration="@integer/qmui_anim_duration"
android:fromAlpha="0.85"
android:toAlpha="1" />

</set>
26 changes: 26 additions & 0 deletions mcas/src/main/res/anim/anim_slide_activity_close_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Tencent is pleased to support the open source community by making QMUI_Android available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_factor_interpolator">

<translate
android:duration="@integer/qmui_anim_duration"
android:fromXDelta="0%p"
android:toXDelta="100%p"/>

</set>
26 changes: 26 additions & 0 deletions mcas/src/main/res/anim/anim_slide_activity_open_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Tencent is pleased to support the open source community by making QMUI_Android available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-->
<!--Activity 进场动画-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_factor_interpolator">

<translate
android:duration="@integer/qmui_anim_duration"
android:fromXDelta="100%p"
android:toXDelta="0%p"/>

</set>
31 changes: 31 additions & 0 deletions mcas/src/main/res/anim/anim_slide_activity_open_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Tencent is pleased to support the open source community by making QMUI_Android available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/decelerate_low_factor_interpolator">

<translate
android:duration="@integer/qmui_anim_duration"
android:fromXDelta="0%p"
android:toXDelta="-100%p" />

<alpha
android:duration="@integer/qmui_anim_duration"
android:fromAlpha="1"
android:toAlpha="0.85" />

</set>
22 changes: 22 additions & 0 deletions mcas/src/main/res/color/color_common_btn_theme_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Tencent is pleased to support the open source community by making QMUI_Android available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/app_color_theme_disabled" android:state_enabled="false" />
<item android:color="@color/app_color_theme_pressed" android:state_pressed="true" />
<item android:color="@color/app_color_theme" />
</selector>
22 changes: 22 additions & 0 deletions mcas/src/main/res/color/color_common_theme_text.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Tencent is pleased to support the open source community by making QMUI_Android available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions and
limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/app_color_theme_disabled" android:state_enabled="false" />
<item android:color="@color/app_color_theme_pressed" android:state_pressed="true" />
<item android:color="@color/app_color_theme" />
</selector>
Loading

0 comments on commit 6844fed

Please sign in to comment.