🕵️ SicherheitslückenCVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition(15.09.2026 um 21:40 Uhr)
🔧 ProgrammierungEnforce GitHub Advanced Security configurations(15.09.2026 um 21:31 Uhr)
🔧 ProgrammierungHow i give my coding agent a map of the repo with Empryo(15.09.2026 um 21:54 Uhr)
🔧 ProgrammierungReef Connects Agent Feedback, Learning and Versioned Delivery(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungUAJY Handbook RAG Chatbot Splits FAISS Search From Gemini(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungKnowledge Base For AI Agents: What It Must Do(15.09.2026 um 22:00 Uhr)
🕵️ SicherheitslückenCVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition(15.09.2026 um 21:40 Uhr)
🔧 ProgrammierungEnforce GitHub Advanced Security configurations(15.09.2026 um 21:31 Uhr)
🔧 ProgrammierungHow i give my coding agent a map of the repo with Empryo(15.09.2026 um 21:54 Uhr)
🔧 ProgrammierungReef Connects Agent Feedback, Learning and Versioned Delivery(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungUAJY Handbook RAG Chatbot Splits FAISS Search From Gemini(15.09.2026 um 21:55 Uhr)
🔧 ProgrammierungKnowledge Base For AI Agents: What It Must Do(15.09.2026 um 22:00 Uhr)
1 Tag Serie
🤖 Android Tipps 🕛 vor 9 Jahren 4 Min Lesezeit
0

Build flexible layouts with FlexboxLayout

↗ Quelle (feedproxy.google.com)
🗣️ Stimme:
📑 Inhaltsübersicht
📺
feedproxy.google.com

Posted by Takeshi Hagikura, Developer Programs Engineer


At Google I/O last year we announced .



At the same time, we open sourced to Android. Here are some cases where
FlexboxLayout is particularly effective.

FlexboxLayout can be interpreted as an advanced LinearLayout
because both layouts align their child views sequentially. The significant
difference between LinearLayout and FlexboxLayout is that
FlexboxLayout has a feature for wrapping.



That means if you add the flexWrap="wrap" attribute,
FlexboxLayout puts a view to a new line if there is not enough
space left in the current line as shown in the picture below.





Nexus5X portrait











Pixel C with multi window mode enabled, divider line on the left.











Pixel C with multi window mode enabled, divider line on the right.







You would need to define multiple DP-bucket layouts (such as layout-600dp,
layout-720dp, layout-1020dp) to handle various screen sizes with traditional
layouts such as LinearLayout or RelativeLayout. But
the dialog above is built with a single FlexboxLayout.



The technique used in the example is setting the flexWrap="wrap" as
explained above,


<com .google.android.flexbox.flexboxlayout 
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:flexwrap="wrap">

then you can get the following layout where child views are aligned to a new
line instead of overflowing its parent.













You can check out the complete .
With the latest release of the , in the FlexboxLayout repository. As you can see in
the repository, each image shown in RecyclerView has a different
width. But by setting the flexWrap setting to wrap,


FlexboxLayoutManager layoutManager = new FlexboxLayoutManager();
layoutManager.setFlexWrap(FlexWrap.WRAP);

and setting the flexGrow (as you can see, you can configure the
attributes through FlexboxLayoutManager and
FlexboxLayoutManager.LayoutParams for child attributes instead of
configuring it from xml) attribute to a positive value for each child,

void bindTo(Drawable drawable) {
mImageView.setImageDrawable(drawable);
ViewGroup.LayoutParams lp = mImageView.getLayoutParams();
if (lp instanceof FlexboxLayoutManager.LayoutParams) {
FlexboxLayoutManager.LayoutParams flexboxLp =
(FlexboxLayoutManager.LayoutParams) mImageView.getLayoutParams();
flexboxLp.setFlexGrow(1.0f);
}
}

you can see every image fits within the layout nicely regardless of the screen
orientation.



- using FlexboxLayout and
FlexboxLayoutManager.

  • for other
    attributes to build flexible layouts tailored for your needs. We're very open to
    hear your feedback, if you find any issues or feature requests, please file an

  • Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf feedproxy.google.com.
    ↗ Original-Artikel auf feedproxy.google.com lesen
    Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 0%
    🟡 In Evaluierung 0%
    🟢 Keine Auswirkung 0%
    Spannende Innovation 0%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    3 Quellen
    CVE-2026-58728 | Google Android ARM64 MMU mmu.h ARM64_TLBI race condition
    1 Quelle
    DFN-CERT-2026-4853 Xcode: Eine Schwachstelle ermöglicht das Ausspähen von Informationen
    1 Quelle
    Enforce GitHub Advanced Security configurations