Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
MVPArms
提交
8f03af1e
M
MVPArms
项目概览
门心叼龙
/
MVPArms
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MVPArms
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8f03af1e
编写于
7月 24, 2018
作者:
J
JessYan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove AutoLayout on arms
上级
70c869c7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
537 deletion
+0
-537
arms/src/main/java/com/jess/arms/widget/autolayout/AutoAppBarLayout.java
...ava/com/jess/arms/widget/autolayout/AutoAppBarLayout.java
+0
-99
arms/src/main/java/com/jess/arms/widget/autolayout/AutoCollapsingToolbarLayout.java
...s/arms/widget/autolayout/AutoCollapsingToolbarLayout.java
+0
-102
arms/src/main/java/com/jess/arms/widget/autolayout/AutoScrollView.java
.../java/com/jess/arms/widget/autolayout/AutoScrollView.java
+0
-103
arms/src/main/java/com/jess/arms/widget/autolayout/AutoTabLayout.java
...n/java/com/jess/arms/widget/autolayout/AutoTabLayout.java
+0
-124
arms/src/main/java/com/jess/arms/widget/autolayout/AutoToolbar.java
...ain/java/com/jess/arms/widget/autolayout/AutoToolbar.java
+0
-103
arms/src/main/res/values/attrs.xml
arms/src/main/res/values/attrs.xml
+0
-6
未找到文件。
arms/src/main/java/com/jess/arms/widget/autolayout/AutoAppBarLayout.java
已删除
100644 → 0
浏览文件 @
70c869c7
/*
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.widget.autolayout
;
import
android.content.Context
;
import
android.support.design.widget.AppBarLayout
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
com.zhy.autolayout.AutoLayoutInfo
;
import
com.zhy.autolayout.utils.AutoLayoutHelper
;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link AppBarLayout}
* 可使用 MVP_generator_solution 中的 AutoView 模版生成各种符合 AndroidAutoLayout 规范的 {@link View}
*
* @see <a href="https://github.com/JessYanCoding/MVPArms/wiki#3.6">AutoLayout wiki 官方文档</a>
* Created by JessYan on 4/14/2016
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================
*/
public
class
AutoAppBarLayout
extends
AppBarLayout
{
private
AutoLayoutHelper
mHelper
=
new
AutoLayoutHelper
(
this
);
public
AutoAppBarLayout
(
Context
context
)
{
super
(
context
);
}
public
AutoAppBarLayout
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
if
(!
isInEditMode
())
mHelper
.
adjustChildren
();
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
}
@Override
protected
void
onLayout
(
boolean
changed
,
int
l
,
int
t
,
int
r
,
int
b
)
{
super
.
onLayout
(
changed
,
l
,
t
,
r
,
b
);
}
@Override
public
LayoutParams
generateLayoutParams
(
AttributeSet
attrs
)
{
return
new
AutoAppBarLayout
.
LayoutParams
(
getContext
(),
attrs
);
}
public
static
class
LayoutParams
extends
AppBarLayout
.
LayoutParams
implements
AutoLayoutHelper
.
AutoLayoutParams
{
private
AutoLayoutInfo
mAutoLayoutInfo
;
public
LayoutParams
(
Context
c
,
AttributeSet
attrs
)
{
super
(
c
,
attrs
);
mAutoLayoutInfo
=
AutoLayoutHelper
.
getAutoLayoutInfo
(
c
,
attrs
);
}
@Override
public
AutoLayoutInfo
getAutoLayoutInfo
()
{
return
mAutoLayoutInfo
;
}
public
LayoutParams
(
int
width
,
int
height
)
{
super
(
width
,
height
);
}
public
LayoutParams
(
ViewGroup
.
LayoutParams
source
)
{
super
(
source
);
}
public
LayoutParams
(
MarginLayoutParams
source
)
{
super
(
source
);
}
}
}
arms/src/main/java/com/jess/arms/widget/autolayout/AutoCollapsingToolbarLayout.java
已删除
100644 → 0
浏览文件 @
70c869c7
/*
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.widget.autolayout
;
import
android.content.Context
;
import
android.support.design.widget.CollapsingToolbarLayout
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
com.zhy.autolayout.AutoLayoutInfo
;
import
com.zhy.autolayout.utils.AutoLayoutHelper
;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link CollapsingToolbarLayout}
* 可使用 MVP_generator_solution 中的 AutoView 模版生成各种符合 AndroidAutoLayout 规范的 {@link View}
*
* @see <a href="https://github.com/JessYanCoding/MVPArms/wiki#3.6">AutoLayout wiki 官方文档</a>
* Created by JessYan on 4/14/2016
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================
*/
public
class
AutoCollapsingToolbarLayout
extends
CollapsingToolbarLayout
{
private
AutoLayoutHelper
mHelper
=
new
AutoLayoutHelper
(
this
);
public
AutoCollapsingToolbarLayout
(
Context
context
)
{
super
(
context
);
}
public
AutoCollapsingToolbarLayout
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
AutoCollapsingToolbarLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
if
(!
isInEditMode
())
mHelper
.
adjustChildren
();
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
}
@Override
protected
void
onLayout
(
boolean
changed
,
int
l
,
int
t
,
int
r
,
int
b
)
{
super
.
onLayout
(
changed
,
l
,
t
,
r
,
b
);
}
@Override
public
LayoutParams
generateLayoutParams
(
AttributeSet
attrs
)
{
return
new
AutoCollapsingToolbarLayout
.
LayoutParams
(
getContext
(),
attrs
);
}
public
static
class
LayoutParams
extends
CollapsingToolbarLayout
.
LayoutParams
implements
AutoLayoutHelper
.
AutoLayoutParams
{
private
AutoLayoutInfo
mAutoLayoutInfo
;
public
LayoutParams
(
Context
c
,
AttributeSet
attrs
)
{
super
(
c
,
attrs
);
mAutoLayoutInfo
=
AutoLayoutHelper
.
getAutoLayoutInfo
(
c
,
attrs
);
}
@Override
public
AutoLayoutInfo
getAutoLayoutInfo
()
{
return
mAutoLayoutInfo
;
}
public
LayoutParams
(
int
width
,
int
height
)
{
super
(
width
,
height
);
}
public
LayoutParams
(
ViewGroup
.
LayoutParams
source
)
{
super
(
source
);
}
public
LayoutParams
(
MarginLayoutParams
source
)
{
super
(
source
);
}
}
}
arms/src/main/java/com/jess/arms/widget/autolayout/AutoScrollView.java
已删除
100644 → 0
浏览文件 @
70c869c7
/*
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.widget.autolayout
;
import
android.content.Context
;
import
android.support.annotation.Nullable
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ScrollView
;
import
com.zhy.autolayout.AutoLayoutInfo
;
import
com.zhy.autolayout.utils.AutoLayoutHelper
;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link ScrollView}
* 可使用 MVP_generator_solution 中的 AutoView 模版生成各种符合 AndroidAutoLayout 规范的 {@link View}
*
* @see <a href="https://github.com/JessYanCoding/MVPArms/wiki#3.6">AutoLayout wiki 官方文档</a>
* Created by JessYan on 4/14/2016
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================
*/
public
class
AutoScrollView
extends
ScrollView
{
private
AutoLayoutHelper
mHelper
=
new
AutoLayoutHelper
(
this
);
public
AutoScrollView
(
Context
context
)
{
super
(
context
);
}
public
AutoScrollView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
AutoScrollView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
if
(!
isInEditMode
())
mHelper
.
adjustChildren
();
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
}
@Override
protected
void
onLayout
(
boolean
changed
,
int
l
,
int
t
,
int
r
,
int
b
)
{
super
.
onLayout
(
changed
,
l
,
t
,
r
,
b
);
}
@Override
public
LayoutParams
generateLayoutParams
(
AttributeSet
attrs
)
{
return
new
AutoScrollView
.
LayoutParams
(
getContext
(),
attrs
);
}
public
static
class
LayoutParams
extends
ScrollView
.
LayoutParams
implements
AutoLayoutHelper
.
AutoLayoutParams
{
private
AutoLayoutInfo
mAutoLayoutInfo
;
public
LayoutParams
(
Context
c
,
AttributeSet
attrs
)
{
super
(
c
,
attrs
);
mAutoLayoutInfo
=
AutoLayoutHelper
.
getAutoLayoutInfo
(
c
,
attrs
);
}
@Override
public
AutoLayoutInfo
getAutoLayoutInfo
()
{
return
mAutoLayoutInfo
;
}
public
LayoutParams
(
int
width
,
int
height
)
{
super
(
width
,
height
);
}
public
LayoutParams
(
ViewGroup
.
LayoutParams
source
)
{
super
(
source
);
}
public
LayoutParams
(
MarginLayoutParams
source
)
{
super
(
source
);
}
}
}
arms/src/main/java/com/jess/arms/widget/autolayout/AutoTabLayout.java
已删除
100644 → 0
浏览文件 @
70c869c7
/*
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.widget.autolayout
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.support.design.widget.TabLayout
;
import
android.util.AttributeSet
;
import
android.util.TypedValue
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
com.jess.arms.R
;
import
com.zhy.autolayout.utils.AutoUtils
;
import
com.zhy.autolayout.utils.DimenUtils
;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link TabLayout}
* 可使用 MVP_generator_solution 中的 AutoView 模版生成各种符合 AndroidAutoLayout 规范的 {@link View}
*
* @see <a href="https://github.com/JessYanCoding/MVPArms/wiki#3.6">AutoLayout wiki 官方文档</a>
* Created by JessYan on 4/14/2016
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================
*/
public
class
AutoTabLayout
extends
TabLayout
{
private
static
final
int
NO_VALID
=
-
1
;
private
int
mTextSize
;
private
boolean
mTextSizeBaseWidth
=
false
;
public
AutoTabLayout
(
Context
context
)
{
this
(
context
,
null
);
}
public
AutoTabLayout
(
Context
context
,
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
}
public
AutoTabLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
initTextSizeBaseWidth
(
context
,
attrs
);
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
TabLayout
,
defStyleAttr
,
R
.
style
.
Widget_Design_TabLayout
);
int
tabTextAppearance
=
a
.
getResourceId
(
R
.
styleable
.
TabLayout_tabTextAppearance
,
R
.
style
.
TextAppearance_Design_Tab
);
mTextSize
=
loadTextSizeFromTextAppearance
(
tabTextAppearance
);
a
.
recycle
();
}
private
void
initTextSizeBaseWidth
(
Context
context
,
AttributeSet
attrs
)
{
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
AutoTabLayout
);
mTextSizeBaseWidth
=
a
.
getBoolean
(
R
.
styleable
.
AutoTabLayout_auto_textSize_base_width
,
false
);
a
.
recycle
();
}
private
int
loadTextSizeFromTextAppearance
(
int
textAppearanceResId
)
{
TypedArray
a
=
getContext
().
obtainStyledAttributes
(
textAppearanceResId
,
R
.
styleable
.
TextAppearance
);
try
{
if
(!
DimenUtils
.
isPxVal
(
a
.
peekValue
(
R
.
styleable
.
TextAppearance_android_textSize
)))
return
NO_VALID
;
return
a
.
getDimensionPixelSize
(
R
.
styleable
.
TextAppearance_android_textSize
,
NO_VALID
);
}
finally
{
a
.
recycle
();
}
}
@Override
public
void
addTab
(
Tab
tab
,
int
position
,
boolean
setSelected
)
{
super
.
addTab
(
tab
,
position
,
setSelected
);
setUpTabTextSize
(
tab
);
}
@Override
public
void
addTab
(
Tab
tab
,
boolean
setSelected
)
{
super
.
addTab
(
tab
,
setSelected
);
setUpTabTextSize
(
tab
);
}
private
void
setUpTabTextSize
(
Tab
tab
)
{
if
(
mTextSize
==
NO_VALID
||
tab
.
getCustomView
()
!=
null
)
return
;
ViewGroup
tabGroup
=
(
ViewGroup
)
getChildAt
(
0
);
ViewGroup
tabContainer
=
(
ViewGroup
)
tabGroup
.
getChildAt
(
tab
.
getPosition
());
TextView
textView
=
(
TextView
)
tabContainer
.
getChildAt
(
1
);
if
(
AutoUtils
.
autoed
(
textView
))
{
return
;
}
int
autoTextSize
=
0
;
if
(
mTextSizeBaseWidth
)
{
autoTextSize
=
AutoUtils
.
getPercentWidthSize
(
mTextSize
);
}
else
{
autoTextSize
=
AutoUtils
.
getPercentHeightSize
(
mTextSize
);
}
textView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_PX
,
autoTextSize
);
}
}
arms/src/main/java/com/jess/arms/widget/autolayout/AutoToolbar.java
已删除
100644 → 0
浏览文件 @
70c869c7
/*
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.widget.autolayout
;
import
android.content.Context
;
import
android.support.annotation.Nullable
;
import
android.support.v7.widget.Toolbar
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
com.zhy.autolayout.AutoLayoutInfo
;
import
com.zhy.autolayout.utils.AutoLayoutHelper
;
/**
* ================================================
* 实现 AndroidAutoLayout 规范的 {@link Toolbar}
* 可使用 MVP_generator_solution 中的 AutoView 模版生成各种符合 AndroidAutoLayout 规范的 {@link View}
*
* @see <a href="https://github.com/JessYanCoding/MVPArms/wiki#3.6">AutoLayout wiki 官方文档</a>
* Created by JessYan on 4/14/2016
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================
*/
public
class
AutoToolbar
extends
Toolbar
{
private
AutoLayoutHelper
mHelper
=
new
AutoLayoutHelper
(
this
);
public
AutoToolbar
(
Context
context
)
{
super
(
context
);
}
public
AutoToolbar
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
AutoToolbar
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
if
(!
isInEditMode
())
mHelper
.
adjustChildren
();
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
}
@Override
protected
void
onLayout
(
boolean
changed
,
int
l
,
int
t
,
int
r
,
int
b
)
{
super
.
onLayout
(
changed
,
l
,
t
,
r
,
b
);
}
@Override
public
LayoutParams
generateLayoutParams
(
AttributeSet
attrs
)
{
return
new
AutoToolbar
.
LayoutParams
(
getContext
(),
attrs
);
}
public
static
class
LayoutParams
extends
Toolbar
.
LayoutParams
implements
AutoLayoutHelper
.
AutoLayoutParams
{
private
AutoLayoutInfo
mAutoLayoutInfo
;
public
LayoutParams
(
Context
c
,
AttributeSet
attrs
)
{
super
(
c
,
attrs
);
mAutoLayoutInfo
=
AutoLayoutHelper
.
getAutoLayoutInfo
(
c
,
attrs
);
}
@Override
public
AutoLayoutInfo
getAutoLayoutInfo
()
{
return
mAutoLayoutInfo
;
}
public
LayoutParams
(
int
width
,
int
height
)
{
super
(
width
,
height
);
}
public
LayoutParams
(
ViewGroup
.
LayoutParams
source
)
{
super
(
source
);
}
public
LayoutParams
(
MarginLayoutParams
source
)
{
super
(
source
);
}
}
}
arms/src/main/res/values/attrs.xml
已删除
100644 → 0
浏览文件 @
70c869c7
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"AutoTabLayout"
>
<attr
name=
"auto_textSize_base_width"
format=
"boolean"
></attr>
</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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录