Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
c1d9b600
Commit
c1d9b600
authored
Dec 26, 2018
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove remoteConfig
parent
d01fa264
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
30 deletions
+34
-30
build.gradle
+1
-1
src/main/java/tech/starwin/LibConfig.java
+8
-11
src/main/java/tech/starwin/utils/BitmapUtils.java
+25
-18
No files found.
build.gradle
View file @
c1d9b600
...
...
@@ -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
...
...
src/main/java/tech/starwin/LibConfig.java
View file @
c1d9b600
...
...
@@ -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();
//
}
/**
...
...
src/main/java/tech/starwin/utils/BitmapUtils.java
View file @
c1d9b600
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment