Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f2254e50
authored
Apr 18, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
68111243
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
49 deletions
app/src/main/java/com/dayu/bigfish/InitializeActivity.java
app/src/main/java/com/dayu/bigfish/ui/fragment/HomeFirstTabFragment.java
app/src/main/java/com/dayu/bigfish/utils/HxManager.java
app/src/main/res/layout/activity_initialize_main.xml
baseSDK/build.gradle
baseSDK/src/main/java/com/dayu/common/Constants.java
baseSDK/src/main/java/com/dayu/utils/badgeNumberManger/BadgeNumberUtils.java
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/HomePersonFragment.java
app/src/main/java/com/dayu/bigfish/InitializeActivity.java
View file @
f2254e50
...
...
@@ -5,14 +5,12 @@ import android.annotation.TargetApi;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.support.annotation.NonNull
;
import
android.support.v7.app.AppCompatActivity
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.Toast
;
import
com.dayu.base.ui.activity.DataBindingActivity
;
import
com.dayu.bigfish.databinding.ActivityInitializeMainBinding
;
import
com.dayu.bigfish.ui.MainActivity
;
import
com.dayu.usercenter.ui.activity.LoginActivity
;
import
com.dayu.utils.MPermissionUtils
;
...
...
@@ -26,23 +24,22 @@ import io.reactivex.Observable;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
public
class
InitializeActivity
extends
AppCompatActivity
{
public
class
InitializeActivity
extends
DataBindingActivity
<
ActivityInitializeMainBinding
>
{
private
static
final
String
TAG
=
"InitializeActivity"
;
public
static
final
int
SDK_PERMISSION_REQUEST
=
1
;
private
Activity
mActivity
;
private
Disposable
mDisposable
;
private
String
[]
mPerArr
;
@Override
p
rotected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
)
;
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
supportRequestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
setContentView
(
R
.
layout
.
activity_initialize_main
);
p
ublic
int
getLayoutId
(
)
{
return
R
.
layout
.
activity_initialize_main
;
}
@Override
public
void
initView
()
{
MobclickAgent
.
openActivityDurationTrack
(
false
);
mActivity
=
this
;
mPerArr
=
new
String
[]{
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
String
[]
mPerArr
=
new
String
[]{
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
MPermissionUtils
.
requestPermissionsResult
(
mActivity
,
SDK_PERMISSION_REQUEST
,
mPerArr
,
new
MPermissionUtils
.
OnPermissionListener
()
{
@Override
...
...
@@ -55,8 +52,11 @@ public class InitializeActivity extends AppCompatActivity {
showPerMissionDialog
();
}
});
initVp
();
}
private
void
initVp
()
{
}
private
void
doJump
()
{
Intent
intent
;
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/HomeFirstTabFragment.java
View file @
f2254e50
...
...
@@ -10,7 +10,8 @@ import com.dayu.bigfish.presenter.homefirsttab.HomeFirstPresenter;
import
com.umeng.analytics.MobclickAgent
;
/**
* Created by luofan on 2017/11/20.
* Created by luofan
* on 2017/11/20.
*/
public
class
HomeFirstTabFragment
extends
BaseFragment
<
HomeFirstPresenter
,
FragmentFirstBinding
>
implements
HomeFirstContract
.
View
{
...
...
app/src/main/java/com/dayu/bigfish/utils/HxManager.java
View file @
f2254e50
...
...
@@ -26,7 +26,8 @@ import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
import
static
com
.
dayu
.
common
.
Constants
.
IS_DEBUG
;
/**
* Created by luofan on 2017/12/1.
* Created by luofan
* on 2017/12/1.
*/
public
class
HxManager
{
...
...
app/src/main/res/layout/activity_initialize_main.xml
View file @
f2254e50
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#ffffff"
android:background=
"#ffffff"
>
>
<android.support.v4.view.ViewPager
android:id=
"@+id/vp_initial"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/start_pager_image"
...
...
@@ -13,6 +20,7 @@
android:layout_height=
"match_parent"
android:layout_centerHorizontal=
"true"
android:background=
"@mipmap/bg_splash"
/>
android:visibility=
"visible"
/>
</RelativeLayout>
</RelativeLayout>
</layout>
\ No newline at end of file
baseSDK/build.gradle
View file @
f2254e50
...
...
@@ -28,8 +28,8 @@ android {
}
compileOptions
{
sourceCompatibility
1.
8
targetCompatibility
1.
8
sourceCompatibility
JavaVersion
.
VERSION_1_
8
targetCompatibility
JavaVersion
.
VERSION_1_
8
}
...
...
@@ -45,7 +45,7 @@ dependencies {
exclude
group:
'com.android.support'
,
module:
'support-annotations'
})
testCompile
'junit:junit:4.12'
compile
'com.android.support:design:27.1.
0
'
compile
'com.android.support:design:27.1.
1
'
//mutidex
compile
'com.android.support:multidex:1.0.3'
//eventBus
...
...
baseSDK/src/main/java/com/dayu/common/Constants.java
View file @
f2254e50
...
...
@@ -12,24 +12,24 @@ public class Constants {
/**
* 测试环境配置.
*/
public
static
final
int
LOG_LEVEL
=
LogUtils
.
LEVEL_ALL
;
public
static
final
String
ENVIROMENT
=
"debug"
;
public
static
final
String
BASE_URL
=
"http://47.94.101.239:3112"
;
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
public
final
static
String
WEB_SOP
=
"http://47.94.101.239:9004/#/sop"
;
public
final
static
String
WEB_ZHI_SHI
=
"http://47.94.101.239:9004/#/detail"
;
public
static
final
boolean
IS_DEBUG
=
true
;
//
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
//
public static final String ENVIROMENT = "debug";
//
public static final String BASE_URL = "http://47.94.101.239:3112";
//
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
//
public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
//
public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
//
public static final boolean IS_DEBUG = true;
/**
* uat环境配置.
*/
//
public static final String ENVIROMENT = "uat";
//
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
//
public static final String BASE_URL = "http://47.95.223.6:3112";
//
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
//
public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
//
public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
//
public static final boolean IS_DEBUG = true;
public
static
final
String
ENVIROMENT
=
"uat"
;
public
static
final
int
LOG_LEVEL
=
LogUtils
.
LEVEL_ALL
;
public
static
final
String
BASE_URL
=
"http://47.95.223.6:3112"
;
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
public
final
static
String
WEB_SOP
=
"http://47.95.223.6:9004/#/sop"
;
public
final
static
String
WEB_ZHI_SHI
=
"http://47.95.223.6:9004/#/detail"
;
public
static
final
boolean
IS_DEBUG
=
true
;
/**
* 正式环境.
...
...
baseSDK/src/main/java/com/dayu/utils/badgeNumberManger/BadgeNumberUtils.java
View file @
f2254e50
...
...
@@ -27,7 +27,7 @@ public class BadgeNumberUtils {
* @param context context
* @param number 角标显示的数字
*/
public
static
void
setBadgeNumberHuaWei
(
Context
context
,
int
number
)
{
static
void
setBadgeNumberHuaWei
(
Context
context
,
int
number
)
{
try
{
if
(
number
<
0
)
number
=
0
;
Bundle
bundle
=
new
Bundle
();
...
...
@@ -41,7 +41,7 @@ public class BadgeNumberUtils {
}
}
public
static
void
setBadgeNumberOPPO
(
Context
context
,
int
number
)
{
static
void
setBadgeNumberOPPO
(
Context
context
,
int
number
)
{
try
{
if
(
number
==
0
)
{
number
=
-
1
;
...
...
@@ -61,14 +61,13 @@ public class BadgeNumberUtils {
Log
.
e
(
"OPPO"
+
" Badge error"
,
"unable to resolve intent: "
+
intent
.
toString
());
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
e
(
"OPPO"
+
" Badge error"
,
"set Badge failed"
);
}
}
p
ublic
static
boolean
canResolveBroadcast
(
Context
context
,
Intent
intent
)
{
p
rivate
static
boolean
canResolveBroadcast
(
Context
context
,
Intent
intent
)
{
PackageManager
packageManager
=
context
.
getPackageManager
();
List
<
ResolveInfo
>
receivers
=
packageManager
.
queryBroadcastReceivers
(
intent
,
0
);
return
receivers
!=
null
&&
receivers
.
size
()
>
0
;
...
...
@@ -91,7 +90,7 @@ public class BadgeNumberUtils {
}
//vivo
public
static
void
setBadgeNumberVIVO
(
Context
context
,
int
number
)
{
static
void
setBadgeNumberVIVO
(
Context
context
,
int
number
)
{
try
{
Intent
intent
=
new
Intent
(
"launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM"
);
intent
.
putExtra
(
"packageName"
,
context
.
getPackageName
());
...
...
@@ -157,7 +156,7 @@ public class BadgeNumberUtils {
}
//HTC
static
void
setBadgeNumberHTC
(
Context
context
,
int
num
)
{
static
void
setBadgeNumberHTC
(
Context
context
,
int
num
)
{
try
{
Intent
intent1
=
new
Intent
(
"com.htc.launcher.action.SET_NOTIFICATION"
);
...
...
@@ -174,7 +173,7 @@ public class BadgeNumberUtils {
}
else
{
Log
.
e
(
"HTC"
+
" Badge error"
,
"unable to resolve intent: "
+
intent
.
toString
());
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
e
(
"HTC"
+
" Badge error"
,
"set Badge failed"
);
}
...
...
@@ -182,13 +181,13 @@ public class BadgeNumberUtils {
}
//NOVA
static
void
setBadgeNumberNOVA
(
Context
context
,
int
num
)
{
try
{
static
void
setBadgeNumberNOVA
(
Context
context
,
int
num
)
{
try
{
ContentValues
contentValues
=
new
ContentValues
();
contentValues
.
put
(
"tag"
,
context
.
getPackageName
()
+
"/"
+
context
.
getPackageManager
().
getLaunchIntentForPackage
(
context
.
getPackageName
()).
getComponent
().
getClassName
());
contentValues
.
put
(
"tag"
,
context
.
getPackageName
()
+
"/"
+
context
.
getPackageManager
().
getLaunchIntentForPackage
(
context
.
getPackageName
()).
getComponent
().
getClassName
());
contentValues
.
put
(
"count"
,
num
);
context
.
getContentResolver
().
insert
(
Uri
.
parse
(
"content://com.teslacoilsw.notifier/unread_count"
),
contentValues
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
e
(
"NOVA"
+
" Badge error"
,
"set Badge failed"
);
}
...
...
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/HomePersonFragment.java
View file @
f2254e50
...
...
@@ -252,8 +252,10 @@ public class HomePersonFragment extends BaseFragment<HomePersonPresenter, Fragme
public
void
onResume
()
{
super
.
onResume
();
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
();
if
(
userInfo
!=
null
){
mPresenter
.
mUrl
.
set
(
userInfo
.
getHeaderImg
());
}
}
@Override
...
...
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