Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_highgold
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_highgold
Commits
f0a66870
Commit
f0a66870
authored
May 28, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.1.1发版 更新一览sdk
parent
0e5e19b9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
332 additions
and
7 deletions
+332
-7
build.gradle
highgold/app/build.gradle
+4
-3
ReadActivity.kt
...main/java/com/mints/highgold/ui/activitys/ReadActivity.kt
+30
-3
ReadAdapter.kt
...rc/main/java/com/mints/highgold/ui/adapter/ReadAdapter.kt
+56
-0
MainFragment.java
...ain/java/com/mints/highgold/ui/fragment/MainFragment.java
+2
-0
RecyclerViewDivider.java
...in/java/com/mints/highgold/utils/RecyclerViewDivider.java
+149
-0
activity_read.xml
highgold/app/src/main/res/layout/activity_read.xml
+21
-1
item_rv_read.xml
highgold/app/src/main/res/layout/item_rv_read.xml
+70
-0
No files found.
highgold/app/build.gradle
View file @
f0a66870
...
...
@@ -237,8 +237,9 @@ dependencies {
implementation
(
name:
'msa_mdid_1.0.13'
,
ext:
'aar'
)
// 猎豹游戏
implementation
(
name:
'cmgame-sdk-tt2103-1.1.8'
,
ext:
'aar'
)
// 增加X5,可以提高在android5.0和5.1下的游戏体验,webview比默认的做了很多优化
implementation
(
name:
'x5fit-1.1.8'
,
ext:
'aar'
)
// implementation(name: 'cmgame-sdk-tt2203-1.2.2', ext: 'aar')
// implementation(name: 'x5fit-1.2.2', ext: 'aar')
implementation
files
(
"libs/qq_x5.jar"
)
// x5版本:20190429_175122
// 鱼丸盒子
implementation
(
name:
'xzzq_ywsdk_1.0.6'
,
ext:
'aar'
)
...
...
@@ -258,11 +259,11 @@ dependencies {
// 一览视频
// implementation "com.yilan.sdk:ui:1.9.0.2"//修改为具体的sdk版本
// implementation "com.yilan.sdk:ad:1.9.0.2"//修改为具体的sdk版本,支持广点通、百度广告
implementation
(
"com.yilan.sdk:ui:2.0.0.
0
"
)
{
implementation
(
"com.yilan.sdk:ui:2.0.0.
4
"
)
{
exclude
group:
'com.yilan.sdk'
,
module:
'toutiao'
exclude
group:
'com.yilan.sdk'
,
module:
'gdt'
}
implementation
"com.yilan.sdk:ad:2.0.0.
0
"
//修改为具体的sdk版本,支持广点通、百度广告
implementation
"com.yilan.sdk:ad:2.0.0.
4
"
//修改为具体的sdk版本,支持广点通、百度广告
implementation
(
'com.aliyun.ams:alicloud-android-httpdns:1.2.3@aar'
)
{
transitive
true
}
...
...
highgold/app/src/main/java/com/mints/highgold/ui/activitys/ReadActivity.kt
View file @
f0a66870
package
com.mints.highgold.ui.activitys
import
android.support.v7.widget.DividerItemDecoration
import
android.support.v7.widget.LinearLayoutManager
import
android.view.View
import
com.mints.highgold.R
import
com.mints.highgold.mvp.presenters.ReadPresenter
import
com.mints.highgold.mvp.views.ReadView
import
com.mints.highgold.ui.activitys.base.BaseActivity
import
com.mints.highgold.ui.adapter.ReadAdapter
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
kotlinx.android.synthetic.main.activity_read.*
import
kotlinx.android.synthetic.main.header_activity.*
/**
* 描述:阅读赚钱
* 作者:孟崔广
...
...
@@ -14,11 +21,12 @@ import kotlinx.android.synthetic.main.header_activity.*
* 邮箱:mengcga@163.com
*/
class
ReadActivity
:
BaseActivity
()
,
View
.
OnClickListener
,
ReadView
{
,
View
.
OnClickListener
,
ReadView
,
OnRefreshListener
,
ReadAdapter
.
OnItemClickListener
{
private
val
TAG
=
ReadActivity
::
class
.
java
.
simpleName
private
lateinit
var
readPresenter
:
ReadPresenter
private
lateinit
var
readAdapter
:
ReadAdapter
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_read
...
...
@@ -31,6 +39,17 @@ class ReadActivity : BaseActivity()
readPresenter
=
ReadPresenter
()
readPresenter
?.
attachView
(
this
)
val
linearLayoutManager
=
LinearLayoutManager
(
this
)
rvRead
.
layoutManager
=
linearLayoutManager
val
divider
=
DividerItemDecoration
(
this
,
DividerItemDecoration
.
VERTICAL
)
rvRead
.
addItemDecoration
(
divider
)
if
(!
::
readAdapter
.
isInitialized
){
readAdapter
=
ReadAdapter
(
ArrayList
())
}
rvRead
.
adapter
=
readAdapter
readAdapter
.
setOnItemClickListener
(
this
)
}
override
fun
onDestroy
()
{
...
...
@@ -41,15 +60,23 @@ class ReadActivity : BaseActivity()
private
fun
initListener
()
{
tv_activity_back
.
setOnClickListener
(
this
)
refreshRead
.
setOnRefreshListener
(
this
)
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
tv_activity_back
->{
R
.
id
.
tv_activity_back
->
{
finish
()
}
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
// readPresenter?.reportAddCoinMsg()
}
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
)
{
showToast
(
"${position}"
)
}
}
highgold/app/src/main/java/com/mints/highgold/ui/adapter/ReadAdapter.kt
0 → 100644
View file @
f0a66870
package
com.mints.highgold.ui.adapter
import
android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
com.mints.highgold.R
class
ReadAdapter
(
val
readList
:
ArrayList
<
String
>)
:
RecyclerView
.
Adapter
<
ReadAdapter
.
ViewHolder
>(),
View
.
OnClickListener
{
lateinit
var
mOnItemClickListener
:
OnItemClickListener
inner
class
ViewHolder
(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
val
ivReadItem
:
ImageView
=
view
.
findViewById
(
R
.
id
.
ivReadItem
)
val
tvReadItemName
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvReadItemName
)
val
tvReadItemCount
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvReadItemCount
)
val
tvReadItemContent
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvReadItemContent
)
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
val
view
=
LayoutInflater
.
from
(
parent
.
context
).
inflate
(
R
.
layout
.
item_rv_read
,
parent
,
false
)
val
viewHolder
=
ViewHolder
(
view
)
//将创建的View注册点击事件
view
.
setOnClickListener
(
this
);
return
viewHolder
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
// val fruit = readList[position]
// holder.fruitName.text = fruit.name
// holder.fruitIcon.setImageResource(fruit.icon)
//将position保存在itemView的Tag中,以便点击时进行获取
holder
.
itemView
.
setTag
(
position
);
}
// override fun getItemCount() = readList.size
override
fun
getItemCount
()
=
20
//define interface
interface
OnItemClickListener
{
fun
onItemClick
(
view
:
View
?,
position
:
Int
)
}
fun
setOnItemClickListener
(
listener
:
OnItemClickListener
)
{
mOnItemClickListener
=
listener
}
override
fun
onClick
(
v
:
View
?)
{
mOnItemClickListener
?.
onItemClick
(
v
,
v
!!
.
tag
as
Int
)
}
}
\ No newline at end of file
highgold/app/src/main/java/com/mints/highgold/ui/fragment/MainFragment.java
View file @
f0a66870
...
...
@@ -47,6 +47,7 @@ import com.mints.highgold.ui.activitys.AwardActivity;
import
com.mints.highgold.ui.activitys.FriendsNewActivity
;
import
com.mints.highgold.ui.activitys.MainActivity
;
import
com.mints.highgold.ui.activitys.NewyearActivity
;
import
com.mints.highgold.ui.activitys.ReadActivity
;
import
com.mints.highgold.ui.activitys.RedboxActivity
;
import
com.mints.highgold.ui.activitys.WhatGoldActivity
;
import
com.mints.highgold.ui.activitys.WxLoginActivity
;
...
...
@@ -355,6 +356,7 @@ public class MainFragment extends BaseFragment
Bundle
bundle
;
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_fragment_main_whatgold
:
// 如何赚金币
// readyGo(ReadActivity.class);
readyGo
(
WhatGoldActivity
.
class
);
// DomobVedioAdManager.Companion.getInstance(getActivity()).loadDomobAd(10,20,"main","abc");
break
;
...
...
highgold/app/src/main/java/com/mints/highgold/utils/RecyclerViewDivider.java
0 → 100644
View file @
f0a66870
package
com
.
mints
.
highgold
.
utils
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Paint
;
import
android.graphics.Rect
;
import
android.graphics.drawable.Drawable
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.View
;
public
class
RecyclerViewDivider
extends
RecyclerView
.
ItemDecoration
{
private
Paint
mPaint
;
//分割线
private
Drawable
mDivider
;
//分割线高度,默认是2px
private
int
mDividerHeight
=
2
;
//列表的方向:LinearLayoutManager.VERTICAL或LinearLayoutManager.HORIZONTAL
private
int
mOrientation
;
private
static
final
int
[]
ATTRS
=
new
int
[]{
android
.
R
.
attr
.
listDivider
};
/**
*
* 默认分割线:高度为2px,颜色为灰色
* 获取属性值,
*
* @param context
* @param orientation 列表方向
*/
public
RecyclerViewDivider
(
Context
context
,
int
orientation
){
if
(
orientation
!=
LinearLayoutManager
.
VERTICAL
&&
orientation
!=
LinearLayoutManager
.
HORIZONTAL
)
{
throw
new
IllegalArgumentException
(
"请输入正确的参数!"
);
}
mOrientation
=
orientation
;
final
TypedArray
array
=
context
.
obtainStyledAttributes
(
ATTRS
);
mDivider
=
array
.
getDrawable
(
0
);
array
.
recycle
();
mDividerHeight
=
mDivider
.
getIntrinsicHeight
();
}
/**
* 自定义分割线
*
* @param context
* @param orientation 列表方向
* @param drawableId 分割线图片
*/
public
RecyclerViewDivider
(
Context
context
,
int
orientation
,
int
drawableId
)
{
if
(
orientation
!=
LinearLayoutManager
.
VERTICAL
&&
orientation
!=
LinearLayoutManager
.
HORIZONTAL
)
{
throw
new
IllegalArgumentException
(
"请输入正确的参数!"
);
}
mOrientation
=
orientation
;
mDivider
=
ContextCompat
.
getDrawable
(
context
,
drawableId
);
mDividerHeight
=
mDivider
.
getIntrinsicHeight
();
}
/**
* 自定义分割线
*
* @param context
* @param orientation 列表方向
* @param dividerHeight 分割线高度
* @param dividerColor 分割线颜色
*/
public
RecyclerViewDivider
(
Context
context
,
int
orientation
,
int
dividerHeight
,
int
dividerColor
)
{
if
(
orientation
!=
LinearLayoutManager
.
VERTICAL
&&
orientation
!=
LinearLayoutManager
.
HORIZONTAL
)
{
throw
new
IllegalArgumentException
(
"请输入正确的参数!"
);
}
mOrientation
=
orientation
;
mDividerHeight
=
dividerHeight
;
mPaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
mPaint
.
setColor
(
dividerColor
);
mPaint
.
setStyle
(
Paint
.
Style
.
FILL
);
}
//获取分割线尺寸
@Override
public
void
getItemOffsets
(
Rect
outRect
,
View
view
,
RecyclerView
parent
,
RecyclerView
.
State
state
)
{
if
(
mOrientation
==
LinearLayoutManager
.
VERTICAL
)
{
outRect
.
set
(
0
,
0
,
0
,
mDivider
.
getIntrinsicHeight
());
}
else
{
outRect
.
set
(
0
,
0
,
mDivider
.
getIntrinsicWidth
(),
0
);
}
outRect
.
set
(
0
,
0
,
0
,
mDividerHeight
);
}
@Override
public
void
onDraw
(
Canvas
c
,
RecyclerView
parent
,
RecyclerView
.
State
state
)
{
super
.
onDraw
(
c
,
parent
,
state
);
if
(
mOrientation
==
LinearLayoutManager
.
VERTICAL
){
drawVerticalLine
(
c
,
parent
);
}
else
{
drawHorizontalLine
(
c
,
parent
);
}
}
//为横方向item, 画分割线
private
void
drawHorizontalLine
(
Canvas
canvas
,
RecyclerView
parent
)
{
final
int
top
=
parent
.
getPaddingTop
();
final
int
bottom
=
parent
.
getMeasuredHeight
()
-
parent
.
getPaddingBottom
();
final
int
childSize
=
parent
.
getChildCount
();
for
(
int
i
=
0
;
i
<
childSize
;
i
++)
{
final
View
child
=
parent
.
getChildAt
(
i
);
RecyclerView
.
LayoutParams
layoutParams
=
(
RecyclerView
.
LayoutParams
)
child
.
getLayoutParams
();
final
int
left
=
child
.
getRight
()
+
layoutParams
.
rightMargin
;
final
int
right
=
left
+
mDividerHeight
;
if
(
mDivider
!=
null
)
{
mDivider
.
setBounds
(
left
,
top
,
right
,
bottom
);
mDivider
.
draw
(
canvas
);
}
if
(
mPaint
!=
null
)
{
canvas
.
drawRect
(
left
,
top
,
right
,
bottom
,
mPaint
);
}
}
}
//为竖方向item, 画分割线
private
void
drawVerticalLine
(
Canvas
canvas
,
RecyclerView
parent
)
{
final
int
left
=
parent
.
getPaddingLeft
();
final
int
right
=
parent
.
getMeasuredWidth
()
-
parent
.
getPaddingRight
();
final
int
childSize
=
parent
.
getChildCount
();
for
(
int
i
=
0
;
i
<
childSize
;
i
++)
{
final
View
child
=
parent
.
getChildAt
(
i
);
RecyclerView
.
LayoutParams
layoutParams
=
(
RecyclerView
.
LayoutParams
)
child
.
getLayoutParams
();
final
int
top
=
child
.
getBottom
()
+
layoutParams
.
bottomMargin
;
final
int
bottom
=
top
+
mDividerHeight
;
if
(
mDivider
!=
null
)
{
mDivider
.
setBounds
(
left
,
top
,
right
,
bottom
);
mDivider
.
draw
(
canvas
);
}
if
(
mPaint
!=
null
)
{
canvas
.
drawRect
(
left
,
top
,
right
,
bottom
,
mPaint
);
}
}
}
}
highgold/app/src/main/res/layout/activity_read.xml
View file @
f0a66870
...
...
@@ -3,9 +3,29 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:orientation=
"vertical"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".ui.activitys.ReadActivity"
>
<include
layout=
"@layout/header_activity"
/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/refreshRead"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
app:srlAccentColor=
"#999"
app:srlPrimaryColor=
"#F9F9F9"
>
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rvRead"
android:overScrollMode=
"never"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
\ No newline at end of file
highgold/app/src/main/res/layout/item_rv_read.xml
0 → 100644
View file @
f0a66870
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:padding=
"10dp"
>
<com.shehuan.niv.NiceImageView
android:id=
"@+id/ivReadItem"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:src=
"@mipmap/bg_main_top"
app:corner_radius=
"10dp"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
android:paddingLeft=
"10dp"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tvReadItemName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"淘金空间高额版"
android:textColor=
"@color/product_net_text"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tvReadItemCount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"4dp"
android:gravity=
"center_vertical"
android:text=
"+1000"
android:textColor=
"@color/main_mints"
android:textSize=
"12sp"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tvReadItemContent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:text=
"content"
android:textColor=
"@color/main_nor_color"
android:textSize=
"12sp"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tvReadItemGold"
android:layout_width=
"78dp"
android:layout_height=
"32dp"
android:background=
"@drawable/shape_main_water"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
</LinearLayout>
\ No newline at end of file
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