Git Product home page Git Product logo

Comments (9)

KingJA avatar KingJA commented on September 23, 2024

@joeyyoung4466 what do you expect?

from loadsir.

joeyyoung4466 avatar joeyyoung4466 commented on September 23, 2024

there is a simple test demo:
xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/btn_show_empty_data"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="empty_data"
        android:textSize="@dimen/font_normal"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/btn_show_success"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="success"
        android:textSize="@dimen/font_normal"
        app:layout_constraintStart_toEndOf="@+id/btn_show_empty_data"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/iv_left"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:src="@color/colorAccent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/iv_right"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn_show_empty_data" />

    <ImageView
        android:id="@+id/iv_right"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:src="@color/colorPrimary"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/iv_left"
        app:layout_constraintTop_toBottomOf="@+id/btn_show_empty_data" />
</android.support.constraint.ConstraintLayout>

if regist iv_left or iv_right , both iv_left and iv_right will dismiss

from loadsir.

KingJA avatar KingJA commented on September 23, 2024

@joeyyoung4466 I have checked out this case. As a result , LoadSir doesn't support ConstraintLayout, beacuse ConstraintLayout's custom attrs like 'app:layout_constraintBottom_toBottomOf' can't be transfered to LoadLayout. May be you can reach it by other way.

from loadsir.

joeyyoung4466 avatar joeyyoung4466 commented on September 23, 2024

got it. thanks

from loadsir.

KingJA avatar KingJA commented on September 23, 2024

@joeyyoung4466 Hey guy, maybe you could wrap the ImageView with a ViewGroup which include the arttrs. though it's not good, but it works.

from loadsir.

joeyyoung4466 avatar joeyyoung4466 commented on September 23, 2024

@KingJA yep I know what you mean.
But at some complicate layout,there is a ConstraintLayout wrap a lot of view inside, if need to regist one of there child views, it have to be wraped by another ViewGroup. as I post above,change it to:

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.knell.framesample.test.ui.activity.TestLoadSirActivity">

    <Button
        android:id="@+id/btn_show_empty_data"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="empty_data"
        android:textSize="@dimen/font_normal"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/btn_show_success"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="success"
        android:textSize="@dimen/font_normal"
        app:layout_constraintStart_toEndOf="@+id/btn_show_empty_data"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/iv_left"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:src="@color/colorAccent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/ll_right"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn_show_empty_data" />

    <LinearLayout
        android:id="@+id/ll_right"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/iv_left"
        app:layout_constraintTop_toBottomOf="@+id/btn_show_empty_data">

        <ImageView
            android:id="@+id/iv_right"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@color/colorPrimary" />
    </LinearLayout>

</android.support.constraint.ConstraintLayout>

and regist iv_right,it work perfectly.
BTW, would you consider support ConstraintLayout in future version?

from loadsir.

KingJA avatar KingJA commented on September 23, 2024

@joeyyoung4466 Thank you for using LoadSir, I will say, maybe. Enjoy youself, man.

from loadsir.

vee-zhang avatar vee-zhang commented on September 23, 2024

调试了大半天,找不到问题,看到这才惊觉,看来loadSir跟不上时代了啊,我们现在所有项目都提倡用ConstraintLayout解决重复绘制问题。

from loadsir.

songshuaiqi avatar songshuaiqi commented on September 23, 2024

确实发现有这个问题,希望后续可以优化吧

from loadsir.

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.