Tagged Questions
1
vote
3answers
34 views
Change Layout when Thread finish
I want to change the layout when a thread ends, but I don't understand the bug; for example:
res/layout:
-mainView.xml
-threadView.xml
MainActivity.java
protected void firstThread() {
...
0
votes
1answer
23 views
postion icons within LinearLayout
I've an app where i have 2 icons within a Linearlayout. I'm not particularly good with layouts and i'm unsure how to position the icons next to each other centrally. Could anyone explain how i can do ...
0
votes
2answers
72 views
get parent's view from a layout
I have a FragmentActivity with this layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
...
0
votes
1answer
18 views
add RelativeLayout to Canvas
I have created a custom view by extending View
class CustomView extends View{
...
@Override
public void onDraw(Canvas canvas){}
...
}
I want to draw a RelativeLayout inside my custom view. How ...
0
votes
1answer
26 views
drawing multiple layouts inside a view
I have a view/layout that I need to render multiple times on a canvas. Call it stats. So I create a stats.xml file and lay out my views in it. Then in the .java file, I inflate the layout and edit the ...
0
votes
0answers
18 views
Add scrolling to programmatically defined view
I have defined a custom view using extends View. My view is working well. But now I want my view to scroll so to encompass longer contents. In addition, I want the coordinate of the person's finger ...
0
votes
1answer
31 views
Android-Change Layout of view dynamically
I have some view in my activity :
for(int i=0;i<My_NewsGroup.size();i++)
{
View My_UpdateView=new View(MainActivity.this);
My_UpdateView ...
0
votes
2answers
34 views
Placing a textview correctly within a layout
I have a custom dialog box which is a series of buttons, pickers and viewswitchers. I'm trying to put a textview that displays text above the setDate and setTime buttons. At the moment it displays the ...
0
votes
1answer
27 views
get dimension of displayable area of android device
I actually have two code snippets that I need to compare. Which one is more accurate? I am looking for the dimension of the drawable surface of a device.
Code 1:
DisplayMetrics metrics = ...
0
votes
1answer
21 views
How to anchor a view to the android soft keyboard
Simple question:
How can I anchor a view (specifically EditText) to the top of the soft keyboard when it shows?
I don't want to use adjustPan or adjustResize because I have views at the top of my ...
0
votes
1answer
51 views
Android - do ViewGroup onDraw need to iterate through child view and call onDraw explicitly?
I have spent the whole day debugging various ways to add custom ViewGroup into another custom ViewGroup and nearly went crazy because none of them works, and there is no official documentation or ...
1
vote
1answer
32 views
Align Imageview Just After Title Bar
What im trying to do is align an ImageView (Linear Layout) just after the title bar of the activity.i tried using android:scaleType="fitStart" this moved the imageview just a little bit up. Im a ...
0
votes
0answers
64 views
Canvas containing bitmap size proper adjustment in landscape and portrait mode
Consider the following image as an example:
Landscape mode
In Landscape mode, there are 2 sides viz- left side containing fragment 1 and right side containing fragment 2.
The left side ...
0
votes
1answer
47 views
Someone knows if there is a git repo similar to evernote stack view for android? [closed]
I'm making an app for android and iOS and i was looking if someone can point me to a git repo or a sample code for simulating the stack view inside the Evernote app for iOS. I found a git repo to help ...
1
vote
2answers
136 views
Android - Creating listview with floating headers
Targeting 2.3 - 4.2 I would like to implement the following effect (see image), basically a group list where next item header pushes the last one.
What would be the best approach?
0
votes
1answer
49 views
How to use separator in listview?
I have a listview which have json data. Data is coming with a flag like 0, 1, 2. I want to apply separator in listview based on the flag value. Like if the data have flag=0 then all respective data ...
1
vote
1answer
85 views
Android Preventing Double Click On A Spinner
I have an unwanted problem by default in spinner view.
On Android 2.2 when I double click any spinner it opens twice, Upon pressing the back button the 2nd spinner closes but 1st one remains open.
...
0
votes
1answer
45 views
Getting an error when trying to create my own view class?
Hey guys I am getting an error when trying to create view in my MainActivity. Below I have provided a small bit of my code from my custom GridView and Activity. For some reason when I am trying to ...
0
votes
1answer
123 views
whole viewgroup to bitmap
Is it possible to get a full bitmap from a viewgroup-object?
This code takes a 'screenshot' off the view group that's currently on the screen, but I want the whole view, also what's not currently on ...
0
votes
1answer
57 views
add (AdMob) size could be fill_parent insted wrap_content?
my add makes some view scale problems . i solved it by making android:layout_width fill_parent insted wrap_content .
<com.google.ads.AdView
android:id="@+id/ad"
...
1
vote
2answers
140 views
Android: Adding buttons at runtime
I'm trying to add some buttons in my TableRow, at runtime. My TableRow has this structure:
<TableRow
android:layout_marginTop="100px"
android:gravity="bottom"
...
1
vote
0answers
102 views
How to shrink a layout with or without animation [closed]
I couldn't find a good example for how to do this.
I want to shrink a layout like a paper crumple
just like:
...
8
votes
2answers
211 views
Is it possible to create this kind of custom view in android?
I was just wondering if I can create a similar kind of layout in android.
The custom view must be expandable depending upon image nature. I tried with GridView to make this kind of view.
If anyone ...
0
votes
2answers
118 views
Get reference of custom view by id declared in xml from activity
I have a custom view that extends ImageView and I use it in an XML layout like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout ...
4
votes
3answers
2k views
Extending Android View class to add a dropshadow
I want to extend LinearLayout so that when my layout is drawn a drop shadow is added underneath it. I've played around overriding the onDraw method but I'm a bit lost. Any help with this or even ...
3
votes
1answer
78 views
Where to set size of view which is field of class extending RelativeLayout?
I have a class MyLayout extending RelativeLayout which includes View type field. MyLayout object is created in xml layout file, so all properties are set there. I need to programatically set size of ...
0
votes
2answers
221 views
Parent view draw child view efficient
For example, top level LinearLayout view has 300 child view. But device screen dimension only show 11 child view once. How android compute how many child views can show once? How a view know that it ...
0
votes
3answers
58 views
How can I reference layout files other than the current one?
In my application I call setContentView( layout1.xml );, I want to access an element within a DIFFERENT layout file, lets call it layout2.xml.
I have tried
view1 = (View) findViewById( ...
0
votes
0answers
74 views
View setPadding getting smaller view Android
I'm writing some code to slipe the item of ListView to the right so the item could be deleted.
All is going fine,but the problem is that when i slide to the right,my custom item is becoming ...
1
vote
1answer
265 views
Empty space in BarChartGraph using GraphView library
I am currently trying to draw a graph using GraphView library (http://www.jjoe64.com/p/graphview-library.html). I am currently using version 3.
I've a problem about Bar in BarChartGraph. I push a ...
1
vote
2answers
272 views
Android: ScrollView not working with View class
I've created a class which i use to draw some graphs, the class extends View, and it looks just like here How to draw a line in android.
Inside an activity, I show it with this
drawView = new ...
1
vote
1answer
64 views
How can I access View's state?
I am trying to set theme's default ENABLED_STATE color for state disabled items in the list, so the list items won't look GRAY in my ListView. How can I get stateSet to use in the following code:
...
0
votes
0answers
75 views
ViewHolder pattern / findViewById explanation
Can someone explain me why when we inflate the View in the getView() method in custom adapter and after we after each call of findViewById and new instance of founded child view object is created in ...
0
votes
1answer
42 views
View.VISIBLE or View.INVISIBLE from helper class
I have an activitiy with an layout and a ProgressBar:
public class Saldo_Menu extends Activity implements OnClickListener, OnLongClickListener {
static InternetHelper IH;
ProgressBar pleasewait;
...
2
votes
2answers
291 views
How to manage linear sub layout programmatically?
Issue about layout aliment.
i want to add view dynamically.
Logical code :
linear1 = (LinearLayout) findViewById(R.id.parent);
linear2 = (LinearLayout) findViewById(R.id.chiled);
int ...
0
votes
2answers
314 views
Android- Draw line between two views
Below is my program where I have created three new views in a frame. On click of two different views I want to draw a line between the views. I am trying to figure out how to do this...
Ball ...
0
votes
2answers
424 views
ImageView within RelativeLayout is not matching parent
So, I'm trying to view a camera preview as a background with an imageview on top of it. Check this question out, that I've asked, to get a better idea of what I'm trying to accomplish. However, ...
3
votes
1answer
411 views
Applying a mask to a single overlay view without masking the entire activity
I have a simple activity with a green background and I am trying to provide a red overlay with a transparent circular area. Here is the effect I am trying to accomplish:
Expected Image
With the code ...
0
votes
0answers
237 views
How to remove programmatically added custom view from fragment
I have populated the container with custom view using following code
Agraph agraph = new Agraph(getActivity(),30);
LinearLayout mainContainer = (LinearLayout) ...
2
votes
3answers
711 views
Transparent background EditText over ImageView won't display cursor
So, I want the user to be able to type over an image that I set to an Image View. The image is set and works. When the user clicks the image, an Edit Text box shows up where they clicked. But the ...
0
votes
2answers
333 views
Clear previous View and show new View on button click in the same Activity
I have created an activity with two buttons at the top. One button to show "SMS Logs" and second to show "Call Logs".
On clicking "SMS Logs" button, i am dynamically creating textviews and linear ...
0
votes
1answer
589 views
Adding a textview dynamically in fragment
I am new in android development..I am working with fragment.The problem i am facing right now is-I can't add view dynamically in fragment.When I tried to do this I got a nullpointerexception...My code ...
1
vote
1answer
77 views
Refresh View with new content not using any Adapter in multiple choice Test app
I am a newbee in Android app creating world.
I am creating an app where multiple choice questions are there. And, it could be 25, 50 or 100 depend on what user chooses. Now in an Activity, there ...
5
votes
2answers
520 views
Move up one layout with the soft keyboard but keep one on the bottom
I have the following TabHost layout:
<?xml version="1.0" encoding="iso-8859-1"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
...
0
votes
0answers
119 views
How to have click feedback similar to a gridview item on my custom View in a horizontal scroll view
I have a HorizontalScrollView as indicated below. I need the items in the HorizontalScrollView to respond to click events in such a way similar to the default of items in a GridView (that is the empty ...
0
votes
0answers
40 views
Layout with a special shape
I am working on a game and I was wondering if there is a way to make a special shape FrameLayout (let's say a star shape) where I will display a GLSurfaceView like this:
FrameLayout gameFrame = ...
1
vote
1answer
900 views
How Do Implement ViewPager PagerTitleStrip?
I am a noob to android and i have been using tutorials to construct a viewpager layout. However, i have not been able to find a tutorial that also shows how to implement the pagertitle strip as well. ...
3
votes
1answer
688 views
Avoid onMeasure and onLayout everytime ImageView Bitmap is set
This is my setup. I have a custom ListView with some fancy headers, which is inside a ViewPager. I'm maintaining a memory cache of images that having been downloaded and stored locally like any ...
1
vote
1answer
91 views
Android Custom View sizing
I am attempting to experiment in creating my own Views by subclassing "View." I want to simulate a new Button type class that will be drawn with the onDraw where I simply draw a rectangle from the ...
-1
votes
1answer
214 views
Android How to redraw a Custom View
I know that this question has been asked other times, but I can't solve my problem!
I create my own View (RadarView), extending View. But id doesn't update! I tried using "invalidate()" and ...