Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

只提需求和建议!!! 疑问或者咨询请另起Issues #46

Open
RuffianZhong opened this issue Oct 22, 2019 · 48 comments
Open

只提需求和建议!!! 疑问或者咨询请另起Issues #46

RuffianZhong opened this issue Oct 22, 2019 · 48 comments
Labels
feature Will support

Comments

@RuffianZhong
Copy link
Owner

对于本库暂时没有的需求,可以在这里提出来,会根据大众需求酌情添加,完善本库

@RuffianZhong
Copy link
Owner Author

@Zeng-Ke 希望添加分状态设置阴影功能。比如normal下有阴影,其它状态下没有阴影的 #42

@RuffianZhong
Copy link
Owner Author

@LLQQHH RImageView 一般我们是点击或者触摸的时候前景变暗,而不是更换图片(特别是图片是网络请求的),但是我好像没有看到有设置图片前景颜色的办法! #24

@RuffianZhong
Copy link
Owner Author

@azhengyongqin 希望能加个设置单个边框的属性 #8

@RuffianZhong RuffianZhong added enhancement New feature or request feature Will support and removed enhancement New feature or request labels Oct 22, 2019
@RuffianZhong RuffianZhong pinned this issue Oct 22, 2019
@scsfwgy
Copy link
Contributor

scsfwgy commented Oct 24, 2019

库非常棒,已经在线上应用,减少了很多工作量。

需求:希望可以增加全局设置RWidget默认样式,为了保持应用的统一样式以及减少模板代码的编写。比如:整一个init方法,去设置类似a.getDimensionPixelSize(R.styleable.RTextView_icon_width, 0)这里的0可以让开发者去设置,而不是给默认值,如果开发者不设置再用这些默认值。

之前尝试过

  1. 继承RWidget去设置一些默认属性,但是再去在xml中设置就会无效。
  2. xml抽取style,貌似不支持非系统控件。

看这个需求是否合理,如果合理的话我去实现这里一块也行,到时候发一个pr.

@RuffianZhong
Copy link
Owner Author

RuffianZhong commented Oct 24, 2019

@scsfwgy 个人认为这个需求还是相对小众的,你可以自行实现一下,不难。
我还是建议你使用style(style使用自定义控件属性方式如下:直接写自定义属性名称)

    <!--首页Item样式-->
    <style name="itemMain" parent="AppTheme">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">45dp</item>
        <item name="android:gravity">center</item>
        <!--RWidgetHelper-->
        <item name="background_normal">@color/colorPrimary</item>
        <item name="background_pressed">@color/colorPrimaryDark</item>
        <item name="corner_radius">6dp</item>
    </style>

虽然这种方式不会代码联想自定义属性的名称,但是足以解决你的需求,因为你想要全局设置的一般就那几个属性

@scsfwgy
Copy link
Contributor

scsfwgy commented Oct 25, 2019

嗯,看其它开发者的需求吧,需求多的话再说。我这边是对颜色、尺寸、样式都做了统一的处理。

@RuffianZhong RuffianZhong changed the title 需求收集 需求,提在这里!!! Oct 28, 2019
@baowenqing
Copy link

大佬ConstraintLayout 约束布局 以后是否支持一下 O(∩_∩)O

@RuffianZhong
Copy link
Owner Author

@liupeng110
RTextView继承的是原生的TextView所以使用原生方法就可以实现图片和文字的间距

    <com.ruffian.library.widget.RTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:drawablePadding="6dp" />

如果你想要 weight 情况下,使得图片和文本的距离可以控制,就使用 app:icon_with_text="true" (图片和文本一起居中) 结合 drawablePadding="10dp" (控制图片与文本距离)

    <com.ruffian.library.widget.RTextView
        android:id="@+id/tv_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawablePadding="10dp"
        android:gravity="center"
        android:text="@string/app_name"
        app:icon_src_normal="@mipmap/ic_launcher"
        app:icon_with_text="true" />

@RuffianZhong
Copy link
Owner Author

@baowenqing V.1.1.8 新增 RConstraintLayout。同时重新实现了RImageView 欢迎使用

@baowenqing
Copy link

父控件设置了圆角 子控件是填满的 绘制后 会没有圆角。
希望大佬加个裁剪功能。
先谢谢大佬啦!

@sangx123
Copy link

我也遇到这个问题,父控件圆角,子控件设置颜色后会覆盖父控件的圆角

@RuffianZhong
Copy link
Owner Author

@sangx123 是的,由于现在的圆角只是背景效果圆角并没有对子控件进行裁剪,所以子控件会“覆盖”底层父控件的圆角效果,下个版本考虑加上这个功能。
暂时的解决方式,您可以对子控件设置与父控件一致的圆角达到效果

@yunshuipiao
Copy link

yunshuipiao commented Apr 30, 2020

大部分控件的RTL支持,比如LinearLayout, ViewPager, RecyclerView.

@LwkCoder
Copy link

LwkCoder commented Jul 17, 2020

首先非常感谢作者,确实减少了很多工作量
另外提出一点希望改进的地方:
是否可以支持设置多个icon的方法,现在的情况是只能设置一个icon,比如:

<com.ruffian.library.widget.RTextView
        style="@style/SmallTextStyle"
        android:drawablePadding="8dp"
        android:text="2020年1月"
        android:drawableRight="@drawable/ic_arrow_right"
        app:icon_height="10dp"
        app:icon_width="10dp"
        app:icon_src_normal="@drawable/ic_calendar" />

上面代码中android:drawableRight="@drawable/ic_arrow_right"无法显示出来

希望作者支持一下多icon的情况 区分开各icon的属性
比如:
icon_left_width、icon_left_height、icon_left_src_nomal
icon_right_width、icon_right_height、icon_left_src_nomal

谢谢啦

@RuffianZhong
Copy link
Owner Author

RuffianZhong commented Jul 17, 2020

首先非常感谢作者,确实减少了很多工作量另外提出
一点希望改进的地方:
是否可以支持设置多个icon的方法,现在的情况是只能设置一个icon,可选:

<com.ruffian.library.widget.RTextView
        style="@style/SmallTextStyle"
        android:drawablePadding="8dp"
        android:text="2020年1月"
        android:drawableRight="@drawable/ic_arrow_right"
        app:icon_height="10dp"
        app:icon_width="10dp"
        app:icon_src_normal="@drawable/ic_calendar" />

上面的代码中android:drawableRight="@drawable/ic_arrow_right"无法显示出来

希望作者支持一下多图标的情况区分开各图标的属性 类别

icon_left_width,icon_left_height,icon_left_src_nomal
icon_right_width,icon_right_height,icon_left_src_nomal

谢谢啦

已实现,升级到最新版本(1.1.14/0.0.5)

@vic-tan
Copy link

vic-tan commented Jul 21, 2020

是否支持 kotlin

@RuffianZhong
Copy link
Owner Author

是否支持 kotlin

java 和 kotlin 兼容混编。有不少开发者在kotlin上使用此库,暂时没有收到不兼容的反馈

@scsfwgy
Copy link
Contributor

scsfwgy commented Jul 26, 2020

RText支持设置icon,要是能支持设置icon到文字之间的距离、支持icon大小的设置就好了。

@RuffianZhong
Copy link
Owner Author

RText支持设置icon,要是能支持设置icon到文字之间的距离、支持icon大小的设置就好了。

@scsfwgy 可以支持啊。仔细看demo和readme嘛。现在最新版本都支持任意4方向同时设置icon和大小了。至于你说的icon到文字的间距,你可以使用
icon_with_text 图片和文本一起居中 true/false
这样文字和图片就一起居中,结合原生属性drawablePadding,设置icon之间的距离。

@scsfwgy
Copy link
Contributor

scsfwgy commented Jul 30, 2020

RText支持设置icon,要是能支持设置icon到文字之间的距离、支持icon大小的设置就好了。

