Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
15d72123
Commit
15d72123
authored
Jan 27, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
来电秀逻辑优化
parent
72a3dcbe
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
122 deletions
+48
-122
AndroidManifest.xml
GoodMoney/app/src/main/AndroidManifest.xml
+0
-2
DetailActivity.java
.../java/com/mints/goodmoney/call/detail/DetailActivity.java
+0
-102
DetailApplyActivity.java
.../com/mints/goodmoney/call/detail/DetailApplyActivity.java
+7
-4
KylVideoActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
+20
-2
activity_detail.xml
GoodMoney/app/src/main/res/layout/activity_detail.xml
+10
-0
activity_kyl_video.xml
GoodMoney/app/src/main/res/layout/activity_kyl_video.xml
+9
-10
activity_permission.xml
GoodMoney/app/src/main/res/layout/activity_permission.xml
+1
-1
item_fragment_main_my_title.xml
...y/app/src/main/res/layout/item_fragment_main_my_title.xml
+1
-1
ic_friends.png
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_friends.png
+0
-0
No files found.
GoodMoney/app/src/main/AndroidManifest.xml
View file @
15d72123
...
...
@@ -216,8 +216,6 @@
android:name=
".ui.activitys.KylVideoActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".call.detail.DetailActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".call.permission.PermissionActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".call.detail.DetailApplyActivity"
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/call/detail/DetailActivity.java
deleted
100644 → 0
View file @
72a3dcbe
package
com
.
mints
.
goodmoney
.
call
.
detail
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.provider.ContactsContract
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.VideoView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.mints.goodmoney.R
;
import
com.mints.goodmoney.call.business.VideoDBHelper
;
import
com.mints.goodmoney.call.permission.PermissionActivity
;
import
com.mints.goodmoney.call.permission.PermissionManager
;
/**
* 设置来电秀
* 作者:孟崔广
*/
public
class
DetailActivity
extends
AppCompatActivity
{
public
static
final
String
KEY_VIDEO_PATH
=
"video_path"
;
public
static
final
String
KEY_SET_RINGTONE
=
"key_set_ringtone"
;
public
static
final
int
REQUEST_ID_PICK_VIDEO_CONTACT
=
0
;
private
VideoView
mVideoView
;
private
String
mVideoPath
;
private
boolean
mSetRingtone
=
true
;
private
String
mContact
=
VideoDBHelper
.
UNKNOWN_NUMBER
;
public
static
void
startSelf
(
Context
context
,
String
path
)
{
if
(
context
==
null
)
{
return
;
}
Intent
intent
=
new
Intent
(
context
,
DetailActivity
.
class
);
intent
.
putExtra
(
DetailActivity
.
KEY_VIDEO_PATH
,
path
);
if
(!(
context
instanceof
Activity
))
{
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
}
context
.
startActivity
(
intent
);
}
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_detail
);
handleIntent
();
init
();
}
private
void
handleIntent
()
{
mVideoPath
=
getIntent
().
getStringExtra
(
KEY_VIDEO_PATH
);
}
private
void
init
()
{
mVideoView
=
findViewById
(
R
.
id
.
video_view
);
mVideoView
.
setOnPreparedListener
(
mp
->
{
mp
.
start
();
mp
.
setLooping
(
true
);
});
mVideoView
.
setVideoPath
(
mVideoPath
);
mVideoView
.
start
();
}
private
void
selectVideoContact
()
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_PICK
,
ContactsContract
.
Contacts
.
CONTENT_URI
);
startActivityForResult
(
intent
,
REQUEST_ID_PICK_VIDEO_CONTACT
);
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
REQUEST_ID_PICK_VIDEO_CONTACT
)
{
}
}
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
PermissionManager
.
getInstance
().
onRequestPermissionsResult
(
this
,
requestCode
,
permissions
,
grantResults
);
if
(
PermissionManager
.
getInstance
().
isContactEnabled
(
this
))
{
selectVideoContact
();
}
}
public
void
setShow
(
View
view
)
{
if
(
PermissionManager
.
getInstance
().
checkEssential
(
this
))
{
VideoDBHelper
.
getInstance
().
setSelectVideo
(
this
,
mContact
,
mVideoPath
);
DetailApplyActivity
.
startSelf
(
this
,
mVideoPath
,
mSetRingtone
);
}
else
{
PermissionActivity
.
startSelf
(
this
);
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/call/detail/DetailApplyActivity.java
View file @
15d72123
...
...
@@ -28,13 +28,16 @@ public class DetailApplyActivity extends AppCompatActivity {
private
boolean
mSetRingtone
=
true
;
private
String
mVideoPath
;
public
static
final
String
KEY_VIDEO_PATH
=
"video_path"
;
public
static
final
String
KEY_SET_RINGTONE
=
"key_set_ringtone"
;
public
static
void
startSelf
(
Context
context
,
String
path
,
boolean
setRingtone
)
{
if
(
context
==
null
)
{
return
;
}
Intent
intent
=
new
Intent
(
context
,
DetailApplyActivity
.
class
);
intent
.
putExtra
(
DetailActivity
.
KEY_VIDEO_PATH
,
path
);
intent
.
putExtra
(
DetailActivity
.
KEY_SET_RINGTONE
,
setRingtone
);
intent
.
putExtra
(
DetailA
pplyA
ctivity
.
KEY_VIDEO_PATH
,
path
);
intent
.
putExtra
(
DetailA
pplyA
ctivity
.
KEY_SET_RINGTONE
,
setRingtone
);
if
(!(
context
instanceof
Activity
))
{
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
}
...
...
@@ -56,8 +59,8 @@ public class DetailApplyActivity extends AppCompatActivity {
}
private
void
handleIntent
()
{
mSetRingtone
=
getIntent
().
getBooleanExtra
(
DetailActivity
.
KEY_SET_RINGTONE
,
true
);
mVideoPath
=
getIntent
().
getStringExtra
(
DetailActivity
.
KEY_VIDEO_PATH
);
mSetRingtone
=
getIntent
().
getBooleanExtra
(
DetailA
pplyA
ctivity
.
KEY_SET_RINGTONE
,
true
);
mVideoPath
=
getIntent
().
getStringExtra
(
DetailA
pplyA
ctivity
.
KEY_VIDEO_PATH
);
}
private
void
setRingtone
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
View file @
15d72123
...
...
@@ -10,7 +10,10 @@ import com.downloader.OnDownloadListener
import
com.downloader.PRDownloader
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.video.VideoAdingManager
import
com.mints.goodmoney.call.detail.DetailActivity
import
com.mints.goodmoney.call.business.VideoDBHelper
import
com.mints.goodmoney.call.detail.DetailApplyActivity
import
com.mints.goodmoney.call.permission.PermissionActivity
import
com.mints.goodmoney.call.permission.PermissionManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.VideoAdingBean
...
...
@@ -99,6 +102,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
when
(
v
?.
id
)
{
R
.
id
.
ivBack
->
finish
()
R
.
id
.
ivSetting
->
{
if
(
downloadVedioSucFlag
)
{
readyGo
()
return
}
RxPermissions
(
this
)
.
request
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
{
granted
:
Boolean
->
...
...
@@ -196,6 +203,17 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
return
}
DetailActivity
.
startSelf
(
this
@KylVideoActivity
,
vedioPathName
)
// DetailActivity.startSelf(this@KylVideoActivity, vedioPathName)
// finish()
readyGo
()
}
private
fun
readyGo
()
{
if
(
PermissionManager
.
getInstance
().
checkEssential
(
this
))
{
VideoDBHelper
.
getInstance
().
setSelectVideo
(
this
,
VideoDBHelper
.
UNKNOWN_NUMBER
,
vedioPathName
)
DetailApplyActivity
.
startSelf
(
this
,
vedioPathName
,
true
)
}
else
{
PermissionActivity
.
startSelf
(
this
)
}
}
}
GoodMoney/app/src/main/res/layout/activity_detail.xml
View file @
15d72123
...
...
@@ -3,6 +3,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<com.mints.goodmoney.call.widget.CustomVideoView
android:id=
"@+id/video_view"
android:layout_width=
"match_parent"
...
...
@@ -22,4 +23,13 @@
android:onClick=
"setShow"
android:text=
"设置来电秀"
android:textColor=
"@color/white"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"4dp"
android:layout_marginTop=
"14dp"
android:onClick=
"ivOnfinish"
android:padding=
"20dp"
android:src=
"@mipmap/ic_left_arrow"
/>
</RelativeLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/activity_kyl_video.xml
View file @
15d72123
...
...
@@ -23,17 +23,16 @@
<TextView
android:id=
"@+id/ivSetting"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"120dp"
android:drawableTop=
"@mipmap/ic_setting_vedio"
android:drawablePadding=
"4dp"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"50dp"
android:layout_marginRight=
"50dp"
android:background=
"@drawable/shape_tv_gold"
android:gravity=
"center"
android:text=
"设置来电秀"
android:textColor=
"@color/color_FF9837"
android:textSize=
"14sp"
android:layout_marginBottom=
"40dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
android:textColor=
"@color/white"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/activity_permission.xml
View file @
15d72123
...
...
@@ -118,7 +118,7 @@
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"
5
0dp"
android:layout_height=
"
4
0dp"
android:layout_marginLeft=
"60dp"
android:layout_marginTop=
"40dp"
android:layout_marginRight=
"60dp"
...
...
GoodMoney/app/src/main/res/layout/item_fragment_main_my_title.xml
View file @
15d72123
...
...
@@ -36,7 +36,7 @@
android:id=
"@+id/item_title_friends"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:drawable
Left=
"@mipmap/ic_friends_enable
"
android:drawable
Top=
"@mipmap/ic_friends
"
android:drawablePadding=
"2dp"
android:text=
"平台分红"
android:textColor=
"@color/color_FF9837"
...
...
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_friends.png
0 → 100644
View file @
15d72123
1.6 KB
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