Commit c1d9b600 by sikang

remove remoteConfig

parent d01fa264
......@@ -103,7 +103,7 @@ dependencies {
//firebase cloud message
api 'com.google.firebase:firebase-messaging:17.3.2'
//firebase remoteConfig
api 'com.google.firebase:firebase-config:16.0.0'
// api 'com.google.firebase:firebase-config:16.0.0'
//facebook accountKit SDK
......
......@@ -8,8 +8,6 @@ import android.view.View;
import com.appsflyer.AppsFlyerLib;
import com.google.firebase.FirebaseApp;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator;
......@@ -24,7 +22,6 @@ import org.litepal.LitePal;
import cn.fraudmetrix.octopus.aspirit.main.OctopusManager;
import tech.starwin.network.Gateway;
import tech.starwin.utils.TrackEventHelper;
import tech.starwin.utils.PreferencesManager;
import tech.starwin.utils.ScreenAutoSize;
import tech.starwin.utils.collection.UploadManager;
......@@ -135,14 +132,14 @@ public class LibConfig {
/**
* init FirebaseRemoteConfig
*/
private static void initFirebaseRemoteConfig() {
FirebaseRemoteConfig.getInstance().setConfigSettings(
new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(LibConfig.DEBUG)
.build()
);
TrackEventHelper.fetchRemoteConfig();
}
// private static void initFirebaseRemoteConfig() {
// FirebaseRemoteConfig.getInstance().setConfigSettings(
// new FirebaseRemoteConfigSettings.Builder()
// .setDeveloperModeEnabled(LibConfig.DEBUG)
// .build()
// );
// TrackEventHelper.fetchRemoteConfig();
// }
/**
......
......@@ -67,6 +67,8 @@ public class BitmapUtils {
*/
public static Bitmap loadBitmapCenterByPath(String path, int width, int height) {
Bitmap bitmap = loadBitmapByPath(path, width, height);//先按比例缩小到最小倍数,然后加载图片到内存
if (bitmap == null)
return null;
bitmap = scaleBitmap(bitmap, width, height);//再将加载好的图片缩放到指定大小
return cropBitmapCenter(bitmap, width, height);
}
......@@ -76,25 +78,30 @@ public class BitmapUtils {
* 按指定尺寸加载SD卡 中的图片(指定宽高保持比例缩放)
*/
public static Bitmap loadBitmapByPath(String path, float width, float height) {
int degree = readPictureDegree(path);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;//不加载bitmap到内存中
BitmapFactory.decodeFile(path, options);
float outWidth = options.outWidth;
float outHeight = options.outHeight;
options.inDither = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inSampleSize = 1;
if (outWidth != 0 && outHeight != 0 && width != 0 && height != 0) {
int scaleX = (int) (outWidth / width);
int scaleY = (int) (outHeight / height);
options.inSampleSize = scaleX < scaleY ? scaleX : scaleY;
try {
int degree = readPictureDegree(path);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;//不加载bitmap到内存中
BitmapFactory.decodeFile(path, options);
float outWidth = options.outWidth;
float outHeight = options.outHeight;
options.inDither = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inSampleSize = 1;
if (outWidth != 0 && outHeight != 0 && width != 0 && height != 0) {
int scaleX = (int) (outWidth / width);
int scaleY = (int) (outHeight / height);
options.inSampleSize = scaleX < scaleY ? scaleX : scaleY;
}
options.inJustDecodeBounds = false;
Bitmap bitmap = BitmapFactory.decodeFile(path, options);
//把图片旋转为正的方向
return rotateBitmap(bitmap, degree);
} catch (NullPointerException e) {
return null;
}
options.inJustDecodeBounds = false;
Bitmap bitmap = BitmapFactory.decodeFile(path, options);
//把图片旋转为正的方向
return rotateBitmap(bitmap, degree);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment