Android :: Android EditText Not Take Up Remaining Space

May 13, 2010

In my Android app, I have a tabbed Activity. In one of the tabs I have two TextViews and two EditTexts. The first EditText is only one line, and that's fine. However, I want the other EditText, android:id="@+id/paste_code", to take up the remaining space, but no matter what I do to it, it will only show one line. I don't want to manually set the number of lines, since the number that would fit on the screen differs based on your device.

Here's the relevant code. It's nested inside all the necessary components for a tabbed Activity.

<ScrollView
android:id="@+id/basicTab"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Paste title"
android:layout_weight="0" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/paste_title_hint"
android:id="@+id/paste_title"
android:lines="1"
android:gravity="top|left"
android:layout_weight="0" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
adroid:text="Paste text"
android:layout_weight="0" />
<EditText
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:hint="@string/paste_hint"
android:id="@+id/paste_code"
android:gravity="top|left"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>

Android :: Android EditText Not Take Up Remaining Space


Android :: SD Card - How To Detect Remaining Space?

May 8, 2009

Is there any way to detect remaining space on the sdcard through the API? I prefer not to make native or shell calls.

View 4 Replies View Related

Android :: Text Longer Than Available Space / How To Get Remaining Lines?

Sep 24, 2010

I have a long text and I want it to be displayed with a TextView. The text I have is much longer than the available space. However I don't want to use scrolling, but ViewFlipper to flip to the next page. How can I retrieve the lines from the first TextView that are not shown because the view is to short so that I can paste them into the next TextView?

I simply have to use a custom View with a StaticLayout like this:

