Code Monkey home page Code Monkey logo

Comments (11)

angcyo avatar angcyo commented on July 30, 2024 1

3.0.0 后, 支持RTL.

注意: Demo中使用的是系统ViewPager, 默认是不支持RTL的.

可以参考以下库:
https://github.com/diego-gomez-olvera/RtlViewPager

from dsltablayout.

angcyo avatar angcyo commented on July 30, 2024

抱歉, 还没考虑到需要支持RTL的情况!

你可以把UI设计需求给我看下么?

目前你可以用动态addView的形式达到效果.

from dsltablayout.

yunnec avatar yunnec commented on July 30, 2024

WX20191224-104636@2x

不太方面直接传UI,基本是这个样子的,上下两个tablayout,其中二级tablayout的item会比较多,具体数量是从服务端获取的。比较关键的点是要支持RTL。

from dsltablayout.

angcyo avatar angcyo commented on July 30, 2024

上述布局 要变成
TAB1-3 TAB1-2 TAB1-1
TAB2-4 TAB2-3 TAB2-2 TAB2-1

然后其他代码不变, 只是单纯的RTL布局方式? index需要RTL吗?

from dsltablayout.

yunnec avatar yunnec commented on July 30, 2024

我这边index可能不太用的到,因为比较紧急,我先使用RTL情况下切换数据源的方式来实现了。能支持index的话还是更好一些。

from dsltablayout.

XiongKe94 avatar XiongKe94 commented on July 30, 2024

@angcyo 能不能扩展布局从右到左方向如图。
屏幕快照 2020-12-23 16 21 35

屏幕快照 2020-12-23 16 22 07

布局不同index都是一样的,比如“更新”item index==0

from dsltablayout.

scsfwgy avatar scsfwgy commented on July 30, 2024

需求+1,应用需要支持阿拉伯语。基本可以理解为正常用户布局的镜像。就是对Rtl的支持。

from dsltablayout.

scsfwgy avatar scsfwgy commented on July 30, 2024

这个东西理论上不是通过改变数据源方式进行支持的。像原生控件,TextView,ViewGroup默认都是支持的,只要语言跳转为阿拉伯语,UI自动镜像。

from dsltablayout.

angcyo avatar angcyo commented on July 30, 2024

需求+1,应用需要支持阿拉伯语。基本可以理解为正常用户布局的镜像。就是对Rtl的支持。

如果布局支持RTL, 那滚动方向是不是和LTR反过来了?

比如: LTR时, 滚动有效值是0~1000, 但是RTL时, 滚动有效值就是-1000~0? 是这样的么?

from dsltablayout.

scsfwgy avatar scsfwgy commented on July 30, 2024

应该不是吧。你看一下LinearLayout的源码,他就是把索引currIndex=count-1,换句话说就是tab的tab第一个跑到了最后一个,反转过来。其他应该不动。android-29 LinearLayout line:1750。点击事件:最后一个index成了第一个。

image

from dsltablayout.

angcyo avatar angcyo commented on July 30, 2024

LinearLayout不涉及滚动, 只具备布局的参考价值.

看了下HorizontalScrollView的代码, 发现滚动也是反过来的.

from dsltablayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.