@scsfwgy 可以支持啊。仔细看demo和readme嘛。现在最新版本都支持任意4方向同时设置icon和大小了。至于你说的icon到文字的间距,你可以使用
icon_with_text 图片和文本一起居中 true/false
这样文字和图片就一起居中,结合原生属性drawablePadding,设置icon之间的距离。

大小的看到了。设置padding,这个需求还是挺大的,原生的不太好用😂。库很棒,基本现在样式都是用这个库实现的,赞。

@scsfwgy
Copy link
Contributor

scsfwgy commented Jul 30, 2020

image

<com.ruffian.library.widget.RTextView
                    android:id="@+id/afmwl_rtv_tabTransfer"
                    android:layout_width="0dp"
                    android:layout_height="34dp"
                    android:layout_weight="1"
                    app:border_width_normal="1dp"
                    app:border_color_normal="@color/wrapper_k_divider_design"
                    app:corner_radius="@dimen/wrapper_k_btn_corners_small"
                    android:text="划转"
                    android:gravity="center"
                    android:textSize="14sp"
                    android:textColor="@color/white"
                    app:icon_normal_left="@drawable/wallet_transfer"
                    app:icon_width_left="18dp"
                    app:icon_height_left="18dp"
                    app:icon_with_text="true"
                    app:ripple="true" />

@RuffianZhong
Copy link
Owner Author

app:ripple="true"

@scsfwgy 这里解释一下 app:icon_with_text="true" 的特性是实现那个“充值”的效果,此时图标和文本仅仅挨在一起,在此基础上你加上 android:drawablePadding="10dp" 就会将图标和文本之间的距离撑开 10dp(并且保持整体居中)

你截图上是说 图标和文本 在点击之前无法一起居中,点击之后才能一起居中吗?如果是这样的话那可能是一个bug,预期是在任何状态下都是一起居中的。我这边暂时没测到这种点击之前不能居中的情况,你另起一个 issue 描述一下使用场景,我猜测可能是有bug导致它在点击之前不能一起居中

@scsfwgy
Copy link
Contributor

scsfwgy commented Jul 30, 2020

app:ripple="true"

@scsfwgy 这里解释一下 app:icon_with_text="true" 的特性是实现那个“充值”的效果,此时图标和文本仅仅挨在一起,在此基础上你加上 android:drawablePadding="10dp" 就会将图标和文本之间的距离撑开 10dp(并且保持整体居中)

你截图上是说 图标和文本 在点击之前无法一起居中,点击之后才能一起居中吗?如果是这样的话那可能是一个bug,预期是在任何状态下都是一起居中的。我这边暂时没测到这种点击之前不能居中的情况,你另起一个 issue 描述一下使用场景,我猜测可能是有bug导致它在点击之前不能一起居中

应该是bug,我再起一个issue。另外 android:drawablePadding="10dp"这个有局限,会设置drawable四边内边距,而我想要的是仅仅设置文字到icon的距离,要想设置单边,要代码控制,还挺麻烦的。

@RuffianZhong
Copy link
Owner Author

父控件设置了圆角 子控件是填满的 绘制后 会没有圆角。
希望大佬加个裁剪功能。
先谢谢大佬啦!

最新版本已经支持控件裁剪

@RuffianZhong
Copy link
Owner Author

我也遇到这个问题,父控件圆角,子控件设置颜色后会覆盖父控件的圆角

最新版本已经支持控件裁剪

@fuguiniao
Copy link

渐变颜色设置只支持从array xml中获取 那不是还得在xml中新建对应的数组 能否直接在属性中按格式直接多个渐变颜色,用这个就是为了不想每次都要去建一堆东西

@RuffianZhong
Copy link
Owner Author

@fuguiniao 这个还好吧,相当于从配置文件获取一个值,如同string.xml中取值,你说的按照某种格式设置值不是没有想过,最终我还是觉得从array.xml中取值会好一点,从项目维护来看的话我也建议你写到xml文件中去

@tanranran
Copy link

希望可以增加不同方向的边框显示,并为每个方向的边框参数提供api设置

@tommy-siwer
Copy link

RImageView用glide加载gif无效
这个问题不知大佬有没有遇到,或者有啥别的写法没

@RuffianZhong
Copy link
Owner Author

@tommy-siwer 这是一个BUG,我抽空解决一下

@Jasperben
Copy link

RLinearLayout怎么变成圆形 RImageView怎么加shadow

@tanranran
Copy link

@Jasperben 文档上都有,把文档吃透

@TianGuisen
Copy link

可以做到为View设置宽高比例吗?

@TianGuisen
Copy link

TextInputEditText有没有说法

@BatterMan-Li
Copy link

请问如何添加边框和内容填充的间距?
目前设计图中边框和内容填充间有距离(如图),间距的颜色默认为父布局的颜色,请问如何设置?
image

@tanranran
Copy link

可以做到为View设置宽高比例吗?

@TianGuisen ConstraintLayout

@RuffianZhong
Copy link
Owner Author

请问如何添加边框和内容填充的间距?
目前设计图中边框和内容填充间有距离(如图),间距的颜色默认为父布局的颜色,请问如何设置?
image

@BatterMan-Li 抱歉,框架目前无法在一个控件中实现这个效果。这边建议你根据具体的业务使用 layer-list 或者组合控件实现

@RuffianZhong RuffianZhong changed the title 需求,提在这里!!! 只提需求和建议!!! 疑问或者咨询请另起Issues May 28, 2021
@kangjie6501
Copy link

不支持阿拉伯(RTL)布局

@scsfwgy
Copy link
Contributor

scsfwgy commented Mar 12, 2022

不支持阿拉伯(RTL)布局

同样有这个需求,面对海外用户。

@RuffianZhong
Copy link
Owner Author

@yunshuipiao @kangjie6501 @scsfwgy 最新版本(v0.0.9)已经支持RTL,请升级到最新版本。
没有新增start/end属性,使用原来属性即可。left = left || start,right = right || end

@Xxj-star
Copy link

studio 2021.3.1 版本无法预览xml demo也是一样
image

@roger66
Copy link

roger66 commented Oct 27, 2022

可以加上边框渐变色吗?

@liweiGe
Copy link

liweiGe commented Jan 30, 2023

目前有个需求是这样的,Rtextview 设置了icon_normal_left 属性,设置了一张图片,但是check,或者unable 时图片是需要隐藏的,我试了下目前暴露的api都没法满足,就算设置了透明的drawable,图片的位置还是被占用了,没有达到gone的效果,设置app:icon_src_unable="@null" 也是不行的,因为默认你用的就是normal的属性

@RuffianZhong
Copy link
Owner Author

RuffianZhong commented Jan 31, 2023

rTextView设置了个是这样这样drawable,图片的位置还是被占用了,没有达到gone的效果,设置app:icon_src_unable="@null" 也是不行的,因为默认你用的就是正常的属性

@liweiGe
这个需求可以通过设置 icon 的宽/高(小于0)

例如:textView.getHelper().setIconSizeLeft(-1,-1);

//缓存:原icon宽高
textView.getHelper().getIconWidthLeft();
textView.getHelper().getIconHeightLeft();

//隐藏时设置为 -1
textView.getHelper().setIconSizeLeft(-1,-1);

@dianchewolf
Copy link

dianchewolf commented Jul 7, 2023

这个控件非常好用,希望增加 rtextview 不同状态的 文字大小 和 样式textStyle
@RuffianZhong

@yilylong
Copy link

阴影可以单独控制哪一边显示就好了。又或者shadow_radius能控制设置给哪个边

@NicodeLee
Copy link

RTextView希望能添加删除线、下划线功能 @RuffianZhong

@Hoppen2020
Copy link

Hoppen2020 commented Feb 22, 2024

我发现圆形的阴影只能设置左上,左下,右上,右下。如果我只需要阴影在正下方,圆形形状会改变

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Will support
Projects
None yet
Development

No branches or pull requests