Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
android-touch-event
提交
871d3e9f
A
android-touch-event
项目概览
门心叼龙
/
android-touch-event
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
android-touch-event
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
871d3e9f
编写于
5月 15, 2019
作者:
门心叼龙
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
map touch add
上级
1f3f39e5
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
269 addition
and
13 deletion
+269
-13
app/src/main/java/com/android/touchevent/MapTouchActivity.java
...rc/main/java/com/android/touchevent/MapTouchActivity.java
+2
-2
app/src/main/java/com/android/touchevent/view/BlogTransView.java
.../main/java/com/android/touchevent/view/BlogTransView.java
+0
-3
app/src/main/java/com/android/touchevent/view/FatArrowView.java
...c/main/java/com/android/touchevent/view/FatArrowView.java
+47
-0
app/src/main/java/com/android/touchevent/view/SettingBarView.java
...main/java/com/android/touchevent/view/SettingBarView.java
+134
-0
app/src/main/res/drawable/bg_usecar_arrow.xml
app/src/main/res/drawable/bg_usecar_arrow.xml
+6
-0
app/src/main/res/layout/activity_trip_detail.xml
app/src/main/res/layout/activity_trip_detail.xml
+0
-8
app/src/main/res/layout/view_setting_bar.xml
app/src/main/res/layout/view_setting_bar.xml
+52
-0
app/src/main/res/layout/view_usecar_fat_arrow.xml
app/src/main/res/layout/view_usecar_fat_arrow.xml
+16
-0
app/src/main/res/mipmap-xhdpi/usecar_icon_fold.png
app/src/main/res/mipmap-xhdpi/usecar_icon_fold.png
+0
-0
app/src/main/res/mipmap-xhdpi/usecar_icon_star.png
app/src/main/res/mipmap-xhdpi/usecar_icon_star.png
+0
-0
app/src/main/res/mipmap-xhdpi/usecar_icon_unfold.png
app/src/main/res/mipmap-xhdpi/usecar_icon_unfold.png
+0
-0
app/src/main/res/values/attrs.xml
app/src/main/res/values/attrs.xml
+12
-0
未找到文件。
app/src/main/java/com/android/touchevent/MapTouchActivity.java
浏览文件 @
871d3e9f
...
...
@@ -38,10 +38,10 @@ public class MapTouchActivity extends AppCompatActivity {
mBlogMapView
.
onCreate
(
savedInstanceState
);
init
();
init
Listener
();
}
public
void
init
()
{
public
void
init
Listener
()
{
//设置BlogScrollView的透明部分的监听器
mBlogScrollView
.
setTransViewTouchListener
(
new
BlogTransView
.
OnTouchEventListener
()
{
@Override
...
...
app/src/main/java/com/android/touchevent/view/BlogTransView.java
浏览文件 @
871d3e9f
...
...
@@ -72,8 +72,6 @@ public class BlogTransView extends RelativeLayout {
mBtnZoomChangeListener
=
listener
;
}
public
void
setBtnMapZoomChecked
(
boolean
b
)
{
if
(
mBtnMapZoom
!=
null
)
{
mBtnMapZoom
.
setChecked
(
b
);
...
...
@@ -89,7 +87,6 @@ public class BlogTransView extends RelativeLayout {
return
false
;
}
}
public
void
setDispatchEventListener
(
DispatchEventListener
dispatchEventListener
)
{
mDispatchEventListener
=
dispatchEventListener
;
}
...
...
app/src/main/java/com/android/touchevent/view/FatArrowView.java
0 → 100644
浏览文件 @
871d3e9f
package
com.android.touchevent.view
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.MotionEvent
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.RelativeLayout
;
import
com.android.touchevent.R
;
/**
* Description: <FatArrowView><br>
* Author: gxl<br>
* Date: 2019/4/9<br>
* Version: V1.0.0<br>
* Update: <br>
*/
public
class
FatArrowView
extends
RelativeLayout
{
public
static
final
String
TAG
=
FatArrowView
.
class
.
getSimpleName
();
private
CheckBox
mCheckBox
;
private
CompoundButton
.
OnCheckedChangeListener
mChangeListener
;
public
void
setChangeListener
(
CompoundButton
.
OnCheckedChangeListener
changeListener
)
{
mChangeListener
=
changeListener
;
}
public
FatArrowView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
inflate
(
context
,
R
.
layout
.
view_usecar_fat_arrow
,
this
);
mCheckBox
=
findViewById
(
R
.
id
.
check_trip_expend
);
mCheckBox
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
if
(
mChangeListener
!=
null
){
mChangeListener
.
onCheckedChanged
(
buttonView
,
isChecked
);
}
}
});
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
return
mCheckBox
.
onTouchEvent
(
event
);
}
}
app/src/main/java/com/android/touchevent/view/SettingBarView.java
0 → 100644
浏览文件 @
871d3e9f
package
com.android.touchevent.view
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.android.touchevent.R
;
/**
* Description: <SettingBarView><br>
* Author: gxl<br>
* Date: 2019/3/4<br>
* Version: V1.0.0<br>
* Update: <br>
*/
public
class
SettingBarView
extends
RelativeLayout
{
private
ImageView
imgLeftIcon
;
private
TextView
txtSetTitle
;
private
EditText
txtSetContent
;
private
ImageView
imgRightIcon
;
private
RelativeLayout
layoutSettingBar
;
private
OnClickSettingBarViewListener
mOnClickSettingBarViewListener
;
private
OnClickRightImgListener
mOnClickRightImgListener
;
private
boolean
isEdit
=
false
;
//是否需要编辑
public
interface
OnClickSettingBarViewListener
{
void
onClick
();
}
public
interface
OnClickRightImgListener
{
void
onClick
();
}
public
void
setOnClickRightImgListener
(
OnClickRightImgListener
onClickRightImgListener
)
{
mOnClickRightImgListener
=
onClickRightImgListener
;
}
public
void
setOnClickSettingBarViewListener
(
OnClickSettingBarViewListener
onClickSettingBarViewListener
)
{
mOnClickSettingBarViewListener
=
onClickSettingBarViewListener
;
}
public
SettingBarView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
inflate
(
context
,
R
.
layout
.
view_setting_bar
,
this
);
layoutSettingBar
=
findViewById
(
R
.
id
.
layout_setting_bar
);
imgLeftIcon
=
findViewById
(
R
.
id
.
img_left_icon
);
txtSetTitle
=
findViewById
(
R
.
id
.
txt_set_title
);
txtSetContent
=
findViewById
(
R
.
id
.
txt_set_content
);
imgRightIcon
=
findViewById
(
R
.
id
.
img_right_icon
);
TypedArray
typedArray
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SettingBarView
);
boolean
isVisableLeftIcon
=
typedArray
.
getBoolean
(
R
.
styleable
.
SettingBarView_set_left_icon_visable
,
false
);
boolean
isVisableRightIcon
=
typedArray
.
getBoolean
(
R
.
styleable
.
SettingBarView_set_right_icon_visable
,
false
);
String
title
=
typedArray
.
getString
(
R
.
styleable
.
SettingBarView_set_title
);
String
hint
=
typedArray
.
getString
(
R
.
styleable
.
SettingBarView_set_content_hint
);
String
content
=
typedArray
.
getString
(
R
.
styleable
.
SettingBarView_set_content
);
int
rightIcon
=
typedArray
.
getResourceId
(
R
.
styleable
.
SettingBarView_set_right_icon
,
0
);
int
leftIcon
=
typedArray
.
getResourceId
(
R
.
styleable
.
SettingBarView_set_left_icon
,
0
);
imgLeftIcon
.
setVisibility
(
isVisableLeftIcon
?
View
.
VISIBLE
:
View
.
GONE
);
txtSetTitle
.
setText
(
title
);
txtSetContent
.
setHint
(
hint
);
txtSetContent
.
setText
(
content
);
imgRightIcon
.
setVisibility
(
isVisableRightIcon
?
View
.
VISIBLE
:
View
.
GONE
);
if
(
leftIcon
>
0
)
{
imgLeftIcon
.
setImageResource
(
leftIcon
);
}
if
(
rightIcon
>
0
)
{
imgRightIcon
.
setImageResource
(
rightIcon
);
}
imgRightIcon
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
mOnClickRightImgListener
!=
null
)
{
mOnClickRightImgListener
.
onClick
();
}
}
});
layoutSettingBar
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
mOnClickSettingBarViewListener
!=
null
)
{
mOnClickSettingBarViewListener
.
onClick
();
}
}
});
}
public
void
setContent
(
String
value
)
{
if
(
txtSetContent
!=
null
&&
!
TextUtils
.
isEmpty
(
value
))
{
txtSetContent
.
setText
(
value
);
}
}
public
String
getContent
()
{
if
(
txtSetContent
!=
null
)
{
return
txtSetContent
.
getText
().
toString
();
}
return
null
;
}
public
void
enableEditContext
(
boolean
b
)
{
isEdit
=
b
;
if
(
txtSetContent
!=
null
)
{
txtSetContent
.
setEnabled
(
b
);
}
}
public
void
showImgLeftIcon
(
boolean
show
)
{
if
(
imgLeftIcon
!=
null
)
{
imgLeftIcon
.
setVisibility
(
show
?
View
.
VISIBLE
:
View
.
GONE
);
}
}
@Override
public
boolean
onInterceptTouchEvent
(
MotionEvent
ev
)
{
return
!
isEdit
;
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
return
layoutSettingBar
.
onTouchEvent
(
event
);
}
}
app/src/main/res/drawable/bg_usecar_arrow.xml
0 → 100644
浏览文件 @
871d3e9f
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@mipmap/usecar_icon_fold"
android:state_checked=
"true"
/>
<item
android:drawable=
"@mipmap/usecar_icon_unfold"
android:state_checked=
"false"
/>
<item
android:drawable=
"@mipmap/usecar_icon_unfold"
/>
</selector>
\ No newline at end of file
app/src/main/res/layout/activity_trip_detail.xml
浏览文件 @
871d3e9f
...
...
@@ -10,7 +10,6 @@
android:layout_height=
"?attr/actionBarSize"
android:background=
"?attr/colorPrimary"
app:popupTheme=
"@style/AppTheme.PopupOverlay"
/>
<RelativeLayout
...
...
@@ -26,20 +25,16 @@
android:layout_height=
"250dp"
android:layout_alignParentTop=
"true"
/>
<com.android.touchevent.view.BlogScrollView
android:id=
"@+id/view_scrollview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentTop=
"true"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.android.touchevent.view.BlogTransView
android:id=
"@+id/view_blog_trans"
android:layout_width=
"match_parent"
...
...
@@ -53,7 +48,6 @@
android:layout_height=
"wrap_content"
android:background=
"#ffffff"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
...
...
@@ -61,7 +55,6 @@
android:paddingLeft=
"16dp"
android:paddingRight=
"16dp"
>
<TextView
android:id=
"@+id/txt_trip_title"
android:layout_width=
"wrap_content"
...
...
@@ -224,7 +217,6 @@
android:padding=
"10dp"
android:text=
"RxJava线程切换之subscribeOn和observeOn详解"
/>
</LinearLayout>
<View
...
...
app/src/main/res/layout/view_setting_bar.xml
0 → 100644
浏览文件 @
871d3e9f
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id=
"@+id/layout_setting_bar"
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:paddingLeft=
"5dp"
android:paddingRight=
"10dp"
android:background=
"#FFFFFF"
>
<ImageView
android:id=
"@+id/img_left_icon"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/usecar_icon_star"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
/>
<TextView
android:id=
"@+id/txt_set_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"17sp"
android:textColor=
"#333333"
android:layout_toRightOf=
"@+id/img_left_icon"
android:layout_centerVertical=
"true"
/>
<EditText
android:id=
"@+id/txt_set_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textSize=
"15sp"
android:textColor=
"#333333"
android:layout_toRightOf=
"@+id/txt_set_title"
android:layout_toLeftOf=
"@+id/img_right_icon"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"14dp"
android:layout_marginRight=
"14dp"
android:enabled=
"false"
android:background=
"@null"
android:singleLine=
"true"
android:ellipsize=
"end"
/>
<ImageView
android:id=
"@+id/img_right_icon"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/usecar_list_icon_into"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/view_usecar_fat_arrow.xml
0 → 100644
浏览文件 @
871d3e9f
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/layout_usecar_arrow"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
tools:ignore=
"MissingDefaultResource"
>
<CheckBox
android:id=
"@+id/check_trip_expend"
android:layout_width=
"12dp"
android:layout_height=
"7dp"
android:background=
"@drawable/bg_usecar_arrow"
android:button=
"@null"
android:layout_centerInParent=
"true"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/usecar_icon_fold.png
0 → 100644
浏览文件 @
871d3e9f
385 字节
app/src/main/res/mipmap-xhdpi/usecar_icon_star.png
0 → 100644
浏览文件 @
871d3e9f
517 字节
app/src/main/res/mipmap-xhdpi/usecar_icon_unfold.png
0 → 100644
浏览文件 @
871d3e9f
385 字节
app/src/main/res/values/attrs.xml
0 → 100644
浏览文件 @
871d3e9f
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"SettingBarView"
>
<attr
name=
"set_left_icon_visable"
format=
"boolean"
/>
<attr
name=
"set_left_icon"
format=
"reference"
/>
<attr
name=
"set_title"
format=
"string"
/>
<attr
name=
"set_content"
format=
"string"
/>
<attr
name=
"set_content_hint"
format=
"string"
/>
<attr
name=
"set_right_icon_visable"
format=
"boolean"
/>
<attr
name=
"set_right_icon"
format=
"reference"
/>
</declare-styleable>
</resources>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录