public ReaderColumView(Context context, Typeface typeface, String cText) { super(context);
Display display = ((WindowManager)
context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
dWidth = display.getWidth(); dHeight = display.getHeight();
contentText = cText; tp = new TextPaint();
tp.setTypeface(typeface); tp.setTextSize(25);
tp.setColor(Color.BLACK); tp.setAntiAlias(true);
StaticLayout measureLayout = new StaticLayout(contentText, tp, 440, Alignment.ALIGN_NORMAL, 1, 2, true);
Boolean reachedEndOfScreen = false;
int line = 0; while (!reachedEndOfScreen) {
if (measureLayout.getLineBottom(line) > dHeight-30) { reachedEndOfScreen = true;
fittedText = contentText.substring(0, measureLayout.getLineEnd(line-1));
setLeftoverText(contentText.substring(measureLayout.getLineEnd(line-1)));
} line++;
} } protected void onDraw(Canvas canvas) { super.onDraw(canvas);
StaticLayout textLayout = new StaticLayout(fittedText, tp, 440, Alignment.ALIGN_NORMAL, 1, 2, true);
canvas.translate(20,20); textLayout.draw(canvas);
}
Thats not optimized yet but you get the point.

View 1 Replies View Related

Android :: Relative Layout Height To Fill Remaining Space

Sep 9, 2010

I have the following layout in my xml file:

<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout android:id="@+id/logoLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
-- some images </FrameLayout>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:layout_below="@+id/logoLayout">

Button 1
Button 2
Button 3
Button 4

</RelativeLayout>
<RelativeLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_alignParentBottom="true">

Button 5
</RelativeLayout>
<RelativeLayout>

Maybe I didn't do it in the best way. What I want: have the Layout that contains the 4 buttons to use the entire space between the top and bottom layout, and I want to have the button equally arranged in the layout. Something like this:
http://img16.imageshack.us/i/androidq.png/

I add the whole layout code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background">

<!--The header of the page-->
<FrameLayout android:id="@+id/logoLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView android:id="@+id/logoBackground"
android:src="@drawable/logo_background_small"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

<ImageView android:id="@+id/logoImage"
android:src="@drawable/logo_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:gravity="center"
android:padding="3dip"/>

<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/tracks"
android:layout_gravity="center"
android:gravity="right"
android:textSize="22dip"
android:textColor="#ffffff"
android:padding="3dip">

</TextView>
</FrameLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:layout_below="@+id/logoLayout">

<Button android:id="@+id/btn1"
android:layout_height="wrap_content"
android:layout_width="250dip"
android:drawableLeft="@drawable/img_small_btn_look_around"
android:background="@drawable/main_long_menu_button"
android:text="@string/btn1"
android:textSize="18dip"
android:textColor="#ffffff"
android:layout_marginTop="20dip"
android:onClick="btnMyTracksOnClick">
</Button> <Button android:id="@+id/btn2"
android:layout_height="wrap_content"
android:layout_width="250dip"
android:drawableLeft="@drawable/img_small_btn_look_around"
android:background="@drawable/main_long_menu_button"
android:text="@string/btn2"
android:textSize="18dip"
android:textColor="#ffffff"
android:layout_marginTop="20dip"
android:layout_below="@+id/btn1">
</Button>
<Button android:id="@+id/btn3"
android:layout_height="wrap_content"
android:layout_width="250dip"
android:drawableLeft="@drawable/img_small_btn_look_around"
android:background="@drawable/main_long_menu_button"
android:text="@string/btn3"
android:textSize="18dip"
android:textColor="#ffffff"
android:layout_marginTop="20dip"
android:layout_below="@+id/btn2">
</Button>
<Button android:id="@+id/btn4"
android:layout_height="wrap_content"
android:layout_width="250dip"
android:drawableLeft="@drawable/img_small_btn_look_around"
android:background="@drawable/main_long_menu_button"
android:text="@string/btn4"
android:textSize="18dip"
android:textColor="#ffffff"
android:layout_marginTop="20dip"
android:layout_below="@+id/bt3">
</Button> </RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_alignParentBottom="true"
<Button android:layout_width="90dip"
android:layout_height="wrap_content"
android:textSize="20dip"
android:textColor="#ffffff"
android:layout_alignParentLeft="true"
android:background="@drawable/sett_menu_button"
android:text="@string/back"
android:layout_marginLeft="3dip"/>
</RelativeLayout>
</RelativeLayout>

View 2 Replies View Related

HTC Desire :: Phone Storage - Remaining Space Going Up And Down

Jun 28, 2010

I was wondering though how people handle being so close to the limit. My problems seem to come when I update my apps. Despite no reason for space increase when I update them I regularly lose space. Today I update a couple of apps and it pushed me over the limit, so I had to go in a find a few I don't use and remove them. That left me with supposed about 15.5mb left, but now it's gone down to 14.95, despite no apps being added, so I can see a warning coming soon. One thing I have noticed is that for some apps removing them completely, and then added them back again seems to gain you some space.

It unfortunately is just blind luck in finding ones that will happen for, or at least it seems to be so to me. Also very annoying is that the space you clear by deleting apps doesn't seem to correspond with what you get back. I just cleared supposedly 1.5mb of cache from the web browser, yet I only got 500kb of space back? Obviously I've been through all the apps and looked for any that I can clear the cache for. One thing I would like to know is why the low space warning has to come at ~15mb? Seems to be I've always got that space just wasted, which is a pain as there are plenty of 200-300kb apps I could add, using just 5mb of the space.

View 11 Replies View Related

Android :: Copy And Paste Image On EditText - But EditText Show Me Obj

Jan 15, 2010

Adding an image on EditText works fine. However, copying an image is another problem. When I insert an image on EditText by using ImageSpan it shows correctly, but I copy inserted image, EditText shows me only 'obj'.

View 1 Replies View Related

Android :: To Make EditText Look Like TextView But Still Behave Like EditText

May 17, 2009

I want an EditText to look like TextView but still behave like EditText. I've tried applying TextView style to my EditText in my layout.xml file, like this:

CODE:............

But I get an error within xml editor: "Error: No resource found that matches the given name (at 'style' with value '@android:style/ Widget_TextView')." It is strange because @android:style/ Widget_TextView definitively exists - I double checked it in code via android.R.style.Widget_TextView. Another strange thing is that I don't get android:style offered in the xml editor while typing? There is android:id, android:text and everything else.. but not android:style?

I consider the hard way (making EditText look like TextView) to be: extending EditText and overriding it's onDraw method.

View 9 Replies View Related

Android :: Placing A TextView Before EditText Element In Android Layout XML Causes EditText Not To Show

Jul 29, 2010

Every time I put a TextView before an EditText element in a LinearLayout, the EditText does not show. When I don't, it does.

I've narrowed the problem down to the TextView's layout_width attribute. If I give it "wrap_content", it works, but doesn't "block" down, and it appears on the same line as the EditText.

CODE:...........

View 2 Replies View Related

Android :: ScrollView With EditText - Scrolling In EditText

May 14, 2010

Our app (WordPress for Android) uses a ScrollView for the new blog post view. The issue is that if a user writes a lengthy blog post in the EditText, they are unable to scroll inside of the EditText because the ScrollView seems to be taking over the scrolling action, even when you are in the EditText.

Here's the layout XML (the EditText in question is @id/content):

CODE:...............

View 2 Replies View Related

Android :: Have Uneditable Text In Edittext In Same EditText?

May 26, 2009

I am using an EditText. Is it possible to have a part of text uneditable and the rest editable in the same EditText?

View 2 Replies View Related

Android :: How To Get Remaining Battery Level?

Feb 9, 2010

Searching old posts reveal that no one knows a way to get the current battery level without using intents. Is this true? There's no method to just return the current battery level?

View 4 Replies View Related

General :: Android App That Shows Battery Life Remaining In Notification Bar?

Jun 29, 2012

I'm looking for an app that would show the battery life remaining in my notification bar (similar to battery life remaining on mac computers), I've searched and searched and searched and cannot seem to find an app that does so. I have found apps that can tell me the time remaining, just not in the top bar of my phone. I'm running a Galaxy S3 w/ ICS.

View 4 Replies View Related

Android :: Android - EditText And Button - When Click Button - Unfocus EditText And Hide Soft Keyboard

Jun 24, 2010

CODE:............

I have this at the top of my application. When the application starts, the EditText is orange highlighted and has a cursor in it; when the EditText is tapped, the soft keyboard pops up. The user uses it to type into the EditText.

However, when they click the Button, my onClick method fires and does everything it's supposed to, however the soft keyboard stays on screen and the EditText is still highlighted with its cursor.

I also have, at the top of the Button onclick: findViewById(R.id.name).clearFocus();

In spite of this, the EditText does not seem to clear its focus. How do I make the button actually act as if it is submitting the form?

Also, I do not transition to a different Activity on the click of the Button. I suppose that is the typical case, and probably the reason why they don't bother hiding the keyboard. However I want to keep the search box and button at the top of the screen, so I just dynamically fill and add views to the screen when the Button is pressed. How can I achieve my desired behavior?

View 1 Replies View Related

Android :: Countdown Timer To Show Days , Hours , Sec And Millisecond Remaining For Specific Date

Sep 20, 2010

I want to run an countdown time , in which i want to show days,hours,sec and millisecond remaining for a specific date. and will be be keep changing till the end of the specific date.

View 1 Replies View Related

HTC EVO 4G :: Remaining Amount Of ROM Available?

Jun 30, 2010

So, it definitely blows that this was advertised with 1 gb of ROM, and we only ended up with about 370mb of ROM. But, it is what it is. Now, I know RAM is more important when it comes to making the phone snappy and dealing with all the open apps. But, does it affect the phones performance when the phone gets low on ROM? I'm around 220mb of available ROM, which is still a good amount, but I cant help but check the file size of every app and game i download and cringe if its bigger than average. So, is there a number I should try to stay above? 150mb, 100, 50, or does it really not matter as far as the phone's responsiveness and snappiness is concerned?

View 4 Replies View Related

HTC Hero :: Remaining Memory Quite Low

Jan 1, 2010

When I first got my HTC Hero before installing any apps from the Market I checked how much memory I have. 148 mb was available, does this sound about right for you guys?? or is it quite low?

View 2 Replies View Related

Samsung Vibrant :: Low Amount Of RAM Remaining?

Jul 25, 2010

Doesn't the vibrant have 512M of RAM? Where is all of it going? I am using the ATK (advanced task killer) to keep background tasks at a minimum, but I only see around 100M of available memory. Is this good? It doesn't seem like a lot. Can others post them amount of available memory they have remaining?

View 14 Replies View Related

HTC EVO 4G :: 62 Hours / 24 Percent Battery Remaining

May 26, 2010

62 hours and 24% battery still remaining. This is after my initial period of hammering on the phone and back to my normal daily usage pattern which is like a blackberry user (some phone calls in and out, lots of email, at least a few every 30 minutes during the day and early evening). What this means for me as a blackberry user is that I can now confidently switch over from blackberry to the Evo as primary phone and get through a normal day (16 hours) without needing a mid-day charge.

Here are settings from my testing experience that I wish I had known when I first got the EVO at Google I/O:

1. Add to home sense screen:
widget: Power Control Android
widget: settings, 4G
widget: settings: Hotspot

2. Install android market apps (free):
Advanced Task Killer
Spare Parts
K-9 Mail

3. Run Advanced Task Killer (some disagree, do what you want. I'll revisit and retest this when 2.2 gets released by HTC for the EVO. I don't need sprint navigation, sprint tv, etc. to ever be running since I will use google navigation. I haven't had time to do another endurance test without using ATK and I'm not planning to do another endurance test)

Deselect things you actually want to keep running in the background, e.g.:
voice dialer
voice search
google voice
calendar
k-9 mail
gmail
....
Kill selected apps

ATK will put a notification up at each boot and remember your selections so it's easy to re-kill off all the sprint and other apps you don't normally want 'running' in the background.

4. Turn off 4G and hotspot on the main page with widgets installed.
Note: I found I don't need to disable gps or bluetooth since with streamlined apps running nothing is using them unless I want it to and I want my bluetooth to automatically pickup when I get in the car.

5. Turn screen brightness to low or medium using widget icon. this disables auto brightness but the lower screen brightness seems fine for me. When outside in the sun just click it up if needed

6. Settings Wireless and Networks, Wi-Fi Settings, <menu button> Advanced, Wi-Fi sleep policy, Never.
It's a bit counterintuitive, but I've tested it out both ways and confirmed the articles that recommend this. The phone uses dramatically less power in this state as opposed to auto sleeping wi-fi which turns on the 3G radio. Dramatic as in without keeping wi-fi alive overnight my battery went from like 70% to almost nothing during earlier tests.

7. <optional> Run the battery from a full charge to completely drained once. I'm not sure if this had an effect or not, just putting it in because I did it once before this current long runtime since charge to make sure the battery was properly profiled. It's easy to do with 4G on and watching HD youtube videos.

8. K-9 versus gmail client. I'm seeing much more cpu usage from gmail client versus K-9. I have work email on a host service that supports imap idle (rackspace). The imap idle push seems to really save on cpu usage and my work email delivers as fast to the Evo as it does to my blackberry. I like the gmail client for my personal mail but may end up switching my gmail.com to deliver via K-9 instead to really save on battery. Needs more exploring but it appears the gmail client 'push' is not as efficient as the imap idle.

9. Summary, when you want to show off your 4G Youtube HD or use the phone as a mobile hotspot, just click on the 4G and away it goes. But normally keep that radio off since you don't actually need it and it's a huge power drain. With the widget installed this becomes an easy habit.

View 49 Replies View Related

HTC Hero :: Low On Space Phone Storage Space Is Getting Low

Sep 9, 2010

i got this notification yesterday so i deleted some apps and all my text messages but i cant get rid of it now!
any ideas?

View 14 Replies View Related

Motorola Droid :: How To Show Remaining Battery?

Jan 7, 2010

I am able to see how much of my phone is using the battery i.e. display 50%, but I can't find what my total battery remaining is. How do I show that?

View 6 Replies View Related

Motorola :: My Droid X Only Has 4 Home Screens / Need Remaining

Aug 4, 2010

I just got my Droid X and I saw someplace that it is supposed to have 7 home screens, but mine only has 4.. how do I get the other 3?

View 3 Replies View Related

General :: WiFi Bars Remaining Gray

Jul 22, 2013

I moved from Shanghai to an apartment building in Chicago. Internet is included in my new building--just need to provide your own router. I have a Netgear N600 router from a few years ago that I plugged in, and everything fired up properly and looked great. But I noticed that my wifi bars remained gray with no Google Services sync. I have a Nexus 7 and a Nexus 4, both rooted and running CM 10.1.2. The only mod I have on either is LTE enabled on the N4.

I did a factory reset and went through the setup wizard again. I also checked for a firmware update, but there wasn't one available. The reset didn't solve the problem. If I flip my WiFi off on the N4, I immediately connect to T-Mobile 4G data, and all of my Google Services sync. When I turn wifi back on, I reconnect to my router, and my Google Services sync stops. I can force a per-app sync by going into Gmail, Google Voice, etc., but there is no background sync.

View 6 Replies View Related

Motorola Droid :: Minutes Used / Remaining Alert Application?

Mar 25, 2010

Anyone know of a simple app that you can set your minutes per month allowance, monthly end dates and have the app pop an alert at a predefined # of minutes used. So, I could tell it to alert me when I reach 800 minutes (or when I have 100 remianing)? I use the MyVerizon app, but would like a way to set an alert in case I forget to check and get close to my minutes.

View 1 Replies View Related

Motorola Droid :: Battery Percentages - Don't Display The Remaining In 1% Increments

Jul 10, 2010

how come none of the roms for the droid don't display the battery remaining in 1% increments. I just put a new ron on my girlfriends eris and it has this ability, just wondering why we don't have that, it would be nice.

View 7 Replies View Related

Motorola Droid X :: 90 Percent Charge Remaining Soon After Disconnecting Charger

Aug 23, 2010

I would say within 5 minutes of taking the phone off of the charger, the battery drops to 90%. I'm running stock software (2.1), ran the *228 option 2, turned off GPS tried anything simple I could find by searching.

View 13 Replies View Related

Samsung Galaxy I7500 :: Galaxo And Still Only 3 Home Screens / Get Remaining To Work?

Apr 14, 2010

I have received my i7500 today and flashed Galaxo 1.6.2 right away. I actually thought it would add home screens to the device (read somewhere that it should have 10) but I can only access 3 (the middle one and one to the left/right) after flashing it - and I am sure Galaxo works fine as the phone information confirm that I am on JC6 with Galaxo.

Any idea how I get the remaining home screens to work?

View 2 Replies View Related

Samsung Galaxy I7500 :: Galaxo And Still Only 3 Home Screens / Get Remaining To Work?

Apr 14, 2010

I have received my i7500 today and flashed Galaxo 1.6.2 right away. I actually thought it would add home screens to the device (read somewhere that it should have 10) but I can only access 3 (the middle one and one to the left/right) after flashing it - and I am sure Galaxo works fine as the phone information confirm that I am on JC6 with Galaxo.

Any idea how I get the remaining home screens to work?

View 2 Replies View Related

HTC Incredible :: SD Space And Disc Space

May 13, 2010

So I just downloaded an app that quickly shows battery life, SD space, and disc space. It says I have used 628 of 748 mb on the disc. I thought the phone had an internal memory of 8gb.

View 3 Replies View Related

Samsung Moment :: Notification "Low On Space Phone Storage Space Is Getting Low"

Dec 16, 2009

Had my Samsung Moment for about a month. LOVE IT. Few issues (same as everyone else has noticed), but nothing terrible. Until: Randomly today TWO Notifications popped up that said "Low on space Phone storage space is getting low." One was what seemed to be from the "hardware" and the other was from the "Work Mail" app (which I don't use, haven't used, haven't even opened). When I click it, it takes me to the Manager screen. So, I began uninstalling some apps I don't really use (I didn't have that many anyway...a couple of games [Solitaire, etc], Facebook, Notes). It started running really slowly and random Force Close messages would appear for things like android.process, messaging--things that have never Force Closed before. I turned it off (pressed and held the red button), waited a few seconds, then turned it back on again. Immediately after the "Sprint" logo lights show finished, I got another Force Close message. When the Home Screen showed up, I had the two notifications again "Low on space". When I cleared the notifications, only the "Work Mail" one would clear. I went through and deleted some more apps that I don't use. Got on my computer & Googled the issue. Found a couple of random forums that suggested cleaning out the Cache in the Browser. I did that. Cleaned the History & Cookies in the Browser, too. Then, I did a soft reset (took out the battery). Started it up again, SAME notifications. Less Force Close messages. But, it's running VERY slowly.

After a few hours, I noticed that I hadn't received any text messages or Gmail notifications. I had my sister text me about 2 hours ago. Still have not received it.
I really don't want to hard reset. I haven't synced my contacts (I have over 400 & the Sprint store had trouble moving them from my Centro to the Moment) to Google yet, nor have I hooked my Moment up to my Mac yet (the Sprint guys had no idea if it would work or not with Snow Leopard & I hadn't had time to check yet) and I'm worried to try it now that my Moment has gone crazy...I really don't want to lose 400 contacts.I don't download a lot of apps. Most are reputable (Pandora, MotherTED, Shazam, Movies, Jewels). The last one I remember downloading was Google Voice three days ago (which I haven't really used because I've had the flu). I don't know if this is a Malware/Virus issue or if I'm just an idiot & did something wrong. But, it's running REALLY slowly right now. Still not receiving texts or emails (though my Twitter app has notified me of a couple of @ replies).I'm going to call Sprint & Samsung tomorrow, then go to a Sprint tech store if they can't help. But, I'm just hoping one of you have come across this & can help before I have to deal with hours of hold music & techies who tell me to soft reset over & over again.

BTW:
After awhile, I finally checked the storage space:
External SD care: Total: 1.89; Available: 1.85
Internal: About 2 hours ago when I first checked, after I had deleted a bunch of apps it said I had 7.something MB, now (after not downloading ANYTHING or barely even TOUCHING the damn thing) it says 1.95MB. Which leads me to believe that the 7.whatever was not necessarily accurate.

View 31 Replies View Related

Android :: Populate EditText Widget Text From Another EditText Widget Text

Jan 6, 2010

I am trying to populate the text of a second EditText widget with the text from the first EditText widget only when the second EditText widget receives focus, the second widget is not empty, and the first widget is not empty. When I run it and click into the second widget it does not populate. When I remove the third constraint ('etxt.getText ().toString().trim() == ""')) it works. so getText() on the second EditText widget is returning something even though the second widget has no initial value other then the text that is displayed via the hint attribute.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved