I have three custom views (I'll call them boxes), first two boxes needs to be side by side. Each one to utilize 50% of the width with a certain space between them and the third one needs to be on second row(or below these two boxes) utilizing full width.
Now if any of the boxes that doesn't have data, needs to be hidden and the rest of the boxes need to be adjusted. In short, these boxes needs to be adjusted based on other boxes' visibility. e.g if box 1 is hidden then we only show box2 and box3 side by side, if box2 is hidden we show box1 and box3 side by side and if two boxes are hidden the remaining box should utilize full width of the screen. This should work for both phone and tablet. Right now I have a solution that only works if I have three boxes with data, if I hide one of those, it wouldn't work as expected. Any suggestions?
Android: Is it possible to dynamically position views horizontally and vertically at the same time?
256 Views Asked by oop At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in ANDROID-LAYOUT
- Is ConstraintLayout broken?
- error: cannot find symbol View root = inflater.inflate(R.layout.toolbar, parent, false);
- C# Xamarin Android | Change Contentview from class
- RTL/LTR layout drawable as Background
- Tab ItemIndicator not visible - Android TabLayout
- Guidelines in layouts in android studio
- How to style dynamic text in android with TextView
- Is it possible to navigate from one navgraph to a different one on a different starting fragment? (Nested Navgraph)
- Open full screen fragment from smaller fragment
- Should I create a layout file for each card view I have?
- Convert coordinates in android
- why does my background color override some of my other components?
- Layout goes over recycler view instead of pushing it above
- Vertical Label In Android And Show Text In Center With Dynamic Width
- The recyclerView items doesnt shows up when i put them inside a horizontalScrollView
Related Questions in ANDROID-CONSTRAINTLAYOUT
- How ignore ConstraintLayout padding in children element
- ConstraintLayout aspect ratio
- How to Create smaller Button in Constraint Layout
- ConstraintLayout shows bad layout on preview even though on blueprint is ok
- Android constraint layout cuts off the text in textview
- Margins on children of ConstraintLayout do not display?
- Convert LinearLayout to ConstraintLayout issue
- Removing/Editing a constraint of a view inside a ConstraintLayout programmatically
- Constraint layout's width and height attributes automatically reset to 0dp
- How do I create a constraint layout programmatically
- Why even using requestLayout() after expanding view the textViews overlap each other in ConstrainLayout?
- Bad lag in Android Studio Visual Layout Editor
- ConstraintLayout drawing order/layer order
- Android Constraint Layout onMeasure not seeing soft Keyboard
- how to MODIFY a constraint layout programmatically?
Related Questions in ANDROID-FLEXBOXLAYOUT
- Displaying two or more texts horizontally based on their size Jetpack compose Android
- Android: FlexBoxLayoutManager with RecyclerView causes multiple items to refresh on calling notifyItemChanged
- FlexboxLayout Jetpack Compose any options?
- FlexBoxLayout - How to stretch buttons only when wrapped?
- Absolute position TextView inside a FlexBox Android
- How to know number of lines/rows in FlexboxLayout android
- Recycle view FlexboxLayoutManger issue
- Android nested RecyclerView with LinearLayoutManager and FlexboxLayoutManager not working properly
- How to group items within RecyclerView when using FlexboxLayoutManager
- Flexbox layout reduces my buttons in recyclerview
- How to create a grid which you can scroll both vertically and horizontally, which contains random sized elements, and works with recyclerview?
- Is it possible to have fixed number of columns with android flexbox layout
- Android: Is it possible to dynamically position views horizontally and vertically at the same time?
- Android FlexLayout spacing between views
- How to flexible new line textview and hide an item in FlexboxLayout?
Related Questions in CONSTRAINTLAYOUT-FLOW
- Constraint layout flow vertical align
- Horizontal margin does not apply to the item in a ConstraintLayout vertically aligned by Flow
- How to limit the number of line of a constraint layout flow?
- Android: Is it possible to dynamically position views horizontally and vertically at the same time?
- ConstraintLayout Flow wrapping
- How to get all children/referenced views inside a ConstraintLayout's Flow helper
- Android: How to display text at the left/right side and also at the bottom position of an image?
- Add buttons programmatically to Flow of ConstraintLayout?
- Is there any way of using ConstraintLayout's Flow helper widget programmatically?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I achieved it with this lines of code (although without spacing):