viewgroup

Android — Hiding Views

好久不见. 提交于 2019-12-21 20:24:46
问题 Okay, so I've done some looking around and I see how you are SUPPOSED to do it, but for me, it is just not working. I need to be able to set the alpha of a RelativeLayout both in XML and in code. For my XML, I have the following <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/player_controls" android:layout_height="match_parent" android:layout_width="match_parent" android:alpha="0.0"> <RelativeLayout android

How to create custom gridview (Like matrix structure ) in Android

给你一囗甜甜゛ 提交于 2019-12-21 19:54:46
问题 I want to create a matrix like gridview say 10x20 matrix we want to specify the number of rows and column of the View ie 10x20 if the screen is low it should scroll to horizontally and vertically for example the image below describe the Matrix Gridview Each cell represent (0,0) (0,1) etc... (1,0) (1,1) etc.. How can generate this type of view? Advance Thanks ....!!! 回答1: try this: GridViewCustomAdapter import java.util.ArrayList; import android.app.Activity; import android.content.Context;

Views within a Custom ViewGroup are not showing

守給你的承諾、 提交于 2019-12-13 12:06:12
问题 I have recently delved into creating custom ViewGroups and have encountered a problem I can't figure out. I have 2 ViewGroups - ViewManager and Article ViewManager simply lays out an Article below the previous Article (ie like a vertical LinearLayout) Article arranges several TextViews and an ImageView as you can see in the image. Creating a single Article and adding it to ViewManager works fine and everything shows up but when I add a second Article none of the content of the Article is

setMargins method is not working on custom ViewGroup

99封情书 提交于 2019-12-12 10:06:52
问题 I am working on a project where my portion of work is to create a sliding layout on main screen which will partially appear at bottom when the app will start and we can scroll that layout. And then I have to add child views inside of it which will be cards. Now for that I have created a custom ViewGroup and I will add them programmatically. I have succeed in making most of the portion of the task. I have created a custom FrameLayout for sliding layout. Then I used it and added in XML. <?xml

Android ViewGroup ticker

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 19:58:04
问题 I am developing an Android component that has the same functionality as a news Ticker. It's a ViewGroup that takes an array of Views and animate them to create the effect of a Ticker. I have implemented the onMeasure and onLayout methods, and I have a timer that calls a method every X time to refresh the position of every View . It basically moves the position of every child by 5 pixels lets say. Everything is working great so far, but the problem is that a few seconds after the Views start

How to correctly override onLayout Method in a Viewgroup class

假装没事ソ 提交于 2019-12-11 12:19:27
问题 I have a class extending from a view group class. Now I know that in onLayout you have to call the layout method on each children. The question here is what values should be passed to the child layout. In my view I inflate a xml and attach it to this class (The width and height are defined in xml). In onlayout I get one child count which is correct but the width and height of the child is returning 0. How I can get the width and height of the child. And if I am setting the position and

How to do Android Accessibility for custom viewgroups

眉间皱痕 提交于 2019-12-11 11:39:19
问题 I have a CustomViewGroup that extends from a ViewGroup. In it I have 2 text views and 3, 4 different buttons that I inflate from different XML files. My problem is that it does not seem to be accessible. What do I need to do at my end to see whats the problem? Can you someone please point me to a good article or resource about accessibility ? The Androiid docs are very hard for me to follow. I am specifically looking for source code for extending ViewGRoups and using it. Thanks 回答1: You

Embed activity of application A inside application B's viewgroup in android

我的梦境 提交于 2019-12-11 03:37:19
问题 My requirement is as follows: I have two of my application, one is Application A and Application B. Now I want them to work individually as well as mutually We can assume this is the scenario which I need(assumed): Application A has activity DoPlusMinusActivity which is having two EditText box and two buttons named Add and subtract, which does the appropriate function as their name and store the result. Application B has activity MultipleCalcActivity which is having some EditText box and some

Custom Layout Manager using predefined and developer-defined child view(s)

好久不见. 提交于 2019-12-10 10:26:24
问题 Revised Question When one looks online in tutorials, or by Google IO presentations, there are always just 2 kinds of UI customizations that one can do (but there are several implementations of doing each type). These customizations are: Creating a custom view that is a composite of existing views, or your own Creating a custom layout that is your own However, what if I wanted to create a hybrid of these two? Specifically a Custom View that allow child views to be laid out how I define? There

Set GestureDetector to all child views

独自空忆成欢 提交于 2019-12-09 10:43:36
问题 I would like to add a GestureDetector to all views (view groups) of an activity without assigning it manually to every single view. Right now onFling() is only activated when swiping over the background but not when swiping on e.g. button1. package com.app.example; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android