Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0

# Conflicts:
#	modules/mogo-module-tanlu/build.gradle
This commit is contained in:
zhangyuanzhen
2020-02-12 21:07:08 +08:00
153 changed files with 3063 additions and 1622 deletions

View File

@@ -62,7 +62,7 @@ public class AbsMogoApplication extends Application {
Analytics.getInstance().setAppKey( "6bbe7e0e1ecd8e2f8dc336e1678a2791" );
// 0 - debug 近实时上报积累一条埋点上报或者积累3秒上报一次。
// 2 - 本地缓存聚合上报积累30条埋点上报或者积累60秒上报一次。
AnalyticsConfig.getInstance( sApp ).setMode( DebugConfig.isDebug() ? 0 : 2 );
AnalyticsConfig.getInstance( sApp ).setMode( DebugConfig.isDebug() ? 2 : 2 );
AnalyticsConfig.getInstance( sApp ).shouldLog( DebugConfig.isDebug() );
// 初始化 arouter

View File

@@ -1,6 +1,7 @@
package com.mogo.utils.glide;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -12,6 +13,7 @@ import com.bumptech.glide.load.engine.Resource;
import com.bumptech.glide.load.engine.cache.ExternalPreferredCacheDiskCacheFactory;
import com.bumptech.glide.load.engine.cache.LruResourceCache;
import com.bumptech.glide.load.engine.cache.MemoryCache;
import com.bumptech.glide.load.engine.executor.GlideExecutor;
import com.bumptech.glide.module.AppGlideModule;
/**
@@ -32,7 +34,9 @@ public class BaseGlideModule extends AppGlideModule {
*
* 是在sdcard/Android/data/包名/cache/DISK_CACHE_NAME目录当中
*/
builder.setLogLevel(Log.VERBOSE);
builder.setMemoryCache( new LruResourceCache( MEMORY_CACHE_SIZE ) );
builder.setDiskCache( new ExternalPreferredCacheDiskCacheFactory( context, DISK_CACHE_NAME, DISK_CACHE_SIZE ) );
builder.setDiskCacheExecutor(GlideExecutor.newDiskCacheExecutor(GlideExecutor.UncaughtThrowableStrategy.DEFAULT));
}
}

View File

@@ -5,6 +5,8 @@ import android.content.SharedPreferences;
import androidx.annotation.NonNull;
import java.util.Set;
public class SharedPrefsMgr {
private static final String File_Name = "app_shared_pref";
@@ -128,4 +130,17 @@ public class SharedPrefsMgr {
}
}
public void putStringSet( String key, Set< String > values ) {
try {
SharedPreferences.Editor editor = sSharedPrefs.edit();
editor.putStringSet( key, values );
editor.apply();
} catch ( Exception e ) {
}
}
public Set<String> getStringSet( String key ) {
return sSharedPrefs.getStringSet( key, null );
}
}